PHP Point Of Sale
sale_bg;
$items_table="$cfg_tableprefix".'items';
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit();
}
$display->displayTitle("$lang->newSale");
if(empty($_SESSION['current_sale_customer_id']))
{
$customers_table="$cfg_tableprefix".'customers';
if(isset($_POST['customer_search']) and $_POST['customer_search']!='')
{
$search=$_POST['customer_search'];
$_SESSION['current_customer_search']=$search;
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table WHERE last_name like \"%$search%\" or first_name like \"%$search%\" or id =\"$search\" ORDER by last_name",$dbf->conn);
}
elseif(isset($_SESSION['current_customer_search']))
{
$search=$_SESSION['current_customer_search'];
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table WHERE last_name like \"%$search%\" or first_name like \"%$search%\" or id =\"$search\" ORDER by last_name",$dbf->conn);
}
elseif($dbf->getNumRows($customers_table) >200)
{
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table ORDER by last_name LIMIT 0,200",$dbf->conn);
}
else
{
$customer_result=mysql_query("SELECT first_name,last_name,account_number,id FROM $customers_table ORDER by last_name",$dbf->conn);
}
$customer_title=isset($_SESSION['current_customer_search']) ? "$lang->selectCustomer: ":"$lang->selectCustomer: ";
echo "
";
$items_table="$cfg_tableprefix".'items';
$brands_table="$cfg_tableprefix".'brands';
if(isset($_POST['item_search']) and $_POST['item_search']!='')
{
$search=$_POST['item_search'];
$_SESSION['current_item_search']=$search;
$item_result=mysql_query("SELECT item_name,unit_price,tax_percent,brand_id,item_number,quantity,id FROM $items_table WHERE item_name like \"%$search%\" or item_number= \"$search\" or id =\"$search\" ORDER by item_name",$dbf->conn);
}
elseif(isset($_SESSION['current_item_search']))
{
$search=$_SESSION['current_item_search'];
$item_result=mysql_query("SELECT item_name,unit_price,tax_percent,brand_id,item_number,quantity,id FROM $items_table WHERE item_name like \"%$search%\" or item_number= \"$search\" or id =\"$search\" ORDER by item_name",$dbf->conn);
}
elseif($dbf->getNumRows($items_table) >200)
{
$item_result=mysql_query("SELECT item_name,unit_price,tax_percent,brand_id,item_number,quantity,id FROM $items_table ORDER by item_name LIMIT 0,200",$dbf->conn);
}
else
{
$item_result=mysql_query("SELECT item_name,unit_price,tax_percent,brand_id,item_number,quantity,id FROM $items_table ORDER by item_name",$dbf->conn);
}
$item_title=isset($_SESSION['current_item_search']) ? "$lang->selectItem: ":"$lang->selectItem: ";
echo "