<script>
$(document).ready(function() {

        $("#divimiz").load("hedef/veriler.php");

});

setInterval(function() {$("#divimiz").load('hedef/veriler.php');}, 1000);







</script>

<script type="text/javascript"> 

function stopRKey(evt) { 
  var evt = (evt) ? evt : ((event) ? event : null); 
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); 
  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;} 
} 

document.onkeypress = stopRKey; 

</script>


<script>
(function($){
    $(document).on("keyup", "#DOKTOR_ID",function(){
		var DOKTOR_ID = $("#DOKTOR_ID").val();
		if (DOKTOR_ID.length > 2){ // aranılan kelime 2 harften fazla olmallı
            $.ajax({
                type: "POST",
                url: "hedef/source.php",
                data: {
                    sehir: DOKTOR_ID,
                },
                error: function (xhr, textStatus, errorThrown) {
                    alert('Hata: ' + xhr.responseText);
                },
                success: function (data) {
				    $("#menuac").addClass('open');
                    $("#liyapistir").html(data)
                }
            });
		}
	});
	$(document).on("click", "#liyapistir li a",function(){
		$("#DOKTOR_ID").val($(this).html());
		$("#menuac").removeClass('open');
	});
	$(document).on("click", "body",function(){
		$("#menuac").removeClass('open');
	});
})(jQuery);
</script>





	

<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox -->
<link rel="stylesheet" href="fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

<!-- Optionally add helpers - button, thumbnail and/or media -->
<link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>

<link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>






<script type="text/javascript">
	$(document).ready(function() {
	$(".various").fancybox({
		maxWidth	: 800,
		maxHeight	: 600,
		fitToView	: false,
		width		: '70%',
		height		: '70%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none'
	});
});
</script>


<?php
include('../baglan.php');


$baglan = mysql_query("select * from doktorlar"); 


$yaz = mysql_fetch_assoc($baglan); // while dongsu icine almadim tek veri cekecegimiz icin. burda get methodunu da kullandık

?>


<div class="box">
<form name="form1" method="post" action="admin.php?target=satisekle-islem">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active">
 <a href="#tab_1" data-toggle="tab">Satış Bilgileri</a></li>

<BR>
<? echo $_SESSION["kullanici_adi"];?>


                                </ul>
<div class="tab-content" >


<div class="tab-pane active" id="tab_1">
<div class="box box-success">
              


 <div class="box-body">
<input name="SATIS_ID" type="hidden" id="SATIS_ID" size="20" />
 <input name="SATIS_TURU" type="hidden" id="SATIS_TURU" value="Satis" size="20" />
<label>Ürün Adı</label>
<select name="SATIS_URUN_ADI" id="SATIS_URUN_ADI" class="form-control   select2-hidden-accessible"   aria-hidden="true" required>
 
     <?php include('baglan.php'); 
$sql = mysql_query("SELECT * FROM urunler"); 
while ($a = mysql_fetch_array($sql)) {
if ($yaz[SATIS_URUN_ADI] == $a[URUN_LINK]){ $durum=  'selected="selected"'; } else { $durum =''; }?>
  
<option value="<?php echo $a['URUN_LINK']?>" <?php echo $durum; ?> ><?php echo $a[URUN_ADI];?></option>

<?php } ?>
</select>
 <BR>

<label>Ürün Fiyatı</label>
<select name="SATIS_TUTARI" id="SATIS_TUTARI" class="form-control   select2-hidden-accessible"   aria-hidden="true" required>
 
     <?php include('baglan.php'); 
$sql = mysql_query("SELECT * FROM urunler"); 
while ($a = mysql_fetch_array($sql)) { if ($yaz[SATIS_URUN_ADI] == $a[URUN_LINK]){ $durum=  'selected="selected"'; } else { $durum =''; }?>
<option value="<?php echo $a['URUN_FIYAT']?>" <?php echo $durum; ?> ><?php echo $a[URUN_ADI];?> - <?php echo $a[URUN_FIYAT];?>  </option>

<?php } ?>
</select>
 <BR>
 
 <label>Ürün Kullanımı</label>
<select name="SATIS_URUN_KULLANIM" id="SATIS_URUN_KULLANIM" class="form-control   select2-hidden-accessible"   aria-hidden="true" required>
<option value="Oral">Oral</option>
<option value="Enjeksiyon">Enjeksiyon</option>
</select>
 


 <BR>

<label>Satış Adet</label>
<input name="SATIS_ADET" type="text" class="form-control"  id="SATIS_ADET" size="63"  required/> 
 
<input name="SATIS_DEPRESANT" type="hidden" id="SATIS_DEPRESANT" value="<? echo $_SESSION["kullanici_adi"];?>" size="20" />

<label>Satış Tarihi</label>

 <input type="date"   name="SATIS_TARIH" id="SATIS_TARIH" class="form-control"  min="2022-01-01" max="2022-12-31" required >
 <BR>
<label>Ürün Reçete Eden Hekim Adı ve Soyadı</label>
<select name="SATIS_ALAN_HEKIM" id="SATIS_ALAN_HEKIM"   class="form-control">
        <?php include('baglan.php'); 

 
$mesut=$_SESSION["kullanici_adi"];
$sql = mysql_query("SELECT * FROM doktorlar where DOKTOR_SORUMLU_KODU='$mesut'"); 
while ($a = mysql_fetch_array($sql)) {
if ($yaz[SATIS_ALAN_HEKIM] == $a[DOKTOR_ADI]){ $durum=  'selected="selected"'; } else { $durum =''; }?>
    


<option value="<?php echo $a[DOKTOR_ADI];?>" <?php echo $durum; ?> ><?php echo $a[DOKTOR_ADI];?></option>
 
<?php } ?>
          </select>
 
 
 
  <BR>
    

<label>Eczane Adı</label>
<select name="SATIS_ECZANE" id="SATIS_ECZANE"   class="form-control">
        <?php

$mesut=$_SESSION["kullanici_adi"];
 include('baglan.php'); 
$sql = mysql_query("SELECT * FROM eczane WHERE  DOKTOR_SORUMLU_KODU='$mesut'"); 
while ($a = mysql_fetch_array($sql)) {
if ($yaz[SATIS_ECZANE] == $a[DOKTOR_ADI]){ $durum=  'selected="selected"'; } else { $durum =''; }?>
      
<option value="<?php echo $a[DOKTOR_ADI];?>" <?php echo $durum; ?> ><?php echo $a[DOKTOR_ADI];?></option>

<?php } ?>
          </select>

 
        <div class="input-group-btn" id="menuac">
          <ul class="dropdown-menu" id="liyapistir">
          </ul>
        </div>
  
 




 
  <BR>

 

<label>Hekim Grubu</label>
<select name="SATIS_BRANS" id="SATIS_BRANS" class="form-control   select2-hidden-accessible"   aria-hidden="true" required>
 
<option value="Ortopedi">Ortopedi</option>
<option value="Uroloji">Üroloji </option>
</select>
  <BR>
 
 <label>ÜRÜN KULLANIMI</label>
<select name="SATIS_URUN_KULLANIM" id="SATIS_URUN_KULLANIM" class="form-control   select2-hidden-accessible"   aria-hidden="true" required>
<option value="Oral">Oral</option>
<option value="Enjeksiyon">Enjeksiyon</option>
</select>
 
  <BR>
 <label>SATIŞ İL</label>

<select class="form-control " name="SATIS_IL" id="SATIS_IL" required>
    <option value="">Lütfen Seçiminizi Yapınız</option>
    <option value="Adana">ADANA</option>
    <option value="Adiyaman">ADIYAMAN</option>
    <option value="Afyonkarahisar">AFYONKARAHİSAR</option>
    <option value="Agri">AĞRI</option>
    <option value="Aksaray">AKSARAY</option>
    <option value="Amasya">AMASYA</option>
    <option value="Ankara">ANKARA</option>
    <option value="Antalya">ANTALYA</option>
    <option value="Ardahan">ARDAHAN</option>
    <option value="Artvin">ARTVİN</option>
    <option value="Aydin">AYDIN</option>
    <option value="Balikesir">BALIKESİR</option>
    <option value="Bartin">BARTIN</option>
    <option value="Batman">BATMAN</option>
    <option value="Bayburt">BAYBURT</option>
    <option value="Bilecik">BİLECİK</option>
    <option value="Bingöl">BİNGÖL</option>
    <option value="Bitlis">BİTLİS</option>
    <option value="Bolu">BOLU</option>
    <option value="Burdur">BURDUR</option>
    <option value="Bursa">BURSA</option>
    <option value="Canakkale">ÇANAKKALE</option>
    <option value="">ÇANKIRI</option>
    <option value="">ÇORUM</option>
    <option value="">DENİZLİ</option>
    <option value="">DİYARBAKIR</option>
    <option value="">DÜZCE</option>
    <option value="">EDİRNE</option>
    <option value="">ELAZIĞ</option>
    <option value="">ERZİNCAN</option>
    <option value="">ERZURUM</option>
    <option value="">ESKİŞEHİR</option>
    <option value="">GAZİANTEP</option>
    <option value="">GİRESUN</option>
    <option value="">GÜMÜŞHANE</option>
    <option value="">HAKKARİ</option>
    <option value="">HATAY</option>
    <option value="">IĞDIR</option>
    <option value="">ISPARTA</option>
    <option value="">İSTANBUL</option>
    <option value="">İZMİR</option>
    <option value="">KAHRAMANMARAŞ</option>
    <option value="">KARABÜK</option>
    <option value="">KARAMAN</option>
    <option value="">KARS</option>
    <option value="">KASTAMONU</option>
    <option value="">KAYSERİ</option>
    <option value="">KIRIKKALE</option>
    <option value="">KIRKLARELİ</option>
    <option value="">KIRŞEHİR</option>
    <option value="">KİLİS</option>
    <option value="">KOCAELİ</option>
    <option value="">KONYA</option>
    <option value="">KÜTAHYA</option>
    <option value="">MALATYA</option>
    <option value="">MANİSA</option>
    <option value="">MARDİN</option>
    <option value="">MERSİN</option>
    <option value="">MUĞLA</option>
    <option value="">MUŞ</option>
    <option value="">NEVŞEHİR</option>
    <option value="">NİĞDE</option>
    <option value="">ORDU</option>
    <option value="">OSMANİYE</option>
    <option value="">RİZE</option>
    <option value="">SAKARYA</option>
    <option value="">SAMSUN</option>
    <option value="">SİİRT</option>
    <option value="">SİNOP</option>
    <option value="">SİVAS</option>
    <option value="">ŞANLIURFA</option>
    <option value="">ŞIRNAK</option>
    <option value="">TEKİRDAĞ</option>
    <option value="">TOKAT</option>
    <option value="">TRABZON</option>
    <option value="">TUNCELİ</option>
    <option value="">UŞAK</option>
    <option value="">VAN</option>
    <option value="">YALOVA</option>
    <option value="">YOZGAT</option>
    <option value="">ZONGULDAK</option>
       </select>


  <BR>

 <label>SATIŞ İLÇE</label>

<input name="SATIS_ILCE" type="text" class="form-control"  id="SATIS_ILCE" size="63"  required />
 

  
 
                  
                </div><!-- /.box-body -->
              </div><!-- /.box -->

<input name="button" type="submit"  class="btn btn-block btn-success" id="button" value="Satış Ekle" width="200"/>

</div>

  







 



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

                                </div><!-- /.tab-content -->










 
                            </div><!-- nav-tabs-custom -->
                        </div>

</form>


</div>