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>
include "../classes/form.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, 'Admin', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } //set default values, these will change if $action==update. $paid_with_value = ''; $comment_value = ''; $id = -1; //decides if the form will be used to update or add a user. $display->displayTitle("Update Sale"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'sales'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $paid_with_value = $row['paid_with']; $comment_value = $row['comment']; } //creates a form object $f1 = new form('process_update_sale.php', 'POST', 'sale', '325', $cfg_theme, $lang); //creates form parts. echo "<br><br><center><b>{$lang->updateSaleID} {$id}</b></center>"; $option_values = array("{$paid_with_value}", 'Cash', 'Check', 'Credit', 'Gift Certificate', 'Account', 'Other'); $option_titles = array("{$paid_with_value}", $lang->cash, $lang->check, $lang->credit, $lang->giftCertificate, $lang->account, $lang->other); $f1->createSelectField("<b>{$lang->paidWith}:</b>", 'paid_with', $option_values, $option_titles, '130');
<?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageItems}"); $f1 = new form('manage_items.php', 'POST', 'items', '400', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForItemBy}</b>", 'text', 'search', '', '24', '150'); $option_values2 = array('item_name', 'item_number', 'id', 'quantity', 'supplier_catalogue_number'); $option_titles2 = array("{$lang->itemName}", "{$lang->itemNumber}", 'ID', "{$lang->quantityStock}", "{$lang->supplierCatalogue}"); $f1->createSelectField("<b>{$lang->searchBy}</b>", 'searching_by', $option_values2, $option_titles2, 100); $f1->endForm(); echo "<a href='manage_items.php?outofstock=go'>{$lang->showOutOfStock}</a><br>"; echo "<a href='manage_items.php?reorder=go'>{$lang->showReorder}</a>"; $tableheaders = array("{$lang->rowID}", "{$lang->itemName}", "{$lang->itemNumber}", "{$lang->description}", "{$lang->brand}", "{$lang->category}", "{$lang->supplier}", "{$lang->buyingPrice}", "{$lang->sellingPrice}", "{$lang->tax} {$lang->percent}", "{$lang->finalSellingPricePerUnit}", "{$lang->quantityStock}", "{$lang->reorderLevel}", "{$lang->supplierCatalogue}", "{$lang->updateItem}", "{$lang->deleteItem}"); $tablefields = array('id', 'item_name', 'item_number', 'description', 'brand_id', 'category_id', 'supplier_id', 'buy_price', 'unit_price', 'tax_percent', 'total_cost', 'quantity', 'reorder_level', 'supplier_catalogue_number'); if (isset($_POST['search'])) { $search = $_POST['search']; $searching_by = $_POST['searching_by']; echo "<center>{$lang->searchedForItem}: <b>{$search}</b> {$lang->searchBy} <b>{$searching_by}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'items', $tableheaders, $tablefields, "{$searching_by}", "{$search}", 'id');
if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } if (isset($_POST['date_range'])) { $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; $tax_percent = $_POST['selected_tax']; } $sales_table = $cfg_tableprefix . 'sales'; $sales_items_table = $cfg_tableprefix . 'sales_items'; $display_name = $tax_percent . '%'; $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->taxReport}"); $tableheaders = array("{$lang->saleID}", "{$lang->itemName}", "{$lang->tax}", "{$lang->saleTotalCost}"); $tablefields = array('sale_id', 'item_id', 'item_total_tax', 'item_total_cost'); $result = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id DESC", $dbf->conn); $result2 = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id ASC", $dbf->conn); $row = mysql_fetch_assoc($result); $high_id = $row['id']; $row = mysql_fetch_assoc($result2); $low_id = $row['id']; $result3 = mysql_query("SELECT * FROM {$sales_items_table} WHERE sale_id BETWEEN \"{$low_id}\" and \"{$high_id}\" ORDER BY id DESC", $dbf->conn); echo "<center><h4><font color='{$display->list_of_color}'>{$lang->listOfSalesFor} {$display_name}<br>{$lang->between} {$date1} {$lang->and} {$date2}</font></h4></center>"; echo '<hr>'; if (@mysql_num_rows($result) == 0) { echo "<div align='center'>{$lang->noDataInTable} <b>{$sales_table}</b> {$lang->table}.</div>"; exit; }
<?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; 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, 'Sales Clerk', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageCustomers}"); $f1 = new form('manage_customers.php', 'POST', 'customers', '450', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForCustomer}</b>", 'text', 'search', '', '24', '150'); $option_values2 = array('first_name', 'last_name', 'account_number', 'id'); $option_titles2 = array("{$lang->firstName}", "{$lang->lastName}", "{$lang->accountNumber}", 'ID'); $f1->createSelectField("<b>{$lang->searchBy}</b>", 'searching_by', $option_values2, $option_titles2, 100); $f1->endForm(); $tableheaders = array("{$lang->rowID}", "{$lang->lastName}", "{$lang->firstName}", "{$lang->accountNumber}", "{$lang->phoneNumber}", "{$lang->email}", "{$lang->streetAddress}", "{$lang->commentsOrOther}", "{$lang->updateCustomer}", "{$lang->deleteCustomer}"); $tablefields = array('id', 'last_name', 'first_name', 'account_number', 'phone_number', 'email', 'street_address', 'comments'); if (isset($_POST['search'])) { $search = $_POST['search']; $searching_by = $_POST['searching_by']; echo "<center>{$lang->searchedForItem}: <b>{$search}</b> {$lang->searchBy} <b>{$searching_by}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'customers', $tableheaders, $tablefields, "{$searching_by}", "{$search}", 'last_name'); } else { $display->displayManageTable("{$cfg_tableprefix}", 'customers', $tableheaders, $tablefields, '', '', 'last_name');
session_start(); include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/display.php"; include "../classes/security_functions.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, 'Admin', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); if (isset($_GET['generateWith'])) { $generateWith = $_GET['generateWith']; } else { $generateWith = 'id'; } $display->displayTitle("{$lang->itemsBarcode}" . " ({$generateWith})"); echo "<a href='items_barcode.php?generateWith=item_number'>{$lang->itemNumber}</a> / <a href='items_barcode.php?generateWith=id'>id</a>"; if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $items_table = $cfg_tableprefix . 'items'; $result = mysql_query("SELECT * FROM {$items_table} ORDER by item_name", $dbf->conn); echo '<table border=0 width=85% align=center cellspacing=5 cellpadding=12> <tr>'; $counter = 0; while ($row = mysql_fetch_assoc($result)) { if ($counter % 2 == 0) { echo '</tr><tr>'; }
} if (isset($_POST['date_range'])) { $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; $categories_name = array(); $categories_id = array(); $categories_total = array(); $categories_subtotal = array(); } $categories_table = $cfg_tableprefix . 'categories'; $sales_table = $cfg_tableprefix . 'sales'; $sales_items_table = $cfg_tableprefix . 'sales_items'; $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->allCategoriesReport}"); $tableheaders = array("{$lang->category}", "{$lang->totalWithOutTax}", "{$lang->totalWithTax}", "{$lang->tax}"); $result = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id DESC", $dbf->conn); $result2 = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id ASC", $dbf->conn); $row = mysql_fetch_assoc($result); $high_id = $row['id']; $row = mysql_fetch_assoc($result2); $low_id = $row['id']; $result3 = mysql_query("SELECT * FROM {$sales_items_table} WHERE sale_id BETWEEN \"{$low_id}\" and \"{$high_id}\" ORDER BY id DESC", $dbf->conn); echo "<center><h4><font color='{$display->list_of_color}'>{$lang->totalsForCategories}<br>{$lang->between} {$date1} {$lang->and} {$date2}</font></h4></center>"; echo '<hr>'; echo "<table cellspacing='{$display->cellspacing}' cellpadding='{$display->cellpadding}' bgcolor='{$display->table_bgcolor}' width='50%' style=\"border: {$display->border_style} {$display->border_color} {$display->border_width} px\" align='center'>\n\t\t\n\t\t<tr bgcolor={$display->header_rowcolor}>\n\n"; for ($k = 0; $k < count($tableheaders); $k++) { echo "<th align='center'>\n<font color='{$display->header_text_color}' face='{$display->headerfont_face}' size='{$display->headerfont_size}'>{$tableheaders[$k]}</font>\n</th>\n"; } echo '</tr>' . "\n\n";
<?php include "../../settings.php"; include "../../language/{$cfg_language}"; include "../../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageSuppliers}"); $f1 = new form('manage_suppliers.php', 'POST', 'suppliers', '475', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForSupplier}</b>", 'text', 'search', '', '24', '375'); $f1->endForm(); $tableheaders = array("{$lang->rowID}", "{$lang->supplierName}", "{$lang->address}", "{$lang->phoneNumber}", "{$lang->contact}", "{$lang->email}", "{$lang->other}", "{$lang->updateSupplier}", "{$lang->deleteSupplier}"); $tablefields = array('id', 'supplier', 'address', 'phone_number', 'contact', 'email', 'other'); if (isset($_POST['search'])) { $search = $_POST['search']; echo "<center>{$lang->searchedForSupplier}: <b>{$search}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'suppliers', $tableheaders, $tablefields, 'supplier', "{$search}", 'supplier'); } else { $display->displayManageTable("{$cfg_tableprefix}", 'suppliers', $tableheaders, $tablefields, '', '', 'supplier'); } $dbf->closeDBlink(); ?> </body>
<?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageSales}"); $f1 = new form('manage_sales.php', 'POST', 'sales', '450', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForSale}</b>", 'text', 'search', "{$lang->highID}" . '-' . "{$lang->lowID}", '24', '350'); $f1->endForm(); if (isset($_POST['search'])) { $search = $_POST['search']; $temp_search = explode('-', $search); if (!ereg('-', $search)) { echo '<center><b></b></center>'; exit; } $id1 = $temp_search[0]; $id2 = $temp_search[1]; if ($id1 < $id2) { echo "<center><b>{$lang->incorrectSearchFormat}(ex: {$id2}-{$id1})</b></center>"; exit;
exit; } //set default values, these will change if $action==update. $item_id_value = ''; $percent_off_value = ''; $comment_value = ''; $id = -1; //decides if the form will be used to update or add a user. if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = "insert"; } //if action is update, sets variables to what the current users data is. if ($action == "update") { $display->displayTitle("{$lang->updateDiscount}"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'discounts'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $item_id_value = $row['item_id']; $percent_off_value = $row['percent_off']; $comment_value = $row['comment']; } } else { $display->displayTitle("{$lang->addDiscount}"); } //creates a form object $f1 = new form('process_form_discounts.php', 'POST', 'discounts', '300', $cfg_theme, $lang); //creates form parts.
if (!$sec->isLoggedIn()) { header("location: ../../login.php"); exit; } //set default values, these will change if $action==update. $brand_value = ''; $id = -1; //decides if the form will be used to update or add a user. if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = "insert"; } //if action is update, sets variables to what the current users data is. if ($action == "update") { $display->displayTitle("{$lang->updateBrand}"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'brands'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $brand_value = $row['brand']; } } else { $display->displayTitle("{$lang->addBrand}"); } //creates a form object $f1 = new form('process_form_brands.php', 'POST', 'brands', '300', $cfg_theme, $lang); //creates form parts. $f1->createInputField("<b>{$lang->brandName}:</b>", 'text', 'brand', "{$brand_value}", '24', '150'); //sends 2 hidden varibles needed for process_form_users.php.
<?php include "../../settings.php"; include "../../language/{$cfg_language}"; include "../../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageDiscounts}"); $f1 = new form('manage_discounts.php', 'POST', 'discounts', '475', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForDiscount}</b>", 'text', 'search', '', '24', '375'); $f1->endForm(); $tableheaders = array("{$lang->rowID}", "{$lang->itemName}", "{$lang->percentOff}", "{$lang->comment}", "{$lang->updateDiscount}", "{$lang->deleteDiscount}"); $tablefields = array('id', 'item_id', 'percent_off', 'comment'); if (isset($_POST['search'])) { $search = $_POST['search']; echo "<center>{$lang->searchedForDiscount}: <b>{$search}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'discounts', $tableheaders, $tablefields, 'percent_off', "{$search}", 'percent_off'); } else { $display->displayManageTable("{$cfg_tableprefix}", 'discounts', $tableheaders, $tablefields, '', '', 'percent_off'); } $dbf->closeDBlink(); ?> </body>
if (!$sec->isLoggedIn()) { header("location: ../../login.php"); exit; } //set default values, these will change if $action==update. $category_value = ''; $id = -1; //decides if the form will be used to update or add a user. if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = "insert"; } //if action is update, sets variables to what the current users data is. if ($action == "update") { $display->displayTitle("{$lang->updateCategory}"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'categories'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $category_value = $row['category']; } } else { $display->displayTitle("{$lang->addCategory}"); } //creates a form object $f1 = new form('process_form_categories.php', 'POST', 'categories', '300', $cfg_theme, $lang); //creates form parts. $f1->createInputField("<b>{$lang->categoryName}:</b>", 'text', 'category', "{$category_value}", '24', '150'); //sends 2 hidden varibles needed for process_form_users.php.
<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; } if (isset($_POST['date_range'])) { $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->allCustomersReport}"); $tableheaders = array("{$lang->customer}", "{$lang->itemsPurchased}", "{$lang->moneySpentBeforeTax}", "{$lang->moneySpentAfterTax}"); $display->displayTotalsReport($cfg_tableprefix, 'customers', $tableheaders, $date1, $date2, '', ''); ?> </body> </html>
<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; } if (isset($_POST['date_range'])) { $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->profitReport}"); $tableheaders = array("{$lang->date}", "{$lang->totalAmountSoldWithOutTax}", "{$lang->profit}"); $display->displayTotalsReport($cfg_tableprefix, 'profit', $tableheaders, $date1, $date2, 'id', ''); ?> </body> </html>
//set default values, these will change if $action==update. $day = date("d"); $month = date("m"); $year = date("Y"); $today = date("Y-m-d") . ":" . date("Y-m-d"); $yesterday = date("Y-m-d", mktime(0, 0, 0, $month, $day - 1, $year)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month, $day - 1, $year)); $week = date("Y-m-d", mktime(0, 0, 0, $month, $day - 6, $year)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); $thismonth = date("Y-m-d", mktime(0, 0, 0, $month, 1, $year)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); $lastmonth = date("Y-m-d", mktime(0, 0, 0, $month - 1, 1, $year)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month - 1, date("t", mktime(0, 0, 0, $month - 1, 1, $year)), $year)); $thisyear = date("Y-m-d", mktime(0, 0, 0, 1, 1, $year)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); $alltime = date("Y-m-d", mktime(0, 0, 0, 1, 1, 00)) . ":" . date("Y-m-d", mktime(0, 0, 0, $month, $day, $today)); //decides if the form will be used to update or add a user. if (isset($_GET['report'])) { $form = $_GET['report']; } $display->displayTitle("{$lang->inputNeeded} {$form}"); //if action is update, sets variables to what the current users data is. if ($form == "{$lang->allCustomersReport}") { $f1 = new form('all_customers.php', 'POST', 'customers', '215', $cfg_theme, $lang); $option_values2 = array("{$today}", "{$yesterday}", "{$week}", "{$thismonth}", "{$lastmonth}", "{$thisyear}", "{$alltime}"); $option_titles2 = array("{$lang->today}", "{$lang->yesterday}", "{$lang->last7days}", "{$lang->thisMonth}", "{$lang->lastMonth}", "{$lang->thisYear}", "{$lang->allTime}"); $f1->createSelectField("<b>{$lang->dateRange}</b>", 'date_range', $option_values2, $option_titles2, '95'); $f1->endForm(); } elseif ($form == "{$lang->allItemsReport}") { $f1 = new form('all_items.php', 'POST', 'items', '215', $cfg_theme, $lang); $option_values2 = array("{$today}", "{$yesterday}", "{$week}", "{$thismonth}", "{$lastmonth}", "{$thisyear}", "{$alltime}"); $option_titles2 = array("{$lang->today}", "{$lang->yesterday}", "{$lang->last7days}", "{$lang->thisMonth}", "{$lang->lastMonth}", "{$lang->thisYear}", "{$lang->allTime}"); $f1->createSelectField("<b>{$lang->dateRange}</b>", 'date_range', $option_values2, $option_titles2, '95'); $f1->endForm(); } elseif ($form == "{$lang->allItemsReportDateRange}") { $f1 = new form('all_items_date_range.php', 'POST', 'items', '500', $cfg_theme, $lang);
if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } if (isset($_POST['selected_category'])) { $selected_category = $_POST['selected_category']; $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $sales_table = $cfg_tableprefix . 'sales'; $sales_items_table = $cfg_tableprefix . 'sales_items'; $display_name = $dbf->idToField($cfg_tableprefix . 'categories', 'category', $selected_category); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->categoryReport}"); $tableheaders = array("{$lang->saleID}", "{$lang->itemName}", "{$lang->unitPrice}", "{$lang->quantityPurchased}", "{$lang->tax}", "{$lang->itemTotalCost}"); $tablefields = array('sale_id', 'item_id', 'item_unit_price', 'quantity_purchased', 'item_total_tax', 'item_total_cost'); $result = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id DESC", $dbf->conn); $result2 = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id ASC", $dbf->conn); $row = mysql_fetch_assoc($result); $high_id = $row['id']; $row = mysql_fetch_assoc($result2); $low_id = $row['id']; $result3 = mysql_query("SELECT * FROM {$sales_items_table} WHERE sale_id BETWEEN \"{$low_id}\" and \"{$high_id}\" ORDER BY id DESC", $dbf->conn); echo "<center><h4><font color='{$display->list_of_color}'>{$lang->listOfSalesFor} {$display_name}<br>{$lang->between} {$date1} {$lang->and} {$date2}</font></h4></center>"; echo '<hr>'; if (@mysql_num_rows($result) == 0) { echo "<div align='center'>{$lang->noDataInTable} <b>{$sales_table}</b> {$lang->table}.</div>"; exit; }
<?php include "../../settings.php"; include "../../language/{$cfg_language}"; include "../../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageBrands}"); $f1 = new form('manage_brands.php', 'POST', 'brands', '425', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForBrand}</b>", 'text', 'search', '', '24', '350'); $f1->endForm(); $tableheaders = array("{$lang->rowID}", "{$lang->brandName}", "{$lang->updateBrand}", "{$lang->deleteBrand}"); $tablefields = array('id', 'brand'); if (isset($_POST['search'])) { $search = $_POST['search']; echo "<center>{$lang->searchedForBrand}: <b>{$search}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'brands', $tableheaders, $tablefields, 'brand', "{$search}", 'brand'); } else { $display->displayManageTable("{$cfg_tableprefix}", 'brands', $tableheaders, $tablefields, '', '', 'brand'); } $dbf->closeDBlink(); ?> </body>
if (isset($_SESSION['current_sale_customer_id'])) { ?> <body onLoad="itemFocus();"> <?php } else { ?> <body onLoad="customerFocus();"> <?php } $table_bg = $display->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']) ? "<b><font color='white'>{$lang->selectCustomer}: </font></b>" : "<font color='white'>{$lang->selectCustomer}: </font>";
if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } if (isset($_POST['selected_brand'])) { $selected_brand = $_POST['selected_brand']; $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $sales_table = $cfg_tableprefix . 'sales'; $sales_items_table = $cfg_tableprefix . 'sales_items'; $display_name = $dbf->idToField($cfg_tableprefix . 'brands', 'brand', $selected_brand); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->brandReport}"); $tableheaders = array("{$lang->saleID}", "{$lang->itemName}", "{$lang->unitPrice}", "{$lang->quantityPurchased}", "{$lang->tax}", "{$lang->itemTotalCost}"); $tablefields = array('sale_id', 'item_id', 'item_unit_price', 'quantity_purchased', 'item_total_tax', 'item_total_cost'); $result = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id DESC", $dbf->conn); $result2 = mysql_query("SELECT * FROM {$sales_table} WHERE date between \"{$date1}\" and \"{$date2}\" ORDER BY id ASC", $dbf->conn); $row = mysql_fetch_assoc($result); $high_id = $row['id']; $row = mysql_fetch_assoc($result2); $low_id = $row['id']; $result3 = mysql_query("SELECT * FROM {$sales_items_table} WHERE sale_id BETWEEN \"{$low_id}\" and \"{$high_id}\" ORDER BY id DESC", $dbf->conn); echo "<center><h4><font color='{$display->list_of_color}'>{$lang->listOfSalesFor} {$display_name}<br>{$lang->between} {$date1} {$lang->and} {$date2}</font></h4></center>"; echo '<hr>'; if (@mysql_num_rows($result) == 0) { echo "<div align='center'>{$lang->noDataInTable} <b>{$sales_table}</b> {$lang->table}.</div>"; exit; }
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>
session_start(); include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/display.php"; include "../classes/security_functions.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, 'Sales Clerk', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); if (isset($_GET['generateWith'])) { $generateWith = $_GET['generateWith']; } else { $generateWith = 'id'; } $display->displayTitle("{$lang->customersBarcode}" . " ({$generateWith})"); echo "<a href='customers_barcode.php?generateWith=account_number'>{$lang->accountNumber}</a> / <a href='customers_barcode.php?generateWith=id'>id</a>"; if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $customers_table = $cfg_tableprefix . 'customers'; $result = mysql_query("SELECT * FROM {$customers_table} ORDER by last_name", $dbf->conn); echo '<table border=0 width=85% align=center cellspacing=5 cellpadding=12> <tr>'; $counter = 0; while ($row = mysql_fetch_assoc($result)) { if ($counter % 2 == 0) { echo '</tr><tr>'; }
include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/security_functions.php"; include "../classes/form.php"; include "../classes/display.php"; //creates 3 objects needed for this script. $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, 'Admin', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); //checks if user is logged in. if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display->displayTitle("{$lang->updateItem}"); if (isset($_GET['item_id']) and isset($_GET['sale_id']) and isset($_GET['row_id'])) { $item_id = $_GET['item_id']; $sale_id = $_GET['sale_id']; $row_id = $_GET['row_id']; $tablename = "{$cfg_tableprefix}" . 'sales_items'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$row_id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $quantity_purchased_value = $row['quantity_purchased']; $item_unit_price_value = $row['item_unit_price']; $item_tax_percent_value = $row['item_tax_percent']; } //creates a form object $f1 = new form('process_update_item.php', 'POST', 'sale item', '335', $cfg_theme, $lang); //creates form parts. echo "<br><br><center><b>{$lang->updateRowID} {$row_id}</b></center>";
<?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; 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, 'Admin', $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$lang->manageUsers}"); $f1 = new form('manage_users.php', 'POST', 'users', '400', $cfg_theme, $lang); $f1->createInputField("<b>{$lang->searchForUser}</b>", 'text', 'search', '', '24', '300'); $f1->endForm(); $tableheaders = array("{$lang->rowID}", "{$lang->lastName}", "{$lang->firstName}", "{$lang->username}", "{$lang->password}", "{$lang->type}", "{$lang->updateUser}", "{$lang->deleteUser}"); $tablefields = array('id', 'last_name', 'first_name', 'username', 'password', 'type'); if (isset($_POST['search'])) { $search = $_POST['search']; echo "<center>{$lang->searchedForUser}:<b> {$search}</b></center>"; $display->displayManageTable("{$cfg_tableprefix}", 'users', $tableheaders, $tablefields, 'username', "{$search}", 'last_name'); } else { $display->displayManageTable("{$cfg_tableprefix}", 'users', $tableheaders, $tablefields, '', '', 'last_name'); } $dbf->closeDBlink(); ?> </body>
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>
<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; } if (isset($_POST['date_range'])) { $date_range = $_POST['date_range']; $dates = explode(':', $date_range); $date1 = $dates[0]; $date2 = $dates[1]; } $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); $display->displayTitle("{$cfg_company} {$lang->allEmployeesReport}"); $tableheaders = array("{$lang->employee} {$lang->name}", "{$lang->totalItemsSold}", "{$lang->moneySoldBeforeTax}", "{$lang->moneySoldAfterTax}"); $display->displayTotalsReport($cfg_tableprefix, 'employees', $tableheaders, $date1, $date2, '', ''); ?> </body> </html>
$supplier_value = ''; $address_value = ''; $phone_number_value = ''; $contact_value = ''; $email_value = ''; $other_value = ''; $id = -1; //decides if the form will be used to update or add a user. if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = "insert"; } //if action is update, sets variables to what the current users data is. if ($action == "update") { $display->displayTitle("{$lang->updateSupplier}"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'suppliers'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $supplier_value = $row['supplier']; $address_value = $row['address']; $phone_number_value = $row['phone_number']; $contact_value = $row['contact']; $email_value = $row['email']; $other_value = $row['other']; } } else { $display->displayTitle("{$lang->addSupplier}"); }
<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->allItemsReport}"); 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->itemName}", "{$lang->brand}", "{$lang->category}", "{$lang->supplier}", "{$lang->numberPurchased}", "{$lang->subTotalForItem}", "{$lang->totalForItem}"); $display->displayTotalsReport($cfg_tableprefix, 'items', $tableheaders, $date1, $date2, '', ''); ?>
$last_name_value = ''; $account_number_value = ''; $phone_number_value = ''; $email_value = ''; $street_address_value = ''; $comments_value = ''; $id = -1; //decides if the form will be used to update or add a user. if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = "insert"; } //if action is update, sets variables to what the current users data is. if ($action == "update") { $display->displayTitle("{$lang->updateCustomer}"); if (isset($_GET['id'])) { $id = $_GET['id']; $tablename = "{$cfg_tableprefix}" . 'customers'; $result = mysql_query("SELECT * FROM {$tablename} WHERE id=\"{$id}\"", $dbf->conn); $row = mysql_fetch_assoc($result); $first_name_value = $row['first_name']; $last_name_value = $row['last_name']; $account_number_value = $row['account_number']; $phone_number_value = $row['phone_number']; $email_value = $row['email']; $street_address_value = $row['street_address']; $comments_value = $row['comments']; } } else { $display->displayTitle("{$lang->addCustomer}");
<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, 'Admin', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $display->displayTitle("{$lang->users}"); $dbf->closeDBlink(); ?> <ul> <li><a href="form_users.php?action=insert"><?php echo "{$lang->createUser}"; ?> </a> <li><a href="manage_users.php"><?php echo "{$lang->manageUsers}"; ?> </a> </ul>