<?php
$path="../../"; include("../../map.php");
//$path=""; include("../../scripts.php");
?>
<table class="v3-table" style="min-width:500px;">
	<thead>
		<tr>
			<th class="w6">ID
				<div class="order">
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=id+asc" class="fa fa-sort-asc"></a>
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=id+desc" class="fa fa-sort-desc"></a>
				</div>
			</th>
			<th><?php echo ctranslate("Başlık")?>
				<div class="order">
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=t1+asc" class="fa fa-sort-asc"></a>
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=t1+desc" class="fa fa-sort-desc"></a>
				</div>
			<th class="w20"><?php echo ctranslate($t25s[0]);?>
				<div class="order">
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=s3+asc" class="fa fa-sort-asc"></a>
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=s3+desc" class="fa fa-sort-desc"></a>
				</div>
			</th>
			<th class="w10"><?php echo ctranslate("Tarih")?>
				<div class="order">
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=ts2+asc,ts1+asc" class="fa fa-sort-asc"></a>
					<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&uID=<?php echo $_GET["uID"];?>&fID=<?php echo $_GET["fID"];?>&sayfa=<?php echo $_GET["sayfa"];?>&order=ts2+asc,ts1+desc" class="fa fa-sort-desc"></a>
				</div>
			</th>
		</tr>
	</thead>
	<tbody>
<?php
    if(!empty($_POST["key"])){
		$sorgu="and (id LIKE '%".$_POST["key"]."%' or t1 LIKE '%".$_POST["key"]."%' or t4 LIKE '%".$_POST["key"]."%' or n2 LIKE '%".$_POST["key"]."%' or n4 LIKE '%".$_POST["key"]."%')"; 
		$order="order by id desc";
	}elseif(!empty($_GET["uID"])){
		$sorgu="and s3=".$_GET["uID"]."";
		$order="order by id desc";
	}elseif(!empty($_GET["fID"])){
		$sorgu="and s1=".$_GET["fID"]."";
		$order="order by id desc";
	}else if($_GET["order"]<>""){
		$order="order by ".qa($_GET["order"])."";
	}else{
		$order="order by id desc";
	}
	$sql = mysqli_query($conn, "select * from t2 where ne='request' $sorgu $lreq $order limit 0,10"); while($rs=mysqli_fetch_assoc($sql)){
	if($_POST["ts1"]<>"" and $_POST["ts2"]<>""){
		$rts1s = explode(' ',$rs["ts2"]); $rts1 = $rts1s[0];
		if(trim($rts1) >= $_POST["ts1"] and trim($rts1) <= $_POST["ts2"]){}else{$sts="display:none;";}
	}
	if($_GET["s13"] == "0" and $rs["s13"]=="1"){$sts="display:none;";}
	if($_GET["s13"] == "1" and $rs["s13"]=="0"){$sts="display:none;";}
	$sqlk = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='".$rs["t3"]."' and id=".$rs["s2"]."");  $rsk=mysqli_fetch_assoc($sqlk);
	$sqlu = mysqli_query($conn, "select * from t5 where id=".$rs["s3"]."");  $rsu=mysqli_fetch_assoc($sqlu);
	$sqlmx = mysqli_query($conn, "select * from t5 where id=".$rs["s19"]."");  $rsmx=mysqli_fetch_assoc($sqlmx);
	$jsi = json_decode($rs["n2"], true);
	$jsfm = json_decode($rs["n12"],true);	//bildirim
	$ts1 = explode('-',$rs["ts1"]);
?>
	<tr data-id="<?php echo $rs["id"];?>" class="alert alert-<?php if($rs["s4"]==0){?>warning<?php }elseif($rs["s4"]==1){?>info<?php }elseif($rs["s4"]==2){?>success<?php }?>" style="<?php echo $sts?>">
		<th class="v3-text-danger mfrm cp" data-toggle="modal" data-target="#myModal" data-title="<?php echo translate("Request");?>" data-url="<?php if(file_exists("../request/request.php")){echo "../request/request.php";}else{echo "modules/requests/request.php";}?>?islem=fmesaj&id=<?php echo $rs["id"];?>"><?php echo i2a($rs["id"],7);?></a></th>
		<td title="<?php echo $sdil[207]; //Detay?>"><?php echo $rs["t2"];?> <?php if($rs["t1"]<>""){echo "[".$rs["t1"]."]";};?> <b><?php echo $jsi["type"];?></b> <?php if($jsfm["browser"]<>1 or $jsfm["desktop"]<>1){?><i class="fa fa-lightbulb-o" aria-hidden="true"></i><?php }?></td>
		<td>
		<?php if(mysqli_num_rows($sqlu)>0){?><?php echo $rsu["t1"];?><?php }?><?php if(mysqli_num_rows($sqlmx)>0){?> <i class="fa fa-angle-double-right" aria-hidden="true"></i> <?php echo $rsmx["t1"];}?>
		</td>
		<td><div title="<?php echo dtarih($rs["ts1"],"gg ka yyyy");?>" class="v3-date"><span><?php echo dtarih($rs["ts1"],"gg");?></span><span><?php echo dtarih($rs["ts1"],"ka");?></span></div></td>
	</tr>
	<tr style="visibility: hidden;display: none;" id="sp<?php echo $rs["id"];?>">
	<td colspan="10">
	<table class="v3-table">
		<tr>
			<td style="width:25%"><b><?php echo ctranslate(telefon($t25));?></b></td>
			<td>
			<select size="1" name="s19[]" style="" class="form-control" onchange="this.form.submit()">
				<option value="0">Admin</option>
				<?php $sqlm=mysqli_query($conn, "select * from t5"); while($rsm=mysqli_fetch_assoc($sqlm)){?>
					<option value="<?php echo $rsm["id"];?>" title="<?php echo $rsm["t1"];?>" alt="<?php echo $rsm["t1"];?>" style="color:#6699FF" <?php if ($rsm["id"]==$rs["s19"]) {?>Selected<?php }?>><?php echo $rsm["t1"];?></option>
				<?php }?>
			</select>
		</td>
		</tr>
		<?php
		$arrays = json_decode($rs["n2"], true);
		foreach($arrays as $key=>$value){
		?>
		<tr>
			<td style="width:25%"><b><?php echo str_replace("_"," ",$key);?></b></td>
		</tr>
		<?php }?>
		</td>
	</table>
	</tr>
<?php $sts="";}?>
	</tbody>
</table>