Beispiel #1
0
    $action = 'c';
    $id = -1;
}
sanitizeString($action);
// Set up DB connection
$dbBaseClass = new BaseDB();
$recordBase = BaseCompany::$company;
if (Database::getConnection() === false) {
    $_SESSION['error'] = "ERROR: Could not connect. " . printf('%s', dbGetErrorMsg());
    header("Location: BranchDisplayGrid.php");
    exit;
}
// An existing record is expected when the action is not "Create"
if ($action != 'c') {
    // Read the record
    $records = $dbBaseClass->getAll('Company', "WHERE id = {$id}");
    if ($records === false) {
        $_SESSION['error'] = dbGetErrorMsg();
        header("Location: BranchDisplayGrid.php");
        exit;
    }
    // Get the specific record
    $record = sqlsrv_fetch_array($records, SQLSRV_FETCH_ASSOC);
}
$companyBase = BaseCompany::$company;
function echoField($fieldIdName, $hidden = false)
{
    global $action;
    global $record;
    global $recordBase;
    $fieldParams = initializeFieldParametersArray($fieldIdName, $recordBase);
Beispiel #2
0
        $selectList .= "<option value='{$company['Id']}'>{$company['Name']}</option>";
    }
    $action = 'c';
    $id = -1;
}
sanitizeString($action);
// Set up DB connection
if (Database::getConnection() === false) {
    $_SESSION['error'] = "ERROR: Could not connect. " . printf('%s', dbGetErrorMsg());
    header("Location: BranchDisplayGrid.php");
    exit;
}
// An existing record is expected when the action is not "Create"
if ($action != 'c') {
    // Read the record
    $records = $dbBaseClass->getAll('Branch', "WHERE id = {$id}");
    if ($records === false) {
        $_SESSION['error'] = "ERROR: Could not connect. " . printf('%s', dbGetErrorMsg());
        header("Location: BranchDisplayGrid.php");
        exit;
    }
    // Get the specific record
    $record = sqlsrv_fetch_array($records, SQLSRV_FETCH_ASSOC);
}
$recordBase = BaseBranch::$Branch;
function echoField($fieldIdName, $hidden = false)
{
    global $action;
    global $record;
    global $recordBase;
    $fieldParams = initializeFieldParametersArray($fieldIdName, $recordBase);