<?php

include('connectioni.php');

$sql="select * from s_crec where CA_DATE>'2015-08-12' and CANCELL!='1' and FLAG='REC'";
//echo $sql;
$result = mysqli_query($GLOBALS['dbinv'],$sql);
while ($row = mysqli_fetch_array($result)){
	
	$sql1="select * from s_sttr where ST_REFNO='".$row["CA_REFNO"]."'";
	$result1 = mysqli_query($GLOBALS['dbinv'],$sql1);
	if ($row1 = mysqli_fetch_array($result1)){
		
	} else {
		echo $row["CA_REFNO"]." - ".$row["CA_DATE"]." - ".$row["CA_CODE"]." - ".$row["CA_AMOUNT"]." </br>";
	}
	
}


/*$sql="select * from s_salma where GRAND_TOT=TOTPAY and CANCELL!='1' and SDATE>'2015-05-01'";
echo $sql;
$result = mysqli_query($GLOBALS['dbinv'],$sql);
while ($row = mysqli_fetch_array($result)){
	
	$sql1="select * from s_sttr where ST_INVONO='".$row["REF_NO"]."' ";
	$result1 = mysqli_query($GLOBALS['dbinv'],$sql1);
	if ($row1 = mysqli_fetch_array($result1)){
		
	} else {
		echo $row["REF_NO"]." - ".$row["SDATE"]." - ".$row["C_CODE"]." - ".$row["CUS_NAME"]."- </br>";
	}
	
}*/


?>