<?php include 'inc/header.php';?>
<?php include 'inc/sidebar.php';?>
<?php include 'inc/navbar.php';?>


<style>
	.zara-yatay {
		float:left;
	}
	@media print {
		body * {
			visibility: hidden;
		}
		.section-to-print, .section-to-print * {
			visibility: visible;
		}
		.section-to-print {
			position: absolute;
			left: 0;
			top: 0;
		}
	}


</style>

<script type="text/javascript">
	document.addEventListener('DOMContentLoaded', function() {
		if(typeof jQuery !== 'undefined') {
			$(".yazdir").click(function(){
				window.print();
			});
		}
	});
</script>

<!-- Page Content-->
<div class="page-content">
	<div class="container-fluid">
		<!-- Page-Title -->
		<div class="row">
			<div class="col-sm-12">
				<div class="page-title-box">
					<div class="row">
						<div class="col">
							<h4 class="page-title">Sipariş Listesi</h4>
							<ol class="breadcrumb">
								<li class="breadcrumb-item"><a href="anasayfa">Anasayfa</a></li> 
								<li class="breadcrumb-item active">Sipariş Listesi</li>
							</ol>
						</div><!--end col--> 
					</div><!--end row-->                                                              
				</div><!--end page-title-box-->
			</div><!--end col-->
		</div><!--end row-->
		<!-- end page title end breadcrumb -->

		<div class="row">
			<div class="col-lg-12">

				<div class="row justify-content-center">

					<div class="col-md-6 col-lg-2">
						<div class="card report-card">
							<div class="card-body">
								<div class="row d-flex justify-content-center">
									<div class="col">
										<p class="text-dark mb-0 font-weight-semibold">Bekleyen Sipariş</p>
										<h3 class="m-0">    <?php 
										$bekleyen_siparis = $dbh->prepare("SELECT siparis_id FROM product_orders WHERE durum  = ?");
										$bekleyen_siparis->execute([0]);
										echo $bekleyen_siparis->rowCount();
										?></h3>
									</div>
									<div class="col-auto align-self-center">
										<div class="report-main-icon bg-light-alt">
											<i data-feather="bell" class="align-self-center text-muted icon-sm"></i>  
										</div>
									</div>
								</div>


							</div><!--end card-body--> 
						</div><!--end card--> 
					</div> <!--end col--> 
					<div class="col-md-6 col-lg-2">
						<div class="card report-card">
							<div class="card-body">
								<div class="row d-flex justify-content-center">
									<div class="col">
										<p class="text-dark mb-0 font-weight-semibold">Hazırlanan Sipariş</p>
										<h3 class="m-0">    <?php 
										$bekleyen_siparis = $dbh->prepare("SELECT siparis_id FROM product_orders WHERE durum  = ?");
										$bekleyen_siparis->execute([1]);
										echo $bekleyen_siparis->rowCount();
										?></h3>
									</div>
									<div class="col-auto align-self-center">
										<div class="report-main-icon bg-light-alt">
											<i data-feather="bell" class="align-self-center text-muted icon-sm"></i>  
										</div>
									</div>
								</div>

							</div><!--end card-body--> 
						</div><!--end card--> 
					</div> <!--end col--> 
					<div class="col-md-6 col-lg-2">
						<div class="card report-card">
							<div class="card-body">
								<div class="row d-flex justify-content-center">
									<div class="col">
										<p class="text-dark mb-0 font-weight-semibold">Teslimatta Olan Sipariş</p>
										<h3 class="m-0">    <?php 
										$tesl_siparis = $dbh->prepare("SELECT siparis_id FROM product_orders WHERE durum  = ?");
										$tesl_siparis->execute([4]);
										echo $tesl_siparis->rowCount();
										?></h3>
									</div>
									<div class="col-auto align-self-center">
										<div class="report-main-icon bg-light-alt">
											<i data-feather="bell" class="align-self-center text-muted icon-sm"></i>  
										</div>
									</div>
								</div>

							</div><!--end card-body--> 
						</div><!--end card--> 
					</div> <!--end col--> 

					<div class="col-md-6 col-lg-2">
						<div class="card report-card">
							<div class="card-body">
								<div class="row d-flex justify-content-center">
									<div class="col">
										<p class="text-dark mb-0 font-weight-semibold">Tamamlanan Siparişler</p>
										<h3 class="m-0">    <?php 
										$tesl_siparis = $dbh->prepare("SELECT siparis_id FROM product_orders WHERE durum  = ?");
										$tesl_siparis->execute([2]);
										echo $tesl_siparis->rowCount();
										?></h3>
									</div>
									<div class="col-auto align-self-center">
										<div class="report-main-icon bg-light-alt">
											<i data-feather="bell" class="align-self-center text-muted icon-sm"></i>  
										</div>
									</div>
								</div>

							</div><!--end card-body--> 
						</div><!--end card--> 
					</div> <!--end col-->      

					<div class="col-md-6 col-lg-2">
						<div class="card report-card">
							<div class="card-body">
								<div class="row d-flex justify-content-center">
									<div class="col">
										<p class="text-dark mb-0 font-weight-semibold">İptal Olan Siparişler</p>
										<h3 class="m-0">    <?php 
										$ipt_siparis = $dbh->prepare("SELECT siparis_id FROM product_orders WHERE durum  = ?");
										$ipt_siparis->execute([3]);
										echo $ipt_siparis->rowCount();
										?></h3>
									</div>
									<div class="col-auto align-self-center">
										<div class="report-main-icon bg-light-alt">
											<i data-feather="bell" class="align-self-center text-muted icon-sm"></i>  
										</div>
									</div>
								</div>

							</div><!--end card-body--> 
						</div><!--end card--> 
					</div> <!--end col-->                     


				</div><!--end row-->



				<div class="row">
					<div class="col-12">
						<div class="card">
							<div class="card-header">
								<h4 class="card-title">Sipariş Listesi</h4>
								<p class="text-muted mb-0">Değerli kullanıcı, bu alan sayesinde siparişlerinizi görüntüleyebilir ve işlemlerinizi rahatlıkla halledebilirsiniz. Aynı zamanda sütün başlıklarına tıklayarak sıralama yapabilirsiniz ve listeleme özelliğine tıklayarak filtreleme de yapabilirsiniz. Ödeme durumunu değiştirmek için ödenmedi butonuna tıklayarak ödendi olarak değiştirebilirsiniz.
								</div><!--end card-header-->
								<style type="text/css">
									i { 
										font-size: 16px;
									}
								</style>
								<div class="card-body">  
									<table id="datatable-buttonss" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
										<thead>
											<tr>
												<th>Sipariş No</th>
												<th>İsim Soyisim</th>
												<th>Sipariş Tipi</th>
												<th>Ödeme Tipi</th>
												<th>Ödeme Durumu</th>
												<th>Sipariş Durumu</th>
												<th>Tarih</th>
												<th>İşlemler</th> 
											</tr>
										</thead>


										<tbody>
											<?php

											$sipler      =   $dbh->prepare("SELECT * FROM product_orders  order by siparis_id desc ");
											$sipler      ->  execute(array());
											$sipler      =   $sipler      ->fetchAll(PDO::FETCH_OBJ);
											foreach ($sipler as $sip ) {

												$masa_getir = $dbh->prepare("SELECT * FROM masa_no WHERE id = ?");
												$masa_getir->execute(array($sip->masa));
												$masa = $masa_getir->fetch(PDO::FETCH_OBJ);

												$mahh = $dbh->prepare("SELECT * FROM mahalle WHERE mahalle_key = ?");
												$mahh->execute([$sip->mah]);
												$mahh = $mahh ->fetch(PDO::FETCH_OBJ);


												?>
												<tr>
													<td style="width: 10px; height: 10px;"><?=$sip->siparis_id;?></td>
													<td><?= $sip->adi_soyadi;?></td>
													<td><center><button type="button" class="btn btn-outline-primary waves-effect waves-light">
														<?php if ($sip->masa == 0 ){echo "Paket Siparişi";}else{echo $masa->masa_adi;}?>
														<?php if ($sip->teslimat==1){echo " / Gel Al";}else{echo " / Adrese";} ?>
														<?php if ($sip->teslimattarih == "0" ){echo " / Hemen";}else{echo " / ".$sip->teslimattarih;}?>

													</button></center></td>


													<td><center>    <?php 
													if ($sip->payment=="kasa") {
														echo '<button type="button" class=" btn btn-outline-success btn-block mg-b-10" disabled>Kasada Ödeme</button>';
													}elseif ($sip->payment=="kapida") {
														echo '<button type="button" class=" btn btn-outline-dark btn-block mg-b-10" disabled>Kapıda Nakit Ödeme</button>';
													}elseif ($sip->payment=="kapidakart") {
														echo '<button type="button" class=" btn btn-outline-warning btn-block mg-b-10" disabled>Kapıda Kredi Ödeme</button>';
													}else {
														echo '<button type="button" class="btn btn-outline-success btn-block mg-b-10" disabled>Online Ödeme</button>';
													}
													?></center></td>
													<?php $odurum=$sip->odeme_durum; 

													$id=$sip->siparis_id;?>

													<td><center><?php if ($odurum==1) {echo "<a href='' data-toggle='modal' data-target='#m_modal_19".$id."' class='btn btn-outline-success waves-effect waves-light'>Ödendi</button></a>";}else{echo"<a href=''  data-toggle='modal' data-target='#m_modal_19".$id."'><button class='btn btn-outline-danger waves-effect waves-light'>Ödenmedi</button></a>";} ?></center></td>


													<td><center>
														<?php if($sip->durum == 0){
															echo '<button type="button" class="btn btn-outline-secondary waves-effect waves-light">Beklemede</button>';
														}else if ($sip->durum == 1) {
															echo '<button type="button" class="btn btn-outline-dark waves-effect waves-light">Yapılıyor</button>';
														}else if ($sip->durum == 2) {
															echo '<button type="button" class="btn btn-outline-success waves-effect waves-light">Tamamlandı</button>';
														}else if ($sip->durum == 3) {
															echo '<button type="button" class="btn btn-outline-danger waves-effect waves-light">İptal</button>';
														}else if ($sip->durum == 4) {
															echo '<button type="button" class="btn btn-outline-dark waves-effect waves-light">Teslimatta</button>';
														}
														if($sip->dk && $sip->dk!=" "){
															echo '<button type="button" class="btn btn-outline-dark waves-effect waves-light">'.$sip->dk.'</button>';
														}
														?>




													</center>
												</td>

												<td >

													<?php 

													echo date('d-m-Y h:i:s', strtotime($sip->tarih));
													?>

												</td>


												<td style="width: 50px; height: 50px;">
													<button type="button" class="btn btn-outline-primary btn-icon-circle-sm" data-toggle="modal" data-target="#exampleModalDanger1<?=$sip->siparis_id?>"><i class="ti-settings"></i></button>

													<button type="button" class="btn btn-outline-danger btn-icon-circle-sm" data-toggle="modal" data-target="#exampleModalsil<?=$sip->siparis_id?>" ><i class="ti-trash"></i></button>

												</td> 
											</tr>



											<div class="modal fade" id="exampleModalDanger1<?=$sip->siparis_id?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalDanger1<?=$sip->siparis_id?>" aria-hidden="true">
												<div class="modal-dialog" role="document">
													<div class="modal-content">
														<div class="modal-header bg-primary">
															<h6 class="modal-title m-0 text-white" id="exampleModalDanger1<?=$ebultensonuc['id'];?>">Sipariş Detayı</h6>
															<button type="button" class="close " data-dismiss="modal" aria-label="Close">
																<span aria-hidden="true"><i class="la la-times text-white"></i></span>
															</button>
														</div><!--end modal-header-->
														<div class="modal-body section-to-print" id="">
															<div class="row"> 
																<div class="col-lg-12"> 
																	<h5>Kullanıcı Bilgileri ;</h5>
																	<ul class="mt-3 mb-0">
																		<li><b>Sipariş:</b> #<?=$sip->siparis_id;?> / <?=$sip->tarih?></li> 
																		<li><b>İsim Soyisim:</b><?=$sip->adi_soyadi;?></li> 
																		<?php if(!empty($sip->mail)){ ?><li><b>Mail:</b> <?=$sip->mail;?></li><?php } ?>
																		<?php if(!empty($sip->telefon)){ ?><li><b>Telefon:</b> <?=$sip->telefon;?></li>  <?php } ?>
																		<li><b>Adres:</b> <?=$sip->adres?>  /  <?=$mahh->mahalle_title?> mah.</li>  
																	</ul>
																	<br> 


																	<ul class="mt-3 mb-0">
																		<?php 
																		if ($sip->payment=="kasa") { ?>
																			<button type="button" class="  btn btn-outline-warning btn-block mg-b-10">Kasada Ödeme</button> 
																		<?php 	}elseif ($sip->payment=="kapida") {?>
																			<button type="button" class="btn btn-outline-success btn-block mg-b-10">Kapıda Nakit Ödeme</button>
																		<?php 	}elseif ($sip->payment=="kapidakart") {?>
																			<button type="button" class="btn btn-outline-warning btn-block mg-b-10">Kapıda Kredi Ödeme</button>
																		<?php  }else { ?>
																			<button type="button" class="btn btn-outline-success btn-block mg-b-10">Online Ödeme</button>
																		<?php  }?>
																		<?php if ($sip->odeme_durum==1) {echo '<button type="button" class=" btn btn-outline-success btn-block mg-b-10">Ödendi</button> ';}else{echo'<button type="button" class=" btn btn-outline-danger btn-block mg-b-10">Ödenmedi</button>  ';} ?>

																		<button type="button" class=" btn btn-outline-primary  btn-block mg-b-10">
																			<?php if ($sip->masa == 0 ){echo "Paket Siparişi";}else{echo $masa->masa_adi;}?>
																			<?php if ($sip->teslimat==1){echo " / Gel Al";}else{echo " / Adrese";} ?>
																			<?php if ($sip->teslimattarih == "0" ){echo " / Hemen";}else{echo " / ".$sip->teslimattarih;}?>
																		</button>

																	</ul>
																	<br> 

																	<?php 
																	$_SESSION['sepete'] =json_decode($sip->sip);
																	$toplam2=0;
																	foreach ($_SESSION['sepete']  as $siparis => $siparisdetay) {
																		$array=$siparisdetay;
																		$urun_getir = $dbh -> prepare("SELECT * FROM product WHERE id = ?");
																		$urun_getir-> execute(array($siparisdetay->urunid));
																		$urun = $urun_getir->fetch(PDO::FETCH_ASSOC);
																		$fiyat = $urun["product_price"];

																		$ekstraistek=0;
																		$porsyon="";
																		$pfiyat=0;
																		if($siparisdetay->menu_porsiyon>0){
																			$porsyon = $dbh -> prepare("SELECT * FROM product_portion WHERE id = ?");
																			$porsyon-> execute(array($siparisdetay->menu_porsiyon));
																			$porsyon = $porsyon->fetch(PDO::FETCH_ASSOC);
																			$key= array_search($siparisdetay->menu_porsiyon,json_decode($urun['product_portion']) );
																			$porsiyonfler=json_decode($urun['product_portion_price']) ;
																			$pfiyat= $porsiyonfler[$key];
																		}  
																		if($siparisdetay->ekstra){
																			$ekstralara=" ";
																			$eksftop=0;
																			foreach ($siparisdetay->ekstra as $eks) {
																				$ekstrad = $dbh -> prepare("SELECT * FROM selectable WHERE id = ?");
																				$ekstrad-> execute(array($eks));
																				$ekstrad = $ekstrad->fetch(PDO::FETCH_ASSOC);
																				$key= array_search($eks,json_decode($urun['product_optionek']) );
																				$ekstrafiyat=json_decode($urun['product_optionek_price']) ;
																				$ekfiyat= $ekstrafiyat[$key];
																				$eksftop+=$ekfiyat;

																				if($ekfiyat>0){
																					$ekstralara.= $ekstrad['option']." ".$ekfiyat."₺ + ";
																				}else{
																					$ekstralara.= $ekstrad['option']." + ";
																				}
																			}
																			$ekstralara=rtrim($ekstralara," + " );
																		}

																		$toplam = ($fiyat + $pfiyat +  $eksftop)*$array->qty; 
																		$urun = cevir("menu",$urun,$_SESSION["dil"]);
																		$toplam2 += $toplam;

																		$porsyon = cevir("porsiyon_secenekleri",$porsyon,$_SESSION["dil"]);
																		?>
																		<div class="alert alert-outline-primary" role="alert">
																			<strong><b><?=$urun['product_name']?> (<?=$fiyat?> TL)</strong> ;</b><br><br>
																			<li><?=$array->qty?> Adet</li>
																			<li><b>Porsiyon Seçimi:</b> <?php echo   $porsyon['portion'] ." + " .$pfiyat . "TL";?></li>
																			<li><b>Ekstra Seçim:</b> <?php echo " +".$ekstralara."  " ;?> </li>	
																			<li><b>Müşteri Açıklaması:</b> <?php echo $array->icerik;?> </li>	
																			<li><b>Toplam Tutar:<?=$toplam." TL";?></b></li>					 
																		</div>

																	<?php } ?>


																	<br><br>
																	<div class="row">
																		<div class="col-xl-12">
																			<div class="card">
																				<div class="card-header">
																					<h4 class="card-title"><center>Tutar Bilgileri</center></h4> 
																				</div><!--end card-header-->
																				<div class="card-body">        
																					<div class="row">
																						<div class="col-lg-12">
																							<ul class="list-group list-group-flush">
																								<li class="list-group-item"><i class="la la-angle-double-right text-info mr-2"></i><b>Toplam Tutar:</b> <?=$toplam2 ?> TL</li>


																								<li class="list-group-item"><i class="la la-angle-double-right text-info mr-2"></i><b>İndirim Kuponu:</b> 	<?php 

																								$kodkontrol = $dbh -> prepare("SELECT * FROM coupon WHERE coupon_code = ?");
																								$kodkontrol-> execute(array($sip->coupon));
																								$kodkontrol = $kodkontrol->fetch(PDO::FETCH_OBJ);

																								if($sip->coupon){
																									echo "".$kodkontrol->discount_amount."TL indirim Kodu: ".$sip->coupon;
																								} ?> 
																							</li>


																							<li class="list-group-item"><i class="la la-angle-double-right text-info mr-2"></i><b>Genel Toplam:</b> <?=$toplam2 -$kodkontrol->discount_amount?> TL</li>


																						</ul>
																					</div><!--end col-->
																				</div><!--end row-->
																			</div><!--end card-body-->
																		</div><!--end card-->                            
																	</div> <!-- end col -->        
																</div>


															</div><!--end col-->
														</div><!--end row-->                                                     
													</div><!--end modal-body-->
													<div class="modal-footer">
														<div class="btn-group">
															<button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i data-feather="settings" height="15px"></i> İşlemler</button>
															<div class="dropdown-menu">
																<a class="dropdown-item tx-13" href="islem.php?id=<?=$id; ?>&islem=beklemede"><i data-feather="info" height="15px"></i> Bekliyor</a>
																<a class="dropdown-item tx-13" href="islem.php?id=<?=$id; ?>&islem=yapiliyor"><i data-feather="refresh-ccw" height="15px"></i> Hazırlanıyor</a>
																<a class="dropdown-item tx-13" href="islem.php?id=<?=$id; ?>&islem=teslimatta"><i data-feather="x-circle" height="15px"></i> Teslimatta</a>
																<a class="dropdown-item tx-13" href="islem.php?id=<?=$id; ?>&islem=tamamlandi"><i data-feather="check" height="15px"></i> Tamamlandı</a>
																<a class="dropdown-item tx-13" href="islem.php?id=<?=$id; ?>&islem=iptal-edildi"><i data-feather="x-circle" height="15px"></i> İptal Edildi</a>

															</div>
														</div> 
														<div class="btn-group">
															<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i data-feather="settings" height="15px"></i> Gönderim Süresi</button>
															<div class="dropdown-menu">
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=10Dakika">10 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=20Dakika">20 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=30Dakika">30 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=40Dakika">40 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=50Dakika">50 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=60Dakika">60 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=70Dakika">70 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=80Dakika">80 Dakika</a>
																<a class="dropdown-item tx-13" href="gonderimde.php?id=<?=$id;?>&dk=90Dakika">90 Dakika</a>
															</div>
														</div> 
														<a href="yazdir.php?id=<?=$sip->siparis_id?>" target="_blank" class="btn btn-primary "> <i data-feather="printer" height="15px"></i> <?php echo $dil["yazdır"];?></a> 
														<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Kapat</button>

													</div><!--end modal-footer-->
												</div><!--end modal-content-->
											</div><!--end modal-dialog-->
										</div><!--end modal-->


										<!-- ödenmedi butonu güncellemesi -->
										<div class="modal" id="m_modal_19<?=$id;?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel_19<?=$id;?>" style="display: none;" aria-hidden="true">
											<div class="modal-dialog" role="document">
												<div class="modal-content">
													<div class="modal-header">
														<h5 class="modal-title" id="exampleModalLabel_1<?=$id;?>">Ödeme Durum Güncelleme</h5>
														<button type="button" class="close" data-dismiss="modal" aria-label="Close">
															<span aria-hidden="true"><i class="ion-ios-close-empty"></i></span>
														</button>
													</div>
													<div class="modal-body">
														<p>İlgili siparişin ödenme durumunu kolaylıkla güncelleyebilirsiniz.</p><br>

														<?php  if ($odurum==0){ ?>
															<a class="btn btn-outline-success btn-block mg-b-10" href="islem.php?id=<?=$id; ?>&islem=odendi"><i data-feather="check" height="15px"></i> Ödendi</a>
														<?php }else{ ?>
															<a class="btn btn-outline-danger btn-block mg-b-10" href="islem.php?id=<?=$id; ?>&islem=odenmedi"><i data-feather="info" height="15px"></i> Ödenmedi</a>
														<?php } ?>
													</div>
													<div class="modal-footer">
														<button type="button" class="btn btn-secondary" data-dismiss="modal">Kapat</button>
													</div>
												</div>
											</div>
										</div>

										<div class="modal fade" id="exampleModalsil<?=$sip->siparis_id?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalsil<?=$sip->siparis_id?>" aria-hidden="true">
											<div class="modal-dialog" role="document">
												<div class="modal-content">
													<div class="modal-header bg-danger">
														<h6 class="modal-title m-0 text-white" id="exampleModalsil<?=$sip->siparis_id?>"><?=$sip->siparis_id?></h6>
														<button type="button" class="close " data-dismiss="modal" aria-label="Close">
															<span aria-hidden="true"><i class="la la-times text-white"></i></span>
														</button>
													</div><!--end modal-header-->
													<div class="modal-body">
														<div class="row"> 
															<div class="col-lg-12">
																<h5>Bu veriyi silmek istiyormusunuz ?</h5>
																<span class="badge bg-soft-secondary">Eklenme Tarihi:</span>
																<small class="text-muted ml-2"> <?=$mysqldate?></small>
																<ul class="mt-3 mb-0">
																	<li>Bu veri silinirse geri döndürülemez. <br><br><font color="red"><b>UYARI ! </b> Değerli kullanıcı bu veriyi silerseniz kazanç tablosunda ki rakamlarda düşecektir.</font></li> 
																</ul>
															</div><!--end col-->
														</div><!--end row-->                                                     
													</div><!--end modal-body-->
													<div class="modal-footer">
														<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Kapat</button>
														<a href="islem.php?id=<?=$sip->siparis_id; ?>&islem=siparis-sil"><button type="button" class="btn btn-danger btn-sm">Evet, Sil</button></a>
													</div><!--end modal-footer-->
												</div><!--end modal-content-->
											</div><!--end modal-dialog-->
										</div><!--end modal-->
									<?php } ?> 
								</tbody>
							</table>        
						</div>
					</div>
				</div> <!-- end col -->
			</div> <!-- end row -->



		</div><!-- container -->

		<?php include 'inc/footer.php';?>
		<script type="text/javascript">
			$('#datatable-buttonss').DataTable({

				responsive: true,

				language: {

					searchPlaceholder: 'Ara...',

					sSearch: ''

				},

				"order": [[ 0, "desc" ]]

			});
			<?php if($_SESSION['onaysip']){ ?>
				$('#exampleModalDanger1<?=$_SESSION['onaysip']?>').modal('show');
				<?php 
				unset($_SESSION['onaysip']);
			} ?>

		</script>