This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkLogin(){ | |
if(isset($_SESSION['username'] && isset($_SESSION['password']))) | |
return true; | |
elseif (isset($_COOKIE['username']) && isset($_COOKIE['password'])) | |
{ | |
$username = $_COOKIE['username']; | |
$query = $connection->prepare(" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkLogin(){ | |
$username = $_COOKIE['username']; | |
$query = $connection->prepare(" | |
SELECT * FROM adminUsers WHERE username = :username | |
"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include "db.php" ?> | |
<?php session_start(); ?> | |
<?php | |
if(isset($_POST['login'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function findAllUsers(){ | |
global $connection; | |
$query = $connection->prepare(" | |
SELECT users.username, users.display_name, users.id, users.email, tblCarriers.CarrierName | |
FROM users, tblCarriers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php session_start();?> | |
<?php | |
if(!isset($_SESSION['display_name'])) { | |
header("Location: please_login.php"); | |
die(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addUser(){ | |
global $connection; | |
if(isset($_POST['submit'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$display_name = $_POST['display_name']; | |
$email = $_POST['email']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select class="form-control" name="carrier"> | |
<?php | |
$query = $connection->prepare(" | |
SELECT * FROM tblCarriers | |
"); | |
$query->execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-group"> | |
<label for="carrier">Carrier</label> | |
<select class="form-control" name="carrier"> | |
<?php | |
$query = $connection->prepare(" | |
SELECT CarrierName FROM tblCarriers | |
"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addUser(){ | |
global $connection; | |
if(isset($_POST['submit'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$display_name = $_POST['display_name']; | |
$email = $_POST['email']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT users.display_name, serialNumbers.location, COUNT(serialNumbers.Location) AS cnt | |
FROM tracking | |
INNER JOIN users ON tracking.user=users.id | |
LEFT JOIN serialNumbers ON serialNumbers.serial=tracking.computerSerial | |
GROUP BY serialNumbers.location | |
HAVING ( cnt > 0 ) | |
ORDER BY cnt DESC |