<?php
	$path="../../";
	include("../../map.php");
	$sqlt=mysqli_query($conn, "select * from genel where ne='ftasarim'"); $rst=mysqli_fetch_assoc($sqlt);
	if(mysqli_num_rows($sqlt)==0){
		$sqli = $conn->query("insert into genel (ne) values ('ftasarim')");
	}
?>
<style>
@media print {
  .hidden-print {
    display: none !important;
  }
}
body {
	margin:0px;
	padding:0px;
}
</style>
<script>
function toggle(id){
	jQuery(id).toggle("slow", function() {
		// Animation complete.
	});
}
</script>
<title>Print Frame Page</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<?php if($_SESSION["user"]=="Master" or $_SESSION["user"]=="SuperAdmin"){?>
<div class="v3-row hidden-print" style="position:fixed; right:0px; top:30px; width:80px;">
<i class="fa fa-cogs" onclick="toggle('#fset')" style="font-size: 30px; right: 5px; position: absolute; margin-top: -25px; cursor:pointer;"></i>
 <form id="fset" action="?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&id=<?php echo $_GET["id"]?>&sip_no=<?php echo $_GET["sip_no"]?>&durum=tkaydet" method="post" style="display:none; margin-top:20px;">
           <input type="text" name="t1" value="<?php echo $rst["t1"]?>" Placeholder="Kod" title="Kod (Stn)" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t2" value="<?php echo $rst["t2"]?>" Placeholder="Ad" title="Ad (Stn)" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t3" value="<?php echo $rst["t3"]?>" Placeholder="Miktar" title="Miktar (Stn)" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t4" value="<?php echo $rst["t4"]?>" Placeholder="Fiyat" title="Fiyat (Stn)" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t5" value="<?php echo $rst["t5"]?>" Placeholder="Tutar" title="Tutar (Stn)" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t6" value="<?php echo $rst["t6"]?>" Placeholder="W" title="Width" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t7" value="<?php echo $rst["t7"]?>" Placeholder="H" title="Height" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t8" value="<?php echo $rst["t8"]?>" Placeholder="L2" title="L2" style="width:78px; margin-bottom:1px;">
           <input type="text" name="t9" value="<?php echo $rst["t9"]?>" Placeholder="Font-size" title="Font-size" style="width:78px; margin-bottom:1px;">
           <input type="submit" name="" value="Kaydet" style="display:none;">
       </form>
</div>
<?php }?>
<?php
if($rst["t8"]==""){ $ft8="1"; }else{ $ft8=$rst["t8"];}
if($_GET["ne"]=="eticaret"){$nedir="order_";}
for ($i = 0; $i < $ft8; ++$i){?>
<!--
<div style="width:<?php echo $rst["t6"]?>; border:0px; height:<?php echo $rst["t7"]?>;" id="d<?php echo $i?>"></div>
<script>jQuery('#d<?php echo $i?>').load('print_<?php echo $nedir;?>invoice.php?ne=<?php echo $_GET["ne"];?>&id=<?php echo $_GET["id"];?>&sip_no=<?php echo $_GET["sip_no"];?>');</script>
-->
<iframe style="width:<?php echo $rst["t6"]?>; border:0px; height:<?php echo $rst["t7"]?>;" scrolling="<?php if($_SESSION["user"]=="Master" or $_SESSION["user"]=="SuperAdmin"){?>yes<?php }else{?>no<?php }?>" src="print_<?php echo $nedir;?>invoice<?php if($module["muhasebe_fatura_type"]=="2"){?>_gb<?php }?>.php?ne=<?php echo $_GET["ne"];?>&id=<?php echo $_GET["id"];?>&sip_no=<?php echo $_GET["sip_no"];?>"></iframe>
<?php }?>
<?php
if($_GET["durum"]=="tkaydet"){
	$Rs = mysqli_query($conn, "update genel set t1='".$_POST["t1"]."', t2='".$_POST["t2"]."', t3='".$_POST["t3"]."', t4='".$_POST["t4"]."', t5='".$_POST["t5"]."', t6='".$_POST["t6"]."', t7='".$_POST["t7"]."', t8='".$_POST["t8"]."', t9='".$_POST["t9"]."' where ne='ftasarim'");
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&sip_no=".$_GET["sip_no"]."",self,500,1);
}
?>