<?php require('header.php'); ?>
    <div>
        <ul class="breadcrumb">
            <li>
                <a href="posnet.php">Ana Sayfa</a>
            </li>
        
        </ul>
    </div>

    <div class="row">
    <div class="box col-md-12">
    <div class="box-inner">
    <div class="box-header well" data-original-title="">
        <h2><i class="glyphicon glyphicon-user"></i>  Cari Listesi</h2>

        <div class="box-icon">
            <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a>
            <a href="#" class="btn btn-minimize btn-round btn-default"><i
                    class="glyphicon glyphicon-chevron-up"></i></a>
            <a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a>
        </div>
    </div>
	  <div class="box-content">
	<form  name=form method=post action="cariliste.php?ck=sor" onSubmit="return kontrol()">
&nbsp;&nbsp;&nbsp;
       <form  name=form method=post action="stok.php?ck=sor" onSubmit="return kontrol()">
&nbsp;&nbsp;&nbsp;<div class="control-group">
     <div class="form-group has-success col-md-4">
		    <label class="control-label"  for="ara">Cari Kodu</label><br>
                    <input type="text" value="" class="form-control" name="araa">
					 <label class="control-label" for="ara">Cari Adı</label>
                    <input type="text" value=""  class="form-control" name="ara"></div>
          <div class="form-group has-success col-md-4">
		                       
                
                 
                <br><br>
				                    <button type="submit" id="submit" class="btn btn-default">  &nbsp;&nbsp;&nbsp;   Ara    &nbsp;&nbsp;&nbsp; </button>
 </div>
</form>
</tbody>
  
      

     
    




    

	
<?php
$conn = pg_connect("host=localhost dbname=posnet user=postgres password=3641a3641") 
        or die("Failed to create connection to database: ". pg_last_error(). "<br/>");


if ($_POST){
    $ara=$_POST["ara"];
	$araa=$_POST["araa"];
	$say=$_POST["say"];
	
	$tarih = date("Y-m-d"); 
	
	$sql_check = pg_query($conn,"SELECT id, cari_tipi_id, cari_durum, cari_kod, cari_yetkili_adisoyadi, cari_unvan, cari_vergi_daire, cari_vergi_no, cari_adres, cari_fatura_adres, cari_sevk_adres, cari_gsm, cari_telefon, cari_faks, cari_email, cari_anagrup_id, cari_altgrup_id, cari_detaygrup_id, cari_satistoplam_limiti, cari_satishesap_limiti, cari_alistoplam_limiti, cari_alishesap_limiti, cari_iskonto, cari_aylikvade, cari_para_birimi, update_date, update_time, update_user
	FROM posnetshema.cari_tanim where  cari_unvan='%$ara%' or cari_kod='$araa' ");
$satir= pg_fetch_array($sql_check);
if(pg_num_rows($sql_check))  {
	
	
	$fiy1 = $satir['cari_satishesap_limiti'];;
 $vn = $satir["cari_vergi_no"];
$vd = $satir["cari_vergi_daire"];
$fiya1 = number_format($fiy1, 2, ',', '.');



	?><div class="row">
    <div class="box col-md-12">
    <div class="box-inner">
    <div class="box-header well" data-original-title="">
        <h2><i class="glyphicon glyphicon-list-alt"></i></h2>

        <div class="box-icon">
            <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a>
            <a href="#" class="btn btn-minimize btn-round btn-default"><i
                    class="glyphicon glyphicon-chevron-up"></i></a>
            <a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a>
        </div>
    </div>
	
		    <table class="table table-striped table-bordered responsive">
	<tbody>
    <thead>
    <tr>
        <th>Id</th>
        <th>Kodu</th>
        <th>Cari Ünvanı</th>
		 <th>Vergi Dairesi - Numarası</th>
        <th>Telefon</th>
        <th>Bakiye</th>
		  <th>İşlemler</th>
    </tr>
    </thead>
    
    <tr>
        <td><h4><?php echo $satir["id"]; ?></td>
        <td class="center"><h4><?php echo $satir["cari_kod"]; ?></td>
		<td class="center"><h4><?php echo $satir["cari_unvan"]; ?></td>
		 <td class="center"><b><h4><?php echo "$vd.<br>$vn"; ?></td>
		<td class="center"><h4><?php echo $satir["Telefon1"]; ?></td>
        <td class="center"><b><h4><?php echo "$fiya1"; ?></td>
		
       
           
        </td>
        <td class="center">
		<a href="carihesapdetay.php?ck=cari_sor&Id=<?php echo $satir["Id"]; ?>" id="sumbit"class="btn btn-success">
            
                <i class="glyphicon glyphicon-zoom-in icon-white"></i>
                Hesap Listesi
            </a>
		
          
        </td>
    </tr>
   
  
             </div>
             </div>
    </div><!--/span-->
   

<?php } }
?>
   
<?php require('footer.php'); ?>