<?php
$path="../../";
include("../../map.php");
if($e3==1){
	$stip="multiple";
	$ckat="Cat_".$_SESSION['lang']."";
}else{
	$ckat="Cat_ID";
}
?>
<?php if($a4<>0){?>
	<fieldset class="grey-bg v3-col-md-3">
		<legend><?php echo $sdil[12]; //Kategori?> <span style="font-size:8px; color:#ccc;">(s9)</span></legend>
		<select size=1 name="s9[]" ID="cs9" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php $s9S = explode(',',$rs["s9"]); $sql=mysqli_query($conn, "select * from kategoriler where ne='ukategori' order by sira asc"); 	while($rsx=mysqli_fetch_assoc($sql)){?>
				<option value="<?php echo $rsx[$ckat];?>" ID="<?php echo $rsx[$ckat];?>" style="color:#6699FF" <?php foreach($s9S as $x9){if($x9==$rsx[$ckat]){echo "selected";}}?>><?php echo $rsx["Cat_".$_SESSION['lang'].""];?></option>
			<?php };?>
		</select>
	</fieldset>
<?php }?>
<?php if($a4>1){?>
	<fieldset class="grey-bg v3-col-md-3">
		<legend><?php echo ctranslate("Alt Kategori")?> <span style="font-size:8px; color:#ccc;">(s10)</span></legend>
		<select size=1 name="s10[]" ID="cs10" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php
			$s10S = explode(',',$rs["s10"]);
			$sql2=mysqli_query($conn, "select * from kategoriler where ne='ualt_kategori' and c1=".$rs["s9"]." order by sira asc"); while($rsy=mysqli_fetch_assoc($sql2)){
				?>
				<option value="<?php echo $rsy[$ckat];?>" ID="<?php echo $rsy[$ckat];?>"style="color:#6699FF" <?php foreach($s10S as $s10){if($s10==$rsy[$ckat]){echo "selected";}}?>><?php echo $rsy["Cat_".$_SESSION['lang'].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<script type="text/javascript">
		jQuery('#cs9').on('change', function(){
			var ID = $('#cs9 option:selected').attr('ID');
			jQuery('#cs10').load('modules/ajax/categorie_ajax.php?ne=<?php echo $_GET["ne"]?>&islem=kategori&islem=ualt_kategori&c='+ID);
		})
	</script>
<?php }?>
<?php if($a4>2){?>
	<fieldset class="grey-bg v3-col-md-3">
		<legend><?php echo $sdil[79]; //Alt2 Kategori?> <span style="font-size:8px; color:#ccc;">(s11)</span></legend>
		<select size=1 name="s11[]" ID="cs11" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php
			$s11S = explode(',',$rs["s11"]);
			$sql3=mysqli_query($conn, "select * from kategoriler where ne='ualt_kategori2' and c2=".$rs["s10"]." order by sira asc"); while($rsz=mysqli_fetch_assoc($sql3)){
				?>
				<option value="<?php echo $rsz[$ckat];?>" ID="<?php echo $rsz[$ckat];?>" style="color:#6699FF" <?php foreach($s11S as $s11){if($s11==$rsz[$ckat]){echo "selected";}}?>><?php echo $rsz["Cat_".$_SESSION['lang'].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<script type="text/javascript">
		jQuery('#cs10').on('change', function(){
			var ID = $('#cs10 option:selected').attr('ID');
			jQuery('#cs11').load('modules/ajax/categorie_ajax.php?ne=<?php echo $_GET["ne"]?>&islem=kategori&islem=ualt_kategori2&c='+ID);
		})
	</script>
<?php }?>
<?php if($a4>3){?>
	<fieldset class="grey-bg v3-col-md-3">
		<legend><?php echo ctranslate("Alt2 Kategori")?> <span style="font-size:8px; color:#ccc;">(t11)</span></legend>
		<select size=1 name="t11[]" ID="ct11" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php
			$t11S = explode(',',$rs["t11"]);
			$sql4=mysqli_query($conn, "select * from kategoriler where ne='ualt_kategori3' and s3=".$rs["s11"]." order by sira asc"); while($rsw=mysqli_fetch_assoc($sql4)){
				?>
				<option value="<?php echo $rsw[$ckat];?>" ID="<?php echo $rsw[$ckat];?>" style="color:#6699FF" <?php foreach($t11S as $t11){if($t11==$rsw[$ckat]){echo "selected";}}?>><?php echo $rsw["Cat_".$_SESSION['lang'].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<script type="text/javascript">
		jQuery('#cs11').on('change', function(){
			var ID = $('#cs11 option:selected').attr('ID');
			jQuery('#ct11').load('modules/ajax/categorie_ajax.php?ne=<?php echo $_GET["ne"]?>&islem=kategori&islem=ualt_kategori3&c='+ID);
		})
	</script>
<?php }?>
<?php if($a4>4){?>
	<fieldset class="grey-bg v3-col-md-3">
		<legend><?php echo ctranslate("Alt2 Kategori")?> <span style="font-size:8px; color:#ccc;">(t12)</span></legend>
		<select size=1 name="t12[]" ID="ct12" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php
			$t12S = explode(',',$rs["t12"]);
			$sql5=mysqli_query($conn, "select * from kategoriler where ne='ualt_kategori4' and s4=".$rs["t11"]." order by sira asc"); while($rsj=mysqli_fetch_assoc($sql5)){
				?>
				<option value="<?php echo $rsj[$ckat];?>" ID="<?php echo $rsj[$ckat];?>" style="color:#6699FF" <?php foreach($t12S as $t12){if($t12==$rsj[$ckat]){echo "selected";}}?>><?php echo $rsj["Cat_".$_SESSION['lang'].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<script type="text/javascript">
		jQuery('#ct11').on('change', function(){
			var ID = $('#ct11 option:selected').attr('ID');
			jQuery('#ct12').load('modules/ajax/categorie_ajax.php?ne=<?php echo $_GET["ne"]?>&islem=kategori&islem=ualt_kategori4&c='+ID);
		})
	</script>
	<?php }?>