Esempio n. 1
0
        $cab->CabinetHeight = $_REQUEST['cabinetheight'];
        $cab->Model = $_REQUEST['model'];
        $cab->MaxKW = $_REQUEST['maxkw'];
        $cab->MaxWeight = $_REQUEST['maxweight'];
        $cab->InstallationDate = $_REQUEST['installationdate'];
        $cab->UpdateCabinet();
    } elseif ($_REQUEST['cabaction'] == 'Create') {
        $cab->DataCenterID = $_REQUEST['datacenterid'];
        $cab->Location = $_REQUEST['location'];
        $cab->AssignedTo = $_REQUEST['assignedto'];
        $cab->CabinetHeight = $_REQUEST['cabinetheight'];
        $cab->Model = $_REQUEST['model'];
        $cab->MaxKW = $_REQUEST['maxkw'];
        $cab->MaxWeight = $_REQUEST['maxweight'];
        $cab->InstallationDate = $_REQUEST['installationdate'];
        $cab->CreateCabinet();
    }
}
if ($nodccab == "") {
    // only attempt to check for racks in the db if a data center has already been created
    $result = $dbh->prepare("SELECT * FROM fac_Cabinet LIMIT 1;");
    $result->execute();
    if ($result->rowCount() == 0) {
        // No racks defined disable complete option
        $nodccab = "<h3>Create a rack for equipment to be housed in</h3>";
        $nocabdrop = "readonly";
        $nocab = "error";
    } else {
        $nocab = $nocabdrop = $nodccab = "";
    }
}