<?php require('header.php');
$bugun = date("Y-m-d");
$yenitarih = strtotime('-1 day',strtotime($bugun));
$dun = date('Y-m-d' ,$yenitarih );
						
@session_start();

?>

<body onload="setTimeout('timeout()', 50)"></body>
<div>
        <ul class="breadcrumb">
            <li>
                <a href="posnet.php">Anasayfa</a>
            </li>
            <li>
                <a href="#">Şube Kasa Bazlı Detay</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><?php echo $bugun; ?> &nbsp  Kasa Bazlı Satış Durum</h2>

                    <div class="box-icon">
                        
                        <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 id="main_fb">
   <div id="friend_list">
                <div class="box-content">
                    <table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
                        <thead>
                    <th>Kasa No</th>
        <th>B.Tipi</th>
        <th>B.Adet</th>
		<th>Tutar</th>
        <th>İndirim</th>
               
               
                    
                        </thead>

						<?php 
						
					$ck = @$_GET["ck"];
switch($ck){
case"detay":
 $ad = $_GET["id"];  	

						
	$sorgu=odbc_exec($conn," SELECT 
    
      [kasano]
      ,(case iptalmi when 1 then 'IPTAL '+belgetipi else belgetipi end)as belge
      ,[belgeadeti]
      ,[tutar]
      ,[indirim]
  FROM [POSNET].[dbo].[CIRO] where kasano in (select kasano from MAGAZAKASA where magazano = '$ad') and CAST(tarih AS date) = '$bugun'
  order by kasano 
         
");
  
       while($kayit=odbc_fetch_array($sorgu))
	{	

	
?> 


                        <tbody>
                        <tr>
 <td class="center"><h4><b><?php echo $kayit["kasano"]; ?></td>
        <td class="center"><h4><b><?php echo $kayit["belge"]; ?></td>
		<td class="center"><h4><b><?php echo $kayit["belgeadeti"]; ?></td>
		<td class="center"><h4><b><font color='yellow'><?php echo $kayit["tutar"]; ?></td></font>
		<td class="center"><h4><b><?php echo $kayit["indirim"]; ?></td>
                        </tr>
<?php }} ?>

                      <tr>
					  <td ><center></center></td>
					  <td><center></center></td>
					
					  
					  </tr>
                        </tbody>
                    </table>
                   
                </div>
            </div>
        </div>
    </div><!--/span-->
	</div>
</div>

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

























