isLoggedIn())
{
header ("location: ../login.php");
exit();
}
if(isset($_POST['selected_customer']))
{
$selected_customer=$_POST['selected_customer'];
$date_range=$_POST['date_range'];
$dates=explode(':',$date_range);
$date1=$dates[0];
$date2=$dates[1];
}
$first_name=$dbf->idToField($cfg_tableprefix.'customers','first_name',$selected_customer);
$last_name=$dbf->idToField($cfg_tableprefix.'customers','last_name',$selected_customer);
$display_name=$first_name.' '.$last_name;
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
$display->displayTitle("$cfg_company $lang->customerReport");
$tableheaders=array("$lang->rowID","$lang->date","$lang->itemsPurchased","$lang->paidWith","$lang->soldBy","$lang->saleSubTotal","$lang->saleTotalCost","$lang->showSaleDetails");
$tablefields=array('id','date','items_purchased','paid_with','sold_by','sale_sub_total','sale_total_cost','sale_details');
$display->displayReportTable("$cfg_tableprefix",'sales',$tableheaders,$tablefields,'customer_id',"$selected_customer","$date1","$date2",'date',"$lang->listOfSalesFor $display_name
$lang->between $date1 $lang->and $date2");
?>