<?php
$path="../../";
include("../../map.php");
$scats = json_decode(GetArr("s","categories"), true);
$hcats = json_decode(GetArr("h","categories"), true);
$ucats = json_decode(GetArr("u","categories"), true);
$xcats = json_decode(GetArr("x","xmodules","",""), true);
$sitems = json_decode(GetArr("sayfa","",""), true);
?>
<option value="">...</option>
<?php if(($_GET["q"]<>"" && $_GET["ne"]=="kayit") || ($_GET["ne"]=="products")){?>
	<?php $sqlu=mysqli_query($conn, "select id,t1,t2,t4,t5,t10,s4,s5,n2,pb1,pb2,pb3 from ".$_SESSION["lang"]." where ne='kayit' and s13=1 and (t1 LIKE '%".$_GET["q"]."%' or t4 LIKE '%".$_GET["q"]."%' or t5 LIKE '%".$_GET["q"]."%' or n4 LIKE '%".$_GET["q"]."%') order by t1 asc"); while($rsu=mysqli_fetch_assoc($sqlu)){?>
		<option value="<?php if($rsu[$_GET["val"]]<>""){echo $rsu[$_GET["val"]];}else{echo translate($_GET["val"]." Tanımsız");}?>" <?php if($varyasyon=="var"){?>data-price="0" data-var="1"<?php }else{?>data-price="<?php echo sprice($rsu["pb1"]);?>" data-lprice="<?php if($rsu["pb2"]>0){echo sprice($rsu["pb2"]);}else{echo "0,00";}?>" data-mprice="<?php if($rsu["pb3"]>0){echo sprice($rsu["pb3"]);}else{echo "0,00";}?>" data-var="0"<?php }?> data-tax="<?php echo $rsu["s4"];?>" data-id="<?php echo $rsu["id"];?>" data-title="<?php echo $rsu["t1"];?>" data-desc="<?php echo $rsu["n2"];?>" data-unit="<?php echo $rsu["t10"];?>" data-pb="<?php echo $rsu["t2"];?>"><?php echo $rsu["t1"];?> <?php echo price($rsu["id"],"pb1");?> <?php echo $kpb?><?php if($f7==1){?>{<?php echo $rsu["s5"]." ".$rsu["t10"];?>}<?php }?></option>
	<?php }?>

<?php }elseif($_GET["q"]<>"" and $_GET["ne"]=="uye"){?>
	<?php $sqlu=mysqli_query($conn, "select id,t1 from t5 where ne='uye' and (t1 LIKE '%".$_GET["q"]."%' or n4 LIKE '%".$_GET["q"]."%') order by t1 asc"); while($rsu=mysqli_fetch_assoc($sqlu)){?>
		<option value="<?php echo $rsu["id"];?>"><?php echo $rsu["t1"];?></option>
	<?php }?>

<?php }elseif($_GET["q"]<>"" and $_GET["ne"]=="link"){?>
	<?php
	if($d10<>0){
		foreach($scats as $xkey=>$xvalue){$jscx = json_decode($xvalue["n1"],true);
		if(($xvalue["ne"]=="skategori" or $xvalue["ne"]=="".$_GET["ne"][0]."kategori") or ($xvalue["t1"]=="".$_GET["ne"]."")){
			?>
			<option class="c0" value="<?php echo linked("a",$xvalue["id"]);?>" title="<?php echo $xvalue["item"];?>" style="color:#6699FF">+ <?php echo ctranslate($xvalue["item"]);?></option>
		<?php }?>
	<?php }?>
	<?php
	foreach($sitems as $skey=>$svalue){
		if($svalue["ne"]=="sayfa"){
			?>
			<option value="<?php echo linked("s",$svalue["id"]);?>" title="<?php echo $svalue["t1"];?>" alt="<?php echo $svalue["t1"];?>" style="color:#6699FF !important">- <?php echo $svalue["t1"];?></option>
		<?php }}?>
	<?php }?>
	<?php
	if($b1<>0){
		foreach($hcats as $xkey=>$xvalue){
			if($xvalue["ne"]=="hkategori"  or ($xvalue["t1"]=="haber")){
				?>
				<option class="c0" value="<?php echo linked("b",$xvalue["id"]);?>" title="<?php echo $xvalue["item"];?>" style="color:#6699FF">+ <?php echo ctranslate($xvalue["item"]);?></option>
			<?php }}?>
		<?php }?>
		<?php
		foreach($xcats as $mkey=>$mvalue){
			if($mvalue["ne"]=="xmodules"){
				foreach($xcats as $xkey=>$xvalue){
					if($xvalue["ne"]=="".$mvalue["n4"]."kategori" or ($xvalue["t1"]==$mvalue["n2"])){
						?>
						<option class="c0" value="<?php echo linked($mvalue["n2"][0],$xvalue["id"]);?>" title="<?php echo $xvalue["item"];?>" style="color:#6699FF">+ <?php echo ctranslate($xvalue["item"]);?></option>
					<?php }}?>
					<?php
					foreach($xcats as $skey=>$svalue){
						if($mvalue["n2"]=="".$svalue["ne"]."" and $svalue["type"]=="page"){
							?>
							<option class="c0" value="<?php echo linked($mvalue["n2"][0],$svalue["id"]);?>" title="<?php echo $svalue["item"];?>" style="color:#6699FF">- <?php echo ctranslate($svalue["item"]);?></option>
						<?php }}?>
					<?php }}?>
					<?php
					if($a4<>0){
						foreach($ucats as $xkey=>$xvalue){
							if($xvalue["ne"]=="ukategori" or ($xvalue["t1"]=="kayit" and $xvalue["s1"]=="0")){
								?>
								<option class="c0" value="<?php echo linked("x",$xvalue["id"]);?>" title="<?php echo $xvalue["item"];?>" style="color:#6699FF">+ <?php echo ctranslate($xvalue["item"]);?></option>
								<?php foreach($ucats as $ykey=>$yvalue){?>
									<?php if((($yvalue["ne"]=="ualt_kategori") and $yvalue["c1"]=="".$xvalue["id"]."") or (($yvalue["t1"]=="kayit" and $yvalue["s1"]=="".$xvalue["id"]."") and $yvalue["s2"]=="0")){?>
										<option class="c1" value="<?php echo linked("y",$yvalue["id"]);?>" title="<?php echo $yvalue["item"];?>" style="color:#6699FF">- <?php echo ctranslate($yvalue["item"]);?></option>
										<?php foreach($ucats as $zkey=>$zvalue){?>
											<?php if((($zvalue["ne"]=="ualt2_kategori") and $zvalue["c2"]=="".$yvalue["id"]."") or ($zvalue["t1"]=="kayit" and $zvalue["s2"]=="".$yvalue["id"]."" and $zvalue["s3"]=="0")){?>
												<option class="c2" value="<?php echo linked("z",$zvalue["id"]);?>" title="<?php echo $zvalue["item"];?>" style="color:#6699FF">. <?php echo ctranslate($zvalue["item"]);?></option>
											<?php }}?>
										<?php }}?>
									<?php }?>
								<?php }?>
							<?php }?>
						<?php }?>

						<?php if($_GET["Cat_ID"]<>"" and $_GET["ne"]=="kayit" and $_GET["model"]=="grid"){?>
							<?php $sqlu=mysqli_query($conn, "select id,t1,t2,t4,t5,t10,s4,s5,n2,pb2,pb3 from ".$_SESSION["lang"]." where ne='kayit' and s13=1 and (s11='".$_GET["CatID"]."' or s11 LIKE '%|".$_GET["CatID"]."|%') order by t1 asc"); while($rsu=mysqli_fetch_assoc($sqlu)){?>
								<a class="pgrid" value="<?php echo $rsu["t1"]?>" <?php if($varyasyon=="var"){?>data-price="0" data-var="1"<?php }else{?>data-price="<?php echo jsprice(price($rsu["id"],"pb1"));?>" data-lprice="<?php if($rsu["pb2"]>0){echo jsprice(price($rsu["id"],"pb2"));}else{echo "0,00";}?>" data-mprice="<?php if($rsu["pb3"]>0){echo jsprice(price($rsu["id"],"pb3"));}else{echo "0,00";}?>" data-var="0"<?php }?> data-tax="<?php echo $rsu["s4"];?>" data-id="<?php echo $rsu["id"];?>" data-title="<?php echo $rsu["t1"];?>" data-desc="<?php echo $rsu["n2"];?>" data-unit="<?php echo $rsu["t10"];?>" data-pb="<?php echo $rsu["t2"];?>">
									<img src="<?php echo medya($rs["id"],"1","kresim","t1","",$weburl);?>">
									<?php echo $rsu["t1"]?>	
								</a>
							<?php }?>
							<?php }?>