</script> <!--<link rel="stylesheet" type="text/css" href="quantum.css" />--> <!--[if lt IE9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <meta name="viewport" content="width=device-width, initial-scale=0.62"> </head> <body> <?php include 'header.php'; ?> <h2>Registered Users</h2> <?php if ($fw->isAdmin($_SESSION) || $fw->isSuperAdmin($_SESSION)) { $query = "select * from users"; } else { die; } $result = $fw->query($query); if ($result) { $num_results = $result->num_rows; echo "<p>Number of matches found: " . $num_results . "</p>"; if ($num_results > 0) { $output = "\n\n\t\t<table class=\"table-striped table-style table-hover search-results\">\n" . "\t\t\t<thead>\n" . "\t\t\t\t<tr>\n" . "\t\t\t\t\t<th>ID</th>\n" . "\t\t\t\t\t<th>Username</th>\n" . "\t\t\t\t\t<th>Full Name</th>\n" . "\t\t\t\t\t<th>Email</th>\n" . "\t\t\t\t\t<th>is_user</th>\n" . "\t\t\t\t\t<th>is_admin</th>\n" . "\t\t\t\t\t<th>is_super</th>\n" . "\t\t\t\t</tr>\n" . "\t\t\t</thead>\n" . "\t\t\t<tbody>\n"; for ($i = 0; $i < $num_results; $i++) { $row = $result->fetch_assoc(); $output .= "\t\t\t\t<tr>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['id']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['username']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['fullname']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['email']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_user']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_admin']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_superadmin']) . "</td>\n" . "\t\t\t\t</tr>\n"; } $output .= "\t\t\t</tbody>\n" . "\t\t</table>\n";
<?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>
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; } if (is_array($scale_information)) {
$_SESSION['viewScale']['result'] = "The ticket was successfully updated!"; $_SESSION['digest'] = $digest; header("Location: viewScale.php?id={$scale_id}"); } else { $_SESSION['viewScale']['error'] = "Something went wrong when submitting your ticket to the database. Please try again."; header("Location: viewScale.php?id={$scale_id}"); } } else { $_SESSION['viewScale']['error'] = "That information has already been submitted, no changes were made."; header("Location: viewScale.php?id={$scale_id}"); } } else { $_SESSION['viewScale']['error'] = "No ticket id was associated with this action, please try again."; header("Location: viewScale.php?id={$scale_id}"); } } elseif ($_POST['submit'] == "Save Changes" && $fw->isAdmin($_SESSION)) { $techname = $_SESSION['USER']['fullname']; $scale_id = $fw->clean_input($_POST['scale_id']); $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']);