<? include_once("config_ar.php");?>

<?php
/**
 * @author Hossam
 * @copyright 2011
 */


//----------------------------- word kay for search -----------------------

function wordkay(){
    $sel = "select * from wordkay where id=1";
    $query = mysql_query($sel);
    while($result=mysql_fetch_array($query)){
        extract($result);
        echo "$wordar.$worden";

    }
}

//----------------------------- title pages -----------------------

function title_site(){
	$sel = "select sitename from users where id=1";
    $query = mysql_query($sel);
    while($result=mysql_fetch_array($query)){
        extract($result);
        echo "$sitename";

    }
}

///////////cut_text...////////

function cut_text($text,$length){
    if (strlen($text) > $length) {
    	$text = substr($text,0,$length);
    	$text = explode(" ", $text);
    	$text = array_slice($text,0,count($text)-1);
    	$text = implode(" ",$text);
    	$text .= " ...";
   	 }

    return $text;

}

//--------------------- fetch news title ----------------------------
function titlenews($num_news){

            $sql444="select id from news WHERE langu ='$_SESSION[lang_g]' and active=1";
            $query444=mysql_query($sql444);
            $rows=mysql_num_rows($query444);
            if($rows != 0){?>

            			<!-- news -->
                        <div class="plocklefts">
                            <div class="top_plocklefts"><?=NEWS_LANG?></div>
                            <div class="center_plocklefts">
                                <ul>

                            <?
                              $sql88="select id,intro from news WHERE langu ='$_SESSION[lang_g]' and active=1 ORDER BY id DESC limit $num_news";
                              $query88=mysql_query($sql88);
                              while($result88=mysql_fetch_array($query88)){
                              	extract($result88);
								if($_SESSION['lang_g']== ar){
                            ?>

                              <li>
                              	<?=cut_text($intro,175)?><a href="news_in.php?id=<?=$id?>"><?=MOREWELCOM?></a>
                              </li>
                              <? }elseif($_SESSION['lang_g']== en){?>
                               <li>
                               <?=cut_text($intro,75)?><a href="news_in.php?id=<?=$id?>"><?=MOREWELCOM?></a>

                              </li>
                                <?
								}
							} ?>

                            </ul>
                        </div>
                        <div class="bottom_plocklefts"></div>
                    </div>
                    <!-- /news -->

            <? }
}

//---------------- fetch title news for path hed --------------------------
function fet_title_news_path(){

            $id = intval($_GET['id']);
            $sql88="select title from news WHERE id=$id AND active=1";
            $query88=mysql_query($sql88);
            while($result88=mysql_fetch_array($query88)){
           	    extract($result88);
                echo $title;
            }

}

//--------------- fetch news_in ------------------------------
function fet_news_in (){

                            $id = intval($_GET['id']);
							$sel="select * from news where id=$id AND active=1";
							$query=mysql_query($sel);
							while ($result=mysql_fetch_array($query)){
								extract($result);
							}
				?>
                <div class="titlnews_in"><?=$title?></div>
                <div class="detlsnews_in">
                    <div class="imgnews_in">
                    	<?
						if($_SESSION['lang_g']== ar){
							$pathpic="upload/news/";
						}elseif($_SESSION['lang_g']== en){
							$pathpic="upload/news_en/";
						}
						?>
                        <img src="<?=$pathpic.$picname?>" />
                    </div>
                    <div class="chearnews_in"></div>
                </div>
                <div class="descnews_in"><?=$content?></div>
                <?
}

//--------------- fetch news all -----------------------------------
function fetnews_all($numshow_news){

							$selx="select * from news where langu ='$_SESSION[lang_g]' and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_news;
									//pagenation step 2 $post_count
									$qury="select * from news where langu ='$_SESSION[lang_g]' and active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									if($_SESSION['lang_g']== ar){
										$pathpic="upload/news";
									}elseif($_SESSION['lang_g']== en){
										$pathpic="upload/news_en";
									}
									$sel="select * from news WHERE langu ='$_SESSION[lang_g]' and active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										//$descall=substr($content, 0, 200);
										echo "<div class='plock_news'>";
											echo "
													<a href='news_in.php?id=$id'>

														<span class='titel_news2'>$title</span>
														<br />
														<span class='img_news'><img src='$pathpic/$picname' width='100px' height='60px' class='imgpord' /></span>
														<br />
														<span class='intro_news'>".cut_text($intro,150)."</span>
														<br />
														<div class='tex_news2'>$date at $time</div>

													</a>
												";
										echo "</div>";
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="news.php?page='.$first.'">الأول</a> ';
															echo ' <a href="news.php?page='.$prev.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="news.php?page='.$i.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="news.php?page='.$next.'">التالي</a> ';
															echo ' <a href="news.php?page='.$last.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//---------------- fetch title products_cat for path hed --------------------------
function fet_title_products_cat_path($id){

            $id = intval($_GET['id']);
            $sql88="select name from cat WHERE langu='$_SESSION[lang_g]' AND id=$id AND active=1";
            $query88=mysql_query($sql88);
            while($result88=mysql_fetch_array($query88)){
           	    extract($result88);
                echo $name;
            }

}

//---------------- fetch title products_cat for path hed --------------------------
function fet_title_maktaba_cat_path($id){

            $id = intval($_GET['id']);
            $sql88="select name from cat_maktaba WHERE langu='$_SESSION[lang_g]' AND id=$id AND active=1";
            $query88=mysql_query($sql88);
            while($result88=mysql_fetch_array($query88)){
           	    extract($result88);
                echo $name;
            }

}

//---------------- fetch title products_cat for path hed --------------------------
function fet_title_center_mali_cat_path($id){

            $id = intval($_GET['id']);
            $sql88="select name from cat_mali WHERE langu='$_SESSION[lang_g]' AND id=$id AND active=1";
            $query88=mysql_query($sql88);
            while($result88=mysql_fetch_array($query88)){
           	    extract($result88);
                echo $name;
            }

}

//--------------- fetch products all -----------------------------------
function fetproducts_all($numshow_products){

							$selx="select * from cat where langu='$_SESSION[lang_g]' AND active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_products;
									//pagenation step 2 $post_count
									$qury="select * from cat where langu='$_SESSION[lang_g]' AND active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db

									$sel="select * from cat WHERE langu='$_SESSION[lang_g]' AND active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);

                                        if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/cat";
                                        }else{$pathpic="upload/cat_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="products_cat.php?id=<?=$id?>">
                                                    <div class="prod_ega_in">
                                                        <p>
                                                        	<img src="<?=$pathpic?>/<?=$picname?>" />
                                                        </p>
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="products.php?page='.$first.'">الأول</a> ';
															echo ' <a href="products.php?page='.$prev.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="products.php?page='.$i.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="products.php?page='.$next.'">التالي</a> ';
															echo ' <a href="products.php?page='.$last.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//--------------- fetch products all -----------------------------------
function fetcertifecats_all($numshow_products){

							$selx="select * from src_jornal where langu='$_SESSION[lang_g]' AND type='customer' and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_products;
									//pagenation step 2 $post_count
									$qury="select * from src_jornal where langu='$_SESSION[lang_g]' AND type='customer' and active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/cat";
									$sel="select * from src_jornal WHERE langu='$_SESSION[lang_g]' AND type='customer' and active=1 ORDER BY id DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/cat";
                                        }else{$pathpic="upload/cat_en";}
                                        ?>

                                            <div class="prodher_ega">

                                                    <div class="prod_ega_in">
                                                        <p class="newcirti">
                                                        	<img src="upload/customer/<?=$pic.$extention_pic?>" />
                                                        </p>
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>

                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="certifecats.php?page='.$first.'">الأول</a> ';
															echo ' <a href="certifecats.php?page='.$prev.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="certifecats.php?page='.$i.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="certifecats.php?page='.$next.'">التالي</a> ';
															echo ' <a href="certifecats.php?page='.$last.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//--------------- fetch products all -----------------------------------
function fetcertifecats_homsuup($numshow_products){

							$selx="select * from src_jornal where langu='$_SESSION[lang_g]' AND type='customer' and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ
							?>
                            <!-- suppliers -->
                            <div class="plocklefts">
                                <div class="top_plocklefts"><?=Suppliers_LANG?></div>
                                <div class="center_plocklefts">
                                    <div class="picsuppliers">
                                        <marquee width="170" height="100" direction="up" scrolldelay="7" onMouseOut="scrollAmount=3" onMouseOver="scrollAmount=1" scrollamount="3">
                            <?
									//pagenation step 6 fetch data from db
									//$pathpic="upload/cat";
									$sel="select * from src_jornal WHERE langu='$_SESSION[lang_g]' AND type='customer' and active=1 ORDER BY id DESC limit $numshow_products";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/cat";
                                        }else{$pathpic="upload/cat_en";}
                                        ?>
                                           <img width="170" height="55" src="upload/customer/<?=$pic.$extention_pic?>" title="<?=$name?>" />

                                        <?
									}
							?>
                                        </marquee>
                                    </div>
                                </div>
                                <div class="bottom_plocklefts"></div>
                            </div>
                            <!-- /suppliers -->
                            <?

								}

}

//--------------- fetch maktaba all -----------------------------------
function fetmaktaba_all($numshow_products){

							$selx="select * from cat_maktaba where langu='$_SESSION[lang_g]' AND active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_products;
									//pagenation step 2 $post_count
									$qury="select * from cat_maktaba where langu='$_SESSION[lang_g]' AND active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/cat_maktaba";
									$sel="select * from cat_maktaba WHERE langu='$_SESSION[lang_g]' AND active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/cat_maktaba";
                                        }else{$pathpic="upload/cat_maktaba_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="library_cat.php?id=<?=$id?>">
                                                    <div class="prod_ega_in">
                                                        <!--
                                                        <p>
                                                        	<img src="<?=$pathpic?>/<?=$picname?>" />
                                                        </p>
                                                        -->
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="library.php?page='.$first.'">الأول</a> ';
															echo ' <a href="library.php?page='.$prev.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="library.php?page='.$i.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="library.php?page='.$next.'">التالي</a> ';
															echo ' <a href="library.php?page='.$last.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//--------------- fetch products all -----------------------------------
function fetcenter_mali_all($numshow_center_mali){

							$selx="select * from cat_mali where langu='$_SESSION[lang_g]' AND active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_center_mali;
									//pagenation step 2 $post_count
									$qury="select * from cat_mali where langu='$_SESSION[lang_g]' AND active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/cat_mali";
									$sel="select * from cat_mali WHERE langu='$_SESSION[lang_g]' AND active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/cat_mali";
                                        }else{$pathpic="upload/cat_mali_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="center_financial_cat.php?id=<?=$id?>">
                                                    <div class="prod_ega_in">
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="center_financial.php?page='.$first.'">الأول</a> ';
															echo ' <a href="center_financial.php?page='.$prev.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="center_financial.php?page='.$i.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="center_financial.php?page='.$next.'">التالي</a> ';
															echo ' <a href="center_financial.php?page='.$last.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//--------------- fetch products all -----------------------------------
function fetproducts_cat_all($numshow_products_cat){


                            //fetch data product cat
                            $id_cat_prod = intval($_GET['id']);
    						//$pathpic="upload/cat";
    						//fetch desc for intero cat
    						$sql="select * from cat WHERE langu='$_SESSION[lang_g]' AND id=$id_cat_prod and active = 1";
    						$query=mysql_query($sql);
    						while($result=mysql_fetch_array($query)){
    							 extract($result);
    							 if($_SESSION[lang_g] == 'ar'){
                                    $pathpic="upload/cat";
                                  }else{$pathpic="upload/cat_en";}
                                 ?>
    								<div class="hfgyft">
    									<span class=" font14 classfont1 clrgreen"><?=$name?></span><img src="<?=$pathpic?>/<?=$picname?>" width="100" height="100" class="imgpord" />
    									<br /><br />
    									<span class="clrgreen ftnew font16 bold marg5 ajustify dirr"><?=$intro?></span>
    								</div>
    							<?
    						}

                            //ftch data products for section
                            $selx="select * from product WHERE langu='$_SESSION[lang_g]' AND id_cat=$id_cat_prod and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_products_cat;
									//pagenation step 2 $post_count
									$qury="select * from product WHERE langu='$_SESSION[lang_g]' AND id_cat=$id_cat_prod and active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/product";
									$sel="select * from product WHERE langu='$_SESSION[lang_g]' AND id_cat=$id_cat_prod and active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/product";
                                        }else{$pathpic="upload/product_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="products_in.php?id=<?=$id?>&id_cat=<?=$id_cat?>">
                                                    <div class="prod_ega_in">
                                                        <p>
                                                        	<img src="<?=$pathpic?>/<?=$picname?>" />
                                                        </p>
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="products_cat.php?page='.$first.'&id='.$id_cat_prod.'">الأول</a> ';
															echo ' <a href="products_cat.php?page='.$prev.'&id='.$id_cat_prod.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="products_cat.php?page='.$i.'&id='.$id_cat_prod.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="products_cat.php?page='.$next.'&id='.$id_cat_prod.'">التالي</a> ';
															echo ' <a href="products_cat.php?page='.$last.'&id='.$id_cat_prod.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}

//--------------- fetch products all -----------------------------------
function fetsupply_gall_home($numshow_products_cat){


                            //fetch data product cat
                            //$id_cat_prod = intval($_GET['id']);
    						//$pathpic="upload/cat";


                            //ftch data products for section
                            $selx="select * from product WHERE langu='$_SESSION[lang_g]' AND active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){

                                    //pagenation step 6 fetch data from db
									//$pathpic="upload/product";
									$sel="select * from product WHERE langu='$_SESSION[lang_g]' AND active=1 ORDER BY date_time DESC limit $numshow_products_cat";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/product";
                                        }else{$pathpic="upload/product_en";}
                                        ?>

                                                    <li>
                                                    <a href="products_in.php?id=<?=$id?>&id_cat=<?=$id_cat?>">
                                                    <img src="<?=$pathpic?>/<?=$picname?>" width="110" height="100" alt="" /><br /><?=$name?>
                                                    </a>
                                                    </li>


                                        <?
									}


								}

}


//--------------- fetch products all -----------------------------------
function fetproducts_forhomepage_all($numshow_products_cat){


                        //pagenation step 6 fetch data from db
									//$pathpic="upload/product";
									$sel="select * from product WHERE langu='$_SESSION[lang_g]' AND active=1 ORDER BY id DESC limit $numshow_products_cat";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/product";
                                        }else{$pathpic="upload/product_en";}
                                        ?>
                                        <a href="products_in.php?id=<?=$id?>&id_cat=<?=$id_cat?>" title="<?=$name?>">
                                            <img src="<?=$pathpic?>/<?=$picname?>" width="100" height="100" />
                                        </a>
                                        <?
									}

}

//--------------- fetch fetmaktaba_cat_all -----------------------------------
function fetmaktaba_cat_all($numshow_products_cat){


                            //fetch data product cat
                            $id_cat_prod = intval($_GET['id']);
    						//$pathpic="upload/cat_maktaba";
    						//fetch desc for intero cat
    						$sql="select * from cat_maktaba WHERE langu='$_SESSION[lang_g]' AND id = $id_cat_prod and active = 1";
    						$query=mysql_query($sql);
    						while($result=mysql_fetch_array($query)){
    							 extract($result);
    							if($_SESSION[lang_g] == 'ar'){
                                    $pathpic="upload/cat_maktaba";
                                }else{$pathpic="upload/cat_maktaba_en";}
                                 ?>
    								<div class="hfgyft">
    									<span class=" font14 classfont1 clrgreen"><?=$name?></span>
                                        <!--
                                        <img src="<?=$pathpic?>/<?=$picname?>" width="100" height="100" style="float:right;" class="imgpord" />
                                        <span class="clrgreen ftnew font16 bold marg5 ajustify dirr"><?=$intro?></span>
                                        -->
    									<br /><br />

    								</div>
    							<?
    						}

                            //ftch data products for section
                            $selx="select * from product_maktaba WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_products_cat;
									//pagenation step 2 $post_count
									$qury="select * from product_maktaba WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/product_maktaba";
									$sel="select * from product_maktaba WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                            $pathpic="upload/product_maktaba";
                                        }else{$pathpic="upload/product_maktaba_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="library_in.php?id=<?=$id?>&id_cat=<?=$id_cat?>">
                                                    <div class="prod_ega_in">
                                                        <p>
                                                        	<img src="<?=$pathpic?>/<?=$picname?>" />
                                                        </p>
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="library_cat.php?page='.$first.'&id='.$id_cat_prod.'">الأول</a> ';
															echo ' <a href="library_cat.php?page='.$prev.'&id='.$id_cat_prod.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="library_cat.php?page='.$i.'&id='.$id_cat_prod.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="library_cat.php?page='.$next.'&id='.$id_cat_prod.'">التالي</a> ';
															echo ' <a href="library_cat.php?page='.$last.'&id='.$id_cat_prod.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}


//--------------- fetch products all -----------------------------------
function fet_center_mali_cat_all($numshow_center_mali_cat){


                            //fetch data product cat
                            $id_cat_prod = intval($_GET['id']);
    						//$pathpic="upload/cat_mali";
    						//fetch desc for intero cat
    						$sql="select * from cat_mali WHERE langu='$_SESSION[lang_g]' AND id = $id_cat_prod and active = 1";
    						$query=mysql_query($sql);
    						while($result=mysql_fetch_array($query)){
    							 extract($result);
    							 if($_SESSION[lang_g] == 'ar'){
                                      $pathpic="upload/cat_mali";
                                }else{$pathpic="upload/cat_mali_en";}
                                 ?>
    								<div class="hfgyft">
    									<span class=" font14 classfont1 clrgreen"><?=$name?></span>
                                        <!--
                                        <img src="<?=$pathpic?>/<?=$picname?>" width="100" height="100" class="imgpord" />
                                        <span class="clrgreen ftnew font16 bold marg5 ajustify dirr"><?=$intro?></span>
                                        -->
    									<br /><br />

    								</div>
    							<?
    						}

                            //ftch data products for section
                            $selx="select * from product_mali WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1";
							$qurx=mysql_query($selx);
							$numro=mysql_num_rows($qurx);

							if($numro){ //Ýí ÍÇáÉ æÌÏ ÇÎÈÇÑ

									//pagenation step 1 $each_page
									$each_page=$numshow_center_mali_cat;
									//pagenation step 2 $post_count
									$qury="select * from product_mali WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1";
									$resul=mysql_query($qury);
									$post_count=mysql_num_rows($resul);
									//pagenation step 3 $page_count
									$page_count=ceil($post_count/$each_page);
									//pagenation step 4 $page
									if(!isset($_GET['page']) || intval($_GET['page']) <=0){
										$page=1;
									}elseif($_GET['page'] > $page_count){
										$page=$page_count;
									}else{
										$page=$_GET['page'];
									}
									//pagenation step 5 $start
									if($post_count >0){
										$start=$each_page*($page-1);
									}

									//pagenation step 6 fetch data from db
									//$pathpic="upload/product_mali";
									$sel="select * from product_mali WHERE langu='$_SESSION[lang_g]' AND id_cat = $id_cat_prod and active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
									$qur=mysql_query($sel);
									while($result=mysql_fetch_array($qur)){
										extract($result);
										if($_SESSION[lang_g] == 'ar'){
                                              $pathpic="upload/product_mali";
                                        }else{$pathpic="upload/product_mali_en";}
                                        ?>
                                            <div class="prodher_ega">
                                                <a href="center_financial_in.php?id=<?=$id?>&id_cat=<?=$id_cat?>">
                                                    <div class="prod_ega_in">
                                                        <p>
                                                        	<img src="<?=$pathpic?>/<?=$picname?>" />
                                                        </p>
                                                        <p class="namecat"><?=$name?></p>
                                                    </div>
                                                </a>
                                            </div>
                                        <?
									}

									//pagenation step 7 design button counter
									echo "<div class='counter'>";
										if($page_count > 1){
														$first = 1;
														$prev = $page - 1;
														$next = $page + 1;
														$last = $page_count;

														//show first & prev
														if($page > 1){
															echo ' <a href="center_financial_cat.php?page='.$first.'&id='.$id_cat_prod.'">الأول</a> ';
															echo ' <a href="center_financial_cat.php?page='.$prev.'&id='.$id_cat_prod.'">السابق</a> ';
														}

														// show numbers pages
														for($i=1; $i<=$page_count; $i++){
															if($page != $i){
																echo ' <a href="center_financial_cat.php?page='.$i.'&id='.$id_cat_prod.'">'.$i.'</a> ';
															}else{
																echo '<b>'.$i.'</b>';
															}

														}

														//show next & last
														if($page < $page_count){
															echo ' <a href="center_financial_cat.php?page='.$next.'&id='.$id_cat_prod.'">التالي</a> ';
															echo ' <a href="center_financial_cat.php?page='.$last.'&id='.$id_cat_prod.'">الأخير</a> ';
														}

										}
									echo "</div>";
								}

}



//---------------- fetch title products_cat for path hed --------------------------
function fet_title_products_in_path(){
            ?>
            <li><a title="الرئيسة" href="main.php"><?=HOME_LANG?></a></li>
            <li><a href="products.php"><?=THE_supply_LANG?></a></li>

            <?
            $id_get = intval($_GET['id']);
            $id_cat_get = intval($_GET['id_cat']);

            $sel="select * from cat where langu='$_SESSION[lang_g]' AND id=$id_cat_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
                extract($result);
                ?>
                <li><a href="products_cat.php?id=<?=$id?>"><?=$name?></a></li>

                <?
            }

            $sel="select * from product where langu='$_SESSION[lang_g]' AND id=$id_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
            extract($result);?>
                <li><a href="products_in.php?id=<?=$id_get?>&id_cat=<?=$id_cat_get?>"><?=$name?></a></li>

            <?}
}


//---------------- fetch title maktaba for path hed --------------------------
function fet_title_maktaba_in_path(){
            ?>
            <a href="main.php"><?=HOME_LANG?></a>
            <span> >> </span>
            <a href="library.php"><?=Library_LANG?></a>
            <span> >> </span>
            <?
            $id_get = intval($_GET['id']);
            $id_cat_get = intval($_GET['id_cat']);

            $sel="select * from cat_maktaba where langu='$_SESSION[lang_g]' AND id = $id_cat_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
                extract($result);
                ?>
                <a href="library_cat.php?id=<?=$id?>"><?=$name?></a>
                <span> >> </span>
                <?
            }

            $sel="select * from product_maktaba where langu='$_SESSION[lang_g]' AND id = $id_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
            extract($result);
                echo $name;
            }
}

//---------------- fetch title products_cat for path hed --------------------------
function fet_title_center_mali_in_path(){
            ?>
            <a href="main.php"><?=HOME_LANG?></a>
            <span> >> </span>
            <a href="center_financial.php"><?=Financial_LANG?></a>
            <span> >> </span>
            <?
            $id_get = intval($_GET['id']);
            $id_cat_get = intval($_GET['id_cat']);

            $sel="select * from cat_mali where langu='$_SESSION[lang_g]' AND id = $id_cat_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
                extract($result);
                ?>
                <a href="center_financial_cat.php?id=<?=$id?>"><?=$name?></a>
                <span> >> </span>
                <?
            }

            $sel="select * from product_mali where langu='$_SESSION[lang_g]' AND id = $id_get AND active=1";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
            extract($result);
                echo $name;
            }
}


//--------------- fetch product_in ------------------------------
function fet_product_in (){
                            $id = intval($_GET['id']);
							$sel="select * from product where langu='$_SESSION[lang_g]' AND id=$id AND active=1";
							$query=mysql_query($sel);
							while ($result=mysql_fetch_array($query)){
								extract($result);
							}
				?>
                <div class="titlnews_in"><?=$name?></div>
                <div class="detlsnews_in">

                </div>
                <div class="descnews_in"><?=$content?></div>
                <?
}

//--------------- fetch maktaba_in ------------------------------
function fet_maktaba_in (){
                            $id = intval($_GET['id']);
							$sel="select * from product_maktaba where langu='$_SESSION[lang_g]' AND id=$id AND active=1";
							$query=mysql_query($sel);
							while ($result=mysql_fetch_array($query)){
								extract($result);
							}
				?>
                <div class="titlnews_in"><?=$name?></div>
                <div class="detlsnews_in">

                </div>
                <div class="descnews_in"><?=$content?></div>
                <?
}


//--------------- fetch product_in ------------------------------
function fet_center_mali_in (){
                            $id = intval($_GET['id']);
							$sel="select * from product_mali where langu='$_SESSION[lang_g]' AND id=$id AND active=1";
							$query=mysql_query($sel);
							while ($result=mysql_fetch_array($query)){
								extract($result);
							}
				?>
                <div class="titlnews_in"><?=$name?></div>
                <div class="detlsnews_in">

                </div>
                <div class="descnews_in"><?=$content?></div>
                <?
}

//--------------------------- Counter vistors -------------------------------
/*
function counters(){
   	 			//??? ??? ????? ??????
				//????? ????? ???? ????? ?? ????? ????? ????? ?????? ????? ??????? ????? ???????
				$ss = "gausts.txt";
				// ?????? ?? ?? ????? ?????
						  if( file_exists($ss))
						   {
				//??? ??????? ????? ??? ??? ??????
				$b = file_get_contents("$ss");}
				//??? ????? ??? ??? ?????? ?? ?????? ??? ?? ??? ??????
				$fo = fopen($ss,"w");
				//????? ???? ??????? ??? ?????? ??????
				$q = $b+1;
				//??????? ??? ?????
				fwrite($fo,$q);
				// ????? ?????
				fclose($fo);
				//????? ??? ?????? ????? ??? 1
				//???????  q???? ??  ?????
				 echo $q;
}
*/
//--------------------------- date - time -------------------------------
/*
function dateeng(){
    //$date_time_f=date("Y-m-d h:i:s");
    //$date_f=date("Y-m-d");
    $time_f=date("h:i:s");
    echo $time_f;
}
*/


/*------------------------------- news menu left ---------------------------------------------*/
/*
function news_left (){
    $pathpic="upload/news";
    $sel="select * from news WHERE active=1 ORDER BY time ASC LIMIT 3";
    $qur=mysql_query($sel);
    while($result=mysql_fetch_array($qur)){
        extract($result);
        $intro=substr($intro, 0, 55);
        echo "<ul>";
            echo "
                    <a href='news_in.php?id=$id'>
                    <li>

                        <span class='tit_news'>$title</span>
                        <br />
                        <span class='img_news'><img src='$pathpic/$picname' width='50' height='50' class='imgpord' /></span>
                        <span class='tex_news'>$intro...</span>
                        <br />
                        <span class='tex_news'>$date</span>

                    </li>
                </a>
                ";
        echo "</ul>";
    }
}
*/
/*------------------------------- news menu left after click ---------------------------------------------*/
/*
function news_in (){
    $id = $_GET['id'];
    $pathpic="upload/news";
    $sel="select * from news where id = $id";
    $qur=mysql_query($sel);
    while($result=mysql_fetch_array($qur)){
        extract($result);

        echo "<div>";
            echo "

                        <span class='tit_news'>$title</span>
                        <br />
                        <span class='tit_news'>$intro</span>
                        <br />
                        <span class='img_news'><img src='$pathpic/$picname' width='150' height='150' class='imgpord' /></span>
                        <br />
                        <span class='tex_news'>$content</span>
                        <br /><br />
                        <span class='tex_news'>Date Created : $date at $time</span>


                ";
        echo "</div>";
    }
}
*/
/*------------------------------- path news in ---------------------------------------------*/
/*
function path_news (){
    $id = $_GET['id'];
    $sel="select * from news where id = $id";
    $qur=mysql_query($sel);
    while($result=mysql_fetch_array($qur)){
        extract($result);
        $path=$title;
        echo "<div id='path'>";
            echo "

                  <a href='main.php'>ط§ظ„ط±ط¦ظٹط³ظٹط©</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  <a href='news.php'>ط§ظ„ط£ط®ط¨ط§ط±</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  $path

                ";
        echo "</div>";
    }
}
*/

/*------------------------------- news all ---------------------------------------------*/
/*
function news_all (){

    $selx="select * from news where active=1";
    $qurx=mysql_query($selx);
    $numro=mysql_num_rows($qurx);

    if($numro){ //في حالة وجد اخبار

            //pagenation step 1 $each_page
            $each_page=3;
            //pagenation step 2 $post_count
            $qury="select * from news where active=1";
            $resul=mysql_query($qury);
            $post_count=mysql_num_rows($resul);
            //pagenation step 3 $page_count
            $page_count=ceil($post_count/$each_page);
            //pagenation step 4 $page
            if(!isset($_GET['page']) || intval($_GET['page']) <=0){
                $page=1;
            }elseif($_GET['page'] > $page_count){
                $page=$page_count;
            }else{
                $page=$_GET['page'];
            }
            //pagenation step 5 $start
            if($post_count >0){
                $start=$each_page*($page-1);
            }

            //pagenation step 6 fetch data from db
            $pathpic="upload/news";
            $sel="select * from news WHERE active=1 ORDER BY date_time DESC limit $each_page OFFSET $start";
            $qur=mysql_query($sel);
            while($result=mysql_fetch_array($qur)){
                extract($result);
                $descall=substr($content, 0, 200);
                echo "<div class='plock_news'>";
                    echo "
                            <a href='news_in.php?id=$id'>


                                <span class='titel_news2'>$title</span>
                                <br />
                                <span class='img_news'><img src='$pathpic/$picname' width='100' height='100' class='imgpord' /></span>
                                <br />
                                <span class='intro_news'>$intro</span>
                                <br /><br />
                                <span class='tex_news2'>Date Created : $date at $time</span>




                            </a>
                        ";
                echo "</div>";
            }

            //pagenation step 7 design button counter
            echo "<div class='counter'>";
                if($page_count > 1){
                                $first = 1;
                                $prev = $page - 1;
                                $next = $page + 1;
                                $last = $page_count;

                                //show first & prev
                                if($page > 1){
                                    echo ' <a href="news.php?page='.$first.'">ط§ظ„ط§ظˆظ„</a> ';
                                    echo ' <a href="news.php?page='.$prev.'">ط§ظ„ط³ط§ط¨ظ‚</a> ';
                                }

                                // show numbers pages
                                for($i=1; $i<=$page_count; $i++){
                                    if($page != $i){
                                        echo ' <a href="news.php?page='.$i.'">'.$i.'</a> ';
                                    }else{
                                        echo '<b>'.$i.'</b>';
                                    }

                                }

                                //show next & last
                                if($page < $page_count){
                                    echo ' <a href="news.php?page='.$next.'">ط§ظ„ظ‚ط§ط¯ظ…</a> ';
                                    echo ' <a href="news.php?page='.$last.'">ط§ظ„ط£ط®ظٹط±</a> ';
                                }

                }
            echo "</div>";
        }
}
*/
/*------------------------------- date & time footer ------------------------*/
/*
    function datetim (){
        echo date(" H:i:s / d M Y");
    }
*/

/*------------------------------- page about us ---------------------------------------------*/
/*
function about_us(){
    $sel="select * from pagefixed where id=1 AND active=1";
    $query=mysql_query($sel);
    while ($result=mysql_fetch_array($query)){
        extract($result);
    }
    echo "$content";
}
*/
/*------------------------------- page fro3na ---------------------------------------------*/
/*
function fro3na(){
    $sel="select * from pagefixed where id=2 AND active=1";
    $query=mysql_query($sel);
    while ($result=mysql_fetch_array($query)){
        extract($result);
    }
    echo "$content";
}
*/
/*------------------------------- page contact us ---------------------------------------------*/
/*
function contact_us(){
    $sel="select * from pagefixed where id=3 AND active=1";
    $query=mysql_query($sel);
    while ($result=mysql_fetch_array($query)){
        extract($result);
    }
    echo "$content";
}
*/
/*------------------------------- page product ---------------------------------------------*/
/*
function product(){
    $sel="select * from pagefixed where id=4 AND active=1";
    $query=mysql_query($sel);
    while ($result=mysql_fetch_array($query)){
        extract($result);
    }
    echo "$content";
}
*/

/*------------------------------- page home intro ---------------------------------------------*/
/*
function intro_home(){
    $sel="select * from pagefixed where id=5 AND active=1";
    $query=mysql_query($sel);
    while ($result=mysql_fetch_array($query)){
        extract($result);
        //$descall=substr($content, 0, 500);
    }
    echo "

        $content

    ";
}
*/
/*------------------------------- menu father left ---------------------------------------------*/
/*
function cat_all(){
    $sql="select * from cat where active = 1";
            $query=mysql_query($sql);
            while($result=mysql_fetch_array($query)){
                extract($result); ?>

                         <a href="product_in.php?id=$id"><div class="itmesmenuleft font14 classfont1 aright">??? ??????</div></a>

            <? }
}
*/
/*------------------------------- all father right ---------------------------------------------*/
/*
function cat_all_right(){
    $sql="select * from cat where active = 1";
            $query=mysql_query($sql);
            $pathpic="upload/cat";
            while($result=mysql_fetch_array($query)){
                extract($result);
                echo "
                        <a href='product_in.php?id=$id'>
                        <div class='prodhere'>
                            <img src='$pathpic/$picname' width='100' height='100' class='imgpord' />
                            <br />
                            $name
                        </div>
                        </a>
                    ";

            }
}
*/
/*------------------------------- show all products in rights ---------------------------------------------*/
/*
function product_all(){

            $id=$_GET['id'];
            $pathpic="upload/cat";
            //fetch desc for intero cat
            $sql="select * from cat WHERE id = $id and active = 1";
            $query=mysql_query($sql);
            while($result=mysql_fetch_array($query)){
                 extract($result);
                echo "
                    <div class='introcat'>
                        <span class='titleprod'>$name</span><img src='$pathpic/$picname' width='100' height='100' style='float:left;' class='imgpord' />
                        <br /><br />
                        $content
                    </div>
                ";
            }

            //fetch product from cat
            $sql="select * from product WHERE id_cat = $id and active = 1";
            $query=mysql_query($sql);
            $pathpicprod="upload/product";
            while($result=mysql_fetch_array($query)){
                extract($result);
                echo "

                    <div class='prod_cat'>
                        <a href='product_in_details.php?id=$id'><img src='$pathpicprod/$picname' width='100' height='180' /></a>
                        <br />
                        <a href='product_in_details.php?id=$id'>$name</a>
                    </div>

                ";
            }
}
*/
/*------------------------------- path select from menu left product ---------------------------------------------*/
/*
function path_product (){
    $id = $_GET['id'];
    $sel="select * from cat where id = $id";
    $qur=mysql_query($sel);
    while($result=mysql_fetch_array($qur)){
        extract($result);
        $path=$name;
        echo "<div id='path'>";
            echo "

                  <a href='main.php'>ط§ظ„ط±ط¦ظٹط³ظٹط©</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  <a href='product.php'>ط§ظ„ظ…ظ†طھط¬ط§طھ</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  $path

                ";
        echo "</div>";
    }
}
*/

/*------------------------------- show all details products in rights ---------------------------------------------*/
/*
function product_all_details(){

            $id=$_GET['id'];
            $sql="select * from product WHERE id = $id";
            $query=mysql_query($sql);
            $pathpicprod="upload/product";
            while($result=mysql_fetch_array($query)){
                extract($result);
                echo "
                   <br />
                   <span class='titleprod'>$name</span><img src='$pathpicprod/$picname' width='132' height='240' style='float:left;' class='imgpord' />
                    <br /><br />
                    $content
                    <br />
                ";
            }
}
*/
/*------------------------------- path select product details ---------------------------------------------*/
/*
function path_product_details (){

	$id = $_GET['id'];
    $sel="select * from product where id = $id";
    $qur=mysql_query($sel);
    while($result=mysql_fetch_array($qur)){
        extract($result);
        $path=$name;
		$catid=$id_cat;
        echo "<div id='path'>";
            echo "

                  <a href='main.php'>ط§ظ„ط±ط¦ظٹط³ظٹط©</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  <a href='product.php'>ط§ظ„ظ…ظ†طھط¬ط§طھ</a>
				  &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
				  ";
				$sel="select * from cat where id = $catid";
				$qur=mysql_query($sel);
				while($result=mysql_fetch_array($qur)){
					extract($result);
					$namecat=$name;
				}
				  echo "
                  <a href='product_in.php?id=$id'>$namecat</a>
                    &nbsp;&nbsp;&nbsp; >>> &nbsp;&nbsp;&nbsp;
                  $path

                ";
        echo "</div>";
    }
}
*/

?>