<?php ob_start();?>
<?php
$path="../../";
include("../../map.php");
include("../../scripts.php");
$sql=mysqli_query($conn, "select * from kategoriler where Cat_ID=".$_GET["Cat_ID"].""); $rs=mysqli_fetch_assoc($sql);
$jsi = json_decode($rs["n6"], true);
$jsm = json_decode($rs["n7"], true);
if ($_GET["ne"] == "kayit"){
	$q="u";
	$climit=$a4;
}elseif ($_GET["ne"] == "sayfa"){	
	$q="s";
	$climit=$d10;
}elseif ($_GET["ne"] == "haber"){
	$q="h";
	$climit=$b1;
}elseif ($_GET["ne"] == "msayfa"){
	$q="m";
	$climit=$g7;
}elseif ($_GET["ne"] == "marka"){
	$q="n";
	$climit="5";
}elseif ($_GET["ne"] == "uye"){
	$q="k";
	$climit="3";
}elseif ($_GET["ne"] == "reklam"){
	$q="r";
	$climit="3";
}elseif ($_GET["ne"] == "forum"){
	$q="f";
}else{
	$q=substr($_GET["ne"],0,1);
	$climit = $module["d10_".$_GET["ne"].""];
}
$ne=$_GET["ne"];
$islem=$_GET["islem"];
$Cat_ID=$_GET["Cat_ID"];
if(isset($rs['n1_lang1'])){
	$clang="_".$_SESSION["lang"]."";
	//echo "var";
}
if(($_SESSION["kim"]=="Admin") or ($_SESSION["kim"]=="yonetici" and $_SESSION["y9"]==3)){
	if (($e10==1 and $_SESSION["user"]<>V3d('TWFzdGVy'))) {
		$yetki=0;
	}else{
		$yetki=1;
	}
}else{
	$yetki=0;
}
?>
<style>
	.chosen-container {width:99% !important;float: left;}
	.c0 	{color: red; font-weight: bold;}
	.c1 	{color: orange; font-weight: bold;}
	.c2 	{color: #f5d719; font-weight: bold;}
	.c3 	{color: green; font-weight: bold;}
	.c4 	{color: blue; font-weight: bold;}
	.c5 	{color: black; font-weight: bold;}	
	.c6 	{color: grey; font-weight: bold;}	
	.col-md-12 	{margin-bottom:5px; min-height: 34px !important;}	
	.form-control {font-weight:100;}
</style>
<?php if($_GET["durum"]=="ok"){?>
	<div class="alert alert-success" role="alert" style="padding:5px;">
		<?php echo $sdil[212]; //islem Basariyla Gerçeklestirilmistir !?>
	</div>
<?php }elseif($_GET["durum"]=="hata"){?>
	<div class="alert alert-danger" role="alert">
		...
	</div>
<?php }?>
<form name="frm" class="col-md-12" enctype="multipart/form-data" action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&Cat_ID=<?php echo $_GET["Cat_ID"];?>&durum=kaydet" method="post">
		<input type="hidden" name="nedir" value="<?php if($_GET["nedir"]<>""){echo $_GET["nedir"];}else{echo $rs["ne"];}?>" />
		<input type="hidden" name="c1" value="<?php if($_GET["c1"]<>""){echo $_GET["c1"];}else{echo $rs["c1"];}?>" />
		<input type="hidden" name="c2" value="<?php if($_GET["c2"]<>""){echo $_GET["c2"];}else{echo $rs["c2"];}?>" />
		<input type="hidden" name="s3" value="<?php if($_GET["s3"]<>""){echo $_GET["s3"];}else{echo $rs["s3"];}?>" />
		<input type="hidden" name="s4" value="<?php if($_GET["s4"]<>""){echo $_GET["s4"];}else{echo $rs["s4"];}?>" />
		<input type="hidden" name="s5" value="<?php if($_GET["s5"]<>""){echo $_GET["s5"];}else{echo $rs["s5"];}?>" />
	<ul class="nav nav-tabs" role="tablist">
		<li role="presentation" class="active"><a href="#tb1" aria-controls="tb1" role="tab" data-toggle="tab">#<?php echo $rs["Cat_ID"];?> <?php echo $rs["Cat_".$_SESSION['lang'].""];?></a></li>
		<li role="presentation" class=""><a href="#tb2" aria-controls="tb2" role="tab" data-toggle="tab">Detay</a></li>
		<li role="presentation" class=""><a href="#tb3" aria-controls="tb3" role="tab" data-toggle="tab">Extra</a></li>
		<?php $sqld=mysqli_query($conn, "select * from genel where ne='tanim' and t2='sp' order by t2,n4 asc"); while($rsd=mysqli_fetch_assoc($sqld)){?>
			<li role="presentation" class=""><a href="#tb<?php echo $rsd["id"];?>" aria-controls="tb<?php echo $rsd["id"];?>" role="tab" data-toggle="tab"><?php echo $rsd["n4"];?></a></li>
		<?php }?>
		<select size=1 name="s9" style="width: 200px; float: right; margin-top: 5px; background: whitesmoke;" class="form-control e">
			<option value="0">Admin</option>
			<?php $sqlm=mysqli_query($conn, "select * from t5"); while($rsm=mysqli_fetch_assoc($sqlm)){?>
			<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php if (($rs["s9"]=="" and $rsm["id"]==$_SESSION["user_id"]) or ($rs["s9"]<>"" and $rsm["id"]==$rs["s9"])) {?>Selected<?php }?>><?php echo $rsm["t1"];?></option>
			<?php }?>
		</select>
	</ul>
	<div class="tab-content">
		<div role="tabpanel" class="tab-pane active" id="tb1">
			<div class="row">
				<div class="col-xs-12" style="margin-top:10px;">
					<select class="form-control" onChange="self.location.href=this.options[this.selectedIndex].value;" style="height:34px;">
						<option value="0"><?php echo translate("Grup Değiştir")?></option>
						<?php $sql=mysqli_query($conn, "select * from kategoriler where ne='".$q."kategori' order by sira asc"); while($rsc=mysqli_fetch_assoc($sql)){?>
							<option class="c0" value="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&c1=<?php echo $rsc["Cat_ID"];?>&c2=0&s3=0&s4=0&s5=0&Cat_ID=<?php echo $rs["Cat_ID"];?>&nedir=<?php echo $rsc["ne"][0];?>alt_kategori">[x] <?php echo $rsc["Cat_".$_SESSION["lang"].""]?></option>
							<?php $sql1=mysqli_query($conn, "select * from kategoriler where ne='".$q."alt_kategori' and c1=".$rsc["Cat_ID"]." order by sira asc");?>
							<?php if(mysqli_num_rows($sql1)>0){?>
								<?php while($rsc1=mysqli_fetch_assoc($sql1)){?>
									<?php if(($rsc1["ne"]=="".$q."kategori" and $climit>1) or ($rsc1["ne"]=="".$q."alt_kategori" and $climit>2) or ($rsc1["ne"]=="".$q."alt_kategori2" and $climit>3) or ($rsc1["ne"]=="".$q."alt_kategori3" and $climit>4) or ($rsc1["ne"]=="".$q."alt_kategori4" and $a5=="5")){?>
										<option class="c1" value="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&c1=<?php echo $rsc["Cat_ID"];?>&c2=<?php echo $rsc1["Cat_ID"];?>&s3=0&s4=0&s5=0&Cat_ID=<?php echo $rs["Cat_ID"];?>&nedir=<?php echo $rsc["ne"][0];?>alt_kategori2">[y] <?php echo $rsc1["Cat_".$_SESSION["lang"].""]?></option>
									<?php }else{?>
										<option class="c1" value="#" <?php if($_GET["cID"]==$rsc1["Cat_ID"]){?>Selected<?php }?>>[y] <?php echo $rsc1["Cat_".$_SESSION["lang"].""]?></option>
									<?php }?>
									<?php $sql2=mysqli_query($conn, "select * from kategoriler where ne='".$q."alt_kategori2' and c2=".$rsc1["Cat_ID"]." order by sira asc");?>
									<?php if(mysqli_num_rows($sql2)>0){?>
										<?php while($rsc2=mysqli_fetch_assoc($sql2)){?>
											<?php if(($rsc2["ne"]=="".$q."kategori" and $climit>1) or ($rsc2["ne"]=="".$q."alt_kategori" and $climit>2) or ($rsc2["ne"]=="".$q."alt_kategori2" and $climit>3) or ($rsc2["ne"]=="".$q."alt_kategori3" and $climit>4) or ($rsc2["ne"]=="".$q."alt_kategori4" and $a5=="5")){?>
												<option class="c2" value="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&c1=<?php echo $rsc["Cat_ID"];?>&c2=<?php echo $rsc1["Cat_ID"];?>&s3=<?php echo $rsc2["Cat_ID"];?>&s4=0&s5=0&Cat_ID=<?php echo $rs["Cat_ID"];?>&nedir=<?php echo $rsc["ne"][0];?>alt_kategori3">[z] <?php echo $rsc2["Cat_".$_SESSION["lang"].""]?></option>
											<?php }else{?>
												<option class="c2" value="#" <?php if($_GET["cID"]==$rsc2["Cat_ID"]){?>Selected<?php }?>>[z] <?php echo $rsc2["Cat_".$_SESSION["lang"].""]?></option>
											<?php }?>
											<?php $sql3=mysqli_query($conn, "select * from kategoriler where ne='".$q."alt_kategori3' and s3=".$rsc2["Cat_ID"]." order by sira asc");?>                                                        
											<?php if(mysqli_num_rows($sql3)>0){?>
												<?php while($rsc3=mysqli_fetch_assoc($sql3)){?>
													<?php if(($rsc3["ne"]=="".$q."kategori" and $climit>1) or ($rsc3["ne"]=="".$q."alt_kategori" and $climit>2) or ($rsc3["ne"]=="".$q."alt_kategori2" and $climit>3) or ($rsc3["ne"]=="".$q."alt_kategori3" and $climit>4) or ($rsc3["ne"]=="".$q."alt_kategori4" and $a5=="5")){?>
														<option class="c3" value="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&c1=<?php echo $rsc["Cat_ID"];?>&c2=<?php echo $rsc1["Cat_ID"];?>&s3=<?php echo $rsc2["Cat_ID"];?>&s4=<?php echo $rsc3["Cat_ID"];?>&s5=0&Cat_ID=<?php echo $rs["Cat_ID"];?>&nedir=<?php echo $rsc["ne"][0];?>alt_kategori4">[w] <?php echo $rsc3["Cat_".$_SESSION["lang"].""]?></option>
													<?php }else{?>
														<option class="c3" value="#" <?php if($_GET["cID"]==$rsc3["Cat_ID"]){?>Selected<?php }?>>[w] <?php echo $rsc3["Cat_".$_SESSION["lang"].""]?></option>
													<?php }?>
													<?php $sql4=mysqli_query($conn, "select * from kategoriler where ne='".$q."alt_kategori4' and s4=".$rsc3["Cat_ID"]." order by sira asc");?>
													<?php if(mysqli_num_rows($sql4)>0){?>
														<?php while($rsc4=mysqli_fetch_assoc($sql4)){?>
															<?php if(($rsc4["ne"]=="".$q."kategori" and $climit>1) or ($rsc4["ne"]=="".$q."alt_kategori" and $climit>2) or ($rsc4["ne"]=="".$q."alt_kategori2" and $climit>3) or ($rsc4["ne"]=="".$q."alt_kategori3" and $climit>4) or ($rsc4["ne"]=="".$q."alt_kategori4" and $a5=="5")){?>
																<option class="c4" value="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&c1=<?php echo $rsc["Cat_ID"];?>&c2=<?php echo $rsc1["Cat_ID"];?>&s3=<?php echo $rsc2["Cat_ID"];?>&s4=<?php echo $rsc3["Cat_ID"];?>&s5=<?php echo $rsc4["Cat_ID"];?>&Cat_ID=<?php echo $rs["Cat_ID"];?>&nedir=<?php echo $rsc["ne"][0];?>alt_kategori5">[j] <?php echo $rsc4["Cat_".$_SESSION["lang"].""]?></option>
															<?php }else{?>
																<option class="c4" value="#" <?php if($_GET["cID"]==$rsc4["Cat_ID"]){?>Selected<?php }?>>[j] <?php echo $rsc4["Cat_".$_SESSION["lang"].""]?></option>
															<?php }?>
															<?php $sql5=mysqli_query($conn, "select * from kategoriler where ne='".$q."alt_kategori5' and s5=".$rsc4["Cat_ID"]." order by sira asc");?>
															<?php if(mysqli_num_rows($sql5)>0){?>
																<?php while($rsc5=mysqli_fetch_assoc($sql5)){?>
																	<option class="c5" value="#"><?php echo $rsc5["Cat_".$_SESSION["lang"].""]?></option>
																<?php }?>
															<?php }?>                                                   
														<?php }?>
													<?php }?>                                                     
												<?php }?>
											<?php }?>                                                   
										<?php }?>
									<?php }?>
								<?php }?>
							<?php }?>
						<?php }?>
					</select>
				</div>
				<div class="col-xs-6"><input type="text" name="cat" class="form-control" value="<?php echo $rs["Cat_".$_SESSION['lang'].""];?>" placeholder="<?php echo $rs["Cat_lang1"];?>" style=""/></div>
				<div class="col-xs-2"><input type="text" name="t4" value="<?php if($rs["t4"]==""){echo i2a($rs["Cat_ID"],7);}else{echo $rs["t4"];}?>" style="" class="form-control" placeholde="ID"/></div>
				<div class="col-xs-2"><input type="text" name="sira" value="<?php echo $rs["sira"];?>" style="" class="form-control"/></div>
				<div class="col-xs-1 tar"><input type="checkbox" name="s2" value="1" style="width:33px;" title="s2 Vitrin" class="form-control with-tip" <?php if($rs["s2"]==1){?>Checked<?php }?>></div>
				<div class="col-xs-1 tar"><input type="checkbox" name="s1" value="1" class="form-control with-tip msa" style="width:33px" <?php if($rs["s1"]<>0){?>Checked<?php }?> title="Silinemez!"></div>	
			</div>
		</div>
		<div role="tabpanel" class="tab-pane" id="tb2">
			<div class="row">
				
				<div class="col-xs-12" style="margin-top:10px;">
					<input type="text" style="" name="n1" class="form-control" title="n1_langx" value="<?php echo $rs["n1".$clang.""];?>" placeholder="<?php echo $sdil[39]; //Title?>" />
				</div>
				<div class="col-xs-12" style="margin-top:10px;">
					<textarea style="height:60px;" class="form-control" name="n2" title="n2_langx" placeholder="<?php echo $sdil[207]; //Açıklama?>"><?php echo $rs["n2".$clang.""];?></textarea>
				</div>
				<div class="col-xs-12" style="margin-top:10px;">
					<textarea style="height:60px;" class="form-control" name="n4" title="n4_langx" placeholder="<?php echo $sdil[41]; //Etiket?>"><?php echo $rs["n4".$clang.""];?></textarea>
				</div>
				<div class="col-xs-12" style="margin-top:10px;">
					<input type="text" style="" name="n3" class="form-control" title="n3" value="<?php echo $rs["n3"];?>" placeholder="Extra / Renk" />
				</div>
				<div class="col-xs-8" style="margin-top:10px;">
					<input type="text" name="n5" style="" class="form-control" value="<?php echo $rs["n5"];?>" placeholder="http://www.">
				</div>
				<div class="col-xs-4">
					<select size="1" name="t6" style="margin-top:10px;" class="form-control">
						<option value="<?php echo $rs["t6"];?>"> <?php if($rs["t6"]==""){echo "Target";}else{echo $rs["t6"];}?> </option>
						<option value="_self" >_self</option>
						<option value="_blank" >_blank</option>
						<option value="_top" >_top</option>
					</select>
				</div>
				<div style="clear:both;"></div>
				<div class="col-xs-6">
					<?php if(empty($rs["image"])){?>
					<input type="checkbox" class="" name="r1" value="ON" style="display:none;" alt="Resim Var/Yok" title="Resim Var/Yok">
					<input class="form-control" type="file" name="resim" style="" onchange="document.frm.r1.checked=true;" accept="*" style="margin-top:10px;">
					<?php }elseif(!empty($rs["image"])){?>
						<div style="clear:both;"></div>
						<a href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&Cat_ID=<?php echo $_GET["Cat_ID"];?>&durum=rsil" style="position: absolute; margin-top: 45px; margin-left: 10px; background: white; padding: 2px; border-radius: 2px; filter: drop-shadow(2px 4px 6px black);"><i class="fa fa-times"></i></a>
						<?php if(uzanti($rs["image"],"tip")=="resim"){?>
						<img src="../../../deppo/kategori/<?php echo $rs["image"];?>" style="margin-left:5px; height:65px;">
						<?php }else{?>
						<img src="../../<?php echo uzanti($rs["image"],"gorsel")?>" style="margin-left:5px; height:65px;">
						<?php }?>
					<?php }?>
				</div>
				<div class="col-xs-6">
					<?php if(empty($rs["image2"])){?>
					<input type="checkbox" class="" name="r2" value="ON" style="display:none;" alt="Resim Var/Yok" title="Resim Var/Yok">
					<input class="form-control" type="file" name="resim2" style="" onchange="document.frm.r1.checked=true;" accept="*" style="margin-top:10px;">
					<?php }elseif(!empty($rs["image2"])){?>
						<div style="clear:both;"></div>
						<a href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&Cat_ID=<?php echo $_GET["Cat_ID"];?>&durum=rsil2" style="position: absolute; margin-top: 45px; margin-left: 10px; background: white; padding: 2px; border-radius: 2px; filter: drop-shadow(2px 4px 6px black);"><i class="fa fa-times"></i></a>
						<?php if(uzanti($rs["image2"],"tip")=="resim"){?>
						<img src="../../../deppo/kategori/<?php echo $rs["image2"];?>" style="margin-left:5px; height:65px;">
						<?php }else{?>
						<img src="../../<?php echo uzanti($rs["image2"],"gorsel")?>" style="margin-left:5px; height:65px;">
						<?php }?>
					<?php }?>
				</div>
				
			</div>
		</div>
		<div role="tabpanel" class="tab-pane" id="tb3">
			<div class="row">
				<div class="col-xs-12" style="margin-top:10px;">
					<?php
					$i=0;$sqli=mysqli_query($conn, "select * from genel where ne='inputs' and (t2='All' or t2='".$_SESSION["lang"]."') and n3='kategori' and n4<>'switch' and (n2='0' or n2='".$rs["Cat_ID"]."') and s1=0 order by s10 asc");
					if(mysqli_num_rows($sqli)>0){
						?>
						<div class="">
							<div class="row">
								<?php while($rsi=mysqli_fetch_assoc($sqli)){$i++;?>
									<div class="col-xs-4 col-md-4" style="">
										<label><i class="<?php echo $rsi["n14"]?>"></i> <?php echo $rsi["n1"];?> <span style="font-size:8px; color:#ccc;"> (i<?php echo $i;?>)</span></label>
										<?php if($rsi["n4"]=="input"){?>
											<input class="form-control <?php echo $rsi["n13"]?>" type="<?php echo $rsi["n5"]?>" name="i<?php echo $i;?>" value="<?php echo $jsi["i".$i.""];?>" placeholder="<?php echo $rsi["n11"]?>" style="" <?php echo $rsi["n8"]?> <?php echo $rsi["n6"]?>>
										<?php }elseif($rsi["n4"]=="textarea"){?>
											<textarea class="form-control <?php echo $rsi["n13"]?>" name="i<?php echo $i;?>" placeholder="<?php echo $rsi["n11"]?>" <?php echo $rsi["n8"]?> <?php echo $rsi["n6"]?>><?php echo $jsi["i".$i.""];?></textarea>
										<?php }elseif($rsi["n4"]=="select"){?>
											<select class="form-control <?php echo $rsi["n13"]?> chosen-select" name="i<?php echo $i;?>[]" style="" <?php echo $rsi["n8"]?> <?php echo $rsi["n6"]?>>
												<option value=""><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
												<?php $o=0;$sqlo=mysqli_query($conn, "select * from genel where ne='inputs' and s1=".$rsi["id"]." order by s10 asc"); while($rso=mysqli_fetch_assoc($sqlo)){$o++;?>
													<option value="<?php echo $rso["n2"]?>" <?php $q="";foreach($jsi["i".$i.""] as $q){?><?php if($q==$rso["n2"] or $rso["n3"]==1){echo "selected";}}?>><?php echo $rso["n1"]?></option>
												<?php }?>
											</select>
										<?php }elseif($rsi["n4"]=="radio"){?>
											<?php $o=0;$sqlo=mysqli_query($conn, "select * from genel where ne='inputs' and t2='".$_SESSION["lang"]."' and s1=".$rsi["id"]." order by s10 asc"); while($rso=mysqli_fetch_assoc($sqlo)){$o++;?>
												<div style="float:left; margin-right: 5px;">
													<label style="float:left; margin-right:5px;"><?php echo $rso["n1"];?>
													<input type="radio" name="i<?php echo $i;?>" value="<?php echo $rso["n2"];?>" <?php echo $rsi["n8"]?> <?php if($jsi["i".$i.""]==$rso["n2"] or $rso["n3"]==1){echo "checked";}?>></label>
												</div>
											<?php }?>
										<?php }elseif($rsi["n4"]=="checkbox"){?>
											<?php $o=0;$sqlo=mysqli_query($conn, "select * from genel where ne='inputs' and t2='".$_SESSION["lang"]."' and s1=".$rsi["id"]." order by s10 asc"); while($rso=mysqli_fetch_assoc($sqlo)){$o++;?>
												<div style="float:left; margin-right: 5px;">
													<label style="float:left; margin-right:5px;"><?php echo $rso["n1"];?>
													<input type="checkbox" name="i<?php echo $i;?>[]" value="<?php echo $rso["n2"];?>" <?php echo $rsi["n8"]?> <?php foreach($jsi["i".$i.""] as $q){?><?php if($q==$rso["n2"] or $rso["n3"]==1){echo "checked";}?><?php }?>></label>
												</div>
											<?php }?>
										<?php }?>
										<p style="font-size:10px;"><?php echo $rsi["n9"];?></p>
									</div>
								<?php }?>
							</div>
						</div>
					<?php }?>
				</div>
				<?php if($module["areas"]=="2"){?>
					<div class="col-xs-12 col-md-12" style="">
						<fieldset class="grey-bg" style="height: 150px;">
						<label style="display:block; width:100%;"><?php echo translate("Bölgeler")?></b> <span style="font-size:8px; color:#ccc;">(n11)</span></label>
							<select name="areas[]" data-placeholder="<?php echo translate("Seçiniz")?>" multiple="multiple" class="form-control chosen-select" tabindex="8" style="clear:both;">
								<?php $areas_ = explode(',',$rs["n11"]); $sqla=mysqli_query($conn, "select * from genel where ne='areas' order by id asc"); while($areas=mysqli_fetch_assoc($sqla)){?>
								<option value="<?php echo $areas["id"]?>" <?php foreach($areas_ as $area_) {?><?php if($areas["id"]==$area_){?>Selected<?php }}?>><?php echo loc($areas["n2"])?> <?php if($areas["n3"]<>""){echo "> ".loc($areas["n3"])."";}?> <?php if($areas["n4"]<>""){echo "> ".loc($areas["n4"])."";}?></option>
								<?php }?>
							</select>
						</fieldset>
					</div>
				<?php }?>
			</div>
		</div>
		<?php $sqld=mysqli_query($conn, "select * from genel where ne='tanim' and t2='sp' order by t2,n4 asc"); while($rsd=mysqli_fetch_assoc($sqld)){?>
			<div role="tabpanel" class="tab-pane" id="tb<?php echo $rsd["id"];?>" style="margin-top:30px;">
				<?php if($rsd["n4"]=="Trendyol" and tanim("sp+Trendyol","n1",0)<>""){?>
						<select name="ictrendyol" id="ictrendyol" class="form-control chosen-select" style="">
						<option value="0">Lütfen Seçiniz</option>
						<?php
							$url = "".$weburl."/".$crmpath."/modules/integration/trendyol/categories.json";
							$categories = file_get_contents($url);
							$categories = json_decode($categories, true);
							foreach($categories[categories] as $item1){
								foreach($item1[subCategories] as $item2){
									foreach($item2[subCategories] as $item3){
									foreach($item3[subCategories] as $item4){
										if($item4<>""){
										?>
											<option value="<?php echo $item4[id]?>" <?php if($jsi["ictrendyol"]==$item4[id]){echo "Selected";}?>><?php echo $item1[name]?> > <?php echo $item2[name]?> > <?php echo $item3[name]?> > <?php echo $item4[name]?></option>
										<?php }elseif($item3<>""){
											?>
											<option value="<?php echo $item3[id]?>" <?php if($jsi["ictrendyol"]==$item3[id]){echo "Selected";}?>><?php echo $item1[name]?> > <?php echo $item2[name]?> > <?php echo $item3[name]?></option>
										<?php }else{ ?>
											<option value="<?php echo $item2[id]?>" <?php if($jsi["ictrendyol"]==$item2[id]){echo "Selected";}?>><?php echo $item1[name]?> > <?php echo $item2[name]?></option>
										<?php
											}
										}
									}
								}
							}
						?>
						</select>
				<?php }elseif($rsd["n4"]=="N11" and tanim("sp+N11","n1",0)<>""){?>
					<select name="imcn11" id="imcn11" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<select name="iscn11" id="iscn11" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<select name="icn11" id="icn11" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<script type="text/javascript">
						jQuery(document).ready(function() {
							jQuery('#imcn11').load('../integration/n11/categories.php?ne=GetTopLevelCategories&sID=<?php echo $jsi["imcn11"]?>');
						<?php if($jsi["iscn11"]<>""){?>
							jQuery('#iscn11').load('../integration/n11/categories.php?ne=GetSubCategories&sID=<?php echo $jsi["iscn11"]?>&ID=<?php echo $jsi["imcn11"]?>');
						<?php }?>
						<?php if($jsi["icn11"]<>""){?>
							jQuery('#icn11').load('../integration/n11/categories.php?ne=GetSub2Categories&sID=<?php echo $jsi["icn11"]?>&ID=<?php echo $jsi["iscn11"]?>');
						<?php }?>
						});
						jQuery('#imcn11').on('change', function(){
							var ID = jQuery('#imcn11 option:selected').attr('ID');
							jQuery('#iscn11').load('../integration/n11/categories.php?ne=GetSubCategories&sID=<?php echo $jsi["iscn11"]?>&ID='+ID);
						});
						jQuery('#iscn11').on('change', function(){
							var ID = jQuery('#iscn11 option:selected').attr('ID');
							jQuery('#icn11').load('../integration/n11/categories.php?ne=GetSub1Categories&sID=<?php echo $jsi["icn11"]?>&ID='+ID);
						})
					</script>
				<?php }elseif($rsd["n4"]=="Gittigidiyor" and tanim("sp+Gittigidiyor","n1",0)<>""){?>
					<select name="imcgittigidiyor" id="imcgittigidiyor" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<select name="iscgittigidiyor" id="iscgittigidiyor" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<select name="icgittigidiyor" id="icgittigidiyor" class="form-control" style="width:33%; float:left;"><option value="0">Lütfen Bekleyiniz</option></select>
					<script type="text/javascript">
						jQuery(document).ready(function() {
							jQuery('#imcgittigidiyor').load('../integration/gittigidiyor/categories.php?ne=grupa&sID=<?php echo $jsi["imcgittigidiyor"]?>');
<?php if($jsi["iscgittigidiyor"]<>""){?>
							jQuery('#iscgittigidiyor').load('../integration/gittigidiyor/categories.php?ne=grupab&sID=<?php echo $jsi["iscgittigidiyor"]?>&ID=<?php echo $jsi["imcgittigidiyor"]?>');
<?php }?>
<?php if($jsi["icgittigidiyor"]<>""){?>
							jQuery('#icgittigidiyor').load('../integration/gittigidiyor/categories.php?ne=grupabc&sID=<?php echo $jsi["icgittigidiyor"]?>&ID=<?php echo $jsi["iscgittigidiyor"]?>');
<?php }?>
						});
						jQuery('#imcgittigidiyor').on('change', function(){
							var ID = jQuery('#imcgittigidiyor option:selected').attr('ID');
							jQuery('#iscgittigidiyor').load('../integration/gittigidiyor/categories.php?ne=grupab&sID=<?php echo $jsi["iscgittigidiyor"]?>&ID='+ID);
						});
						jQuery('#iscgittigidiyor').on('change', function(){
							var ID = jQuery('#iscgittigidiyor option:selected').attr('ID');
							jQuery('#icgittigidiyor').load('../integration/gittigidiyor/categories.php?ne=grupabc&sID=<?php echo $jsi["icgittigidiyor"]?>&ID='+ID);
						})
					</script>
					<?php }elseif($rsd["n4"]=="Hepsiburada" and tanim("sp+Hepsiburada","n1",0)<>""){?>
						<select name="ichepsiburada" id="ichepsiburada" class="form-control chosen-select" style="">
						<option value="0">Lütfen Seçiniz</option>
						<?php
						$url = "".$weburl."/".$crmpath."/modules/integration/hepsiburada/categories.json";
						$categories = file_get_contents($url);
						$categories = json_decode($categories, true);
						foreach($categories["data"] as $item1){?>
						<option value="<?php echo $item1["categoryId"]?>" <?php if($jsi["ichepsiburada"]==$item1["categoryId"]){echo "Selected";}?>><?php if($item1["paths"][0]<>""){echo $item1["paths"][0]." > ";}?> <?php if($item1["paths"][1]<>""){echo $item1["paths"][1]." > ";}?> <?php //if($item1["paths"][2]<>""){echo $item1["paths"][2]." > ";}?> <?php //if($item1["paths"][3]<>""){echo $item1["paths"][3]." > ";}?> <?php echo $item1["name"]?></option>
						<?php }?>
						</select>
					<?php }elseif($rsd["n4"]=="Pttavm" and tanim("sp+Pttavm","n1",0)<>""){?>
						<select name="icpttavm" id="icpttavm" class="form-control chosen-select" style="">
						<option value="0">Lütfen Seçiniz</option>
						<?php
						$url = "".$weburl."/".$crmpath."/modules/integration/pttavm/categories.json";
						$categories = file_get_contents($url);
						$result = json_decode($categories, true);
						foreach($result[AltKategoriListesiResult][AltKategoriDetay] as $kategori){?>
						<option value="<?php echo $kategori["AltKategoriId"]?>" <?php if($jsi["icpttavm"]==$kategori["AltKategoriId"]){echo "Selected";}?>><?php echo $kategori[KategoriAdi];?> > <?php echo $kategori[AltKategoriAdi];?></option>
						<?php }?>
						</select>
					<?php }?>
					</div>
			<?php }?>
			<div class="col-md-12" style="margin-top:50px; clear:both;">
				<button type="submit" style="float:right;" class="btn btn-primary" <?php if ($yetki==0){?>disabled<?php }?>><?php echo $sdil[203]; //Güncelle?></button>
			</div>
</form>
<?php
//-------------------------------------------------------------------------/İşlem Ekle/
if($_GET["durum"] == "kaydet"){
	if($_POST["r1"]<>""){
		$kaydedilecekyer = "../../../deppo/kategori";
		$kaynak	= $_FILES['resim']['tmp_name'];	//Burası resminiz kök klasörünün yerini verir  
		$tipi	= $_FILES['resim']['type']; // Dosyanın Tipi
		$adi	= $_FILES["resim"]["name"]; // Dosyanın PCdeki Adı
		$uzanti = explode('.',$_FILES['resim']['name']);
		$rand 	= substr(md5(uniqid(rand())),0,10); 
		$yeni 	= "".$rand.".".$uzanti[count($uzanti)-1]."";
		move_uploaded_file ($_FILES['resim']['tmp_name'], $kaydedilecekyer . "/".$yeni);
		$Rs = mysqli_query($conn, "update kategoriler set image='".$yeni."' where Cat_ID=".$_GET["Cat_ID"]."");
	}
	if($_POST["r2"]<>""){
		$kaydedilecekyer = "../../../deppo/kategori";
		$kaynak	= $_FILES['resim2']['tmp_name'];	//Burası resminiz kök klasörünün yerini verir  
		$tipi	= $_FILES['resim2']['type']; // Dosyanın Tipi
		$adi	= $_FILES["resim2"]["name"]; // Dosyanın PCdeki Adı
		$uzanti = explode('.',$_FILES['resim2']['name']);
		$rand 	= substr(md5(uniqid(rand())),0,10); 
		$yeni 	= "".$rand.".".$uzanti[count($uzanti)-1]."";
		move_uploaded_file ($_FILES['resim2']['tmp_name'], $kaydedilecekyer . "/".$yeni);
		$Rs = mysqli_query($conn, "update kategoriler set image2='".$yeni."' where Cat_ID=".$_GET["Cat_ID"]."");
	}
	if(!empty($_POST["pb2"])){$spb2=$_POST["pb2"];}else{$spb2="0";}
	if(!empty($_POST["s1"])){$ss1=$_POST["s1"];}else{$ss1=0;}
	if(!empty($_POST["s2"])){$ss2=$_POST["s2"];}else{$ss2=0;}
	if(!empty($_POST["s6"])){$ss6=$_POST["s6"];}else{$ss6=0;}
	if(!empty($_POST["s9"])){$ss9=$_POST["s9"];}else{$ss9=0;}
	if(!empty($_POST["areas"])){$sn11 = implode(',',$_POST["areas"]);}
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$marr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="m"){
			$marr = $marr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$rjsm = json_encode($marr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$Rs = mysqli_query($conn, "update kategoriler set ne='".$_POST["nedir"]."', Cat_".$_SESSION['lang']."='".addslashes(stripslashes($_POST["cat"]))."', n1".$clang."='".addslashes(stripslashes($_POST["n1"]))."', n2".$clang."='".addslashes(stripslashes($_POST["n2"]))."', n3='".addslashes(stripslashes($_POST["n3"]))."', n4".$clang."='".addslashes(stripslashes($_POST["n4"]))."', n5='".$_POST["n5"]."', n6='".addslashes(stripslashes($rjsi))."', n7='".addslashes(stripslashes($rjsm))."', n11='".addslashes(stripslashes($sn11))."', t4='".$_POST["t4"]."', sira='".$_POST["sira"]."', s1='".$ss1."', s2='".$ss2."', s9='".$ss9."', c1='".$_POST["c1"]."', c2='".$_POST["c2"]."', s3='".$_POST["s3"]."', s4='".$_POST["s4"]."', s5='".$_POST["s5"]."' where Cat_ID=".$_GET["Cat_ID"]."");
	go("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&Cat_ID=".$_GET["Cat_ID"]."&c1=".$_GET["c1"]."&c2=".$_GET["c2"]."&s3=".$_GET["s3"]."&s4=".$_GET["s4"]."&s5=".$_GET["s5"]."&durum=ok");
}elseif($_GET["durum"] == "rsil"){
	$dosya="../../../deppo/kategori/".$rs["image"]."";
	unlink($dosya);
	$Rs = mysqli_query($conn, "update kategoriler set image='' where Cat_ID=".$_GET["Cat_ID"]."");
	go("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&Cat_ID=".$_GET["Cat_ID"]."&durum=ok");
}elseif($_GET["durum"] == "rsil2"){
	$dosya="../../../deppo/kategori/".$rs["image2"]."";
	unlink($dosya);
	$Rs = mysqli_query($conn, "update kategoriler set image2='' where Cat_ID=".$_GET["Cat_ID"]."");
	go("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&Cat_ID=".$_GET["Cat_ID"]."&durum=ok");
};?>
<?php ob_end_flush();?>
<script src="../../assets/search_ajax/chosen.jquery.js" type="text/javascript"></script>
<script type="text/javascript">
	var config = {
		'.chosen-select'           : {},
		'.chosen-select-deselect'  : {allow_single_deselect:true},
		'.chosen-select-no-single' : {disable_search_threshold:10},
		'.chosen-select-no-results': {no_results_text:'Kayıt Yok'},
		'.chosen-select-width'     : {width:"95%"}
	}
	for (var selector in config) {
		jQuery(selector).chosen(config[selector]);
	}
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>