<h2>Scale Edit</h2> <?php @($db = new mysqli('localhost', 'root', '', 'brechbuhler')); if (mysqli_connect_error()) { $errnum = mysqli_connect_errno(); echo "Error({$errnum}): Could not connect to database. Please try again later."; exit; } $id = ""; $username = $_SESSION['val_username']; if (isset($_GET['id'])) { $id = $_GET['id']; } else { die("Could not get the scale ID from the form, please notify an admin"); } $fw = new scaleDB(); $scale_information = $fw->getScale($id); if (is_array($scale_information)) { #array_key_exists( 'scale_id', $scale_information ) ) { #Check if the user is actually an admin $query_user = "******"; $result_user = $db->query($query_user); if ($result_user) { while ($row = $result_user->fetch_assoc()) { $db_pass = $row['password']; $db_user = $row['username']; $db_name = $row['fullname']; $db_email = $row['email']; $db_user = $row['is_user']; $db_admin = $row['is_admin']; $db_superadmin = $row['is_superadmin'];
<?php 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 (isset($_SESSION['USER'])) { unset($_SESSION['USER']); session_destroy(); } header("Location: login.php"); die("You must have redirection turned off - To log in again click <a href=\"login.php\">here</a>."); } else { header("Location: login.php"); die("You must be logged in to view this page.<br />Please try logging in <a href=\"login.php\">here</a>."); }
<?php 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']) {
<?php 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)) { 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'];
<?php 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']);
<?php 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)) { ?> <html lang="en"> <head> <title>In-Shop Repair</title> <link rel="stylesheet" type="text/css" href="http://auzarius.com/scales/inshop/framework.css" /> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" /> <link rel="stylesheet" type="text/css" href="http://auzarius.com/scales/inshop/in-shop.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script> $(function() { $( "#accordion" ).accordion({ collapsible: true
<?php 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)) { include 'header.php'; ?> <form action="showRepairs.php" method="post"> <table <?php if ($ismobi->CheckMobile()) { echo 'class="table-style"'; } ?> > <thead> <tr> <td> <h3 style="margin-bottom: 0;">Perform a search</h3> </td> </tr> </thead>
<?php 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)) { include 'header.php'; if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['submit'])) { if ($_POST['submit'] == "Edit Scale" && $fw->isAdmin($_SESSION)) { ?> <h2>Scale Edit</h2> <?php $id = ""; $username = $_SESSION['USER']['username']; if (isset($_GET['id'])) { $id = $_GET['id']; } else { die("Could not get the scale ID from the form, please notify an admin"); } if (!($scale_information = $fw->getScale($id))) { die;
<?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."); }
<?php session_start(); include 'framework.php'; @($fw = new scaleDB('localhost', 'root', '', 'brechbuhler')); if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION) && $fw->isAdmin($_SESSION)) { ?> <?php include 'header.php'; ?> <h2>Scale Edit</h2> <?php $id = ""; $username = $_SESSION['user_validation']['username']; if (isset($_GET['id'])) { $id = $_GET['id']; } else { die("Could not get the scale ID from the form, please notify an admin"); } $scale_information = $fw->getScale($id); if (is_array($scale_information)) { $output = ' <form action="_updateScale.php" method="post"> <table class="table-striped table-style"> <tbody> <tr> <td> ID: </td>
<?php session_start(); include 'framework.php'; $fw = new scaleDB('localhost', 'root', '', 'brechbuhler_test'); if ($fw) { $type = $fw->clean_input($_POST['search_type']); $criteria = $fw->clean_input($_POST['search_criteria']); if ($type == "default") { $_SESSION['search_go'] = 1; $_SESSION['search_query'] = "select * from scales where status != 'Complete' AND status != 'Non-repairable' AND status != 'Replaced the Scale'"; $_SESSION['search_criteria'] = "Based on the default search criteria <br />"; header("Location: showRepairs.php"); die("You must have page redirection turned off, please turn it on and try again."); } elseif ($type == "all") { $_SESSION['search_go'] = 1; $_SESSION['search_query'] = "select * from scales"; $_SESSION['search_criteria'] = "All scale tickets are being shown. <br />"; header("Location: showRepairs.php"); die("You must have page redirection turned off, please turn it on and try again."); } else { if ($type == "id" || $type == "scale_capacity") { $query = "select * from scales where {$type} = '" . $criteria . "'"; } else { $query = "select * from scales where {$type} like '%" . $criteria . "%'"; } $result = $fw->query($query); $_SESSION['search_criteria'] = "\n\t\t\t\t<table class=\"table-striped\" style=\"max-width: 250px;\">\n\t\t\t\t\t<thead style=\"background-color: black; color: white;\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\">Based on this search criteria</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Type</td>\n\t\t\t\t\t\t\t<td>{$type}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Criteria</td>\n\t\t\t\t\t\t\t<td>{$criteria}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>"; if ($result) { $_SESSION['search_go'] = 1; $_SESSION['search_query'] = $query;
<?php 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 ($ismobi->CheckMobile()) { 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"); } if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) { if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['submit'])) { if ($_POST['submit'] == "Submit") { $id;
<?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");