<?php
	$path="../../../";
	if(file_exists("".$path."config/map.php" )){$path2="config/"; include("".$path."config/map.php");}else{include("".$path."map.php");}
	if ($_GET["ne"] == "kayit"){ $q="u"; }elseif ($_GET["ne"] == "video"){ $q="v"; }elseif ($_GET["ne"] == "galeri"){ $q="g"; }elseif ($_GET["ne"] == "sayfa"){ $q="s"; }elseif ($_GET["ne"] == "haber"){ $q="h"; }elseif ($_GET["ne"] == "msayfa"){ $q="m"; }elseif ($_GET["ne"] == "marka"){ $q="n"; }elseif ($_GET["ne"] == "uye"){ $q="k"; }elseif ($_GET["ne"] == "reklam"){ $q="r"; }elseif ($_GET["ne"] == "forum"){ $q="f"; }else{ $q=substr($_GET["ne"],0,1); }
	if ($_GET["val"] == ""){ $cval="Cat_ID"; $kval="id"; }else{ $cval=$_GET["val"]; $kval=$_GET["val"]; } //Value değiştirmek gerekirse val=Cat_lang1 gibi Gönder
	if ($_GET["order"] == ""){ $order="order by sira,Cat_".$_SESSION['lang']." asc"; $korder="order by t1 asc";}else{ $orders=explode('+',$_GET["order"]); $order="order by $orders[0] $orders[1]"; $korder="order by t1 asc";}
	if($_GET["c"]<>""){$cID=$_GET["c"];}
	if ($_GET["sID"] <> ""){
		$sqls=mysqli_query($conn, "select * from kategoriler where Cat_ID=".$_GET["sID"].""); $rss=mysqli_fetch_assoc($sqls);
		if($rss["ne"]=="".$q."alt_kategori"){$cID=$rss["c1"];}elseif($rss["ne"]=="".$q."alt_kategori2"){$cID=$rss["c2"];}elseif($rss["ne"]=="".$q."alt_kategori3"){$cID=$rss["s3"];}elseif($rss["ne"]=="".$q."alt_kategori4"){$cID=$rss["s4"];}elseif($rss["ne"]=="".$q."alt_kategori5"){$cID=$rss["s5"];}
	}
?>
<option value="0">...</option>
<?php if ($_GET["islem"] == "kategori"){?>
<?php
	if($cID==""){
		$sql=mysqli_query($conn, "select * from kategoriler where (ne='".$q."kategori') $order");
	}else{
		$sql=mysqli_query($conn, "select * from kategoriler where (ne='".$q."alt_kategori' and c1=".$cID.") or (ne='".$q."alt_kategori2' and c2=".$cID.") or (ne='".$q."alt_kategori3' and s3=".$cID.") or (ne='".$q."alt_kategori4' and s4=".$cID.") or (ne='".$q."alt_kategori5' and s5=".$cID.") $order"); 
	}
		while($rsc=mysqli_fetch_assoc($sql)){
?>
		<option value="<?php echo $rsc[$cval];?>" ID="<?php echo $rsc["Cat_ID"];?>" <?php if ($_GET["sID"] == $rsc["Cat_ID"]){echo "selected";}?> style="color:#6699FF"><?php echo $rsc["Cat_".$_SESSION['lang'].""];?></option>
	<?php }?>
<?php }elseif ($_GET["islem"] == "kayit"){?>
	<?php $sql=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where (ne='kayit' and s9='".$cID."') or (ne='kayit' and s10='".$cID."') $korder"); while($rsu=mysqli_fetch_assoc($sql)){ ?>
		<option value="<?php echo $rsu[$kval];?>" ID="<?php echo $rsu["id"];?>"style="color:#6699FF"><?php echo $rsu["t1"];?></option>
	<?php }?>
<?php }?>