Example #1
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Data Center Stockroom Supplies");
if (!$person->SiteAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$sup = new Supplies();
$bc = new BinContents();
$inventory = array();
if (isset($_REQUEST["supplyid"]) && $_REQUEST["supplyid"] > 0) {
    $sup->SupplyID = $_REQUEST["supplyid"];
    $sup->GetSupplies();
    $bc->SupplyID = $sup->SupplyID;
    $inventory = $bc->FindSupplies();
}
$status = "";
if (isset($_POST["action"]) && ($_POST["action"] == "Create" || $_POST["action"] == "Update")) {
    $sup->SupplyID = $_REQUEST["supplyid"];
    $sup->PartNum = $_REQUEST["partnum"];
    $sup->PartName = $_REQUEST["partname"];
    $sup->MinQty = $_REQUEST["minqty"];
    $sup->MaxQty = $_REQUEST["maxqty"];
    if ($_REQUEST["action"] == "Create") {
        if ($sup->PartNum != null && $sup->PartNum != "") {
            $sup->CreateSupplies();
        }
    } else {
Example #2
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Data Center Stockroom Supply Bins");
if (!$person->SiteAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$bin = new SupplyBin();
$bc = new BinContents();
$sup = new Supplies();
$supList = $sup->GetSuppliesList(true);
$formpatch = "";
$status = "";
if (isset($_REQUEST["binid"])) {
    $bin->BinID = isset($_POST['binid']) ? $_POST['binid'] : $_GET['binid'];
    $bin->GetBin();
    $bc->BinID = $bin->BinID;
    if (isset($_POST["action"]) && ($_POST["action"] == "Create" || $_POST["action"] == "Update") && ($_POST["location"] != null && $_POST["location"] != "")) {
        $bin->Location = $_POST["location"];
        if ($_POST["action"] == "Create") {
            $bin->CreateBin();
        } else {
            $binContents = $bc->GetBinContents();
            // We don't want someone changing the name of a bin to a blank anymore than we want them creating one as a blank name
            $status = __("Updated");
            $bin->UpdateBin();
            // only attempt to alter the contents of the bin if we have the proper elements
            if (isset($_POST['supplyid']) && count($_POST['supplyid'] > 0)) {
*/
require_once "db.inc.php";
require_once "facilities.inc.php";
require_once "mpdf/mpdf.php";
/* Version 1.0 of this report has no selectable parameters - you just get a complete dump */
$mpdf = new mPDF('win-1252', 'A4', '', '', 20, 15, 48, 25, 10, 10);
$mpdf->useOnlyCoreFonts = true;
// false is default
//$mpdf->SetProtection(array('print'));
$mpdf->SetTitle($config->ParameterArray["OrgName"] . " " . __("Supply Status Report"));
$mpdf->SetAuthor($config->ParameterArray["OrgName"]);
$mpdf->SetDisplayMode('fullpage');
$mpdf->useActiveForms = true;
$sup = new Supplies();
$bin = new SupplyBin();
$bc = new BinContents();
$SupplyList = $sup->GetSuppliesList();
$html = '
<html>
<head>
<style>
body {font-family: sans-serif;
    font-size: 10pt;
}
p {    margin: 0pt;
}
td { vertical-align: top; }
.items td {
    border-left: 0.1mm solid #000000;
    border-right: 0.1mm solid #000000;
}
Example #4
0
 function FindSupplies()
 {
     $this->MakeSafe();
     /* Return all of the bins where this SupplyID is found */
     $sql = "SELECT a.* FROM fac_BinContents a, fac_SupplyBin b WHERE \n\t\t\ta.SupplyID={$this->SupplyID} AND a.BinID=b.BinID ORDER BY b.Location ASC;";
     $binList = array();
     foreach ($this->query($sql) as $row) {
         $binList[] = BinContents::RowToObject($row);
     }
     return $binList;
 }