<?php if(!defined("Hacking")){die("404 Not Found"); } ?>
<?php
    $gelen = @get('oku');
    $siparisler = $db->select('siparisler')
        ->where('siparisler_id',$gelen)
        ->run(true);
?>

<div id="tour-11" class="header-content">
  <h2><i class="fa fa-envelope-o"></i><?php echo $siparisler['siparisler_adsoyad']; ?> <span>kişinin siparişi</span></h2>
</div>
<div class="body-content animated fadeIn">
  <div class="row">
    <div class="col-sm-12">
      <form class="form-horizontal">
        <div class="panel mail-wrapper rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title">Ürün: <?php echo $siparisler['siparisler_konu']; ?></h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title">Sipariş Tarihi: <?php echo $siparisler['siparisler_tarih']; ?></h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-heading">
            <div class="pull-left">
              <?php $durum = $Admin->siparisdurumual($gelen);
                    $sec1 = "";
                    $sec2 = "";
                    $sec3 = "";
                    $sec4 = "";
                if($durum==1){ $sec1 ='checked';}
                if($durum==2){ $sec2 ='checked';}
                if($durum==3){ $sec3 ='checked';}
                if($durum==4){ $sec4 ='checked';}
              ?>
              <h3 class="panel-title">Sipariş Durumu: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                                      <input type="radio" name="rb1" id="rb1" value="onaybekliyor" onclick="siparisdurumu(1,<?=$gelen?>)" <?=$sec1?>> Onay Bekliyor &nbsp;
                                                      <input type="radio" name="rb2" id="rb2" value="islemde" onclick="siparisdurumu(2,<?=$gelen?>)" <?=$sec2?>> İşlemde &nbsp;
                                                      <input type="radio" name="rb3" id="rb3" value="iptaledildi" onclick="siparisdurumu(3,<?=$gelen?>)" <?=$sec3?>> İptal Edildi &nbsp;
                                                      <input type="radio" name="rb4" id="rb4" value="tamamlandi" onclick="siparisdurumu(4,<?=$gelen?>)" <?=$sec4?>> Tamamlandı &nbsp;


              </h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title">E-Postası: <?php echo $siparisler['siparisler_email']; ?></h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title" title="Mesaj">Mesajı: <?php echo $siparisler['siparisler_text']; ?></h3>
            </div>
            <div class="pull-right"> <a href="index.php?do=siparisler&sil=<?php echo $siparisler['siparisler_id']; ?>" class="btn btn-danger btn-sm tooltips" data-container="body" data-original-title="<?php echo $siparisler['siparisler_konu']; ?> siparişli, <?php echo $siparisler['siparisler_adsoyad']; ?>'den gelen siparişi sil" data-toggle="tooltip" data-placement="top" title=""><i class="fa fa-trash-o"></i>&nbsp; Siparişi Sil</a> </div>
            <div class="clearfix"></div>
          </div>
        </div>
        <a href="index.php?do=siparisler" class="btn btn-info btn-sm tooltips" data-container="body" data-original-title="Tüm Gelen Siparişler" data-toggle="tooltip" data-placement="top" title=""><i class="fa fa-envelope-o"></i>&nbsp; Gelen Siparişleri Gör</a>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript">
	function siparisdurumu(rb,gelen){
    $.ajax({
		type: "POST",
		url: "islemler/siparisdurumudegistir.php",	//gönderilecek sayfa.
		data: {ad : rb, gelenid : gelen},		//gidecek veriler.
		success:function(cevap){
      if(rb==1)
        rad("1");
      if(rb==2)
        rad("2");
      if(rb==3)
        rad("3");
        if(rb==4)
          rad("4");
		}
	})};
  function rad($id)
  {
    document.getElementById("rb1").checked = false;
    document.getElementById("rb2").checked = false;
    document.getElementById("rb3").checked = false;
    document.getElementById("rb4").checked = false;
    document.getElementById("rb"+$id).checked = true;
  }
</script>
