<?php
	header('Content-Type: text/html; charset=utf-8');
	error_reporting(0);
	$path="../../";
	include("../../map.php");
	include("../../scripts.php");
	include("../../secure.php");
	//findDirectoryPath("deppo")
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $rs["t1"];?></title>
</head>
<body>
    <div class="qmodal">
        <div class="qmodal-content">
            <!-- Header with Action Buttons -->
            <div class="qmodal-header">
			<div class="header-title">
				<nav aria-label="breadcrumb">
					<ol class="breadcrumb">
						<li class="breadcrumb-item"><a href="<?php echo $weburl?>" target="_blank"><i class="fa fa-home"></i></a></li>
						<li class="breadcrumb-item"><a href="#"><?php echo ctranslate($t26);?></a></li>
						<li class="breadcrumb-item active" aria-current="page"><?php echo $sablonlar //sablonlar?></li>
					</ol>
				</nav>
			</div>
            </div>
            <!-- Left Tab Menu -->
            <div class="v8-columns">
                <!-- Content Area -->
                <div class="" ts1="<?php echo dtarih($rs["ts1"],"gg ka yy time");?>" ts2="<?php echo dtarih($rs["ts2"],"gg ka yy time");?>" ts3="<?php echo dtarih($rs["ts3"],"gg ka yy time");?>">
<table class="table fs13 mfs12">
							<thead>
								<tr>
									<th class="w6" style="text-align:center;">ID</th>
									<th><?php echo $sablon[0] //sablon?></th>
									<th class="w10">Tip</th>
									<th class="w10 dn">Modul</th>
									<th class="w8" style="text-align:center;">Tarih</th>
									<th class="w5" style="text-align:center;">Sıra</th>
									<th class="w6"><?php echo $sdil[213]; //Islemler?></th>
								</tr>
							</thead>
							
							<tbody>
								<form method="POST" action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&durum=ysablon">
									<input type="hidden" value="sablon" name="ne">
									<tr class="addtr">
										<td class="th table-check-cell">-</td>
										<td><input type="text" name="t1" title="" class="form-control" placeholder="<?php echo $sdil[200] //Yeni?>&nbsp;<?php echo $sdil[201] //Ekle?>"></td>
										<td>
											<input type="text" name="t2" list="lt2" title="" class="form-control" placeholder="Taslak Tipi" autocomplete="off">
											<datalist id="lt2" class="">
												<option value="tmail">E-Mail</option>
												<option value="tsms">Sms</option>
												<option value="notifications">Notification</option>
												<option value="agreement">Sözleşme</option>
												<option value="invoice">Fatura</option>
												<option value="offer">Teklif</option>
											</datalist>
										</td>
										<td class="dn">
											<select name="t5" class="form-control small">
												<option value="">-</option>
												<?php if($g9<>0){?>
													<option value="service">Teklif</option>
												<?php }?>
												<?php if($g3==1){?>
													<option value="tahsilat">Tahsilat</option>
												<?php }?>
											</select>
										</td>
										<td>-</td>
										<td>-</td>
										<td class="table-actions">
											<button class="btn btn-warning mbtn ibtn" type="submit"><i class="fa fa-plus" aria-hidden="true"></i><span class="ddn"> <?php echo $sdil[201]; //ekle?></span></button>
										</td>
									</tr>
								</form>
								<?php $sql=mysqli_query($conn, "select * from genel where ne='sablon' $ltemp order by s12 asc"); while($rs=mysqli_fetch_assoc($sql)){ ?>
									<tr>
										<td class="th table-check-cell mfrm" data-toggle="modal" data-width="90%" data-target="#myModal" data-url="../public/template.php?ne=<?php echo $_GET["ne"];?>&islem=dsablon&id=<?php echo $rs["id"];?>" title="<?php echo $sdil[207]; //Detay?>'"><?php echo i2a($rs["id"],7);?></td>
										<td><input type="text" name="t1[]" title="" class="form-control" placeholder="<?php echo $rs["t1"];?>" value="<?php echo $rs["t1"];?>"></td>
										<td>
											<input type="text" name="t2" list="lt2" title="" class="form-control" placeholder="Taslak Tipi"  value="<?php echo $rs["t2"];?>" autocomplete="off">
											<datalist id="lt2" class="">
												<option value="tmail">E-Mail</option>
												<option value="tsms">Sms</option>
												<option value="notifications">Notification</option>
												<option value="agreement">Sözleşme</option>
												<option value="invoice">Fatura</option>
												<option value="offer">Teklif</option>
											</datalist>
										</td>
										<td class="dn">
											<select name="t5" class="form-control small">
												<option value="">...</option>
												<?php if($g9<>0){?>
													<option value="service" <?php if($rs["t5"]=="service"){?>selected<?php }?>>Teklif</option>
												<?php }?>
												<?php if($g3==1){?>
													<option value="tahsilat" <?php if($rs["t5"]=="tahsilat"){?>selected<?php }?>>Tahsilat</option>
												<?php }?>
											</select>
										</td>
										<td><?php echo dtarih($rs["ts1"],"gg ka yy");?></td>
										<td><?php echo $rs["s12"];?></td>
										<td class="table-actions">
											<button type="button" class="btn btn-warning mfrm" data-toggle="modal" data-width="90%" data-target="#myModal" data-url="../public/template.php?ne=<?php echo $_GET["ne"];?>&islem=dsablon&id=<?php echo $rs["id"];?>" title="<?php echo $sdil[207]; //Detay?>"><i class="fa fa-pencil" aria-hidden="true"></i><span class="ddn"> <?php echo $sdil[207]; //Detay?></span></button>
											<button type="button" title="<?php echo $sdil[204]; //Kaldir?>" class="btn btn-danger mbtn " onclick="if(confirm('<?php echo $sdil[215]; ?>')) { location.href='?ne=<?php echo $_GET["ne"]; ?>&islem=<?php echo $_GET["islem"]; ?>&id=<?php echo $rs["id"]; ?>&durum=ssablon'; } return false;"><i class="fa fa-times"></i><span class="ddn"> <?php echo $sdil[204]; //Kaldir?></span></button>
										</td>
									</tr>
								<?php }?>
							</tbody>
							
						</table>
                 </div>
            </div>
</body>
<?php echo $footer?>
</html>
<?php
if($_GET["durum"] == "ysablon"){
	$sql = $conn->query("insert into genel (ne,t1,t2,t3,t5,ts1,s12,s13) values ('sablon', '".$_POST["t1"]."', '".$_POST["t2"]."', 'image', '".$_POST["t5"]."', now(), '0', '1')");
	$sql=mysqli_query($conn, "select * from genel where ne='sablon' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	echo location("?ne=".$_GET["ne"]."&islem=dsablon&id=".$rs["id"]."&durum=ok",self,500,1);
}elseif($_GET["durum"] == "ssablon"){
	$aql = mysqli_query($conn, "delete from genel where ne='sablon' and id=".$_GET["id"]."");
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
}
?>