<div class="inner-wrapper">
	<?php
	$sayfa = $_GET['sayfa'];
	if($_GET['sayfa'] == "") {$sayfa = 0; $ss = 1;}else{$sayfa = ($sayfa-1) * 20; $ss = $_GET['sayfa'];}
	if($_GET["s3"]<>""){$sorgu="and s3=".$_GET["s3"]."";}
	$sql = mysqli_query($conn, "select * from genel where ne='gorev' and s13<>3 ".$sorgu." ".$luye." order by t10 desc");
	$sqls = mysqli_query($conn, "select * FROM genel where ne='gorev' and s13<>0 ".$sorgu." ".$luye.""); $rsay = mysqli_num_rows($sqls);
	?>
	<section role="main" class="content-body">
		<header class="page-header">
			<h2><?php echo $task?></h2>
			<div class="right-wrapper text-right">
				<ol class="breadcrumbs">
					<li>
						<a href=".">
							<i class="fa fa-home"></i>
						</a>
					</li>
					<li><span>Crm +Plus</span></li>
					<li><span><?php echo $task?></span></li>
				</ol>
				
				<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
			</div>
		</header>
		<?php if($_GET["durum"]=="ok"){?>
			<div class="alert alert-success">
				<?php echo $sdil[212]; //Islem Basariyla Gerçeklestirilmistir !?>
			</div>
		<?php }?>
		<div class="v3-row" id="process"></div>
		<div class="row">
			<div class="col">
				<section class="card">
					<header class="card-header v3-bg-info">
						<div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
							<?php include("modules/public/filter.php")?>
							<!--
								<a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
								<a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
							-->
					</div>
					
					<h2 class="card-title"><?php echo $task?></h2>
				</header>
				<div class="card-body" style="">
<?php if($_GET["ts1"]=="" and $_GET["ts2"]==""){?>
						<div class="alert alert-warning">#<?php echo translate("Son 30 Gün Listeniyor.")?></div>
<?php }?>
					<table class="table" style="">
						<thead>
							<tr class="mdn">
								<th class="w4 mw4" style="text-align:center;">ID
									<div class="order">
										<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&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"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&order=ID+desc" class="fa fa-sort-desc"></a>
									</div>
								</th>
								<th><?php echo $task?>
								<div class="order">
									<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&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"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&order=t1+desc" class="fa fa-sort-desc"></a>
								</div>
							</th>
							<th class="w15 mw15"><?php echo $t25?></th>
							<th class="w12 mw12"><?php echo $tasks[0]?> <?php echo $sdil["115"]; //Tarih?>
							<div class="order">
								<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&order=t10+asc" class="fa fa-sort-asc"></a>
								<a href="?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&key=<?php echo $_GET["key"];?>&s9=<?php echo $_GET["s9"];?>&sayfa=<?php echo $_GET["sayfa"];?>&durum=order&order=t10+desc" class="fa fa-sort-desc"></a>
							</div>
						</th>
						<th class="w8 mw8 tar"><?php echo $sdil["213"]; //İşlemler?></th>
					</tr>
				</thead>
				<tbody>
					<?php
							while ($rs=mysqli_fetch_assoc($sql)){
							if(($_SESSION["kim"]=="Admin") or ($_SESSION["kim"]=="yonetici" and $_SESSION["y13"]==3 and $_SESSION["user_id"]==$rs["s19"])){
								if ($rs["s6"]==1 or $authority==0){
									$yetki=0;
								}else{
									$yetki=1;
								}
							}else{
								$yetki=0;
							}
							if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and $rs["t9"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days'))) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rs["t10"]>=$_GET["ts1"] and $rs["t9"]<=$_GET["ts2"])){
							?>
							<tr class="<?php if($rs["t10"] > date('Y-m-d', strtotime(date("Y-m-d"). '5 days'))){?>alert alert-info<?php }elseif($rs["t10"] >= date('Y-m-d', strtotime(date("Y-m-d"). '3 days')) and $rs["t10"] <= date('Y-m-d', strtotime(date("Y-m-d"). '5 days'))){?>alert alert-warning<?php }elseif($rs["t10"] < date('Y-m-d', strtotime(date("Y-m-d"). '3 days'))){?>alert alert-danger<?php }?>" style="<?php if($rs["t10"] < date('Y-m-d')){?>text-decoration: line-through;<?php }?>">
								<th class="mdn cp v3-text-info mfrm" data-width="90%" data-toggle="modal" data-target="#myModal" data-url="modules/tasks/task.php?ne=gorev&islem=gorev&id=<?php echo $rs["id"]?>" data-title="<?php echo $sdil[199]; //Düzenle?>"><?php echo i2a($rs["id"],7);?></th>
								<td>
									<?php echo $rs["t1"]?> <?php if($rs["t2"]<>""){ echo "[".$rs["t2"]."]";}?>  <?php if($rs["s3"]==1){?><i class="fa fa-check"></i><?php }?>
								</td>
								<td style="cursor:pointer; color:red;" class="with-tip">
									<?php $t11Sx = explode(',',$rs["t11"]); $usql=mysqli_query($conn, "select * from t5"); while($rsm=mysqli_fetch_assoc($usql)){?>
										<?php foreach($t11Sx as $t11s){if($t11s==$rsm["id"]){echo "<span class='badge badge-info'>".$rsm["t1"]."</span>";}}?>
									<?php }?>
								</td>
								<td><?php echo dtarih($rs["t10"],"gg ka yy")?> <?php echo $rs["t8"]?></td>
								<td class="table-actions tar">
									<div class="input-group-btn">
										<a style="margin-right:5px;" class="btn btn-warning mfrm" data-toggle="modal" data-width="90%" data-target="#myModal" data-url="modules/tasks/task.php?ne=gorev&islem=gorev&id=<?php echo $rs["id"]?>" data-title="<?php echo $sdil[199]; //Düzenle?>" title="<?php echo $sdil[199]; //Düzenle?>"><i class="fa fa-pencil"></i></a>
										<?php if ($yetki==0){?>
											<a style="" class="btn btn-danger btn-ban-row" title="<?php echo $sdil[216]; //Yetkili Değilsiniz ??>" data-href="#"><i class="fa fa-ban" aria-hidden="true"></i><span class="ddn"> <?php echo $sdil[216]; //Yetkili Değilsiniz ?></span></a>
										<?php }else{ ?>
											<a style="" class="btn btn-danger btn-delete-row" title="<?php echo $sdil[204]; //Kaldir?>" data-href="?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&id=<?php echo $rs["id"]?>&durum=sgorev"><i class="fa fa-times" aria-hidden="true"></i></a>
										<?php } ?>
									</div>
								</td>
							</tr>
						<?php }}?>
					</tbody>
				</table>
			</div>
		</section>
	</div>
</div>
<!-- end: page -->
</section>
</div>
<aside id="sidebar-right" class="sidebar-right">
	<div class="nano">
		<div class="nano-content">
			<a href="#" class="mobile-close d-md-none">
				Collapse <i class="fa fa-chevron-right"></i>
			</a>
			<div class="sidebar-right-wrapper">
				...
			</div>
		</div>
	</div>
</aside>
</section>
<?php
if ($_GET["durum"]=="sgorev"){
	$dsql=mysqli_query($conn, "select * from genel where id='".$_GET["id"]."' order by id desc"); $drs=mysqli_fetch_assoc($dsql); $lt1=$drs["t1"];
	$sql = mysqli_query($conn, "delete from genel where id='".$_GET["id"]."' or s2='".$_GET["id"]."' ");
	$sql = mysqli_query($conn, "delete from t4 where s5=".$_GET["id"]);
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
}elseif ($_GET["durum"]=="ygorev"){
	$st1="".trim($sdil[200])." ".trim($nedir)."";
	$sql = $conn->query("insert into genel(ne, t1, s1, s13, s4, s5, s6, s19, ts1) values ('gorev', '".$st1."', '0', '0', '0', '0', '0', '".$_SESSION["user_id"]."',now())");		
	$sql=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	echo location("?ne=".$_GET["ne"]."&islem=dgorev&id=".$rs["id"]."&durum=ok",self,500,1);
}elseif ($_GET["durum"]=="arsiv"){
	$sql=mysqli_query($conn, "select * from genel where ne='".$_GET["ne"]."' and s3=1 order by id desc"); while($rs=mysqli_fetch_assoc($sql)){
		$Rs = mysqli_query($conn, "update genel set s2='1' where id=".$rs["id"]."");
	}
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
}
?>