예제 #1
0
파일: Location.php 프로젝트: Notacadet/RFID
 public function createLocationView($selectedLocation)
 {
     $conn = RfidController::connect();
     $sql = "SELECT items.rfid, items.items_id, items.serialNum, makes.make_id, nomenclature.nomenclature_id, nomenclature.nomenclature_name, locations.roomNumber, makes.makeName, models.model_name, models.model_id, users.userName, users.user_id FROM items join locations on items.location_id=locations.location_id join models on items.model_id=models.model_id join makes on models.make_id=makes.make_id join users on items.user_id=users.user_id join nomenclature on models.nom_id = nomenclature.nomenclature_id where locations.location_id = '{$selectedLocation}' order by nomenclature_name, makeName, model_name, serialNum";
     $result = $conn->query($sql);
     if (!$result) {
         printf("Error: %s\n", mysqli_error($conn));
         exit;
     }
     echo "<table>\r\n\t\t<tr>\r\n\t\t<th>RFID</th>\r\n\t\t<th>Nomenclature</th>\r\n\t\t<th>Serial Number</th>\r\n\t\t<th>Make Name</th>\r\n\t\t<th>Model Name</th>\r\n\t\t<th>HR Holder</th>\t\t\r\n\t\t</tr>";
     while ($row = mysqli_fetch_array($result)) {
         $selectedModel = $row["model_id"];
         $selectedMake = $row["make_id"];
         $selectedItem = $row["items_id"];
         $selectedNom = $row["nomenclature_id"];
         $selectedUser = $row["user_id"];
         echo "<tr>";
         echo "<td><a href=itemLandingPage.php?fn={$selectedItem}>" . $row['rfid'] . "</td>";
         echo "<td><a href=nomLandingPage.php?fn={$selectedNom}>" . $row['nomenclature_name'] . "</td>";
         echo "<td>" . $row['serialNum'] . "</td>";
         echo "<td><a href=makeLandingPage.php?fn={$selectedMake}>" . $row['makeName'] . "</td>";
         echo "<td><a href=modelToModel_id.php?fn={$selectedModel}>" . $row['model_name'] . "</td>";
         echo "<td><a href=emailLandingPage.php?fn={$selectedUser}>" . $row['userName'] . "</td>";
         echo "</tr>";
     }
     echo "</table>";
     echo "<br/>";
     $conn->close();
 }
예제 #2
0
 public function createNomenclatureView($selectedNom)
 {
     $conn = RfidController::connect();
     $sql = "SELECT makes.makeName, models.model_name, makes.make_id, models.model_id, count(items.rfid) as Items FROM models join makes on models.make_id=makes.make_id join items on models.model_id=items.model_id join nomenclature on models.nom_id=nomenclature.nomenclature_id where nomenclature.nomenclature_id = '{$selectedNom}' group by model_name order by model_name, makeName";
     $result = mysqli_query($conn, $sql);
     if (!$result) {
         printf("Error: %s\n", mysqli_error($conn));
         exit;
     }
     echo "<table>\r\n\t\t<tr>\r\n\t\t<th>Make Name</th>\r\n\t\t<th>Model Name</th>\r\n\t\t<th>Items</th>\r\n\t\t</tr>";
     if ($result->num_rows > 0) {
         //output data of each row into the Array
         while ($row = $result->fetch_assoc()) {
             //$nameArray[]= (string)$row;
             $selectedModel = $row["model_id"];
             $selectedMake = $row["make_id"];
             echo "<tr>";
             echo "<td><a href=makeLandingPage.php?fn={$selectedMake}>" . $row["makeName"] . "</a></td>";
             echo "<td><a href=modelToModel_id.php?fn={$selectedModel}>" . $row['model_name'] . "</td>";
             echo "<td>" . $row["Items"] . "</a></td>";
             echo "</tr>";
         }
     }
     echo "</table>";
     mysqli_close($conn);
 }
예제 #3
0
파일: Model.php 프로젝트: Notacadet/RFID
 public function createModelView($selectedModel)
 {
     $conn = RfidController::connect();
     $sql = "SELECT items.rfid, items.items_id, items.serialNum, locations.location_id, locations.roomNumber, makes.makeName, models.model_name, models.model_id, users.userName, users.user_id FROM items join locations on items.location_id=locations.location_id join models on items.model_id=models.model_id join makes on models.make_id=makes.make_id join users on items.user_id=users.user_id where models.model_id = '{$selectedModel}'";
     $result = $conn->query($sql);
     echo "<table>\r\n\t\t<tr>\r\n\t\t<th>RFID</th>\r\n\t\t<th>Serial Number</th>\r\n\t\t<th>Room Number</th>\r\n\t\t<th>Hand Receipt Holder</th>\t\r\n\t\t</tr>";
     while ($row = mysqli_fetch_array($result)) {
         $selectedLocation = $row["location_id"];
         $selectedItem = $row["items_id"];
         $selectedUser = $row["user_id"];
         echo "<tr>";
         echo "<td><a href=itemLandingPage.php?fn={$selectedItem}>" . $row['rfid'] . "</td>";
         echo "<td>" . $row['serialNum'] . "</td>";
         echo "<td><a href=locationLandingPage.php?fn={$selectedLocation}>" . $row['roomNumber'] . "</td>";
         echo "<td><a href=emailLandingPage.php?fn={$selectedUser}>" . $row['userName'] . "</td>";
         echo "</tr>";
     }
     echo "</table>";
     if (!$result) {
         printf("Error: %s\n", mysqli_error($conn));
         exit;
     }
     echo "<br/>";
     $conn->close();
 }
예제 #4
0
파일: Make.php 프로젝트: Notacadet/RFID
 public function createMakeView($selectedMake)
 {
     $conn = RfidController::connect();
     $sql = "SELECT models.model_id, makes.makeName, models.model_name, makes.make_id, nomenclature.nomenclature_id, nomenclature.nomenclature_Name, users.user_id, count(models.model_name) as modName FROM models join makes on models.make_id=makes.make_id join nomenclature on models.nom_id=nomenclature.nomenclature_id join items on models.model_id=items.model_id join users on items.user_id=users.user_id where makes.make_id = '{$selectedMake}' and users.user_id != '44' group by models.model_name order by nomenclature.nomenclature_name";
     $result = $conn->query($sql);
     if (!$result) {
         printf("Error: %s\n", mysqli_error($conn));
         exit;
     }
     echo "<table>\r\n\t\t<tr>\r\n\t\t<th>Nomenclature</th>\r\n\t\t<th>Model Name</th>\r\n\t\t<th>Total</th>\r\n\t\t</tr>";
     if ($result->num_rows > 0) {
         //output data of each row into the Array
         while ($row = $result->fetch_assoc()) {
             //$nameArray[]= (string)$row;
             $selectedMake = $row["make_id"];
             $selectedModel = $row["model_id"];
             $selectedNom = $row["nomenclature_id"];
             echo "<tr>";
             echo "<td><a href=nomLandingPage.php?fn={$selectedNom}>" . $row['nomenclature_Name'] . "</td>";
             echo "<td><a href=modelToModel_id.php?fn={$selectedModel}>" . $row['model_name'] . "</td>";
             echo "<td>" . $row["modName"] . "</a></td>";
             echo "</tr>";
         }
         echo "</table>";
     }
     echo "<br/>";
     $conn->close();
 }
예제 #5
0
 public function deleteUser($inUser)
 {
     //not functional until we add the delete fields to the tables
     $conn = RfidController::connect();
     $sql = "UPDATE users SET delete_Boolean = '1' WHERE userName = '******'";
     $result = $conn->query($sql);
     if (!$result) {
         die("Didn't Work " . mysqli_error($conn));
     } else {
         echo "Success";
     }
     $conn->close();
 }
예제 #6
0
파일: Item.php 프로젝트: Notacadet/RFID
 public function insertItem($rfid, $inModel, $location, $serialNum, $comments, $price, $hrHolder)
 {
     $conn = RfidController::connect();
     //THIS WORKS
     $sql = "INSERT INTO items (rfid, model_id, location_id, serialNum,  comments, price,  user_id, delete_Boolean) VALUES ('{$rfid}', (SELECT model_id FROM models WHERE model_Name = '{$inModel}'), (SELECT location_id FROM locations WHERE roomNumber = '{$location}'), '{$serialNum}', '{$comments}', '{$price}', (SELECT user_id FROM users WHERE userName = '******'), '0')";
     $result = $conn->query($sql);
     if (!$result) {
         printf("Error: %s\n", mysqli_error($conn));
         exit;
     }
     $conn->close();
     echo "Item added";
 }
예제 #7
0
 public function selectRFID($inrfid, $inSerial)
 {
     $conn = RfidController::connect();
     $sql = "SELECT items.rfid, items.serialNum, locations.roomNumber, makes.makeName, models.model_name FROM items join locations on items.location_id=locations.location_id join models on items.model_id=models.model_id join makes on models.make_id=makes.make_id where rfid like '%{$inrfid}%' and serialNum like '%{$inSerial}%'";
     //$sql = "SELECT * from 'makes'";
     $result = $conn->query($sql);
     if ($result->num_rows > 0) {
         echo "<table><tr><th>RFID</th><th>Serial Number</th><th>Location</th><th>Make</th><th>Model</th></tr>";
         // output data of each row
         while ($row = $result->fetch_assoc()) {
             echo "<tr><td>" . $row["rfid"] . "</td><td>" . $row["serialNum"] . "</td><td>" . $row["roomNumber"] . "</td><td>" . $row["makeName"] . "</td><td>" . $row["model_name"] . "</td></tr>";
         }
         echo "</table>";
     } else {
         echo "0 results";
     }
     $conn->close();
 }
예제 #8
0
<?php

include 'RfidController.php';
$rC = new RfidController();
//isset($_GET['fn']!=="John Doe" )
$name = $_GET['fn'];
//Get the userName (email) based off of first and last name
//$split=explode(" ",$name);
//$fName=$split[0];
//$lName=$split[1];
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$conn = RfidController::connect();
$sql = "SELECT nomenclature.nomenclature_Name, nomenclature.nomenclature_id from nomenclature WHERE nomenclature_id= '{$name}'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $nomenclatureName = $row["nomenclature_Name"];
    }
}
echo "Nomenclature: ";
echo $nomenclatureName;
echo "<br/>";
$nomenclature = $rC->getNewNomenclature();
$nomenclature->createNomenclatureView($name);
예제 #9
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$item = $rC->getNewItem();
$item->generateDeleteItemForm();
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #10
0
<?php

include 'RfidController.php';
$rC = new RfidController();
//isset($_GET['fn']!=="John Doe" )
$name = $_GET['fn'];
//Get the userName (email) based off of first and last name
//$split=explode(" ",$name);
//$fName=$split[0];
//$lName=$split[1];
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$conn = RfidController::connect();
$sql = "SELECT makes.makeName, makes.make_id from makes WHERE make_id= '{$name}'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $makeName = $row["makeName"];
    }
}
echo "Make Name: ";
echo $makeName;
echo "<br/>";
$make = $rC->getNewMake();
$make->createMakeView($name);
예제 #11
0
파일: upModel.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$modelName = $_POST['modelName'];
$rC = new RfidController();
//$nM = Make($makes);
$rC->updateModel($modelName);
예제 #12
0
파일: delUser.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$userName = $_POST['userName'];
$rC = new RfidController();
$user = $rC->getNewUser();
$user->deleteUser($userName);
예제 #13
0
<?php

include 'RfidController.php';
$rC = new RfidController();
//isset($_GET['fn']!=="John Doe" )
$name = $_GET['fn'];
//Get the userName (email) based off of first and last name
//$split=explode(" ",$name);
//$fName=$split[0];
//$lName=$split[1];
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$conn = RfidController::connect();
$sql = "SELECT nomenclature.nomenclature_Name, items.rfid, items.price, items.serialNum, items.items_id, makes.make_id, locations.roomNumber, locations.location_id, makes.makeName, models.model_Name, models.model_id, users.userName FROM items join locations on items.location_id=locations.location_id join models on items.model_id=models.model_id join nomenclature on nomenclature.nomenclature_id=models.nom_id join makes on models.make_id=makes.make_id join users on items.user_id=users.user_id where items_id='{$name}' order by roomNumber, makeName, model_name";
$result = $conn->query($sql);
if (!$result) {
    printf("Error: %s\n", mysqli_error($con));
    exit;
}
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $rfidNum = $row["rfid"];
        $roomNumber = $row["roomNumber"];
        $price = $row["price"];
        $make = $row["makeName"];
        $model = $row["model_Name"];
        $nomenclature = $row["nomenclature_Name"];
        $serialNum = $row["serialNum"];
        $hrHolder = $row["userName"];
    }
}
예제 #14
0
<?php

include 'RfidController.php';
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$rank = $_POST['rank'];
$pass = $_POST['pass'];
$rC = new RfidController();
$users = $rC->getNewUser();
$users->insertUser($firstname, $lastname, $username, $rank, $pass);
예제 #15
0
<?php

include 'handReceipt.php';
include 'RfidController.php';
//isset($_GET['fn']!=="John Doe" )
$name = $_GET['fn'];
//Get the userName (email) based off of first and last name
$split = explode(" ", $name);
$fName = $split[0];
$lName = $split[1];
$conn = RfidController::connect();
$sName = "SELECT userName FROM users WHERE firstNAme= '{$fName}' and lastName= '{$lName}'";
$result = $conn->query($sName);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $holder = $row["userName"];
    }
}
echo $holder;
$testObject = new handReceipt();
$testObject->createHR($holder);
예제 #16
0
파일: selItem.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$rfid = $_POST['rfid'];
$serialNum = $_POST['serial'];
$roomNumber = $_POST['location'];
$rC = new RfidController();
$item = $rC->getNewItem();
$item->selectItem($rfid, $serialNum, $roomNumber);
예제 #17
0
파일: selRFID.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$rfid = $_POST['rfid'];
$serial = $_POST['serial'];
$rC = new RfidController();
//$nM = Make($makes);
$Rfid = $rC->getNewRfid();
$Rfid->selectRFID($rfid, $serial);
예제 #18
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$make = $rC->getNewMake();
$make->generateNewMakeForm();
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #19
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$prof = $rC->getNewProf();
$prof->generateNewProfileForm();
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #20
0
<?php

include 'RfidController.php';
$roomNumber = $_POST['roomNumber'];
$rC = new RfidController();
$location = $rC->getNewLocation();
$location->deleteLocation($roomNumber);
예제 #21
0
<?php

include 'RfidController.php';
$modelName = $_POST['modelName'];
$makeName = $_POST['makeName'];
$nomName = $_POST['nomName'];
$rC = new RfidController();
$model = $rC->getNewModel();
$model->insertModel($modelName, $makeName, $nomName);
예제 #22
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$make = $rC->getNewMake();
$model = $rC->getNewModel();
$nom = $rC->getNewNomenclature();
$make->generateNewMakeForm();
$model->generateNewModelForm();
$nom->generateNewNomForm();
$make->generateSelectMakeForm();
$model->generateSelectModelForm();
$nom->generateSelectNomForm();
$make->generateDeleteMakeForm();
$model->generateDeleteModelForm();
$nom->generateDeleteNomForm();
//$make->generateUpdateMakeForm(); don't need to ever do this to makes
//$model->generateUpdateModelForm(); don't need to ever do this to models until we incorporate pictures.
//$nom->generateUpdateNomForm(); don't need to ever do this
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #23
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$model = $rC->getNewModel();
$model->generateNewModelForm();
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #24
0
파일: delNom.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$nomName = $_POST['nomName'];
$rC = new RfidController();
$nom = $rC->getNewNomenclature();
$nom->deleteNomenclature($nomName);
예제 #25
0
<?php

include 'RfidController.php';
$rC = new RfidController();
//isset($_GET['fn']!=="John Doe" )
$name = $_GET['fn'];
//Get the userName (email) based off of first and last name
//$split=explode(" ",$name);
//$fName=$split[0];
//$lName=$split[1];
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$conn = RfidController::connect();
$sql = "SELECT locations.roomNumber, locations.location_id FROM locations where location_id= '{$name}'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $room = $row["roomNumber"];
    }
}
echo "Room Number: ";
echo $room;
echo "<br/>";
$location = $rC->getNewLocation();
$location->createLocationView($name);
예제 #26
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$nom = $rC->getNewNomenclature();
$nom->generateNewNomForm();
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
예제 #27
0
파일: home.php 프로젝트: Notacadet/RFID
<?php

include 'session.php';
include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
print "<br><br>";
print '<b id="welcome">Welcome: </b>';
?>

<?php 
echo $login_session;
?>

<?php 
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();
?>

예제 #28
0
파일: upNom.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$nomName = $_POST['nomName'];
$rC = new RfidController();
$rC->updateNomenclature($nomName);
예제 #29
0
파일: selMake.php 프로젝트: Notacadet/RFID
<?php

include 'RfidController.php';
$makeName = $_POST['makeName'];
$rC = new RfidController();
$make = $rC->getNewMake();
$make->selectMake($makeName);
예제 #30
0
<?php

include 'RfidController.php';
//include_once 'Make.php';
$rC = new RfidController();
$header = $rC->getNewHeader();
$header->printHTMLHeader();
$prof = $rC->selectProfile();
//$prof->generateNewProfileForm();
//need to add the capability to show all profiles upon landing on this page and a link back to profilepage.php
$footer = $rC->getNewFooter();
$footer->printHTMLFooter();