<html> <head> </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, 'Sales Clerk', $lang); $display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang); if (!$sec->isLoggedIn()) { header("location: ../login.php"); exit; } $table_bg = $display->sale_bg; $num_items = count($_SESSION['items_in_sale']); if ($num_items == 0) { echo "<b>{$lang->youMustSelectAtLeastOneItem}</b><br>"; echo "<a href=javascript:history.go(-1)>{$lang->refreshAndTryAgain}</a>"; exit; } $customers_table = $cfg_tableprefix . 'customers'; $items_table = $cfg_tableprefix . 'items'; $sales_items_table = $cfg_tableprefix . 'sales_items';
<html> <head> </head> <body> <?php include "../settings.php"; include "../language/{$cfg_language}"; include "../classes/db_functions.php"; include "../classes/security_functions.php"; 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, 'Sales Clerk', $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. $first_name_value = ''; $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.
<?php session_start(); include "settings.php"; include "language/{$cfg_language}"; include "classes/db_functions.php"; include "classes/security_functions.php"; //create two objects that are needed in 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, 'Public', $lang); if (isset($_POST['username']) and isset($_POST['password'])) { $username = $_POST['username']; $password = md5($_POST['password']); if ($sec->checkLogin($username, $password)) { $_SESSION['session_user_id'] = $dbf->getUserID($username, $password); header("location: index.php"); } else { echo "<center><b>{$lang->usernameOrPasswordIncorrect}</b></center>"; } } if ($sec->isLoggedIn()) { header("Location: index.php"); } $dbf->closeDBlink(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD>