<div class="inner-wrapper">
	<!-- start: sidebar -->
	<aside id="sidebar-left" class="sidebar-left">
		
		<div class="sidebar-header">
			<div class="sidebar-title">
				Menu
			</div>
			<div class="sidebar-toggle hidden-xs" data-toggle-class="sidebar-left-collapsed" data-target="html" data-fire-event="sidebar-left-toggle">
				<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
			</div>
		</div>
		
		<?php include('menu.php');?>
	</aside>
	<!-- end: sidebar -->
	<section role="main" class="content-body">
		<header class="page-header">
			<h2>Notlar</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 $sdil[68]; //Notlar?></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="row">
			<div class="col">
				<section class="card">
					<header class="card-header">
						<div class="card-actions" id="v-<?php echo $_GET['islem'];?>">
<!--
							<a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
							<a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
						-->
						<a class="mb-1 mt-1 mr-1 btn btn-warning mfrm" data-toggle="modal" data-target="#myModal" data-title="<?php echo $sdil[48]; //E-Ajanda?>" data-url="modules/events/note.php?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&durum=nekle&gun=<?php echo $i-$ilkgun+1;?>&ay=<?php echo $bay;?>&yil=<?php echo $yil;?>" title="<?php echo $nedir; echo $sdil[201]; //Ekle?>"><i class="fa fa-plus" aria-hidden="true"></i></a>
					</div>
					
					<h2 class="card-title"><?php echo $sdil[68]; //Notlar?></h2>
				</header>
				<div class="card-body">
					<table class="table table-no-more table-bordered table-striped mb-0">
						<thead>
							<tr>
								<th class="w1"><span class="loading"></span></th>
								<th class="w10">
									Başlık
								</th>
								<th class="w20">Detay</th>
								<th class="w8">Başlangıç</th>
								<th class="w8">Bitiş</th>
								<th class="w5">Saat</th>
								<th class="w5">İşlemler</th>
							</tr>
						</thead>
						<tbody>
							<?php
							$sqle=mysqli_query($conn, "select * from genel where ne='not' order by t1 asc"); while($etk=mysqli_fetch_assoc($sqle)){
								$sqlu=mysqli_query($conn, "select * from t5 where id=".$etk["s1"].""); $uye=mysqli_fetch_assoc($sqlu);
								$sqlh=mysqli_query($conn, "select * from t4 where ne='hizmet' and id=".$etk["s2"].""); $hiz=mysqli_fetch_assoc($sqlh);
								if(mysqli_num_rows($sqlh)>0){
									$starih = explode('.',$hiz["t4"]);
								}elseif($etk["t4"]<>""){
									$starih = explode('.',$etk["t4"]);
								}
								$xtarih = strtotime("".$starih[2]."-".$starih[1]."-".$starih[0]."  00:00:00");
								$ytarih = strtotime("".date('Y')."-".date('m')."-".date('d')."  00:00:00");
								$gun=($xtarih - $ytarih) / (60*60*24);
								$xtarih = strtotime("".$starih[2]."-".$starih[1]."-".$starih[0]."  00:00:00");
								$ytarih = strtotime("".date('Y')."-".date('m')."-".date('d')."  00:00:00");
								$gun=($xtarih - $ytarih) / (60*60*24);
								if($gun<0){$durum="".$sdil[151]." ".$sdil[152]."";}else{$durum="".$sdil[151]." ".$sdil[153]."";}
								if($gun<30 and $gun>-15){ $hizmet++;
									$icon='<i class="fa fa-bell" style="color:orange;"></i>';
									$ctr="warning";
								}elseif($gun<-15){
									$icon='<i class="fa fa-bell" style="color:red;"></i>';
									$ctr="danger";
								}else{
									$icon='<i class="fa fa-bell" style="color:grey;"></i>';
									$ctr="success";
								}
								?>
								<tr class="alert-<?php echo $ctr?>">
									<td style="text-align: center; font-size: 20px;"><?php echo $icon?></td>
									<td>
										<?php if(mysqli_num_rows($sqlu)==0){?>
											<a href="#" class="mfrm" data-toggle="modal" data-target="#myModal" data-url="note.php?durum=noku&id=<?php echo $etk["id"]?>&ay=<?php echo $ay?>&yil=<?php echo $AktifYil?>" title="Düzenle"><?php echo $etk["t1"]?></a>
										<?php }else{?>
											<a href="?islem=duye&ne=uye&id=<?php echo $uye["id"]?>&sayfa=1#&tab-hizmet" title="Düzenle" class="with-tip"><?php echo $etk["t1"]?></a>
										<?php }?>
									</td>
									<td>
										<?php if(mysqli_num_rows($sqlh)==0){?>
											<?php echo $etk["n1"]?>
										<?php }else{?>
											<span id="link"><?php echo $uye["t1"]?></span> - <a href="#" id="link"><?php echo $hiz["n1"]?></a> Hizmet Sonu
										<?php }?>
									</td>
									<td><?php if(mysqli_num_rows($sqlh)>0){?><?php echo $hiz["t3"]?><?php }else{?><?php echo $etk["ts1"]?><?php }?></td>
									<td><?php echo $starih[0]?>.<?php echo $starih[1]?>.<?php echo $starih[2]?></td>
									<td>
										<?php echo $etk["t2"]?>
									</td>
									<td><a title="Sil" class="btn btn-danger mbtn cw" href="?ne=<?php echo $_GET["ne"]?>&islem=<?php echo $_GET["islem"]?>&id=<?php echo $etk["id"]?>&durum=snot" onClick="return confirm('#Bu Kayıt Silinecektir ! Onaylıyor musunuz ?')"><i class="fa fa-times"></i><span class="ddn"> <?php echo $sdil[204]; //Kaldir?></span></a></td>
								</tr>
							<?php }?>					
						</tbody>
					</table>
				</form>
			</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"] == "snot"){
	$Rs = mysqli_query($conn, "delete from genel where id=".$_GET["id"]."");
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&ay=".$_GET["ay"]."&yil=".$_GET["yil"]."&durum=ok",top,500,1);
}
?>