<?php
$siparis = $db->query("select * from siparisler where id='{$_GET["id"]}'")->fetch(PDO::FETCH_ASSOC);
?>

<div class="page-wrapper">
<div class="content">
<div class="page-header">
<div class="page-title">
<h4>Sipariş Detay </h4>

</div>
</div>
<div class="card">
<div class="card-body">
<div class="card-sales-split">
<h2>Sipariş Kodu  : <?=$siparis["paytr"]?></h2>
<ul>
<li>
<a href="javascript:void(0);"><img src="assets/img/icons/edit.svg" alt="img"></a>
</li>
<li>
<a href="javascript:void(0);"><img src="assets/img/icons/pdf.svg" alt="img"></a>
</li>
<li>
<a href="javascript:void(0);"><img src="assets/img/icons/excel.svg" alt="img"></a>
</li>
<li>
<a href="javascript:void(0);"><img src="assets/img/icons/printer.svg" alt="img"></a>
</li>
</ul>
</div>
<div class="invoice-box table-height" style="max-width: 1600px;width:100%;overflow: auto;margin:15px auto;padding: 0;font-size: 14px;line-height: 24px;color: #555;">
<table cellpadding="0" cellspacing="0" style="width: 100%;line-height: inherit;text-align: left;">
<tbody><tr class="top">
<td colspan="6" style="padding: 5px;vertical-align: top;">
<table style="width: 100%;line-height: inherit;text-align: left;">
<tbody><tr>
<td style="padding:5px;vertical-align:top;text-align:left;padding-bottom:20px">
<font style="vertical-align: inherit;margin-bottom:25px;"><font style="vertical-align: inherit;font-size:14px;color:#7367F0;font-weight:600;line-height: 35px; ">Üye Bilgileri</font></font><br>
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;font-size: 14px;color:#000;font-weight: 400;"> <?=$siparis["adsoyad"]?></font></font><br>
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;font-size: 14px;color:#000;font-weight: 400;"> <?=$siparis["eposta"]?></font></font><br>
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;font-size: 14px;color:#000;font-weight: 400;"> <?=$siparis["telefon"]?></font></font><br>
</td>


</tr>
</tbody></table>
</td>
</tr>
<tr class="heading " style="background: #F3F2F7;">
<td style="padding: 5px;vertical-align: middle;font-weight: 600;color: #5E5873;font-size: 14px;padding: 10px; ">
Ürün Adı
</td>

<td style="padding: 5px;vertical-align: middle;font-weight: 600;color: #5E5873;font-size: 14px;padding: 10px; ">
Fiyat
</td>


</tr>
<?php

$urunid = $siparis["urun"];
$urunid = explode(",",$urunid);
foreach($urunid as $urun =>$deger){
    
$urun = $db->query("select * from urunler where id='$deger'")->fetch(PDO::FETCH_ASSOC);
?>

<tr class="details" style="border-bottom:1px solid #E9ECEF ;">
<td style="padding: 10px;vertical-align: top; display: flex;align-items: center;">
<img src="../resimler/<?=$urun["resim"]?>" alt="<?=$urun["adi"]?>" class="me-2" style="width:40px;height:40px;">
<?=$urun["adi"]?>
</td>
<td style="padding: 10px;vertical-align: top; ">
<?=$urun["fiyat"]?>₺
</td>

</tr>
<?php }?>
</tbody></table>
</div>
<div class="row">

<div class="row">

<div class="col-lg-6 ">
<div class="total-order w-100 max-widthauto m-auto mb-4">
<ul>
<li>
<h4>Ödeme Durumu</h4>
<h5><?php if($siparis["durum"]==1){ echo"Ödendi";} else { echo "Ödenmedi";}?></h5>
</li>
<li class="total">
<h4>Tutar </h4>
<h5><?=$siparis["fiyat"]?>₺</h5>
</li>
</ul>
</div>
</div>
</div>
<div class="col-lg-12">

<a href="siparisler" class="btn btn-cancel">Siparişlere Geri Dön</a>
</div>
</div>
</div>
</div>
</div>
</div>