<?php
$path="../../";
include("../../map.php");
include("../../secure.php");
include("../../scripts.php");
if ($_GET["ne"]=="haber"){
	$count = mysqli_query($conn, "select id FROM ".$_SESSION["lang"]." where ne='".$_GET["ne"]."' ".$luye.""); $cmodule=mysqli_num_rows($count);
	if($module["limit_".$_GET["ne"].""]<>"" and $module["limit_".$_GET["ne"].""] > $cmodule){$limit_module="true";}elseif($module["limit_".$_GET["ne"].""]==""){$limit_module="true";}else{$limit_module="false";}
	if($module["limit_haber"]<>"" and $module["limit_haber"]>$cmodule){}
		$nedir=$t22s[0]; $sislem="sayfa";
}else if($_GET["ne"]=="sayfa"){
	$count = mysqli_query($conn, "select id FROM ".$_SESSION["lang"]." where ne='".$_GET["ne"]."' ".$luye.""); $cmodule=mysqli_num_rows($count);
	if($module["limit_".$_GET["ne"].""]<>"" and $module["limit_".$_GET["ne"].""] > $cmodule){$limit_module="true";}elseif($module["limit_".$_GET["ne"].""]==""){$limit_module="true";}else{$limit_module="false";}
	$nedir=$t21s[0]; $sislem="sayfa";
}else if($_GET["ne"]=="msayfa"){
	$count = mysqli_query($conn, "select id FROM ".$_SESSION["lang"]." where ne='".$_GET["ne"]."' ".$luye.""); $cmodule=mysqli_num_rows($count);
	if($module["limit_".$_GET["ne"].""]<>"" and $module["limit_".$_GET["ne"].""] > $cmodule){$limit_module="true";}elseif($module["limit_".$_GET["ne"].""]==""){$limit_module="true";}else{$limit_module="false";}
	$nedir=$n8s[0]; $sislem="sayfa";
}else if($_GET["ne"]=="kayit"){
	$count = mysqli_query($conn, "select id FROM ".$_SESSION["lang"]." where ne='".$_GET["ne"]."' ".$luye.""); $cmodule=mysqli_num_rows($count);
	if($module["limit_".$_GET["ne"].""]<>"" and $module["limit_".$_GET["ne"].""] > $cmodule){$limit_module="true";}elseif($module["limit_".$_GET["ne"].""]==""){$limit_module="true";}else{$limit_module="false";}
	$nedir=$t24s[0]; $sislem="kayitlar";
}else if($_GET["ne"]=="uye" and $_GET["islem"]=="uyeler"){
	$count = mysqli_query($conn, "select id FROM t5 where ne='".$_GET["ne"]."' ".$luye.""); $cmodule=mysqli_num_rows($count);
	if($module["limit_".$_GET["ne"].""]<>"" and $module["limit_".$_GET["ne"].""] > $cmodule){$limit_module="true";}elseif($module["limit_".$_GET["ne"].""]==""){$limit_module="true";}else{$limit_module="false";}
	$nedir=$t25s[0]; $sislem="uyeler";
}else if($_GET["ne"]=="uye" and $_GET["islem"]=="relations"){
	$nedir=translate("İlişki"); $sislem="relations";$limit_module="true";
}else if($_GET["ne"]=="form"){
	$nedir=$form[0]; $sislem="form";$limit_module="true";
}else if($_GET["ne"]=="reklam"){
	$nedir=$reklam[0]; $sislem="reklam";$limit_module="true";
}else if($_GET["ne"]=="service"){
	$nedir=$t36s[0]; $sislem="service";$limit_module="true";
}else if($_GET["ne"]=="price_list"){
	$nedir=$module["price_list"]; $sislem="price_list";$limit_module="true";
}else if($_GET["ne"]=="gorev"){
	$nedir=$tasks[0]; $sislem="gorev";$limit_module="true";
}else if($_GET["ne"]=="tgorev"){
	$nedir=$tasks[0]; $sislem="tgorev";$limit_module="true";
}else if($_GET["ne"]=="eticaret"){
	$nedir=""; $sislem="siparisler";$limit_module="true";
}else if($_GET["islem"]=="sfatura"){
	$nedir="".$sdil[148]." ".$sdil[24].""; $sislem="muhasebe";$limit_module="true";
}else if($_GET["islem"]=="afatura"){
	$nedir="".$sdil[149]." ".$sdil[24].""; $sislem="muhasebe";$limit_module="true";
}else if($_GET["islem"]=="ifatura"){
	$nedir="".$sdil[139]." ".$sdil[24].""; $sislem="muhasebe";$limit_module="true";
}else{
	$nedir=$_GET["ne"];$limit_module="true";
}
?>
<style>
	legend { margin-bottom: 5px; border-bottom: 0px solid #e5e5e5; font-weight: bold; font-size: 14px; }
	.sam { display: none !important; }
	.cke_contents { height: 165px; }
	#cke_1_top { display: none !important;}
</style>
<?php if($_GET["islem"]=="relations"){?>
	<form action="<?php echo $weburl."/".$crmpath."/"?>?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=nrelations" target="_top" method="post">
		<fieldset class="grey-bg col-sm-5" style="min-height: 65px !important;">
			<label><i class="fa fa-plus" aria-hidden="true"></i> <?php echo ctranslate("Başlık")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
			<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
			<input type="text" name="t1" id="complex-fr-title" value="<?php echo $ut1;?>" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
		</fieldset>
<!--
		<fieldset class="grey-bg col-sm-2" style="min-height: 65px !important;">
			<label><i class="fa fa-user" aria-hidden="true"></i> <?php echo ctranslate("Yetkili")?> <span style="font-size:8px; color:#ccc;">(s19)</span></label>
			<select size=1 name="s19" style="" class="form-control chosen-select">
			    <option value="<?php echo $_SESSION["user_id"]?>" <?php if($_SESSION["user_id"]==$rs["s19"]){echo "Selected";}?>><?php if($_SESSION["user_id"]>0){echo $_SESSION["user"];}else{echo ctranslate("Admin");}?></option>
				<?php $sql=mysqli_query($conn, "select * from t5 where t1 LIKE '%".$q."%' $luye"); while($rsm=mysqli_fetch_assoc($sql)){?>
					<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php if (($rs["s19"]=="" and $rsm["id"]==$_SESSION["user_id"]) or ($rsm["id"]==$rs["s19"])) {echo "Selected";}?>><?php echo $rsm["t1"];?></option>
				<?php }?>
			</select>
		</fieldset>
-->
		<fieldset class="grey-bg col-sm-4" style="min-height: 65px !important;">
			<label><i class="fa fa-cubes" aria-hidden="true"></i> ... <span style="font-size:8px; color:#ccc;">(s2)</span></label>
			<select size=1 name="s2" style="" class="form-control chosen-select">
				<option value="0">...</option>
				<?php $sqlu=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='kayit' $luye"); while($rsu=mysqli_fetch_assoc($sqlu)){?>
					<option value="<?php echo $rsu["id"];?>"><?php echo $rsu["t1"];?></option>
				<?php }?>
			</select>
		</fieldset>
		<fieldset class="grey-bg col-sm-3" style="min-height: 65px !important;">
			<label>
				<i class="fa fa-user" aria-hidden="true"></i> <?php echo ctranslate($t25s[0]); //Üye?> <span style="font-size:8px; color:#ccc;">(s1)</span>
				<a class="cp btn btn-warning fa fa-plus" style="position:absolute; right: -2px; top: 0px; z-index: 99; padding: 2px 5px;" onclick="toggle('#addClient');"></a>
			</label>
			<select size=1 name="s1" id="chooseClient" class="form-control chosen-select">
				<option value="0"><?php echo ctranslate($t25s[0])?></option>
				<?php $sql=mysqli_query($conn, "select * from t5 where ne='uye' $luye"); while($rsm=mysqli_fetch_assoc($sql)){?>
					<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php if($rsm["id"]==$_GET["id"]){echo "selected";}?>><?php echo $rsm["t1"];?></option>
				<?php }?>
			</select>
			<div id="addClient" class="bg-warning" style="display:none; position: absolute; z-index: 99999; margin-top: -34px; width: 95% !important;">
				<div class="row">
					<div class="col-md-12" style="padding:5px 10px;">
						<input type="text" name="ut1" class="form-control" value="" placeholder="<?php echo ctranslate("Ad Soyad")?>" style="height:24px; padding:0px 5px;">
					</div>
					<div class="col-md-12" style="padding:5px 10px;">
						<input type="text" name="ut2" class="form-control" value="" placeholder="<?php echo ctranslate("Email")?>" style="height:24px; padding:0px 5px;">
					</div>
					<div class="col-md-12" style="padding:5px 10px;">
						<input type="text" name="ut4" class="form-control" value="" placeholder="<?php echo ctranslate("Gsm")?>" data-plugin-masked-input="" data-input-mask="<?php echo $module["pmask"];?>" style="height:24px; padding:0px 5px;">
					</div>
				</div>
			</div>
		</fieldset>
		<fieldset class="grey-bg col-sm-12" style="min-height: 65px !important;">
			<label><i class="fa fa-order" aria-hidden="true"></i> <?php echo ctranslate("Detay")?> <span style="font-size:8px; color:#ccc;">(n1)</span></label>
			<textarea class="form-control" name="n1" id="rte"></textarea>
		</fieldset>
    <!--
		<select size=1 name="s19" style="" class="form-control">
			<option value=""><?php echo ctranslate("Seçilmedi")?></option>
			<option value=""><?php echo ctranslate("Çağrı")?></option>
			<option value=""><?php echo ctranslate("E-Posta")?></option>
			<option value=""><?php echo ctranslate("Web Sitesi")?></option>
			<option value=""><?php echo ctranslate("Reklam")?></option>
			<option value=""><?php echo ctranslate("Mevcut Müşteri")?></option>
			<option value=""><?php echo ctranslate("Tavsiye")?></option>
			<option value=""><?php echo ctranslate("Gösteri / Sergi")?></option>
			<option value=""><?php echo ctranslate("Crm Formu")?></option>
			<option value=""><?php echo ctranslate("Geri Arama")?></option>
			<option value=""><?php echo ctranslate("Satış Artışı")?></option>
			<option value=""><?php echo ctranslate("Çevrimiçi Mağaza")?></option>
			<option value=""><?php echo ctranslate("Diğer")?></option>
		</select>
	-->
	<fieldset class="grey-bg col-sm-12" style="min-height: 65px !important;">
		<label><?php echo ctranslate("Yetkili")?></label>
		<?php $t5Sx = explode(',',$rs["s19"]);?>
		<select name="s19[]" data-placeholder="Seçiniz" style="" class="v3-form-control chosen-select" tabindex="8" multiple>
			<option value="0" title="Admin" alt="Admin" style="color:#6699FF" <?php foreach($t5Sx as $t5s){if($t5s==0){echo "selected";}}?>>Admin</option>
			<?php $sql=mysqli_query($conn, "select * from t5 where s9=1"); while($rsm=mysqli_fetch_assoc($sql)){?>
				<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php foreach($t5Sx as $t5s){if($t5s==$rsm["id"]){echo "selected";}}?>><?php echo $rsm["t1"];?></option>
			<?php }?>
		</select>
	</fieldset>
	<div style="clear:both;"></div>
	<div class="" id="inputs">
		<img src="../../assets/img/loading.gif">
		<a class="v3-btn v3-btn-xs v3-btn-default sam" style="" target="_blank" href="?ne=ayarlar&islem=inputs&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>"><i class="fa fa-wrench" aria-hidden="true"></i></a>
	</div>
	<script type="text/JavaScript" language="JavaScript">
		jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["islem"]?>&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
	</script>
	<div class="col-sm-12 mt5 mmt5" style="clear:both; width:100%;">
		<input type="checkbox" name="smail" class="btn btn-warning fl mfl mr5 mmr5" value="1"> <span style="margin-left:10px;" title="Müşteriye mail gönderir">Bilgilendir {Email}</span>
		<button type="submit" name="btn" class="btn btn-warning fr mfr mr5 mmr5" value="Ekle" style="padding: 3px 7px;"><?php echo ctranslate("Ekle")?></button>
		<i class="fa fa-bell-o btn btn-warning fr mfr mr5 mmr5" style="padding: 5px 10px; margin-right:10px;" onclick="toggle('#remember')"></i>
		<div class="fr mfr mr5 mmr5" style="display:none;" id="remember">
			<input type="date" name="t4" class="form-control">
		</div>
	</div>
</form>
<script>
	if (document.getElementById("rte") != undefined) {
		CKEDITOR.replace('rte');
	};
</script>
<?php }elseif($_GET["islem"]=="gorev"){?>
	<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addtask" method="post">
		<fieldset class="v3-col-md-8" style="min-height: 65px !important;">
			<label><i class="fa fa-plus" aria-hidden="true"></i> <?php echo ctranslate("Yapılacak şeyler")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
			<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
			<input type="text" name="t1" id="complex-fr-title" value="<?php echo $ut1;?>" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
		</fieldset>
		<fieldset class="v3-col-md-4" style="min-height: 65px !important;">
			<label><i class="fa fa-user" aria-hidden="true"></i> <?php echo ctranslate("Yetkili")?> <span style="font-size:8px; color:#ccc;">(s19)</span></label>
			<select size=1 name="s19" style="" class="form-control">
				<option value="0"><?php echo ctranslate("Admin")?></option>
				<?php $sql=mysqli_query($conn, "select * from t5 where t1 LIKE '%".$q."%' $luye"); while($rsm=mysqli_fetch_assoc($sql)){?>
					<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php if (($rs["s19"]=="" and $rsm["id"]==$_SESSION["user_id"]) or ($rsm["id"]==$rs["s19"])) {?>Selected<?php }?>><?php echo $rsm["t1"];?></option>
				<?php }?>
			</select>
		</fieldset>
		<fieldset class=" v3-col-md-4" style="">
			<legend><i class="fa fa-play"></i> <?php echo translate("Başlama Tarihi / Saat"); //Tarih?> <span style="font-size:8px; color:#ccc;">(t9/t8)</span></legend>
			<div class="row">
				<div class="col-md-6">
					<input type="date" name="t9" value="<?php echo date('Y-m-d');?>" title="Tarih-1" class="form-control with-tip" />
				</div>
				<div class="col-md-6">
					<input type="time" name="t8" value="<?php echo date('H:i');?>" class="form-control with-tip" />
				</div>
			</div>
		</fieldset>
		<fieldset class=" v3-col-md-4" style="">
			<legend><i class="fa fa-play"></i> <?php echo translate("Bitiş Tarihi / Saat"); //Tarih?> <span style="font-size:8px; color:#ccc;">(t10)</span></legend>
			<div class="row">
				<div class="col-md-6">
					<input type="date" name="t10" value="" title="Tarih-2" class="form-control with-tip" />
				</div>
				<div class="col-md-6">
					<input type="time" name="t11" value="" class="form-control with-tip" />
				</div>
			</div>
		</fieldset>
		<div style="clear:both;"></div>
		<div class="" id="inputs">
			<img src="../../assets/img/loading.gif">
			<a class="v3-btn v3-btn-xs v3-btn-default sam" style="" target="_blank" href="?ne=ayarlar&islem=inputs&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>"><i class="fa fa-wrench" aria-hidden="true"></i></a>
		</div>
		<script type="text/JavaScript" language="JavaScript">
			jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["islem"]?>&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
		</script>
		<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
			<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
		</div>
	</form>

<?php }elseif($_GET["islem"]=="service"){?>
	<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addservice" method="post">
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<label><?php echo $t36s[0]?> Konu <span style="font-size:8px; color:#ccc;">(n2)</span></label>
			<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
			<input type="text" name="n2" id="complex-fr-title" value="" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control" placeholder="<?php echo ctranslate("Başlık")?>">
		</fieldset>
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<label><?php echo $sablonlar //sablonlar?> <span style="font-size:8px; color:#ccc;">(isablon)</span></label>
			<select name="isablon" data-placeholder="Seçiniz" style="" class="form-control chosen-select" data-plugin-selecttwo="" tabindex="8">
				<option value="0">...</option>
				<?php $sqls=mysqli_query($conn, "select * from genel where ne='sablon' order by id desc"); while($rss=mysqli_fetch_assoc($sqls)){ ?>
					<option value="<?php echo $rss["id"];?>" <?php if ($rss["id"]==$jsi["isablon"]){?>Selected<?php }?>><?php echo $rss["t1"];?></option>
				<?php }?>
			</select>
		</fieldset>
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<label><?php echo $t36s[0]?> No <span style="font-size:8px; color:#ccc;">(t1)</span></label>
			<input type="text" name="t1" class="form-control" value="<?php if($fno<>""){echo $fno;}else{echo date('YmdHis');}?>" placeholder="<?php echo $t36s[0]?> No">
		</fieldset>
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<label><b><?php echo $t25s[0]; //Cari?> </b> <span style="font-size:8px; color:#ccc;">(s1)</span></label>
			<?php if($fcariID<>""){?>
				<div style="position:absolute;right: 0px; top: -20px;">
					<i class="cp btn btn-info fa fa-eye fr p8 mp8  e mr5 mmr5" onclick="window.open('?islem=duye&ne=uye&id=<?php echo $fcariID;?>&s2=&key=&sayfa=')" title="+90<?php echo $fcariGsm?>"></i>
					<i class="cp btn btn-info fa fa-envelope fr p8 mp8 mr5 mmr5 " onclick="location.href='mailto:<?php echo v3d($rs5["t2"]);?>'" title="<?php echo v3d($rs5["t2"]);?>"></i>
					<i class="cp btn btn-info fa fa-cc fr p8 mp8 mr5 mmr5 " onclick="toggle('#cc');toggle('.select2');" title="cc"></i>
					<i class="cp btn btn-info fa fa-whatsapp fr p8 mp8 mr5 mmr5 " onclick="window.open('https://<?php if($mobile<>""){echo "api";}else{echo "web";}?>.whatsapp.com/send?phone=90<?php echo telefon($fcariGsm)?>')" title="+90<?php echo $fcariGsm?>"></i>
					<i class="cp btn btn-info fa fa-phone fr p8 mp8 mr5 mmr5 " onclick="location.href='tel:+90<?php echo telefon($fcariGsm)?>'" title="+90<?php echo $fcariGsm?>"></i>
				</div>
			<?php }?>
			<input type="text" name="t6" id="cc" value="<?php echo $rsf["t6"]?>" class="form-control" style="display:none;" placeholder="Cc Email">
			<select name="s1" id="s1" data-placeholder="Seçiniz" style="" class="form-control chosen-select" data-plugin-selecttwo="" tabindex="8">
				<option value="0">Lütfen Seçiniz</option>
				<?php $sql5=mysqli_query($conn, "select * from t5 where ne='uye' $luye order by t1 asc"); while($rs5=mysqli_fetch_assoc($sql5)){?>
					<option value="<?php echo $rs5["id"];?>" title="<?php echo $rs5["t1"];?> {<?php echo v3d($rs5["t2"]);?>}" style="color:#6699FF" <?php if($rs5["id"]==$fcariID){?>Selected<?php }?>><?php echo $rs5["t1"];?></option>
				<?php }?>
			</select>
			<?php if($fcariID==""){?>
				<!--<a class="mb-1 mt-1 mr-1 btn btn-success majx" style="color:white;position: absolute; top: -20px; right: 0px;" data-toggle="modal" data-target="#ajaxModal" data-url="modules/public/addform.php?islem=uye&id=<?php echo $_GET["id"]?>"><i class="fa fa-plus" aria-hidden="true"></i></a>-->
				<a class="cp btn btn-warning fa fa-plus fr p5 mp5" style="position:absolute;right: 0px; top: -20px; z-index: 99;" onclick="toggle('#addClient');toggle('#chooseClient')"></a>
				<div id="addClient" style="display:none;position: absolute; margin-top: -34px; background: white; width: 98%;">
					<div class="row">
						<div class="col-md-4 col-xs-4">
							<input type="text" name="ut1" class="form-control" value="" placeholder="Ad Soyad">
						</div>
						<div class="col-md-4 col-xs-4">
							<input type="text" name="ut2" class="form-control" value="" placeholder="Email">
						</div>
						<div class="col-md-4 col-xs-4">
							<input type="text" name="ut4" class="form-control" value="" placeholder="Gsm" data-plugin-masked-input="" data-input-mask="<?php echo $module["pmask"];?>">
						</div>
					</div>
				</div>
			<?php }?>
		</fieldset>
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<legend><?php echo translate("Teklif Tarihi")?> <span style="font-size:8px; color:#ccc;">(t9)</span></legend>
			<input type="date" name="ts1" id="simple-calendar" class="form-control datepicker" value="<?php if($rsf["t9"]==""){ echo date('Y-m-d'); }else{ echo $rsf["t9"]; }?>" placeholder="Fatura Tarihi">
		</fieldset>
		<fieldset class="v3-col-md-4 col-sm-4" style="min-height: 65px !important;">
			<legend><?php echo translate("Geçerlilik Tarihi")?> <span style="font-size:8px; color:#ccc;">(t10)</span></legend>
			<input type="date" name="ts2" id="simple-calendar" class="form-control datepicker" value="<?php if($rsf["t10"]==""){ echo date('Y-m-d', strtotime(date("Y-m-d"). ' 15 days')); }else{ echo $rsf["t10"]; }?>" placeholder="Fatura Tarihi">
		</fieldset>
		<div style="clear:both;"></div>
		<div class="" id="inputs">
			<img src="../../assets/img/loading.gif">
			<a class="v3-btn v3-btn-xs v3-btn-default sam" style="" target="_blank" href="?ne=ayarlar&islem=inputs&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>"><i class="fa fa-wrench" aria-hidden="true"></i></a>
		</div>
		<script type="text/JavaScript" language="JavaScript">
			jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["islem"]?>&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
		</script>
		<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
			<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
		</div>
	</form>

	<?php
}elseif($_GET["islem"]=="price_list"){
	if($_GET["id"]<>""){
		$sqlb=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' and id=".$_GET["id"]." order by id desc"); $bid=mysqli_fetch_assoc($sqlb);
		$url=$weburl."/price_list/".$bid["id"]."";
		$t1=$bid["t1"];$t2=$bid["t2"];$t3=$bid["t3"];$t4=$bid["t4"];$t5=$bid["t5"];$t9=$bid["t9"];$t10=$bid["t10"];
	}
	?>
	<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=create_price_list" method="post">
		<div class="v3-col-md-12 col-sm-12" style="">
			<label><i class="fa fa-plus" aria-hidden="true"></i> <?php echo ctranslate("Başlık")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
			<input type="text" name="t1" id="complex-fr-title" value="<?php echo $t1?>" class="form-control" placeholder="<?php echo ctranslate("Başlık")?>">
		</div>
		<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
			<label> <?php echo ctranslate("Ad Soyad / Firma")?> <span style="font-size:8px; color:#ccc;">(t2)</span></label>
			<input type="text" name="t2" id="complex-fr-title" value="<?php echo $t2?>" class="form-control" placeholder="<?php echo ctranslate("Ad Soyad / Firma")?>">
		</div>
		<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
			<label><input type="checkbox" name="send" style=""> EMail</label>
			<input type="text" name="t3" value="<?php echo $t3?>" class="form-control" placeholder="Email">
		</div>
		<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
			<label> <?php echo ctranslate("İndirim")?> <span style="font-size:8px; color:#ccc;">(t4)</span></label>
			<input type="number" name="t4" id="complex-fr-title" value="<?php echo $t4?>" class="form-control" placeholder="<?php echo ctranslate("İndirim")?>">
		</div>
		<div style="clear:both;"></div>
		<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
			<label> <?php echo ctranslate("Ürün Grubu")?> <span style="font-size:8px; color:#ccc;">(t5)</span></label>
			<select size=1 name="t5[]" style="" class="form-control chosen-select" multiple>
				<option value=""><?php echo ctranslate("Tüm Ürünler")?></option>
				<?php
				$s5S = explode(',',$t5);
				$sqlx=mysqli_query($conn, "select * from kategoriler where ne='ukategori' order by sira asc"); while($rsx=mysqli_fetch_assoc($sqlx)){$x++;
					$sqly=mysqli_query($conn, "select * from kategoriler where ne='ualt_kategori' and c1=".$rsx["Cat_ID"]." order by sira asc");
					?>
					<option value="<?php echo $rsx["Cat_ID"];?>" style="color:#6699FF" <?php foreach($s5S as $et5){if($et5==$rsx["Cat_ID"]){echo "selected";}}?>><?php echo $rsx["Cat_".$_SESSION['lang'].""];?></option>
					<?php while($rsy=mysqli_fetch_assoc($sqly)){?>
						<option value="<?php echo $rsy["Cat_ID"];?>" style="color:#6699FF" <?php foreach($s5S as $et5){if($et5==$rsy["Cat_ID"]){echo "selected";}}?>><?php echo $rsy["Cat_".$_SESSION['lang'].""];?></option>
					<?php }}?>
				</select>
			</div>
			<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
				<legend><?php echo translate("Teklif Tarihi")?> <span style="font-size:8px; color:#ccc;">(t9)</span></legend>
				<input type="date" name="t9" id="simple-calendar" class="form-control datepicker" value="<?php if($t9==""){ echo date('Y-m-d'); }else{ echo $t9; }?>" placeholder="">
			</div>
			<div class="v3-col-md-4 col-sm-4" style="margin-top:20px;">
				<legend><?php echo translate("Geçerlilik Tarihi")?> <span style="font-size:8px; color:#ccc;">(t10)</span></legend>
				<input type="date" name="t10" id="simple-calendar" class="form-control datepicker" value="<?php if($t10==""){ echo date('Y-m-d', strtotime(date("Y-m-d"). ' 15 days')); }else{ echo $t10; }?>" placeholder="">
			</div>
			<div style="clear:both;"></div>
			<div class="" id="inputs">
				<img src="../../assets/img/loading.gif">
				<a class="v3-btn v3-btn-xs v3-btn-default sam" style="" target="_blank" href="?ne=ayarlar&islem=inputs&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>"><i class="fa fa-wrench" aria-hidden="true"></i></a>
			</div>
			<script type="text/JavaScript" language="JavaScript">
				jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["islem"]?>&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
			</script>
			<div style="clear:both;"></div>
			<div class="col-sm-10" style="margin-top:20px;">
				<input type="text" class="form-control" value="<?php echo $url?>">
			</div>
			<div class="col-sm-2" style="margin-top:20px;">
				<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?>><?php echo ctranslate("Oluştur")?></button>
			</div>
		</form>
		<table class="table" style="width:100%;margin-top:20px;">
			<?php $sql=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' order by id desc"); while($rs=mysqli_fetch_assoc($sql)){?>
				<tr class="cp v3-bg-info">
					<td class="w8" onclick="location.href='?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&id=<?php echo $rs["id"]?>'"><?php echo $rs["id"]?></td>
					<td><?php echo $rs["t1"]?></td>
					<td class="w20"><?php echo $rs["t2"]?></td>
					<td class="w10"><?php echo dtarih($rs["t10"],"gg ua yyyy")?></td>
					<td class="w3"><a href="?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&id=<?php echo $rs["id"]?>&durum=delete_price_list" class="fas fa-trash v3-text-danger"></a></td>
				</tr>
			<?php }?>
		</table>

	<?php }elseif($_GET["islem"]=="form"){?>
		<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addform" method="post">
			<fieldset class="grey-bg col-sm-12">
				<label><i class="fa fa-user" aria-hidden="true"></i> <?php echo ctranslate("Form Başlık")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
				<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
				<input type="text" name="m1" id="fcontrol" value="<?php echo $ut1;?>" class="form-control" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
				<span id="control" style="position: absolute; margin-top: 2px; right: 2%;"></span>
			</fieldset>
			<fieldset class="grey-bg col-sm-4" style="<?php if($h4>0){}else{echo "display:none";}?>">
				<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Form Türü")?> <span style="font-size:8px; color:#ccc;">(m2)</span></label>
				<select size="1" name="m2" id="ss2" style="" class="form-control">
					<option value="form">Form</option>
					<option value="survey"><?php echo translate("Anket"); //Anket?></option>
					<option value="exam"><?php echo translate("Sınav"); //Sınav?></option>
				</select>
			</fieldset>
			<fieldset class="grey-bg col-sm-4" style="">
				<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Form Tipi")?> <span style="font-size:8px; color:#ccc;">(m4)</span></label>
				<select size="1" name="m4" class="form-control" style="float: left;">
					<option value="">..</option>
					<option value="fmesaj"><?php echo translate("Mesaj Formu")?></option>
					<option value="request"><?php echo translate("Talep Formu");?></option>
				</select>
			</fieldset>
			<div style="clear:both;"></div>
			<div class="" id="inputs"><img src="../../assets/img/loading.gif"></div>
			<script type="text/JavaScript" language="JavaScript">
				jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["ne"]?>&nedir=<?php echo $_GET["ne"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
			</script>
			<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
				<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
			</div>
		</form>

	<?php }elseif($_GET["islem"]=="uyeler"){?>
		<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addclient&s2=<?php echo $_GET["s2"];?>&s5=<?php echo $_GET["s5"];?>" method="post">
			<fieldset class="grey-bg col-sm-10">
				<label><i class="fa fa-user" aria-hidden="true"></i> <?php echo ctranslate("Adı Soyadı")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
				<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
				<input type="text" name="t1" id="fcontrol" value="<?php echo $ut1;?>" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
				<span id="control" style="position: absolute; margin-top: 2px; right: 2%;"></span>
			</fieldset>
			<fieldset class="grey-bg col-sm-2">
				<label># ID <span style="font-size:8px; color:#ccc;">(it4)</span></label>
				<?php $ut1="".trim($sdil[200])." ".trim($nedir)."";?>
				<input type="text" name="it4" class="form-control" Placeholder="<?php echo ctranslate(trim($nedir))?> ID">
			</fieldset>
    <!--
		<fieldset class="grey-bg v3-col-sm-6">
			<legend><?php echo $sdil[95]; //Gsm No?> <span style="font-size:8px; color:#ccc;">(t4)</span></legend>
				<input id="fcontrol" <?php if($module["pmask"]<>""){?>data-plugin-masked-input="" data-input-mask="<?php echo $module["pmask"];?>"<?php }?> placeholder="<?php echo $module["pmask"];?>" name="t4" value="<?php echo $rs["t4"];?>" class="form-control" style="border: 1px solid #ccc !important; border-left: 0px;">
			<span id="control"></span>
		</fieldset>
		<fieldset class="grey-bg v3-col-sm-6">
			<legend>E-Mail</legend>
				<input type="email" name="ut2" class="form-control" value="<?php if($rs["t2"]<>""){echo "".base64_decode($rs["t2"])."";}?>" placeholder="E-Mail"  autocomplete="false" style="border: 1px solid #ccc !important; border-left: 0px;">
		</fieldset>
	-->
	<fieldset class="grey-bg col-sm-4" style="<?php if($h4>0){}else{echo "display:none";}?>">
		<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Grup")?> <span style="font-size:8px; color:#ccc;">(s2)</span></label>
		<select size="1" name="s2" id="ss2" style="" class="form-control">
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php $sqlc=mysqli_query($conn, "select * from kategoriler where ne='kkategori' $lcat order by sira asc"); while($rsc=mysqli_fetch_assoc($sqlc)){?>
				<option value="<?php echo $rsc["Cat_ID"];?>" <?php if($rsc["Cat_ID"]==$rsu["s2"]){?>Selected<?php }?> title="<?php echo $rsc["Cat_".$_SESSION["lang"].""];?>" alt="<?php echo $rsc["Cat_".$_SESSION["lang"].""];?>" style="color:#6699FF">[<?php echo $rsc["Cat_ID"];?>] <?php echo $rsc["Cat_".$_SESSION["lang"].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<fieldset class="grey-bg col-sm-4" style="<?php if($h4>1){}else{echo "display:none";}?>">
		<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Alt Grup")?> <span style="font-size:8px; color:#ccc;">(s3)</span></label>
		<select size="1" name="s3" style="" class="form-control">
			<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
			<?php $sql2=mysqli_query($conn, "select * from kategoriler where ne='kalt_kategori' $lcat order by sira asc"); while($rsca=mysqli_fetch_assoc($sql2)){?>
				<option value="<?php echo $rsca["Cat_ID"];?>" title="<?php echo $rsca["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsca["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if ($rsca["Cat_ID"]==$rsu["s3"]) {?>Selected<?php }?>><?php echo $rsca["Cat_".$_SESSION['lang'].""];?></option>
			<?php }?>
		</select>
	</fieldset>
	<div style="clear:both;"></div>
	<div class="" id="inputs"><img src="../../assets/img/loading.gif"></div>
	<script type="text/JavaScript" language="JavaScript">
		jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["ne"]?>&nedir=<?php echo $_GET["ne"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
	</script>
	<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
		<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
	</div>
</form>

<?php }elseif($_GET["ne"]=="sayfa" or $_GET["islem"]=="sayfa"){?>
	<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addpage" method="post">
		<fieldset class="grey-bg col-sm-10">
			<label><i class="fa fa-plus" aria-hidden="true"></i> <?php echo ctranslate("Başlık")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
			<?php $ut1="".trim($sdil[200])." ".trim($nedir)."";?>
			<input type="text" name="t1" value="<?php echo $ut1;?>" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control qcontrol" qcontrol="qt1" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
			<span class="cspan" id="qt1" style="bottom: -10px;"></span>
		</fieldset>
		<fieldset class="grey-bg col-sm-2">
			<label><i class="fa fa-order" aria-hidden="true"></i> <?php echo ctranslate("Sıra")?> <span style="font-size:8px; color:#ccc;">(s1)</span></label>
			<?php $ut1="".trim($sdil[200])." ".trim($nedir)."";?>
			<input autocomplete="off" type="text" list="sl1" name="s1" id="s1" value="0" class="form-control" onfocus="if(this.value == '0') { this.value = ''} " onblur="if(this.value == '') { this.value='0'; }" placeholder="<?php echo $sdil[74]; //Sıra?>">
			<datalist id="sl1" style="display:none;">
				<option value="999"><?php echo ctranslate("Tahsilat Menü")?></option>
				<option value="1000"><?php echo ctranslate("Üyelik Sözleşmesi")?></option>
				<option value="1001"><?php echo ctranslate("Satış Sözleşmesi")?></option>
				<option value="1002"><?php echo ctranslate("İptal İade")?></option>
				<option value="1003"><?php echo ctranslate("Hizmet")?></option>
				<option value="1004"><?php echo ctranslate("Kvkk")?></option>
			</datalist>
		</fieldset>
		<fieldset class="grey-bg col-sm-10 msa">
			<label><i class="fa fa-link" aria-hidden="true"></i> <?php echo ctranslate("Link")?> <span style="font-size:8px; color:#ccc;">(n5)</span></label>
			<input type="text" list="ln5" class="form-control" name="n5" id="n5" style="width:70%; float:left;" value="<?php echo $rs["n5"];?>" placeholder="<?php echo ssl("http://www.");?>" autocomplete="off">
			<datalist id="ln5" style="display: none;"></datalist>
		</fieldset>
		<fieldset class="grey-bg col-sm-2 msa">
			<label><?php echo ctranslate("Method")?> <span style="font-size:8px; color:#ccc;">(t6)</span></label>
			<select size="1" name="t6" 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>
		</fieldset>
		<?php if($d9==1){ $stip="multiple"; } $skat="id"; $ckat="Cat_ID"; ?>
		<?php if($_GET["ne"]=="sayfa" and $d10<>"0" or $_GET["ne"]=="haber" and $b1<>"0" or $_GET["ne"]=="msayfa" and $g7<>"0" or (($_GET["ne"]<>"sayfa" or $_GET["ne"]<>"haber" or $_GET["ne"]<>"msayfa") and $d10<>"0")){?>
			<fieldset class="col-sm-4" style="">
				<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Kategori")?> <span style="font-size:8px; color:#ccc;">(s2)</span></label>
				<select size="1" name="s2[]" id="s2" class="form-control" <?php echo $stip?>>
					<option value="0"><?php echo ctranslate("Lütfen Seçiniz")?></option>
					<?php
					if($d10<>0){
						$sqla=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang'].",sira from kategoriler where ne='skategori' order by sira asc");
						if(mysqli_num_rows($sqla)>0){
							?>
							<optgroup label="<?php echo ctranslate($t21s[0]." Kategori")?>">
								<?php while($rsa=mysqli_fetch_assoc($sqla)){?>
									<option class="c0" value="<?php echo $rsa[$ckat];?>" order="<?php echo $rsa["sira"];?>" title="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsa[$ckat]){echo "selected";}?>>+ <?php echo ctranslate($rsa["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsa["Cat_ID"];?>]</option>
									<?php $sqlb=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where (ne='skategori' or ne='".$_GET["ne"][0]."alt_kategori') and c1=".$rsa["Cat_ID"]." order by sira asc"); while($rsb=mysqli_fetch_assoc($sqlb)){?>
										<option class="c1" value="<?php echo $rsb[$ckat];?>" order="<?php echo $rsb["sira"];?>" title="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsb[$ckat]){echo "selected";}?>>- <?php echo ctranslate($rsb["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsb["Cat_ID"];?>]</option>
										<?php $sqlc=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where (ne='skategori' or ne='".$_GET["ne"][0]."alt_kategori2') and c2='".$rsb["Cat_ID"]."' order by sira asc"); while($_SESSION["s2"]=mysqli_fetch_assoc($sqlc)){?>
											<option class="c2" value="<?php echo $rsc[$ckat];?>" order="<?php echo $rsc["sira"];?>" title="<?php echo $rsc["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsc["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsc[$ckat]){echo "selected";}?>>. <?php echo ctranslate($rsc["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsc["Cat_ID"];?>]</option>
										<?php }?>
									<?php }?>
								<?php }?>
							</optgroup>
						<?php }?>
						<?php
						$sqlsa=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where (ne='sayfa') and s5=1 order by s1 asc");
						if(mysqli_num_rows($sqlsa)>0){
							?>
							<optgroup label="<?php echo ctranslate(telefon($t21));?>">
								<?php while($rssa=mysqli_fetch_assoc($sqlsa)){?>
									<option value="<?php echo $rssa[$skat];?>" order="<?php echo $rssa["s1"];?>" title="<?php echo $rssa["t1"];?>" alt="<?php echo $rssa["t1"];?>" style="color:#6699FF !important" <?php if($_SESSION["s2"]==$rssa[$skat]){echo "selected";}?>>- <?php echo $rssa["t1"];?> [<?php echo $rssa["ne"][0];?><?php echo $rssa["id"];?>]</option>
								<?php }?>
							</optgroup>
						<?php }?>
					<?php }?>
					<?php
					$sqlxm=mysqli_query($conn, "select * from genel where ne='xmodules' order by id asc"); while($rsxm=mysqli_fetch_assoc($sqlxm)){
						if($module["d10_".$rsxm["n2"].""]>0){
							$sqlxa=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='".$rsxm["n4"]."kategori' order by sira asc");
							if(mysqli_num_rows($sqlxa)>0){
								?>
								<optgroup label="<?php echo ctranslate($rsxm["n1"]." Kategori")?>">
									<?php while($rsa=mysqli_fetch_assoc($sqlxa)){?>
										<option value="<?php echo $rsa[$ckat];?>" title="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsa[$ckat]){echo "selected";}?>>+ <?php echo ctranslate($rsa["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsa["Cat_ID"];?>]</option>
										<?php $sqlxb=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='halt_kategori' and c1='".$rsa["Cat_ID"]."' order by sira asc"); while($rsb=mysqli_fetch_assoc($sqlxb)){?>
											<option value="<?php echo $rsb[$ckat];?>" title="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsb[$ckat]){echo "selected";}?>>- <?php echo ctranslate($rsb["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsb["Cat_ID"];?>]</option>
										<?php }?>
									<?php }?>
								</optgroup>
							<?php }}?>
							<?php
							$sqlsa=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where (ne='".$rsxm["n2"]."') and s5=1 order by s1 asc");
							if(mysqli_num_rows($sqlsa)>0){
								?>
								<optgroup label="<?php echo ctranslate($rsxm["n1"]);?>">
									<?php while($rssa=mysqli_fetch_assoc($sqlsa)){?>
										<option value="<?php echo $rssa[$skat];?>" order="<?php echo $rssa["s1"];?>" title="<?php echo $rssa["t1"];?>" alt="<?php echo $rssa["t1"];?>" style="color:#6699FF !important" <?php if($_SESSION["s2"]==$rssa[$skat]){echo "selected";}?>>- <?php echo $rssa["t1"];?> [<?php echo $rssa["ne"][0];?><?php echo $rssa["id"];?>]</option>
									<?php }?>
								</optgroup>
							<?php }?>
						<?php }?>
						<?php
						if($b1<>0){
							$sqlha=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='hkategori' order by sira asc");
							if(mysqli_num_rows($sqlha)>0){
								?>
								<optgroup label="<?php echo ctranslate($t22s[0]." Kategori")?>">
									<?php while($rsa=mysqli_fetch_assoc($sqlha)){?>
										<option value="<?php echo $rsa[$ckat];?>" title="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsa[$ckat]){echo "selected";}?>>+ <?php echo ctranslate($rsa["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsa["Cat_ID"];?>]</option>
										<?php $sqlhb=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='halt_kategori' and c1='".$rsa["Cat_ID"]."' order by sira asc"); while($rsb=mysqli_fetch_assoc($sqlhb)){?>
											<option value="<?php echo $rsb[$ckat];?>" title="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsb[$ckat]){echo "selected";}?>>- <?php echo ctranslate($rsb["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsb["Cat_ID"];?>]</option>
										<?php }?>
									<?php }?>
								</optgroup>
							<?php }?>
						<?php }?>
						<?php
						if($d10<>0){
							$sqlma=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='mkategori' order by sira asc"); 
							if(mysqli_num_rows($sqlma)>0){
								?>
								<optgroup label="<?php echo ctranslate($n8s[0]." Kategori")?>">
									<?php while($rsa=mysqli_fetch_assoc($sqlma)){?>
										<option class="c0" value="<?php echo $rsa[$ckat];?>" title="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsa["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsa[$ckat]){echo "selected";}?>>+ <?php echo ctranslate($rsa["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsa["Cat_ID"];?>]</option>
										<?php $sqlmb=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='malt_kategori' and c1=".$rsa["Cat_ID"]." order by sira asc"); while($rsb=mysqli_fetch_assoc($sqlmb)){?>
											<option class="c1" value="<?php echo $rsb[$ckat];?>" title="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsb["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsb[$ckat]){echo "selected";}?>>- <?php echo ctranslate($rsb["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsb["Cat_ID"];?>]</option>
											<?php $sqlmc=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where (ne='malt_kategori2') and c2='".$rsb["Cat_ID"]."' order by sira asc"); while($rsc=mysqli_fetch_assoc($sqlmc)){?>
												<option class="c2" value="<?php echo $rsc[$ckat];?>" title="<?php echo $rsc["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsc["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsc[$ckat]){echo "selected";}?>>. <?php echo ctranslate($rsc["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsc["Cat_ID"];?>]</option>
											<?php }?>
										<?php }?>
									<?php }?>
								</optgroup>
							<?php }?>
							<?php
							$sqlms=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from ".$_SESSION["lang"]." where ne='msayfa' and s5=1 order by s1 asc");
							if(mysqli_num_rows($sqlms)>0){
								?>
								<optgroup label="<?php echo ctranslate($n8s[0]);?>">
									<?php while($rss=mysqli_fetch_assoc($sqlms)){?>
										<option value="<?php echo $rss[$skat];?>" order="<?php echo $rssa["s1"];?>" title="<?php echo $rss["t1"];?>" alt="<?php echo $rss["t1"];?>" style="color:#6699FF !important" <?php if($_SESSION["s2"]==$rss[$skat]){echo "selected";}?>>- <?php echo $rss["t1"];?> [<?php echo $rss["ne"][0];?><?php echo $rss["id"];?>]</option>
									<?php }?>
								</optgroup>
							<?php }?>
						<?php }?>
						<?php
						if($a4<>0){
							$sqlx=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='ukategori' order by sira asc");
							if(mysqli_num_rows($sqlx)>0){
								?>
								<optgroup label="<?php echo ctranslate($t24s[0]." Kategori")?>">
									<?php while($rsx=mysqli_fetch_assoc($sqlx)){?>
										<option class="c0" value="<?php echo $rsx[$ckat];?>" title="<?php echo $rsx["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsx["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsx[$ckat]){echo "selected";}?>>x) <?php echo ctranslate($rsx["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsx["Cat_ID"];?>]</option>
										<?php $sqly=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='ualt_kategori' and c1=".$rsx["Cat_ID"]." order by sira asc"); while($rsy=mysqli_fetch_assoc($sqly)){?>
											<option class="c1" value="<?php echo $rsy[$ckat];?>" title="<?php echo $rsy["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsy["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsy[$ckat]){echo "selected";}?>>y) <?php echo ctranslate($rsy["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsy["Cat_ID"];?>]</option>
											<?php $sqlz=mysqli_query($conn, "select Cat_ID,Cat_".$_SESSION['lang']." from kategoriler where ne='ualt_kategori2' and c2=".$rsy["Cat_ID"]." order by sira asc"); while($rsz=mysqli_fetch_assoc($sqlz)){?>
												<option class="c2" value="<?php echo $rsz[$ckat];?>" title="<?php echo $rsz["Cat_".$_SESSION['lang'].""];?>" alt="<?php echo $rsz["Cat_".$_SESSION['lang'].""];?>" style="color:#6699FF" <?php if($_SESSION["s2"]==$rsz[$ckat]){echo "selected";}?>>z) <?php echo ctranslate($rsz["Cat_".$_SESSION['lang'].""]);?> [<?php echo $rsz["Cat_ID"];?>]</option>
											<?php }?>
										<?php }?>
									<?php }?>
								</optgroup>
							<?php }?>
						<?php }?>
					</select>
				</fieldset>
			<?php }?>
			<fieldset class="grey-bg col-sm-2" style="<?php if($_GET["ne"]=="haber"){echo "display:none;";}?>">
				<label><i class="fa fa-check-square"></i> <?php echo ctranslate("Ana Menü")?> <span style="font-size:8px; color:#ccc;">(s5)</span></label>
				<select size="1" name="s5" class="form-control">
					<option value="0"><?php echo ctranslate("Kapalı")?></option>
					<option value="1"><?php echo ctranslate("Açık")?></option>
				</select>
			</fieldset>
			<fieldset class="grey-bg col-sm-2 msa" title="Değer Girilirse ilgili idli sayfa açılır.">
				<label><i class="fa fa-order" aria-hidden="true"></i> ID</label>
				<input autocomplete="off" type="text" name="id" value="" class="form-control">
			</fieldset>
			<div style="clear:both;"></div>
			<div class="" id="inputs">
				<img src="../../assets/img/loading.gif">
			</div>
			<script type="text/JavaScript" language="JavaScript">
				jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["ne"]?>&nedir=<?php echo $_GET["ne"]?>&kid=<?php echo $_GET["id"]?>','#inputs'); });
			</script>
			<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
				<button type="submit" name="btn" class="btn btn-success" style="float:right;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle & Düzenle"><?php echo ctranslate("Ekle & Düzenle")?></button>
				<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
			</div>
		</form>
		<script>
			<?php if ($_SESSION["s2"]<>"") {?>
				jQuery(document).ready(function() {
					var val = jQuery('option:selected', jQuery('#s2')).val();
					var s2 = jQuery('option:selected', jQuery('#s2')).attr('order');
					if (typeof s2 !== "undefined") {
						$.get('../../fonksiyon.php?islem=get_order&id=' + val + '&s2=' + s2 + '', function(data) {
							jQuery('#s1').val(data);
						});
					} else {
						jQuery('#s1').val('0');
					}
				}); 
			<?php } ?>
			jQuery(function() {
				jQuery('#s2').change(function() {
					var val = jQuery('option:selected', this).val();
					var s2 = jQuery('option:selected', this).attr('order');
					if (typeof s2 !== "undefined") {
						$.get('../../fonksiyon.php?islem=get_order&id=' + val + '&s2=' + s2 + '', function(data) {
							jQuery('#s1').val(data);
						});
					} else {
						jQuery('#s1').val('0');
					}
				});
			});
		</script>
	<?php }elseif($_GET["islem"]=="kayitlar"){
		$ucats = json_decode(GetArr("u","categories"), true);
		?>
		<form action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addproduct" method="post">
			<fieldset class="grey-bg col-sm-12">
				<label><i class="fa fa-plus" aria-hidden="true"></i> <?php echo ctranslate("Başlık")?> <span style="font-size:8px; color:#ccc;">(t1)</span></label>
				<?php $ut1="".ctranslate(trim($sdil[200])." ".trim($nedir))."";?>
				<input type="text" name="t1" value="<?php echo $ut1;?>" data-plugin-maxlength="" maxlength="<?php echo $module["ksinir"];?>" class="form-control qcontrol" qcontrol="qt1" onfocus="if(this.value == '<?php echo $ut1;?>') { this.value = ''} " onblur="if(this.value == '') { this.value='<?php echo $ut1;?>'; }" placeholder="<?php echo $ut1;?>">
				<span class="cspan" id="qt1" style="bottom: -10px;"></span>
			</fieldset>
			<?php if($a4<>0){?>
				<fieldset class="grey-bg col-sm-4">
					<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Kategori")?> <span style="font-size:8px; color:#ccc;">(s9)</span> </label>
					<select size=1 name="s9[]" ID="cs9" class="form-control chosen-select" multiple>
						<option value="0"><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
						<?php
						foreach($ucats as $key=>$value){
							if(($module["ajax_categories"]<>1 and $value["ne"]=="".$q."kategori" and $value["c1"]==0 or ($module["ajax_categories"]==1 and $value["t1"]=="".$_GET["ne"]."" and $value["c1"]==0))){ $xselected = ($value["id"] == $rs["s9"] || in_array($value["id"], multivalues($rs["s9"]))) ? 'selected' : '';
								echo "<option value=\"".$value["id"]."\" id=\"".$value["id"]."\" ".$xselected.">".$value["item"]."</option>";
							}
						}
						?>
				</select>
			</fieldset>
		<?php }?>
		<?php if($a4>1){?>
			<fieldset class="grey-bg col-sm-4">
				<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Alt Kategori")?> <span style="font-size:8px; color:#ccc;">(s10)</span></label>
				<select size=1 name="s10[]" ID="cs10" class="form-control chosen-select" multiple>
					<option value="0"><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
					<?php
					foreach($ucats as $key=>$value){
						if(($module["ajax_categories"]<>1 and $value["ne"]=="ualt_kategori"  and $value["c2"]==0 or ($module["ajax_categories"]==1 and $value["t1"]=="".$_GET["ne"]."" and $value["c2"]==0))){ $yselected = ($value["id"] == $rs["s10"] || in_array($value["id"], multivalues($rs["s10"]))) ? 'selected' : '';
							if(in_array($value["c1"], multivalues($rs["s9"])) || $value["c1"]==$rs["s9"]){
								echo "<option value=\"".$value["id"]."\" id=\"".$value["id"]."\" ".$yselected.">".$value["item"]."</option>";
							}
						}
					}
				?>
			</select>
		</fieldset>
	<?php }?>
	<?php if($a4>2){?>
		<fieldset class="grey-bg col-sm-4">
			<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Alt Kategori-2")?> <span style="font-size:8px; color:#ccc;">(s11)</span></label>
			<select size=1 name="s11[]" ID="cs11" class="form-control chosen-select" multiple>
				<option value="0"><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
				<?php
				foreach($ucats as $key=>$value){
					if(($module["ajax_categories"]<>1 and $value["ne"]=="ualt_kategori2" and $value["s3"]==0 or ($module["ajax_categories"]==1 and $value["t1"]=="".$_GET["ne"]."" and $value["s3"]==0))){ $zselected = ($value["id"] == $rs["s11"] || in_array($value["id"], multivalues($rs["s11"]))) ? 'selected' : '';
						if(in_array($value["c2"], multivalues($rs["s10"])) || $value["c2"]==$rs["s10"]){
							echo "<option value=\"".$value["id"]."\" id=\"".$value["id"]."\" ".$zselected.">".$value["item"]."</option>";
						}
					}
				}
			?>
		</select>
	</fieldset>
<?php }?>
<?php if($a4>3){?>
	<fieldset class="grey-bg col-sm-4">
		<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Alt Kategori-3")?> <span style="font-size:8px; color:#ccc;">(t11)</span></label>
		<select size=1 name="t11[]" ID="ct11" class="form-control chosen-select" multiple>
			<option value="0"><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
			<?php
				foreach($ucats as $key=>$value){
					if(($module["ajax_categories"]<>1 and $value["ne"]=="ualt_kategori3" and $value["s4"]==0 or ($module["ajax_categories"]==1 and $value["t1"]=="".$_GET["ne"]."" and $value["s4"]==0))){ $wselected = ($value["id"] == $rs["t11"] || in_array($value["id"], multivalues($rs["t11"]))) ? 'selected' : '';
						if(in_array($value["s3"], multivalues($rs["s11"])) || $value["s3"]==$rs["s11"]){
							echo "<option value=\"".$value["id"]."\" id=\"".$value["id"]."\" ".$wselected.">".$value["item"]."</option>";
						}
					}
				}
			?>
	</select>
</fieldset>
<?php }?>
<?php if($a4>4){?>
	<fieldset class="grey-bg col-sm-4">
		<label><i class="fa fa-list" aria-hidden="true"></i> <?php echo ctranslate("Alt Kategori-4")?> <span style="font-size:8px; color:#ccc;">(t12)</span></label>
		<select size=1 name="t12[]" ID="ct12" class="form-control" <?php echo $stip?>>
			<option value="0"><?php echo $sdil[221]; //Lütfen Seçiniz?></option>
			<?php
			foreach($ucats as $key=>$value){
				if(($module["ajax_categories"]<>1 and $value["ne"]=="ualt_kategori3" or ($module["ajax_categories"]==1 and $value["t1"]=="".$_GET["ne"]."" and $value["s4"]==$rs["t11"] and $value["s5"]==0))){$value["id"]==$rs["t12"] ? $selected="selected" : $selected="";
				echo "<option value=\"".$value["id"]."\" id=\"".$value["id"]."\" ".$selected.">".$value["item"]."</option>";
			}
		}
		?>
	</select>
</fieldset>
<script type="text/javascript">
	jQuery('#ct11').on('change', function() {
		var ID = $('#ct11 option:selected').attr('ID');
		jQuery('#ct12').load('../ajax/categorie<?php if($module["ajax_categories"]<>""){echo "s";}?>_ajax.php?ne=<?php echo $_GET["ne"]?>&islem=kategori&islem=ualt_kategori4&c=' + ID);
	})
</script>
<?php }?>
<div style="clear:both;"></div>
<div class="" id="inputs">
	<img src="../../assets/img/loading.gif">
	<a class="v3-btn v3-btn-xs v3-btn-default sam" style="" target="_blank" href="?ne=ayarlar&islem=inputs&nedir=<?php echo $_GET["islem"]?>&kid=<?php echo $_GET["id"]?>"><i class="fa fa-wrench" aria-hidden="true"></i></a>
</div>
<script type="text/JavaScript" language="JavaScript">
	jQuery(document).ready(function () { loadFunction('../ajax/ajax_inputs.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>','#inputs'); });
	jQuery('#cs9').on('change', function() { divload('../ajax/ajax_inputs.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&s9=' + this.value + '','#inputs'); });
</script>
<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
	<button type="submit" name="btn" class="btn btn-success" style="float:right;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle & Düzenle"><?php echo ctranslate("Ekle & Düzenle")?></button>
	<button type="submit" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="Ekle"><?php echo ctranslate("Ekle")?></button>
</div>
</form>
<?php }elseif($_GET["islem"]=="fis"){ ?>
	<form id="addfis" action="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=addvoucher" method="post" autocomplete="off">
		<fieldset class="grey-bg col-sm-3">
			<label>Fiş Tarihi <span style="font-size:8px; color:#ccc;">(t9)</span></label>
			<input type="date" name="t9" value="<?php echo date("Y-m-d")?>" class="form-control">
		</fieldset>
		<fieldset class="grey-bg col-sm-3">
			<label>Belge No <span style="font-size:8px; color:#ccc;">(t4)</span></label>
			<input type="text" name="t4" class="form-control">
		</fieldset>
		<fieldset class="grey-bg col-sm-3">
			<label>Belge Tarihi <span style="font-size:8px; color:#ccc;">(t3)</span></label>
			<input type="date" name="t3" value="<?php echo date("Y-m-d")?>" class="form-control">
		</fieldset>
		<fieldset class="grey-bg col-sm-3">
			<label>Belge Tipi <span style="font-size:8px; color:#ccc;">(t2)</span></label>
			<input list="lbt" type="text" name="t2" id="t2" class="form-control">
			<datalist id="lbt">
				<option value="Fatura">Fatura</option>
				<option value="İade Fatura">İade Fatura</option>
				<option value="Dekont">Dekont</option>
				<option value="Fiş">Fiş</option>
				<option value="Yazar Kasa Fişi">Yazar Kasa Fişi</option>
				<option value="Makbuz">Makbuz</option>
				<option value="Banka Ekstresi">Banka Ekstresi</option>
				<option value="Serbest Meslek Makbuzu">Serbest Meslek Makbuzu</option>
			</datalist>
		</fieldset>
		<fieldset class="grey-bg col-sm-12">
			<label>Açıklama <span style="font-size:8px; color:#ccc;">(n1)</span></label>
			<input type="text" name="n1" id="fis_n1" class="form-control">
		</fieldset>
		<fieldset class="grey-bg col-sm-12">
			<label>Fiş İçerik</label>
			<table class="table calc">
				<tr>
					<td scope="col" style="width:14%;" class="">Hesap Kodu</td>
					<td scope="col" style="width:20%;" class="">Hesap Adı</td>
					<td scope="col" style="" class="">Açıklama</td>
					<td scope="col" style="width:10%; display:none;" class="icol tac"><?php echo ctranslate("Miktar")?></td>
					<td scope="col" style="width:12%; display:none;" class="icol tar"><?php echo ctranslate("B.Fiyat")?></td>
					<td scope="col" style="width:12%;" class=" tar">Borç</td>
					<td scope="col" style="width:12%;" class=" tar">Alacak</td>
				</tr>
				<?php $i = 0; for ($i = 1; $i <= 49; $i++) {?>
					<tr id="row_<?php echo $i?>" data-id="<?php echo $i?>" style="<?php if($i<>1){?>display:none;<?php }?>">
						<input type="hidden" name="KID[]" value="<?php echo $i?>" />
						<td scope="col" class="w6">
							<input type="text" class="form-control" name="i1<?php echo $i?>" list="li1<?php echo $i?>" id="i1<?php echo $i?>" placeholder="<?php echo ctranslate("Hesap Kodu")?>">
							<datalist id="li1<?php echo $i?>">
								<?php $sqlt1=mysqli_query($conn, "select * from t1 where s1=".$_SESSION["fID"]." and s2=1 order by n1,s10 asc"); while($rst1=mysqli_fetch_assoc($sqlt1)){?>
									<option <?php if($rst1["n3"]=="Grup" or $rst1["n3"]=="Kebir"){echo "disabled";}?> value="<?php echo $rst1["n1"]?>" data-ad="<?php echo $rst1["n2"]?>" data-tur="<?php echo $rst1["n3"]?>" data-tip="<?php echo $rst1["n4"]?>"><?php echo $rst1["n2"]?> {<?php echo $rst1["n3"]?>}</option>
								<?php }?>
							</datalist>
						</td>
						<td scope="col" class="">
							<input type="text" class="form-control" list="li2<?php echo $i?>" name="i2<?php echo $i?>" id="i2<?php echo $i?>" placeholder="<?php echo ctranslate("Hesap Adı")?>">
							<datalist id="li2<?php echo $i?>">
								<?php $sqlt1=mysqli_query($conn, "select * from t1 where s1=".$_SESSION["fID"]." and s2=1 order by n1,s10 asc"); while($rst1=mysqli_fetch_assoc($sqlt1)){?>
									<option <?php if($rst1["n3"]=="Grup" or $rst1["n3"]=="Kebir"){echo "disabled";}?> value="<?php echo $rst1["n2"]?>" data-kod="<?php echo $rst1["n1"]?>" data-tur="<?php echo $rst1["n3"]?>" data-tip="<?php echo $rst1["n4"]?>"><?php echo $rst1["n2"]?> {<?php echo $rst1["n3"]?>}</option>
								<?php }?>
							</datalist>
						</td>
						<td scope="col" class=""><input type="text" class="form-control" id="i3<?php echo $i?>" name="i3<?php echo $i?>" placeholder="<?php echo ctranslate("Açıklama")?>"></td>
						<td scope="col" class="icol tac" style="display:none;"><input type="number" class="form-control tac" name="i6<?php echo $i?>" placeholder="<?php echo ctranslate("Miktar")?>" value="1"></td>
						<td scope="col" class="icol tar" style="display:none;"><input type="text" class="form-control tar bfiyat" name="i7<?php echo $i?>" placeholder="<?php echo ctranslate("B.Fiyat")?>" value="0"></td>
						<td scope="col" class="tar"><input type="text" class="form-control tar borc" name="i4<?php echo $i?>" id="i4<?php echo $i?>" placeholder="<?php echo ctranslate("Borç Tutar")?>" value="0" onfocus="if(this.value == '0') { this.value = ''} " onblur="if(this.value == '') { this.value='0'; }"></td>
						<td scope="col" class="tar"><input type="text" class="form-control tar alacak" name="i5<?php echo $i?>" id="i5<?php echo $i?>" placeholder="<?php echo ctranslate("Alacak Tutar")?>" value="0" onfocus="if(this.value == '0') { this.value = ''} " onblur="if(this.value == '') { this.value='0'; }"></td>
					</tr>
					<script>
						jQuery(function() {
							jQuery('#i1<?php echo $i?>').on('change', function() {
								var val2 = $('#i2<?php echo $i?>').val();
								var n1 = $('#fis_n1').val();
								var c = 0;
								var val = $('#i1<?php echo $i?>').val();
								var ad = $('#li1<?php echo $i?>').find('option[value="' + val + '"]').data('ad'); <
								? php $sqlt1 = mysqli_query($conn, "select * from t1 where s1=".$_SESSION["fID"].
									" and s2=1 order by n1,s10 asc");
								while ($rst1 = mysqli_fetch_assoc($sqlt1)) {
									? >
									if (val == "<?php echo $rst1["
										n1 "]?>") {
										c++;
								} <
								? php
							} ? >
							if (c != 0) {
								jQuery('#i2<?php echo $i?>').val(ad);
								jQuery('#i3<?php echo $i?>').val(n1);
								var tip = $('#li1<?php echo $i?>').find('option[value="' + val + '"]').data('tip');
                            //if(tip=="Alacak"){jQuery("#i4<?php echo $i?>").show();jQuery("#i5<?php echo $i?>").hide();}
                            //if(tip=="Borç"){jQuery("#i4<?php echo $i?>").hide();jQuery("#i5<?php echo $i?>").show();}
                            //vtr('row_<?php echo $i+1?>');
							}
							if (c == 0) {
								alert('Hesap Bulunamadı, Yeni Eklenecek !');
								jQuery("#row_<?php echo $i?>").css("background", "rgb(255 17 0 / 19%)");
							} else {
								jQuery("#row_<?php echo $i?>").css("background", "transparent");
							}
						});
							jQuery('#i2<?php echo $i?>').on('change', function() {
								var val1 = $('#i1<?php echo $i?>').val();
								var c = 0;
								var val = $('#i2<?php echo $i?>').val();
								var kod = $('#li2<?php echo $i?>').find('option[value="' + val + '"]').data('kod'); <
								? php $sqlt1 = mysqli_query($conn, "select * from t1 where s1=".$_SESSION["fID"].
									" and s2=1 order by n1,s10 asc");
								while ($rst1 = mysqli_fetch_assoc($sqlt1)) {
									? >
									if (kod == "<?php echo $rst1["
										n1 "]?>") {
										c++;
								} <
								? php
							} ? >
							if (c != 0) {
								jQuery('#i1<?php echo $i?>').val(kod);
								var tip = $('#li2<?php echo $i?>').find('option[value="' + val + '"]').data('tip');
                            //if(tip=="Alacak"){jQuery("#i4<?php echo $i?>").show();jQuery("#i5<?php echo $i?>").hide();}
                            //if(tip=="Borç"){jQuery("#i4<?php echo $i?>").hide();jQuery("#i5<?php echo $i?>").show();}
                            //vtr('row_<?php echo $i+1?>');
                            //if(c==0){alert('Hesap Bulunamadı, Yeni Eklenecek !'); jQuery("#row_<?php echo $i?>").css("background","rgb(255 17 0 / 19%)");}else{jQuery("#row_<?php echo $i?>").css("background","transparent");}
							}
						});
						});
					</script>
				<?php }?>
				<tr>
					<td scope="col" class=""><?php echo ctranslate("Toplam")?></td>
					<td scope="col" class=""></td>
					<td scope="col" class="icol" style=" display:none;"></td>
					<td scope="col" class="icol" style=" display:none;"></td>
					<td scope="col" class=""></td>
					<td scope="col" class=" tar"><input type="text" class="form-control tar" id="btoplam" name="btoplam" placeholder="<?php echo ctranslate("Borç Toplam")?>" value="0" readonly></td>
					<td scope="col" class=" tar"><input type="text" class="form-control tar" id="atoplam" name="atoplam" placeholder="<?php echo ctranslate("Alacak Toplam")?>" value="0" readonly></td>
				</tr>
			</table>
		</fieldset>
		<div class="col-sm-12" style="clear:both; width:100%; margin-top:20px;">
			<button type="button" onclick="sumcheck();" name="btn" class="btn btn-warning" style="float:right;margin-right:10px;" <?php if(($_SESSION["kim"]=="yonetici" and $e10==1) or $limit_module=="false"){echo "disabled";}?> value="<?php echo ctranslate("Kaydet")?>"><?php echo ctranslate("Kaydet")?></button>
		</div>
		<div style="width: 80%; position: fixed; margin-top: 10%; left: 10%; right: 10%; padding: 20px; background: black; text-align: center; color: white; display:none;" id="hata">
			<h4><?php echo ctranslate("Tutarlar Eşit Değil, Lütfen Kontrol Edin!")?></h4>
			<br>
			<button type="button" id="bduzenle" class="btn btn-warning"><?php echo ctranslate("Kapat")?></button>
		</div>
		<script>
			jQuery(".borc, .alacak, .bfiyat").keyup(function() {
				var str = jQuery(this).val();
				jQuery(this).val(str.replace(",", "."));
			});
			jQuery(function() {
				jQuery('#t2').on('change', function() {
					var val = $('#t2').val();
					if (val == "Fatura" || val == "İade Fatura") {
						jQuery('.icol').show();
					} else {
						jQuery('.icol').hide();
					}
				});
			});
			function sumcheck() {
				var atoplam = jQuery('#atoplam').val();
				var btoplam = jQuery('#btoplam').val();
				if (atoplam != btoplam) {
					jQuery("#hata").show();
				} else {
					document.getElementById('addfis').submit();
				}
			}
			jQuery("#bduzenle").click(function() {
				jQuery("#hata").hide();
			});
			jQuery(function() {
				jQuery("table input").keypress(function(e) {
					if (e.keyCode == 13) {
                    var trid_ = $(this).closest('tr').attr('data-id'); // table row ID
                    var trid = parseInt(trid_, 10) + 1;
                    if (jQuery('#i1' + trid_ + '').val() != "" & jQuery('#i2' + trid_ + '').val() != "") {
                    	jQuery('#row_' + trid + '').show();
                    	jQuery('#i1' + trid + '').focus();
                    }
                }
            });
			});
			jQuery('.borc').on('keyup', function() {
				var borc = 0;
				jQuery(".borc").each(function(index) {
					var intInputValue = parseFloat(jQuery(this).val());
					if (!isNaN(intInputValue)) {
						borc = borc + intInputValue;
					}
				});
				jQuery("#btoplam").val(borc.toFixed(2));
			});
			jQuery('.alacak').on('keyup', function() {
				var alacak = 0;
				jQuery(".alacak").each(function(index) {
					var intInputValue = parseFloat(jQuery(this).val());
					if (!isNaN(intInputValue)) {
						alacak = alacak + intInputValue;
					}
				});
				jQuery("#atoplam").val(alacak.toFixed(2));
			});
		</script>
	</form>
<?php }?>
<?php if($_GET["ne"]=="haber"){?>
<div class="v3-col-md-12" style="position:absolute; bottom:0px; width:100%; font-size:12px">
<div id="tags" style="height: 200px; overflow: auto;"></div>
<form action="<?php echo $weburl."/deppo/tools/script/autopilot.php".tanim("openai","n2",0)?>" id="openai" method="post" style="display:none;">
	<div class="input-group">
		<input type="text" name="tag" class="form-control" placeholder="Kelime" aria-describedby="basic-addon2">
		<span class="input-group-addon cp" id="basic-addon2" onclick="jQuery('#openai').submit();">Gönder</span>
	</div>
</form>
<ul class="v3-list-group" style="margin-top: 30px;">
  <li class="v3-list-group-item v3-bg-info">
	<b>Son Eklenen Haberler</b> (5)
 <i class="fas fa-brain text-danger cp" title="Open AI" onclick="<?php if(tanim("openai","n2",0)<>""){echo "toggle('#openai')";}else{echo "window.open('https://chat.openai.com/chat')";}?>" style="float:right; margin-right:15px; font-size:20px; margin-top: -2px;"></i>
 <i class="fas fa-tags text-warning cp" title="Seo Etiketleri" onclick="jQuery('#tags').load('../../fonksiyon.php?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=tags')" style="float:right; margin-right:15px; font-size:20px;"></i>
  </li>
<?php $sql=mysqli_query($conn, "select id,s13,t1,ts1,ts3,n2,n17 from ".$_SESSION["lang"]." where ne='haber' order by id desc limit 0,5"); while($rsh=mysqli_fetch_assoc($sql)){?>
  <li class="v3-list-group-item <?php if($rsh["s13"]=="0"){echo "v3-bg-warning";}else{echo "v3-bg-success";}?>">
    <span class="v3-badge"><?php if($rsh["ts3"]<>""){echo dtarih($rsh["ts3"],"gg ka yy");}else{echo dtarih($rsh["ts1"],"gg ka yy");}?></span>
    <?php echo $rsh["t1"]?>
  </li>
<?php }?>
</ul>
</div>
<?php }?>
<?php
if ($_GET["durum"]=="addservice"){
	if($_POST["s1"]=="0"){
		$sql5k=mysqli_query($conn, "select * from t5 where t4='".$_POST["ut4"]."'"); $rs5k=mysqli_fetch_assoc($sql5k);
		if(mysqli_num_rows($sql5k)==0 and $_POST["ut4"]<>""){
			$sqli5 = $conn->query("insert into t5(t1, t2, ne, s1, s4, s5, s19, t3, t4, t9, ts1) values ('".$_POST["ut1"]."', '".base64_encode($_POST["ut2"])."', 'uye', '0', '1', '0', '".$ls19."', '".base64_encode(generatePassword(8))."', '".$_POST["ut4"]."', '".$_POST["ts1"]."', now())");	
			$sql5=mysqli_query($conn, "select * from t5 order by id desc"); $rs5=mysqli_fetch_assoc($sql5);
		}else{
			$sql5=mysqli_query($conn, "select * from t5 where t4='".$_POST["ut4"]."'"); $rs5=mysqli_fetch_assoc($sql5);
		}
	}else{
		$sql5=mysqli_query($conn, "select * from t5 where id='".$_POST["s1"]."'"); $rs5=mysqli_fetch_assoc($sql5);
	}
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$marr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$marr = $marr + array( $key => $value);
		}
	}
	$rjsm = json_encode($marr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$ts1 = explode('-',$_POST["ts1"]);
	if($_POST["discount"]==""){ $discount="0"; }else{ $discount=$_POST["discount"]; }
	$sqlk = mysqli_query($conn, "select * from t4 where ne='".$_GET["islem"]."' and s1=".$rs5["id"]." and t1=".$_POST["t1"]." order by id desc"); $rsk=mysqli_fetch_assoc($sqlk);	
	if(mysqli_num_rows($sqlk)>0){
		echo "<script>jQuery(document).ready(function () { window.parent.reviewModal('modules/services/service.php?ne=".$_GET["ne"]."&islem=d".$_GET["islem"]."&id=".$rsk["id"]."');});</script>";
	}else{
		$sql = $conn->query("insert into t4(ne,t1,t2,t3,t4,t5,t6,s1,s2,s3,s4,s13,pb1,pb2,pb3,pb4,n1,n2,n11,n17,n18,t9,t10,s19,ts1) values ('".$_GET["ne"]."', '".$_POST["t1"]."', '".$_POST["t2"]."', '".$_POST["t3"]."', '".$_POST["t4"]."', '".$_POST["t5"]."', '".$_POST["t6"]."', '".$rs5["id"]."', '".$ts1[2]."', '".$ts1[1]."', '".$ts1[0]."', '0', '0', '0', '0', '".$discount."', '".addslashes(stripslashes($_POST["n1"]))."', '".addslashes(stripslashes($_POST["n2"]))."', '".addslashes(stripslashes($_POST["n11"]))."', '".addslashes(stripslashes($rjsi))."','".addslashes(stripslashes($rjsm))."', '".$_POST["ts1"]."', '".$_POST["ts2"]."', '0', now())");
		$sql = mysqli_query($conn, "select * from t4 where ne='service' order by id desc"); $rs=mysqli_fetch_assoc($sql);
		echo "<script>jQuery(document).ready(function () { window.parent.reviewModal('modules/services/service.php?ne=".$_GET["ne"]."&islem=d".$_GET["islem"]."&id=".$rs["id"]."');});</script>";
	}

}elseif ($_GET["durum"]=="addtask"){
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$sql = $conn->query("insert into genel(ne, t1, t8, t9, t10, t11, s19, n17, ts1) values ('gorev', '".addslashes(stripslashes($_POST["t1"]))."', '".$_POST["t8"]."', '".$_POST["t9"]."', '".$_POST["t10"]."', '".$_POST["t11"]."', '".$_POST["s19"]."', '".addslashes(stripslashes($rjsi))."', now())");		
	$sql=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	echo "<script>jQuery(document).ready(function () { window.parent.reviewModal('modules/tasks/task.php?ne=".$_GET["ne"]."&islem=duye&id=".$rs["id"]."');});</script>";

}elseif ($_GET["durum"]=="create_price_list"){
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$t5s = implode(',',$_POST["t5"]);
	$sql = $conn->query("insert into genel(ne, t1, t2, t3, t4, t5, t9, t10, s19, n17, ts1) values ('price_list', '".addslashes(stripslashes($_POST["t1"]))."', '".$_POST["t2"]."', '".$_POST["t3"]."', '".$_POST["t4"]."', '".$t5s."', '".$_POST["t9"]."', '".$_POST["t10"]."', '".$_POST["s19"]."', '".addslashes(stripslashes($rjsi))."', now())");		
	$sql=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	if($_POST["send"]<>""){
		$mesaj	= "".translate("+Sayın")." <b>".$_POST["t2"].";</b><br>".translate("+price_list_mtext")."<br><br>";
		$mesaj	= "".$mesaj." <a href=\"".$weburl."/price_list/".$rs["id"]."\" target=\"_blank\">".translate("+Fiyat teklifi incelemek için lütfen tıklayınız")."</a><br><br>";
		$malici	= $_POST["t3"];
		$konu	= translate("+Fiyat Teklifi");
		$path	="../";
		$mesaj	= $design_top.$mesaj.$design_bottom;
		emailgonder($malici,$konu,$cc,$mesaj);
	}
	echo location("?ne=".$_GET["ne"]."&islem=price_list&id=".$rs["id"]."&durum=ok",self,500,1);

}elseif ($_GET["durum"]=="delete_price_list"){
	$sql = mysqli_query($conn, "delete from genel where id=".$_GET["id"]."");
	echo location("?ne=".$_GET["ne"]."&islem=price_list&durum=ok",self,500,1);

}elseif($_GET["durum"] == "addclient"){
	if($_POST["s2"]==""){ $ss2="0"; }else{ $ss2=$_POST["s2"]; }
	if($_POST["s3"]==""){ $ss3="0"; }else{ $ss3=$_POST["s3"]; }
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	$ut1="".trim($sdil[200])." ".trim($nedir)."";
	$sql = $conn->query("insert into t5 (ne, t1, t3, s2, s3, s4, s7, n17, s19, ts1) values ('uye', '".addslashes(stripslashes($_POST["t1"]))."', '".base64_encode(generatePassword(6))."', '".$ss2."', '".$ss3."', '0', '0', '".addslashes(stripslashes($rjsi))."', '".$ls19."', now())");
	$sql = mysqli_query($conn, "select id from t5 order by id desc"); $rs=mysqli_fetch_assoc($sql);
	if($module["muhasebe_fis"]=="1" and $ss2<>0){
		$sqlc=mysqli_query($conn, "select * from kategoriler where c1=".$ss2." order by Cat_ID desc"); while($rsc=mysqli_fetch_assoc($sqlc)){ $jsi = json_decode($rsc["n6"], true);
		$conn->query("insert INTO t1(t1,t2,ne,n1,n2,n3,n4,n5,s1,s2,s10,s19) VALUES ('".$_GET["ne"]."', '".$_SESSION["lang"]."', 'extra', '".$rsc["t4"]."', '".$rsc["Cat_".$_SESSION["lang"].""]."', '".$jsi["i1"][0]."', '".$jsi["i2"][0]."', '".$_POST["nx5"]."', '".$id."', '1', '".$rsc["sira"]."', '".$ls19."');");
	}
}
	echo "<script>jQuery(document).ready(function () {  window.parent.reviewModal('modules/clients/client.php?ne=".$_GET["ne"]."&islem=duye&id=".$rs["id"]."');});</script>";

}elseif($_GET["durum"] == "addform"){
	for ($l = 1; $l <= $lx; $l++) {
		$sql = $conn->query("insert into lang".$l." (ne,m1,m2,m4) values ('".$_GET["ne"]."', '".$_POST["m1"]."', '".$_POST["m2"]."', '".$_POST["m4"]."')");
	}
	$id=$conn->insert_id;
	echo "<script>jQuery(document).ready(function () {  window.parent.reviewModal('modules/forms/form.php?ne=".$_GET["ne"]."&islem=form&id=".$id."');});</script>";

}elseif($_GET["durum"] == "addpage"){
	$_SESSION["s2"]=$_POST["s2"][0];
	$sql=mysqli_query($conn, "select * from ".$_SESSION['lang']." where ne='".$_GET["ne"]."' and s2='".$_POST["s2"][0]."' order by s1 desc"); $rs=mysqli_fetch_assoc($sql);
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){ $iarr = $iarr + array( $key => $value); }
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	if($_POST["t1"]==""){ $st1="".trim($sdil[200])." ".trim($nedir).""; $sislem="dsayfa";}elseif($_GET["durum"] == "dsayfa"){$st1=$_POST["t1"]; $sislem="dsayfa";}else{ $st1=$_POST["t1"]; $sislem="dsayfa";}
	if($_POST["s1"]>0){ $ss1=$_POST["s1"]; }else{
		if($_GET["ne"]=="haber" or $_GET["ne"]=="kayit"){ $ss1=0; }else{ $ss1=(intval($rs["s1"])+1); }
	}
	if (is_array($_POST["s2"]) && count($_POST["s2"]) === 1) {
		$ss2 = $_POST["s2"][0]; // Tek bir değer
	} else {
		$ss2 = implode(',', array_map(function($value) { return "{" . $value . "}"; }, $_POST["s2"])); // Çoklu değerler
	}
	if($_POST["s3"]==""){ $ss3="0"; }else{ $ss3=$_POST["s3"]; }
	if($_POST["s5"]==""){ $ss5="0"; }else{ $ss5=$_POST["s5"]; }
	if($_POST["s7"]==""){ $ss7="0"; }else{ $ss7=$_POST["s7"]; }
	
	if($_GET["ne"]=="haber" or $_GET["ne"]=="msayfa"){
		if($_POST["s13"]==""){ $ss13="0"; }else{ $ss13=$_POST["s13"]; }
		$ss8="0";
	}else{
		if($_POST["s13"]==""){ $ss13="1"; }else{ $ss13=$_POST["s13"]; }
		$ss8="0";
	}
	$idVal = !empty($_POST["id"]) ? "'".$_POST["id"]."'," : ""; 
	$idKey = !empty($_POST["id"]) ? "id," : "";
	$sql = $conn->query("insert into ".$_SESSION["lang"]." ($idKey ne, t1, t6, n1, n5, s1, s2, s3, s5, s7, s8, s13, s19, n17, ts1) values ($idVal '".$_GET["ne"]."', '".addslashes(stripslashes($st1))."', '".$_POST["t6"]."', '', '".$_POST["n5"]."', '".$ss1."', ".$ss2.", ".$ss3.", '".$ss5."', '".$ss7."', '".$ss8."', '".$ss13."', '".$ls19."', '".addslashes(stripslashes($rjsi))."', now())");
	$id = $conn->insert_id;
	for ($l = 1; $l <= $lx; $l++) {
		if($_SESSION['lang'][-1]<>$l){
			$sql = $conn->query("insert into lang".$l." (id,ne, t1, t6, n1, n5, s1, s2, s3, s5, s7, s8, s13, s19, n17, ts1) values ('".$id."', '".$_GET["ne"]."', '".addslashes(stripslashes($st1))."', '".$_POST["t6"]."', '', '".$_POST["n5"]."', '".$ss1."', ".$ss2.", ".$ss3.", '".$ss5."', '".$ss7."', '".$ss8."', '".$ss13."', '".$ls19."', '".addslashes(stripslashes($rjsi))."', now())");
		}
	}
	if($_POST["btn"]=="Ekle"){
		echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,0,1);
	}elseif($_POST["btn"]=="Ekle & Düzenle"){
		echo "<script>jQuery(document).ready(function () {  window.parent.reviewModal('modules/pages/page.php?ne=".$_GET["ne"]."&islem=d".$_GET["ne"]."&id=".$id."');});</script>";
	}

}elseif($_GET["durum"] == "addproduct"){
	$iarr = array();
	foreach ($_POST as $key => $value){
		if(substr($key,0,1)=="i"){
			$iarr = $iarr + array( $key => $value);
		}
	}
	$rjsi = json_encode($iarr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
	if($_POST["t1"]==""){ $kt1="".trim($sdil[200])." ".trim($nedir).""; $kislem="dkayit";}elseif($_GET["durum"] == "dkayit"){$kt1=$_POST["t1"]; $kislem="dkayit";}else{ $kt1=$_POST["t1"]; $kislem="dkayit";}
	if($_POST["pb1"]==""){ $kpb1="0";}else{ $kpb1=$_POST["pb1"];}
	if($_POST["s5"]==""){ $ks5="0"; }else{ $ks5=$_POST["s5"]; }
	if (is_array($_POST["s9"]) && count($_POST["s9"]) === 1) {
		$ss9 = $_POST["s9"][0]; // Tek bir değer
	} else {
		$ss9 = implode(',', array_map(function($value) { return "{" . $value . "}"; }, $_POST["s9"])); // Çoklu değerler
	}
	if (is_array($_POST["s10"]) && count($_POST["s10"]) === 1) {
		$ss10 = $_POST["s10"][0]; // Tek bir değer
	} else {
		$ss10 = implode(',', array_map(function($value) { return "{" . $value . "}"; }, $_POST["s10"])); // Çoklu değerler
	}
	if (is_array($_POST["s11"]) && count($_POST["s11"]) === 1) {
		$ss11 = $_POST["s11"][0]; // Tek bir değer
	} else {
		$ss11 = implode(',', array_map(function($value) { return "{" . $value . "}"; }, $_POST["s11"])); // Çoklu değerler
	}
	if (is_array($_POST["t11"]) && count($_POST["t11"]) === 1) {
		$st11 = $_POST["t11"][0]; // Tek bir değer
	} else {
		$st11 = implode(',', array_map(function($value) { return "{" . $value . "}"; }, $_POST["t11"])); // Çoklu değerler
	}
	if($_POST["s12"]==""){ $ks12="0"; }else{ $ks12=$_POST["s12"]; }
	if($_POST["s13"]==""){ $ks13="1"; }else{ $ks13=$_POST["s13"]; }
	if($_POST["s1"]==""){ $ks1="0"; }else{ $ks1=$_POST["s1"]; }
	if($_POST["s2"]==""){ $ks2="0"; }else{ $ks2=$_POST["s2"]; }
	if($_POST["t2"]==""){ $kt2=$module["currency"]; }else{ $kt2=$_POST["t2"]; }
	$Sql = $conn->query("insert into ".$_SESSION["lang"]." (t1,ne,ts1,s1,s2,s4,s5,s6,pb1,pb2,pb3,s9,s10,s11,s12,s13,s14,s15,s19,n17,t2,t4,t11,t12) values ('".addslashes(stripslashes($kt1))."', '".$_GET["ne"]."', now(), '".$ks1."', '".$ks2."', '".$s12."', '".$ks5."', '0', '".$kpb1."', '0', '0', '".$ss9."', '".$ss10."', '".$ss11."', '".$ks12."', '".$ks13."', '1', '1', '".$ls19."', '".addslashes(stripslashes($rjsi))."', '".$kt2."', '0', '0', now())");
	$id = $conn->insert_id;
	for ($l = 1; $l <= $lx; $l++){
		if($_SESSION['lang'][-1]<>$l){
		 $Sql = $conn->query("insert into lang".$l." (id,t1,ne,ts1,s1,s2,s4,s5,s6,pb1,pb2,pb3,s9,s10,s11,s12,s13,s14,s15,s19,n17,t2,t4,t11,t12) values ('".$id."','".addslashes(stripslashes($kt1))."', '".$_GET["ne"]."', now(), '".$ks1."', '".$ks2."', '".$s12."', '".$ks5."', '0', '".$kpb1."', '0', '0', '".$ss9."', '".$ss10."', '".$ss11."', '".$ks12."', '".$ks13."', '1', '1', '".$ls19."', '".addslashes(stripslashes($rjsi))."', '".$kt2."', '0', '0', now())");
		}
	}
	if($_POST["btn"]=="Ekle"){
		echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
	}elseif($_POST["btn"]=="Ekle & Düzenle"){
		echo "<script>jQuery(document).ready(function () {  window.parent.reviewModal('modules/products/product.php?ne=".$_GET["ne"]."&islem=dkayit&id=".$id."');});</script>";
	}
}elseif($_GET["durum"] == "addvoucher"){
	if($_POST["btoplam"]==0){$btoplam=0;}else{$btoplam=$_POST["btoplam"];}
	if($_POST["atoplam"]==0){$atoplam=0;}else{$atoplam=$_POST["atoplam"];}
	$sql = $conn->query("insert into t4(ne,t2,t3,t4,t9,n1,s1,s19,pb1,pb2,ts1) values ('fis', '".$_POST["t2"]."', '".$_POST["t3"]."', '".$_POST["t4"]."', '".$_POST["t9"]."', '".$_POST["n1"]."','".$_SESSION["fID"]."', '".$ls19."', '".$btoplam."', '".$atoplam."', now())");	
	$sqlk = mysqli_query($conn, "select * from t4 where ne='fis' order by id desc"); $rsk=mysqli_fetch_assoc($sqlk);
	$KIDS = implode(',',$_POST["KID"]);
	$fisler = explode(',',$KIDS); foreach($fisler as $fisID){
		$sqlpk = mysqli_query($conn, "select * from t1 where ne='extra' and s1='".$_SESSION["fID"]."' and n1='".$_POST["i1".$fisID.""]."' order by id desc"); $rspk=mysqli_fetch_assoc($sqlpk);
		if(mysqli_num_rows($sqlpk)==0 and $_POST["i1".$fisID.""]<>""){
			$conn->query("insert INTO t1(t1,t2,ne,n1,n2,n3,n4,n5,s1,s2,s10,s19) VALUES ('uye', '".$_SESSION["lang"]."', 'extra', '".$_POST["i1".$fisID.""]."', '".$_POST["i2".$fisID.""]."', 'Muavin', '".$_POST["nx4"]."', '".$_POST["nx5"]."', '".$_SESSION["fID"]."', '1', '0', '".$ls19."');");
		}
		if($_POST["i1".$fisID.""]<>""){
			$sql   = $conn->query("insert into t4(ne,s1,s2,t1,t2,t3,t4,t6,t7,t9,t10,t11,pb1,pb2,ts1) values ('furun', '".$rsk["id"]."', '".$_SESSION["fID"]."', 'fis', '".$_POST["i1".$fisID.""]."', '".$_POST["i2".$fisID.""]."', '".$_POST["i3".$fisID.""]."', '".$_POST["i6".$fisID.""]."', '".$_POST["i7".$fisID.""]."', '".$_POST["t9"]."', '".substr($_POST["i1".$fisID.""],0,3)."', '".substr($_POST["i1".$fisID.""],0,6)."', '".$_POST["i4".$fisID.""]."', '".$_POST["i5".$fisID.""]."', now())");
		}
	}
	echo location("".$weburl."/".$crmpath."/modules/public/add.php?ne=muhasebe&islem=fis&durum=yfis",self,0,1);
}
include("../public/log.php");
?>
<?php echo $footer?>

<script>
jQuery( document ).ready(function() {
	jQuery('#cs9').on('change', function () {
		var ID = jQuery('#cs9 option:selected').val(); // Veya `data-id` kullanabilirsiniz
		if (ID) {
			jQuery('#cs10').load('../ajax/categorie<?php if($module["ajax_categories"]<>""){echo "s";}?>_ajax.php?ne=<?php echo $_GET["ne"] ?>&islem=kategori&islem=ualt_kategori&c=' + ID, function () {
				jQuery('#cs10').trigger('chosen:updated');
			});
		}
	});
	jQuery('#cs10').on('change', function () {
		var ID = jQuery('#cs10').val(); // Çoklu seçim için tüm seçilen değerleri alır (dizi olarak döner)
		if (ID) {
			jQuery('#cs11').load('../ajax/categorie<?php if($module["ajax_categories"]<>""){echo "s";}?>_ajax.php?ne=<?php echo $_GET["ne"] ?>&islem=kategori&islem=ualt_kategori2&c=' + ID, function () {
				jQuery('#cs11').trigger('chosen:updated');
			});
		}
	});
	jQuery('#cs11').on('change', function () {
		var ID = jQuery('#cs11').val(); // Çoklu seçim için tüm seçilen değerleri alır (dizi olarak döner)
		if (ID) {
			jQuery('#ct11').load('../ajax/categorie<?php if($module["ajax_categories"]<>""){echo "s";}?>_ajax.php?ne=<?php echo $_GET["ne"] ?>&islem=kategori&islem=ualt_kategori2&c=' + ID, function () {
				jQuery('#ct11').trigger('chosen:updated');
			});
		}
	});
});
</script>