session_start(); require_once 'config.php'; require_once 'framework.php'; require_once 'php/ismobile.class.php'; /*header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Pragma: no-cache"); // HTTP/1.0 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");*/ @($fw = new scaleDB(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB)); @($ismobi = new IsMobile()); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { $techname = $_SESSION['USER']['fullname']; $username = $_SESSION['USER']['username']; $oldpass = $fw->clean_input($_POST['oldPass']); $newpass1 = $fw->clean_input($_POST['newPass1']); $newpass2 = $fw->clean_input($_POST['newPass2']); $date = $fw->getDate(); #Check if the scale still exists in the database $query_user = "******" . $username . "'"; $result_user = $fw->query($query_user); if ($query_user) { while ($row = $result_user->fetch_assoc()) { $db_pass = $row['password']; $db_name = $row['fullname']; $db_user = $row['username']; } if ($db_pass == sha1($oldpass)) { if ($db_name == $_SESSION['USER']['fullname'] && $db_user == $_SESSION['USER']['username']) { if ($newpass1 == $newpass2 && $newpass1 != $oldpass) {
require_once 'php/ismobile.class.php'; /*header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Pragma: no-cache"); // HTTP/1.0 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");*/ @($fw = new scaleDB(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB)); @($ismobi = new IsMobile()); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { header("Location: index.php"); die("<p>You are logged in and do not need to login again!</p>"); } else { if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['submit'])) { if ($_POST['submit'] == "Login") { $username = isset($_POST['username']) ? strtolower($fw->clean_input($_POST['username'])) : NULL; $password = $_POST['password']; $query = "select * from users where username = '******'"; $result = $fw->query($query); if ($result) { while ($row = $result->fetch_assoc()) { $db_id = $row['id']; $db_username = $row['username']; $db_pass = $row['password']; $db_fullname = $row['fullname']; $db_email = $row['email']; $db_user = $row['is_user']; $db_admin = $row['is_admin']; $db_superadmin = $row['is_superadmin']; } if (sha1($password) == @$db_pass && @$db_user == 1) {
session_start(); require_once 'config.php'; require_once 'framework.php'; require_once 'php/ismobile.class.php'; /*header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Pragma: no-cache"); // HTTP/1.0 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");*/ @($fw = new scaleDB(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB)); @($ismobi = new IsMobile()); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $techname = $_SESSION['USER']['fullname']; $companyname = $fw->clean_input($_POST['companyname']); $street = $fw->clean_input($_POST['street']); $city = $fw->clean_input($_POST['city']); $state = $fw->clean_input($_POST['state']); $zipcode = $fw->clean_input($_POST['zipcode']); $indicator_tag = $fw->clean_input($_POST['indicator_tag']); $indicator_manu = $fw->clean_input($_POST['indicator_manu']); $indicator_model = $fw->clean_input($_POST['indicator_model']); $indicator_serial = $fw->clean_input($_POST['indicator_serial']); $scale_manu = $fw->clean_input($_POST['scale_manu']); $scale_model = $fw->clean_input($_POST['scale_model']); $scale_serial = $fw->clean_input($_POST['scale_serial']); $scale_capacity = $fw->clean_input($_POST['scale_capacity']); $scale_divisions = $fw->clean_input($_POST['scale_divisions']); $units = $fw->clean_input($_POST['units']); $date = date('m/d/Y') . " @ " . date('h:i:s A');
<tr> <td> <input type="text" name="search_criteria" maxlength="25" size="18" placeholder="search..." /> </td> </tr> <tr> <td> <input type="submit" name="submit" value="Search" /> </td> </tr> </tbody> </table> </form> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { $type = $fw->clean_input($_POST['search_type']); $criteria = $fw->clean_input($_POST['search_criteria']); if ($type == "default") { $query = "select * from scales where status != 'Complete' AND status != 'Non-repairable' AND status != 'Replaced the Scale' AND status != 'Delivered'"; $criteria = "Based on the default search criteria <br />"; } elseif ($type == "all") { $query = "select * from scales"; $criteria = "All scale tickets are being shown. <br />"; } else { if ($type == "id" || $type == "scale_capacity") { $query = "select * from scales where {$type} = '" . $criteria . "'"; } else { $query = "select * from scales where {$type} like '%" . $criteria . "%'"; } } } else {
<?php session_start(); include 'framework.php'; @($fw = new scaleDB('localhost', 'root', '', 'brechbuhler_test')); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION) && $fw->isSuperAdmin($_SESSION)) { if (isset($_GET['id'])) { $scale_id = $fw->clean_input($_GET['id']); } else { die("No scale was defined in the delete request."); } #$fullname = $_SESSION['user_validation']['fullname']; #$username = $_SESSION['user_validation']['username']; echo $scale_id . "<br />"; $query_scales = "delete from scales where id = '" . $scale_id . "'"; echo $query_scales . "<br />"; $result_scales = $fw->query($query_scales); if (!$result_scales) { die("Something happened. The scale could not be removed from the database at this time. Please try again later."); } $query_events = "delete from events where scale_id = '" . $scale_id . "'"; $result_events = $fw->query($query_events); if (!$result_events) { die("Something happened. The events could not be removed from the database at this time. Please notify an admin."); } header('Location: index.php?result=31'); die("The scale was successfully removed from the database."); } else { header("Location: login.php"); die("You must be logged in to view this page."); }
// HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Pragma: no-cache"); // HTTP/1.0 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); } if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['submit'])) { if ($_POST['submit'] == "Submit") { $id; if (isset($_GET['id'])) { $scale_id = $_GET['id']; $tech = $fw->clean_input($_SESSION['USER']['fullname']); #$status = $fw->clean_input( $_POST['status'] ); $timespent = isset($_POST['timespent']) ? $fw->clean_input($_POST['timespent']) : 0; $stage = $fw->clean_input($_POST['stage']); $date = $fw->getDate(); $comments = $fw->clean_input($_POST['comments']); $digest = md5($stage . $comments); $sessionDigest = isset($_SESSION['digest']) ? $_SESSION['digest'] : ''; if ($digest != $sessionDigest) { $query = "insert into events values\r\n" . "(NULL, " . "'" . $date . "', " . "'" . $scale_id . "', " . "'" . $tech . "', " . "'" . $stage . "', " . "'" . $timespent . "', " . "'" . $comments . "'); "; $result = $fw->query($query); if ($stage != "Added Additional Notes") { $query_two = "update scales set status ='" . $stage . "', updated = '" . $date . "' where id='" . $scale_id . "';"; $result_two = $fw->query($query_two); if ($result && $result_two) { $_SESSION['viewScale']['result'] = "The ticket was successfully updated!";
<?php session_start(); include 'framework.php'; @($fw = new scaleDB('localhost', 'root', '', 'brechbuhler_test')); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { $scale_id = $fw->clean_input($_POST['scale_id']); $tech = $fw->clean_input($_POST['tech']); $status = $fw->clean_input($_POST['status']); $stage = $fw->clean_input($_POST['stage']); $date = $fw->getDate(); $comments = $fw->clean_input($_POST['comments']); $event = $stage; $query = "insert into events values\r\n" . "('NULL', " . "'" . $date . "', " . "'" . $scale_id . "', " . "'" . $tech . "', " . "'" . $event . "', " . "'" . $comments . "'); "; $result = $fw->query($query); if ($stage != "Added Additional Notes") { $query_two = "update scales set status='" . $stage . "' where id='" . $scale_id . "';"; $result_two = $fw->query($query_two); if ($result && $result_two) { //$result->free(); header("Location: index.php?result=5"); die; } elseif ($result || $result_two) { header("Location: index.php?result=4"); } else { header("Location: index.php?result=2"); //echo $query; die; } } elseif ($stage == "Additional Notes" && $result) { header("Location: index.php?result=5");