Skip to content

Commit

Permalink
Added outlet location for rack power
Browse files Browse the repository at this point in the history
  • Loading branch information
administrators committed May 20, 2012
1 parent 34891c9 commit 48354ea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pduinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$pdu->FirmwareVersion=$_REQUEST['firmwareversion'];
$pdu->PanelID=$_REQUEST['panelid'];
$pdu->PanelPole=$_REQUEST['panelpole'];
$pdu->Location=$_REQUEST['location'];
// If failsafe is unset clear auto transfer switch panel information
if(isset($_REQUEST['failsafe'])){
$pdu->FailSafe=1;
Expand Down Expand Up @@ -106,6 +107,10 @@
<div><label for="label">Label</label></div>
<div><input type="text" name="label" id="label" size="50" value="<?php echo $pdu->Label; ?>"></div>
</div>
<div>
<div><label for="location">Outlet Location</label></div>
<div><input type="text" name="location" id="label" size="50" value="<?php echo $pdu->Location; ?>"></div>
</div>
<div>
<div><label for="cabinetid">Cabinet</label></div>
<div><?php echo $cab->GetCabinetSelectList( $facDB ); ?></div>
Expand Down
19 changes: 18 additions & 1 deletion power.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class PowerDistribution {

var $PDUID;
var $Label;
var $Location;
var $CabinetID;
var $InputVoltage;
var $InputAmperage;
Expand Down Expand Up @@ -161,7 +162,23 @@ function CreatePDU( $db ) {
}

function UpdatePDU( $db ) {
$update_sql = "update fac_PowerDistribution set Label=\"" . addslashes($this->Label) . "\", CabinetID=\"" . intval($this->CabinetID) . "\", InputVoltage=\"" . $this->InputVoltage . "\", InputAmperage=\"" . intval( $this->InputAmperage ) . "\", ManagementType=\"" . $this->ManagementType . "\", Model=\"" . addslashes($this->Model) . "\", NumOutputs=\"" . intval($this->NumOutputs) . "\", IPAddress=\"" . addslashes($this->IPAddress) . "\", SNMPCommunity=\"" . addslashes($this->SNMPCommunity) . "\", PanelID=\"" . intval($this->PanelID) . "\", PanelPole=\"" . intval($this->PanelPole) . "\", FailSafe=\"" . intval($this->FailSafe) . "\", PanelID2=\"" . intval($this->PanelID2) . "\", PanelPole2=\"" . intval($this->PanelPole2) . "\" where PDUID=\"" . intval($this->PDUID) . "\"";
$update_sql = "update fac_PowerDistribution set
Label=\"" . addslashes($this->Label) . "\",
Location=\"" . addslashes($this->Location) . "\",
CabinetID=\"" . intval($this->CabinetID) . "\",
InputVoltage=\"" . $this->InputVoltage . "\",
InputAmperage=\"" . intval( $this->InputAmperage ) . "\",
ManagementType=\"" . $this->ManagementType . "\",
Model=\"" . addslashes($this->Model) . "\",
NumOutputs=\"" . intval($this->NumOutputs) . "\",
IPAddress=\"" . addslashes($this->IPAddress) . "\",
SNMPCommunity=\"" . addslashes($this->SNMPCommunity) . "\",
PanelID=\"" . intval($this->PanelID) . "\",
PanelPole=\"" . intval($this->PanelPole) . "\",
FailSafe=\"" . intval($this->FailSafe) . "\",
PanelID2=\"" . intval($this->PanelID2) . "\",
PanelPole2=\"" . intval($this->PanelPole2) . "\"
where PDUID=\"" . intval($this->PDUID) . "\"";

return mysql_query( $update_sql, $db );
}
Expand Down

0 comments on commit 48354ea

Please sign in to comment.