예제 #1
0
<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
require_once 'swiftmailer/swift_required.php';
$subheader = __("Data Center Rack Request");
if ($config->ParameterArray["RackRequests"] != "enabled" || !$person->RackRequest) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$Dept = new Department();
$cab = new Cabinet();
$dev = new Device();
$req = new RackRequest();
$contact = new People();
$tmpContact = new People();
$formfix = $error = '';
$contactList = $person->GetUserList();
//We only need to worry about sending email in the event this is a new submission and no other time.
if (isset($_POST["action"])) {
    if (isset($_REQUEST['requestid']) && $_REQUEST['requestid'] > 0) {
        $req->RequestID = $_REQUEST['requestid'];
        $req->GetRequest();
        $contact->PersonID = $req->RequestorID;
        $contact->GetPerson();
    }
    $tmpContact->PersonID = $_POST["requestorid"];
    $tmpContact->GetPerson();
    // If any port other than 25 is specified, assume encryption and authentication
    if ($config->ParameterArray['SMTPPort'] != 25) {
예제 #2
0
 function UpdateRequest()
 {
     global $dbh;
     $this->MakeSafe();
     $old = new RackRequest();
     $old->RequestID = $this->RequestID;
     $old->GetRequest();
     $sql = "UPDATE fac_RackRequest SET RequestTime=now(), RequestorID={$this->RequestorID},\r\n\t\tLabel=\"{$this->Label}\", SerialNo=\"{$this->SerialNo}\", MfgDate=\"{$this->MfgDate}\", \r\n\t\tAssetTag=\"{$this->AssetTag}\", ESX={$this->ESX}, Owner={$this->Owner}, \r\n\t\tDeviceHeight=\"{$this->DeviceHeight}\", EthernetCount={$this->EthernetCount}, \r\n\t\tVLANList=\"{$this->VLANList}\", SANCount={$this->SANCount}, SANList=\"{$this->SANList}\",\r\n\t\tDeviceClass=\"{$this->DeviceClass}\", DeviceType=\"{$this->DeviceType}\",\r\n\t\tLabelColor=\"{$this->LabelColor}\", CurrentLocation=\"{$this->CurrentLocation}\",\r\n\t\tSpecialInstructions=\"{$this->SpecialInstructions}\"\r\n\t\tWHERE RequestID={$this->RequestID};";
     if ($dbh->query($sql)) {
         class_exists('LogActions') ? LogActions::LogThis($this, $old) : '';
         $this->MakeDisplay();
         return true;
     } else {
         return false;
     }
 }
예제 #3
0
파일: index.php 프로젝트: ghasedak/openDCIM
		(SELECT COUNT(*) FROM fac_VMInventory LIMIT 1) AS VMcount
		FROM fac_Device LIMIT 1;';
$row = $dbh->query($sql)->fetch();
$ITSdevices = $row['Devices'];
$ITSservers = $row['Servers'];
$ITSsize = $row['Size'];
$ITSVM = $row['VMcount'];
$ITSpower = $row['Power'];
$ITSheat = $ITSpower * 3.412 / 12000;
$dc = new DataCenter();
$dcList = $dc->GetDCList();
// Build table to display pending rack requests for inclusion later
$rackrequest = '';
if ($config->ParameterArray["RackRequests"] == "enabled" && $person->RackAdmin) {
    $rackrequest = "<h3>" . __("Pending Rack Requests") . "</h3>\n<div class=\"table whiteborder rackrequest\">\n<div>\n  <div>" . __("Submit Time") . "</div>\n  <div>" . __("Requestor") . "</div>\n  <div>" . __("System Name") . "</div>\n  <div>" . __("Department") . "</div>\n  <div>" . __("Due By") . "</div>\n</div>\n";
    $rack = new RackRequest();
    $tmpContact = new People();
    $dept = new Department();
    $rackList = $rack->GetOpenRequests();
    foreach ($rackList as $request) {
        $tmpContact->PersonID = $request->RequestorID;
        $tmpContact->GetPerson();
        $dept->DeptID = $request->Owner;
        $dept->GetDeptByID();
        $reqDate = getdate(strtotime($request->RequestTime));
        $dueDate = date('M j Y H:i:s', mktime($reqDate['hours'], $reqDate['minutes'], $reqDate['seconds'], $reqDate['mon'], $reqDate['mday'] + 1, $reqDate['year']));
        if (strtotime($dueDate) - strtotime('now') < intval($config->ParameterArray['RackOverdueHours'] * 3600)) {
            $colorCode = 'overdue';
        } elseif (strtotime($dueDate) - strtotime('now') < intval($config->ParameterArray['RackWarningHours'] * 3600)) {
            $colorCode = 'soon';
        } else {