} $action = 'c'; $id = -1; } sanitizeString($action); // Set up DB connection $dbBaseClass = new BaseDB(); if (Database::getConnection() === false) { $_SESSION['error'] = "ERROR: Could not connect. " . printf('%s', dbGetErrorMsg()); header("Location: DivisionDisplayGrid.php"); exit; } // An existing record is expected when the action is not "Create" if ($action != 'c') { // Read the record $records = $dbBaseClass->getAllByFieldName('BusinessEntity', 'id', $id); if ($records === false) { $_SESSION['error'] = dbGetErrorMsg(); header("Location: DivisionDisplayGrid.php"); exit; } // Get the specific record $record = sqlsrv_fetch_array($records, SQLSRV_FETCH_ASSOC); $businessLevelId = $record['BusinessLevelId']['Value']; } $recordBase = BaseBusinessEntity::$BusinessEntity; function echoField($fieldIdName, $hidden = false) { global $action; global $record; global $recordBase;