<html>
<body>
<head>
<script> window.onload = function(){ navigator.vibrate([500]); } </script>
<?php
include_once "veritabani.php";
@session_start();
ob_start();
error_reporting(0);
$kul_id = $_SESSION["id"];
$kul_adi = $_SESSION["name"];
date_default_timezone_set('Europe/Istanbul');
$bugun = date("Y-m-d");
$gdr =odbc_exec($conn," 
 SELECT SUM(toplam)toplam,st.adi,bt.tip
  FROM 
  
  [online_ciro].[dbo].[belge_tanim] as bt
  inner join kasa_tanim as ks on ks.no = bt.kasa_no
  inner join sube_tanim as st on st.id= ks.sube_id
  where tarih between '$bugun' and '$bugun' and 
  iptal=0 and
  tip like '%DER PUSULAS%' 
  group by st.adi	,tip

 ");

while($ver=odbc_fetch_array($gdr)){
	
	$gider += $ver["toplam"];
}
	
$ona =odbc_exec($conn," 
  
    SELECT SUM(toplam)toplam,st.adi,bt.tip
  FROM 
  
  [online_ciro].[dbo].[belge_tanim] as bt
  inner join kasa_tanim as ks on ks.no = bt.kasa_no
  inner join sube_tanim as st on st.id= ks.sube_id
  where tarih between '$bugun' and '$bugun' and 
  iptal=0  AND tip != 'GİDER PUSULASI'  group by st.adi,tip	

  ");
  
   while($kay=odbc_fetch_array($ona)){
	   
  
  $topciro += $kay["toplam"];
 

	

 
  }
  echo 	"<font size=2 color=red >$gider ₺</font>";
    $toplamciro = $topciro-$gider-$gider;
  $btoplamciro = number_format($toplamciro, 2, ',', '.');
  
?>



<?php echo "<font size=4  ><div class='animated flip'>$btoplamciro ₺</div></font>";

	?>
</head>
</body>
</html>
