 

 <?php
header ("Content-Type: text/html; charset=iso-8859-9");
session_start();
ob_start();

 $tarih     = date('d.m.Y H:i:s');

?>

 

 
<?php
include('../baglan.php');
include('../css.php');
 
 
if(isset($_GET['DOKTOR_ID'])) $DOKTOR_ID= $_GET['DOKTOR_ID'];
$baglan = mysql_query("select * from eczane where DOKTOR_ID='$DOKTOR_ID'"); 


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

?>
<script type="text/javascript">
			function update() {
				var select = document.getElementById('SATIS_TUTARI');
				var option = select.options[select.selectedIndex];

				document.getElementById('value').value = option.value;
				document.getElementById('text').value = option.text;
 document.getElementById('id').value = option.id;
			}

			update();
		</script>


<div class="box">
<form name="form1" method="post" action="konsinyeekle-islem.php">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active">
 <a href="#tab_1" data-toggle="tab">Konsinye Bilgileri</a></li>

<BR>
<?php

 
 $sorumlu_kodu=$_SESSION["kullanici_adi"];
echo  $sorumlu_kodu;
?>
                                </ul>
<div class="tab-content" >


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


 <div class="box-body">
<input name="KONSINYE_ID" type="hidden" id="KONSINYE_ID" size="20" />
 <input name="KONSINYE_TURU" type="hidden" id="KONSINYE_TURU" value="Konsinye" size="20" />
   <input name="KONSINYE_GIRIS" type="hidden" id="KONSINYE_GIRIS" value="<? echo $tarih;?>" size="20" />





<label>Eczane Adı</label>
  <br>

<input name="KONSINYE_ECZANE" id="KONSINYE_ECZANE" class="form-control   select2-hidden-accessible" value="<? echo $yaz["DOKTOR_ADI"];?>" size="20" readonly />
 
       
  <BR>
 




<label>Konsinye Ürün Adı</label>
<select name="SATIS_TUTARI" id="SATIS_TUTARI" class="form-control   select2-hidden-accessible"   aria-hidden="true"  onChange="update()" required />
    <option value="">Lütfen Önce Seçiminizi Yapınız</option>
     <?php include('../baglan.php'); 
$sql = mysql_query("SELECT * FROM urunler where URUN_DURUM='Aktif' and URUN_DEPRESANT LIKE '%$sorumlu_kodu%' Order By URUN_ADI asc"); 
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; ?>  id="<?php echo $a['URUN_KULLANIM']?>"><?php echo $a[URUN_LINK];?>  </option>

<?php } ?>
</select>

<label>Konsinye Ürün Kasa Tutarı</label>

		<input type="text" id="value" class="form-control   select2-hidden-accessible"  readonly>
<br>
<input type="text" name="KONSINYE_URUN_ADI" id="text" class="form-control   select2-hidden-accessible"  readonly>
 <br>
<input type="text" name="KONSINYE_KULLANIM"  id="id" class="form-control   select2-hidden-accessible"  readonly>
 
 <BR>

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

<label>Konsinye Tarihi</label>

 <input type="date"   name="KONSINYE_TARIH" id="KONSINYE_TARIH" class="form-control"  min="2025-01-01" max="2025-12-31" required >
  
    


 
  <BR>

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

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

</div>

  







 



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

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










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

</form>


</div>	