<?php
	header('Content-Type: text/html; charset=utf-8');
	error_reporting(0);
	$path="../../";
	include("../../map.php");
	include("../../scripts.php");
	include("../../secure.php");
	$sayfa = $_GET['sayfa'];
	if($sayfa == "") {$sayfa = 0;}else{$sayfa = ($sayfa-1) * 10;} 
	$sql = mysqli_query($conn, "select * from ".$_SESSION['lang']." where ne='".$_GET["ne"]."' order by id desc"); 
	$sql2 = mysqli_query($conn, "select count(*) FROM ".$_SESSION['lang']." where ne='".$_GET["ne"]."'");$rsay=mysqli_fetch_assoc($sql2);
	//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 active" aria-current="page"><?php echo $formlar; //Formlar?></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="v3-table" style="">
						<thead>
							<tr class="mdn">
								<th class="w1 mw10" style="text-align:center;">ID</th>
								<th class="">
									<span class="column-sort">
										<a href="#" title="Sort up" class="sort-up"></a>
										<a href="#" title="Sort down" class="sort-down"></a>
										</span><?php echo $form[0]; //Başlık?>
									</th>
									<th class="w20 mw25"><?php echo $sdil[40]; //Açıklama?></th>
									<th class="w10 mw15"><?php echo $sdil[113]; //Türü?></th>
									<th class="w10 mw15"><?php echo $sdil[115]; //Tarih?></th>
									<th class="w6 mw6" style="text-align:center;"><?php echo $sdil[213]; //İşlemler?></th>
								</tr>
							</thead>
							
							<tbody>
								<?php
									while($rs=mysqli_fetch_assoc($sql)){
									$jsa= json_decode($rs["n3"], true);
									if ($authority==0){ $dauth=0; }else{ $dauth=1; }
									?>
									<tr data-id="<?php echo $rs["id"];?>">
										<th class="mdn v3-text-info cp mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-url="../forms/form.php?islem=dform&ne=<?php echo $_GET["ne"];?>&id=<?php echo $rs["id"];?>&s2=<?php echo $_GET["s2"];?>" data-title="#<?php echo $rs["id"];?>"><?php echo i2a($rs["id"],7);?></th>
										<td><?php echo $rs["m1"];?></td>
										<td class="mdn"><?php echo $rs["m3"];?> <?php if($rs["m2"]=="survey"){echo "{".translate("Katılım")." : ".count($jsa)."}";}?></td>
										<td class="mdn"><?php echo translate($rs["m2"]);?><?php if($rs["m4"]<>""){echo" / ".translate($rs["m4"]);}?></td>
										<td class="mdn"><?php echo dtarih($rs["ts1"],"gg ka yy");?></td>
										<td style="text-align:right;" class="table-actions">
											<div class="input-group-btn">
												<button type="button"  class="btn btn-info mr2 mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-url="../forms/form.php?islem=dform&ne=<?php echo $_GET["ne"];?>&id=<?php echo $rs["id"];?>&s2=<?php echo $_GET["s2"];?>" data-title="#<?php echo $rs["id"];?>" title="<?php echo $sdil[199]; //Düzenle?>"><i class="fa fa-pencil"></i></button>
												<?php if ($dauth==0){?>
													<button type="button" title="<?php echo $sdil[216]; //Yetkili Değilsiniz ??>" class="btn btn-danger btn-ban-row" href="#"><i class="fa fa-lock" aria-hidden="true"></i></button>
												<?php }else{ ?>
													<button type="button" title="<?php echo $sdil[204]; //Kaldir?>" class="btn btn-danger btn-delete-row" data-href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $rs["id"];?>&durum=sform"><i class="fa fa-times" aria-hidden="true"></i></button>
												<?php } ?>
											</div>
										</td>
									</tr>
								<?php }?>
							</tbody>
						</table>
                 </div>
            </div>
</body>
<?php echo $footer?>
</html>
<?php
if($_GET["durum"] == "yform"){
	$ft1="".trim($sdil[200])." ".trim($nedir)."";	
	for ($l = 1; $l <= $lx; $l++) {
		$sql = $conn->query("insert into lang".$l." (ne,m1,m2,m3) values ('".$_GET["ne"]."', '', 'formmail', '".$ft1."')");
	}
	$sql=mysqli_query($conn, "select * from ".$_SESSION['lang']." where ne='".$_GET["ne"]."' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	echo location("?ne=".$_GET["ne"]."&islem=dform&id=".$rs["id"]."&durum=ok",self,500,1);
}
if($_GET["durum"] == "sform"){for ($l = 1; $l <= $lx; $l++) {$Rs = mysqli_query($conn, "delete from lang".$l." where id=".$_GET["id"]."");}
echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok",self,500,1);
}?>