include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/security_functions.php"; include "../classes/display.php"; $lang = new language(); $dbf = new db_functions($cfg_server, $cfg_username, $cfg_password, $cfg_database, $cfg_tableprefix, $cfg_theme, $lang); $sec = new security_functions($dbf, 'Report Viewer', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } if (isset($_GET['sale_id'])) { $sale_id = $_GET['sale_id']; $customer_id = $_GET['sale_customer_id']; $sale_date = $_GET['sale_date']; $temp_first_name = $dbf->idToField("{$cfg_tableprefix}" . 'customers', 'first_name', $customer_id); $temp_last_name = $dbf->idToField("{$cfg_tableprefix}" . 'customers', 'last_name', $customer_id); $sale_customer_name = $temp_first_name . ' ' . $temp_last_name; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->saleDetails}"); $tableheaders = array("{$lang->rowID}", "{$lang->itemName}", "{$lang->brand}", "{$lang->category}", "{$lang->supplier}", "{$lang->quantityPurchased}", "{$lang->unitPrice}", "{$lang->totalItemCost}"); $tablefields = array('id', 'item_id', 'brand_id', 'category_id', 'supplier_id', 'quantity_purchased', 'item_unit_price', 'item_total_cost'); $display->displayReportTable("{$cfg_tableprefix}", 'sales_items', $tableheaders, $tablefields, 'sale_id', "{$sale_id}", '', '', 'id', "{$sale_customer_name}<br>{$sale_date}<br><br>Items in sale<br>"); ?> </body> </html>
include "../classes/security_functions.php"; include "../classes/display.php"; include "../classes/form.php"; $lang = new language(); $dbf = new db_functions($cfg_server, $cfg_username, $cfg_password, $cfg_database, $cfg_tableprefix, $cfg_theme, $lang); $sec = new security_functions($dbf, 'Report Viewer', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } if (isset($_POST['selected_employee'])) { $selected_employee = $_POST['selected_employee']; $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $first_name = $dbf->idToField($cfg_tableprefix . 'users', 'first_name', $selected_employee); $last_name = $dbf->idToField($cfg_tableprefix . 'users', 'last_name', $selected_employee); $display_name = $first_name . ' ' . $last_name; $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->employeeReport}"); $tableheaders = array("{$lang->rowID}", "{$lang->date}", "{$lang->customer}", "{$lang->itemsPurchased}", "{$lang->paidWith}", "{$lang->saleSubTotal}", "{$lang->saleTotalCost}", "{$lang->showSaleDetails}"); $tablefields = array('id', 'date', 'customer_id', 'items_purchased', 'paid_with', 'sale_sub_total', 'sale_total_cost', 'sale_details'); $display->displayReportTable("{$cfg_tableprefix}", 'sales', $tableheaders, $tablefields, 'sold_by', "{$selected_employee}", "{$date1}", "{$date2}", 'date', "{$lang->listOfSaleBy} {$display_name}<br>{$lang->between} {$date1} and {$date2}"); ?> </body> </html>
header("location: ../login.php"); exit; } if (isset($_POST['selected_customer'])) { $selected_customer = $_POST['selected_customer']; $date_range = $_POST['month1']; $dates = explode(':', $date_range); $month1 = $_POST['month1']; $day1 = $_POST['day1']; $year1 = $_POST['year1']; $month2 = $_POST['month2']; $day2 = $_POST['day2']; $year2 = $_POST['year2']; $date1 = date("{$year1}-{$month1}-{$day1}"); $date2 = date("{$year2}-{$month2}-{$day2}"); } $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->customerReportDateRange}"); $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}<br>{$lang->between} {$date1} {$lang->and} {$date2}"); ?> </body> </html>
</script> </head> <body> <?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/security_functions.php"; include "../classes/display.php"; $lang = new language(); $dbf = new db_functions($cfg_server, $cfg_username, $cfg_password, $cfg_database, $cfg_tableprefix, $cfg_theme, $lang); $sec = new security_functions($dbf, 'Report Viewer', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->dailyReport}"); $today = date("F j, Y"); $todaysDate = date("Y-m-d"); $tableheaders = array("{$lang->rowID}", "{$lang->date}", "{$lang->customer}", "{$lang->itemsPurchased}", "{$lang->paidWith}", "{$lang->soldBy}", "{$lang->saleSubTotal}", "{$lang->saleTotalCost}", "{$lang->saleDetails}"); $tablefields = array('id', 'date', 'customer_id', 'items_purchased', 'paid_with', 'sold_by', 'sale_sub_total', 'sale_total_cost', 'sale_details'); $display->displayReportTable("{$cfg_tableprefix}", 'sales', $tableheaders, $tablefields, 'date', "{$todaysDate}", '', '', 'id', "{$lang->listOfSalesFor} {$today}"); ?> </body> </html>
include "../classes/db_functions.php"; include "../classes/security_functions.php"; include "../classes/display.php"; $lang = new language(); $dbf = new db_functions($cfg_server, $cfg_username, $cfg_password, $cfg_database, $cfg_tableprefix, $cfg_theme, $lang); $sec = new security_functions($dbf, 'Report Viewer', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->dateRangeReport}"); if (isset($_POST['month1'])) { $month1 = $_POST['month1']; $day1 = $_POST['day1']; $year1 = $_POST['year1']; $month2 = $_POST['month2']; $day2 = $_POST['day2']; $year2 = $_POST['year2']; $date1 = date("{$year1}-{$month1}-{$day1}"); $date2 = date("{$year2}-{$month2}-{$day2}"); } $tableheaders = array("{$lang->rowID}", "{$lang->date}", "{$lang->customer}", "{$lang->itemsPurchased}", "{$lang->paidWith}", "{$lang->soldBy}", "{$lang->saleSubTotal}", "{$lang->saleTotalCost}", "{$lang->showSaleDetails}"); $tablefields = array('id', 'date', 'customer_id', 'items_purchased', 'paid_with', 'sold_by', 'sale_sub_total', 'sale_total_cost', 'sale_details'); $display->displayReportTable("{$cfg_tableprefix}", 'sales', $tableheaders, $tablefields, '', '', "{$date1}", "{$date2}", 'id', "{$lang->listOfSalesBetween} {$date1} {$lang->and} {$date2}"); ?> </body> </html>