<?php include 'includes/header.php';?>
<title><?php echo $dil['148'];?></title>
<meta name="description" content="sipariş tamamla">
<meta name="keywords" content="sipariş tamamla,">
<meta name="author" content="ParsTech">

<style type="text/css">
  .show{
    display: block!important;
}
</style>

<body class="mobile_panel black_theme">
    <!-- Sepet_Urunler_Wrapper -->
    <div class="cart_product_wrapper">
        <div class="container">
            <div class="cart_product_list flex justify-start items-start text-center flex-col pt-8">
                <div class="product_detail_title "><?php echo $dil['148'];?></div>

                <?php

                if(!$_SESSION['user']){
                    echo ' 
                    <div class="alert alert-warning mb-12" role="alert">
                    ' . $dil['164'] . '  <a href="kayit-ol"> ' . $dil['165'] . ' </a>
                    </div> 

                    ';
                }

                ?>



                <div class="cart_section_title"><?php echo $dil['090'];?></div>

                <!-- Sepet Urunler_Start -->

                <?php 
                //print_r($_SESSION['sepet']);
                if(count($_SESSION['sepet']) > 0){
                  $toplam2=0;
                  foreach ($_SESSION['sepet'] 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);

                    $urun = cevir("product",$urun,$_SESSION["dil"]);

                    $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." TL / ";
                            }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="cart_product card border-0 shadow-light mb-4 w-full">
                        <div class="card-body">
                            <div class="row siparis_tamamla_box">
                                <div class="col-auto w-100px pr-0 align-self-center">
                                    <div class="h-80 position-relative">
                                        <div class="background background-h-100" style="background-image: url(img/<?=$urun['foto']?>);">
                                            <img src="img/<?=$urun['foto']?>" alt="" style="display: none;">
                                        </div>
                                    </div>
                                </div>
                                <div class="col flex flex-col justify-between items-start">
                                    <div class="flex flex-col">
                                     <p class="mb-1"><a href="#" class="text-default"><?=$array['qty']?> x <?=$urun['product_name']?> <font  style="font-size: 14px">+ <?= $fiyat ?> TL</font> <font style="font-size: 14px"><?php if($porsyon['portion']){
                                        echo "/ ".$porsyon['portion'] ." + " .$pfiyat . "TL";
                                    }?> </font></a></p>
                                    <p style="font-size: 13px">+<?=$ekstralara;?></p>

                                    <p class="text-success my-0"><?=$toplam?> TL</sup></p>
                                </div>

                            </div>

                        </div>
                    </div>
                </div>


                <?php
            }

        }else{
            echo $dil['152'];
        }

        ?> 


        <div class="cart_section_title"><?php echo $dil['145'];?></div>
        <div class="col-lg-12 urun_tabs">
            <!-- Nav tabs -->
            <ul class="nav nav-pills nav-justified" role="tablist">
                <li class="nav-item waves-effect waves-light">
                    <a class="nav-link active" data-toggle="tab" href="#home-1" role="tab" aria-selected="true"><?php echo $dil['146'];?></a>
                </li>
                <? if(!isset($_SESSION["masa_no"])){ ?>
                    <li class="nav-item waves-effect waves-light">
                        <a class="nav-link" data-toggle="tab" href="#profile-1" role="tab" aria-selected="false"><?php echo $dil['147'];?></a>
                    </li>
                <?php } ?>
                  <!--   <li class="nav-item waves-effect waves-light">
                        <a class="nav-link" data-toggle="tab" href="#settings-1" role="tab" aria-selected="false">Gel Al Servis</a>
                    </li> -->
                </ul>

                <!-- Tab panes -->
                <div class="tab-content">
                    <div class="tab-pane p-3 active" id="home-1" role="tabpanel">


                       <div class="flex flex-row justify-between items-center w-full mb-0">
                        <label class="standart_label text-left mb-1 font-semibold" for="masano"><?php echo $dil['023'];?>: <span id="table_no">
                            <?php 
                            $masa  = $dbh->prepare("SELECT * FROM masa_no where id=? ");
                            $masa-> execute(array( $_SESSION["masa_no"]));
                            $masa  = $masa->fetch(PDO::FETCH_ASSOC);
                            echo $masa['masa_adi'];
                            ?>

                        </span></label>


                        <? if(!isset($_SESSION["masa_no"])){ ?>
                           <a href="qrsayfa.php" class="qrcode_button btn btn-secondary">
                            <img class="" src="images/icons/black/qr-code.svg">
                            <span><?php echo $dil['025'];?></span>
                        </a>

                    <? } ?>


                </div>
                <? if(!isset($_SESSION["masa_no"])){ ?>
                    <label class="text-danger text-left mb-1 font-semibold -mt-2 mb-4" for="qrkod"><?php echo $dil['024'];?></label>
                <?php  }?>


                <form class="cmxform" id="ContactForm" method="post" action="yeni_sip.php"  data-xhr="true">
                    <div class="cart_section_title"><?php echo $dil['091'];?></div>
                    <div class="form-group flex flex-col justify-start w-full mb-4">
                        <label class="text-left mb-1 font-semibold standart_label" for="adisoyadi"><?php echo $dil['026'];?>*</label>
                        <input type="text" name="adisoyadi" placeholder="<?php echo $dil['026'];?>" id="adisoyadi" value="" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" required="">
                    </div>

                    <!-- Sepet Urunler_End -->
                    <div class="cart_section_title"><?php echo $dil['092'];?></div>

                    <?php

                    $odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=4 && status=1 ");
                    $odemesecenek-> execute(array());
                    $odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
                    if($odemesecenek){ ?>
                        <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
                            <input type="radio" class="custom-control-input" checked="" name="paymentm" id="customCheck10" value="kasa">
                            <label class="custom-control-label standart_label" for="customCheck10"><?php echo $dil['093'];?></label>
                        </div>
                    <?php } ?>
                    <?php

                    $odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=1 && status=1 ");
                    $odemesecenek-> execute(array());
                    $odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
                    if($odemesecenek){ ?>
                        <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
                            <input type="radio" class="custom-control-input" checked="" name="paymentm" id="kartodeme" value="kart">
                            <label class="custom-control-label standart_label" for="kartodeme"><?php echo $dil['094'];?></label>
                        </div>
                    <?php } ?>


                    <div class="card border-0 shadow-light mb-4">
                        <div class="card-body">
                            <?php 
                            if($_SESSION['indirim']){
                                $kodkontrol = $dbh -> prepare("SELECT * FROM coupon WHERE coupon_code = ?");
                                $kodkontrol-> execute(array($_SESSION['indirim']));
                                $kodkontrol = $kodkontrol->fetch(PDO::FETCH_OBJ);
                                if($kodkontrol->status==2 || $toplam2<$kodkontrol->minimum_amount){
                                    echo $toplam2."  ".$kodkontrol->minimum_amount;
                                    $_SESSION['indirim']="";
                                }
                            }
                            ?>
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item"><span><?php echo $dil['070'];?></span> <span class="float-right font-weight-bold"> <?= $toplam2?> TL</span></li>
                                <!--  <li class="list-group-item"><span>Vergi</span> <span class="float-right font-weight-bold">₺ 18</span></li> -->
                                <?php 

                                $indirim = $dbh -> prepare("SELECT * FROM coupon WHERE coupon_code = ?");
                                $indirim-> execute(array($_SESSION['indirim']));
                                $indirim = $indirim->fetch(PDO::FETCH_OBJ);

                                ?>
                                <li class="list-group-item"><span><?php echo $dil['095'];?></span> <span class="float-right font-weight-bold text-success"><?php if($indirim){echo $indirim->discount_amount."TL";
                                $indt= $indirim->discount_amount;
                            }else{echo "0 TL";} ?>

                        </span></li>

                        <li class="list-group-item"><span class=" font-weight-bold"><?php echo $dil['095'];?></span> <span class="float-right font-weight-bold"><?php
                        echo $toplam2- $indt; 
                        ?>TL</span></li>
                    </ul>
                </div>
            </div>

            <input type="hidden" name="siptip" id="siptip" value="masa">

            <button type="submit" class=" btn btn-lg btn-default default-shadow btn-block">

              <div class="spinner-border" style="    width: 1rem;
              height: 1rem;display: none" id="yukleniyorm" role="status">
              <span class="sr-only">Loading...</span>
          </div>
          <?php echo $dil['071'];?> <span class="ml-2 icon arrow_right"></span></button>


      </form>











  </div>

  <div class="tab-pane p-3" id="profile-1" role="tabpanel">

   <form class="cmxform" id="ContactForm" method="post" action="yeni_sip.php"  data-xhr="true">



     <div class="cart_section_title"><?php echo $dil['091'];?></div>
     <div class="form-group flex flex-col justify-start w-full mb-4">
        <label class="text-left mb-1 font-semibold standart_label" for="adisoyadi"><?php echo $dil['026'];?>*</label>
        <input type="text" name="adisoyadi" placeholder="<?php echo $dil['026'];?>" id="adisoyadi" value="<?=$_SESSION['user']->name;?>" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" required="">
    </div>
    <div class="form-group flex flex-col justify-start w-full">
        <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['040'];?>*</label>
        <input type="text" name="telefon" placeholder="<?php echo $dil['040'];?>" id="telefon" value="<?=$_SESSION['user']->phone;?>" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" required="">
    </div>
    <div class="form-group flex flex-col justify-start w-full">
        <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['031'];?>*</label>
        <input type="text" name="mail" placeholder="<?php echo $dil['031'];?>" id="telefon" value="<?=$_SESSION['user']->mail;?>" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" required="">
    </div>




    <h4 class="cart_section_title"><?php echo $dil['097'];?></h4>

    <div class="contactform">
        <div class="checkout_select" style="padding: 10px 0 20px 0%;">


            <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
                <input type="radio" class="custom-control-input" checked="" name="teslimat" id="adrese" onclick="adresdiger(0)" value="0" checked="checked">
                <label class="custom-control-label standart_label" for="adrese"><?php echo $dil['098'];?></label>
            </div>
            <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
                <input type="radio" class="custom-control-input"  name="teslimat" id="gelipal" onclick="adresdiger(1)" value="1">
                <label class="custom-control-label standart_label" for="gelipal"><?php echo $dil['099'];?></label>
            </div>


            <div class="carttotal_row_last show" id="adres_sec" style="display: none" >

                <h4 class="cart_section_title"><?php echo $dil['168'];?></h4>





                <?php  if($_SESSION['user']){  ?>
                    <div class="form-group flex flex-col justify-start w-full">
                        <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['166'];?>*</label>

                        <select name="adressec" onchange="adressecc(this);" id="slct" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" >
                          <option value=""><?php echo $dil['166'];?></option>
                          <?php 
                          $adresler      =   $dbh->prepare("SELECT * FROM users_adress WHERE uye=?  order by id desc");
                          $adresler      ->  execute(array($_SESSION['user']->id));
                          $adresler      =   $adresler      ->fetchAll(PDO::FETCH_OBJ);
                          foreach ($adresler as $adres) {?>
                            <option value="<?=$adres->id?>" ><?=$adres->baslik?></option>
                        <?php } ?>
                        <option value="ekleadres"><?php echo $dil['167'];?></option>

                    </select>
                </div>
            <?php } ?>
            <div id="adresim">


             <div class="form-group flex flex-col justify-start w-full">
                <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['169'];?>*</label>

                <select name="sehir"  id="slct" onchange="ilcegetir(this)" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" >
                  <option value=""><?php echo $dil['170'];?></option>

                  <?php 

                  $sehirler = $dbh -> prepare("SELECT * FROM sehir where aktif=1 order by sehir_title");
                  $sehirler-> execute(array());
                  $sehirler = $sehirler->fetchAll(PDO::FETCH_OBJ);
                  foreach ($sehirler as $sehir) { ?>
                    <option value="<?=$sehir->sehir_key?>"><?=$sehir->sehir_title?></option>
                <?php } ?>
            </select>
        </div>

        <div class="form-group flex flex-col justify-start w-full">
            <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['171'];?>*</label>

            <select name="ilce"  id="slctilce"  onchange="mahallegetir(this)"  class="form_input required w-full text-sm py-2  pl-2 rounded-lg" >
              <option value=""><?php echo $dil['172'];?></option>
          </select>
      </div>

      <div class="form-group flex flex-col justify-start w-full">
        <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['096'];?>*</label>

        <select name="mah"  id="slctmahalle" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" >
          <option value=""><?php echo $dil['173'];?></option>

      </select>
  </div>

  <div class="form-group flex flex-col justify-start w-full">
    <label class=" text-left mb-1 font-semibold standart_label" for="telefon"><?php echo $dil['134'];?>*</label>
    <textarea name="adres" class="form_input required w-full text-sm py-2  pl-2 rounded-lg" placeholder="<?php echo $dil['134'];?>" ></textarea>
</div>

</div>
</div>



<h4 class="cart_section_title"><?php echo $dil['100'];?></h4>

<div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
    <input type="radio" class="custom-control-input" checked="" id="adresep" name="teslimattarih"  onclick="teslimt(0)" value="0" >
    <label class="custom-control-label standart_label" for="adresep"><?php echo $dil['101'];?></label>
</div>
<div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
    <input type="radio" class="custom-control-input"  id="degert" name="teslimattarih"  onclick="teslimt(1)" value="1">
    <label class="custom-control-label standart_label" for="degert"><?php echo $dil['102'];?>:</label>
</div>




<div class="" id="teslimat_tarih_diger_content" style="    display: none;">
  <div class="form-group flex flex-col justify-start w-1/2 " style="float: left;    padding: 10px;">

    <input type="date" name="teslimtarih" placeholder="10.10.2021" min="<?=date('Y-m-d')?>"  value="<?=date('Y-m-d')?>" class="form_input  w-full text-sm py-2  pl-2 rounded-lg"  >
</div>
<div class="form-group flex flex-col justify-start w-1/2" style="    padding: 10px;">
    <input type="time" name="teslimsaat" value="<?=date('H:i')?>" class="form_input  w-full text-sm py-2  pl-2 rounded-lg"  >
</div>
<!--       <textarea name="teslim" class="form_textarea textarea required" placeholder="Teslim Saati Yazınız"></textarea> -->

</div>




</div>
</div>







<div class="cart_section_title"><?php echo $dil['092'];?></div>
<?php

$odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=4 && status=1 ");
$odemesecenek-> execute(array());
$odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
if($odemesecenek){ ?>
    <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4 " style="display: none;" id="kasadaodeme">
        <input type="radio" class="custom-control-input" checked="" name="payment" id="customCheck10s" value="kasa">
        <label class="custom-control-label standart_label" for="customCheck10s"><?php echo $dil['093'];?></label>
    </div>
<?php } ?>

<?php

$odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=2 && status=1 ");
$odemesecenek-> execute(array());
$odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
if($odemesecenek){ ?>

    <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
        <input type="radio" class="custom-control-input" checked="" name="payment" id="customCheck10p" value="kapida">
        <label class="custom-control-label standart_label" for="customCheck10p">Kapıda Nakit</label>
    </div>
<?php } ?>
<?php

$odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=3 && status=1 ");
$odemesecenek-> execute(array());
$odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
if($odemesecenek){ ?>

    <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4" >
        <input type="radio" class="custom-control-input" checked="" name="payment" id="customCheck10ps" value="kapidakart">
        <label class="custom-control-label standart_label" for="customCheck10ps">Kapıda Kredi Kartı</label>
    </div>
<?php } ?>
<?php

$odemesecenek  = $dbh->prepare("SELECT * FROM payments_settings where id=1 && status=1 ");
$odemesecenek-> execute(array());
$odemesecenek  = $odemesecenek->fetch(PDO::FETCH_OBJ);
if($odemesecenek){ ?>
    <div class="form-group_child w-fullx sm:w-fullx md:w-1/2 lg:w-1/2 xl:w-1/2 mb-4">
        <input type="radio" class="custom-control-input" checked="" name="payment" id="kartodemep" value="kart">
        <label class="custom-control-label standart_label" for="kartodemep"><?php echo $dil['105'];?></label>
    </div>
<?php } ?>

<div class="card border-0 shadow-light mb-4">
    <div class="card-body">
        <ul class="list-group list-group-flush">
          <li class="list-group-item"><span><?php echo $dil['070'];?></span> <span class="float-right font-weight-bold"><?= $toplam2?> TL</span></li>
          <!--  <li class="list-group-item"><span>Vergi</span> <span class="float-right font-weight-bold">₺ 18</span></li> -->
          <?php 

          $indirim = $dbh -> prepare("SELECT * FROM coupon WHERE coupon_code = ?");
          $indirim-> execute(array($_SESSION['indirim']));
          $indirim = $indirim->fetch(PDO::FETCH_OBJ);

          ?>
          <li class="list-group-item"><span><?php echo $dil['095'];?></span> <span class="float-right font-weight-bold text-success"><?php if($indirim){echo $indirim->discount_amount."TL";
          $indt= $indirim->discount_amount;
      }else{echo "0 TL";} ?>

  </span></li>

  <li class="list-group-item"><span class=" font-weight-bold"><?php echo $dil['070'];?></span> <span class="float-right font-weight-bold"><?php
  echo $toplam2- $indt; 
  ?> TL</span></li>
</ul>
</div>
</div>

<input type="hidden" name="siptip" id="siptipp" value="paket">

<button type="submit" class=" btn btn-lg btn-default default-shadow btn-block">

    <div class="spinner-border" style="    width: 1rem;
    height: 1rem;display: none" id="yukleniyor" role="status">
    <span class="sr-only">Loading...</span>
</div>
<?php echo $dil['071'];?><span class="ml-2 icon arrow_right"></span></button>
</form>



</div>
<div class="tab-pane p-3" id="settings-1" role="tabpanel">
    <p class="text-muted mb-0">
        Trust fund seitan letterpress, keytar raw denim keffiyeh etsy.
    </p>
</div>
</div>      
</div><!--end col-->


</div>
<!-- Masa Sipariş Bİlgileri -->

</div>

<!-- Paket Sipariş Bİlgileri -->


<!-- Sepet Detaylar -->

  <!--   <div class="input-group text-center mb-4">
        <input type="text" class="form-control" placeholder="İndirim Kuponu">
        <div class="input-group-append">
            <button class="btn btn-success px-3" type="button"><i class="material-icons h6 my-0">done</i> Uygula</button>
        </div>
    </div>
    <div class="alert alert-success mb-4" role="alert">
        İndirim kuponu başarıyla uygulandı!
    </div>
    <div class="alert alert-warning mb-4" role="alert">
        İndirim kuponu tarihi geçmiş!
    </div>
    <div class="alert alert-danger mb-4" role="alert">
        İndirim kuponu yanlış veya eksik !
    </div> -->

    <!-- Sepet Detaylar End -->


</div>
</div>
<?php include 'includes/modal.php';?>
<?php include 'includes/footer.php';?>

<script type="text/javascript">
  function adresdiger(id){
    var panelga = document.getElementById("adres_sec");

    if(id==0){
      panelga.classList.add('show');
    $('#kasadaodeme').hide();

  }else{
    $('#kasadaodeme').show();

      panelga.classList.remove('show');
  }
}
function teslimt(id){
    var panelga = document.getElementById("teslimat_tarih_diger_content");

    if(id==1){
      panelga.classList.add('show');
  }else{

      panelga.classList.remove('show');
  }
}
</script>


<script>
    function opensip(evt, sipname) {
      var i, tabcontent, tablinks;
      tabcontent = document.getElementsByClassName("tabcontent");
      for (i = 0; i < tabcontent.length; i++) {
        tabcontent[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("tablinks");
    for (i = 0; i < tablinks.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" active", "");
    }
    document.getElementById(sipname).style.display = "block";
    evt.currentTarget.className += " active";
}


function adressecc(selectObject) {
  var value = selectObject.value;

  $.ajax({
    url:"post/adressec.php",
    data    :'id='+value,
    type    : 'POST',
    success : function(sonuc){
        $('#adresim').html(sonuc); 

    }
});

}


function ilcegetir(selectObject) {
  var value = selectObject.value;

  $.ajax({
    url:"post/adresislem.php",
    data    :'tur=ilcegetir&id='+value,
    type    : 'POST',
    success : function(sonuc){
        $('#slctilce').html(sonuc); 

    }
});

}

function mahallegetir(selectObject) {
  var value = selectObject.value;

  $.ajax({
    url:"post/adresislem.php",
    data    :'tur=mahallegetir&id='+value,
    type    : 'POST',
    success : function(sonuc){
        $('#slctmahalle').html(sonuc); 

    }
});

}
</script>