UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token return $PageUrl; } // Page URLs var $AddUrl; var $EditUrl; var $CopyUrl; var $DeleteUrl; var $ViewUrl; var $ListUrl; // Message function getMessage() { return @$_SESSION[EW_SESSION_MESSAGE]; } function setMessage($v) { ew_AddMessage($_SESSION[EW_SESSION_MESSAGE], $v); } function getFailureMessage() { return @$_SESSION[EW_SESSION_FAILURE_MESSAGE]; } function setFailureMessage($v) { ew_AddMessage($_SESSION[EW_SESSION_FAILURE_MESSAGE], $v); } function getSuccessMessage() { return @$_SESSION[EW_SESSION_SUCCESS_MESSAGE]; } function setSuccessMessage($v) { ew_AddMessage($_SESSION[EW_SESSION_SUCCESS_MESSAGE], $v); } function getWarningMessage() { return @$_SESSION[EW_SESSION_WARNING_MESSAGE]; } function setWarningMessage($v) { ew_AddMessage($_SESSION[EW_SESSION_WARNING_MESSAGE], $v); } // Methods to clear message function ClearMessage() { $_SESSION[EW_SESSION_MESSAGE] = ""; } function ClearFailureMessage() { $_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; } function ClearSuccessMessage() { $_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; } function ClearWarningMessage() { $_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; } function ClearMessages() { $_SESSION[EW_SESSION_MESSAGE] = ""; $_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; $_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; $_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; } // Show message function ShowMessage() { $hidden = FALSE; $html = ""; // Message $sMessage = $this->getMessage(); if (method_exists($this, "Message_Showing")) $this->Message_Showing($sMessage, ""); if ($sMessage <> "") { // Message in Session, display if (!$hidden) $sMessage = "" . $sMessage; $html .= "
" . $sHeader . "
"; } } // Show Page Footer function ShowPageFooter() { $sFooter = $this->PageFooter; $this->Page_DataRendered($sFooter); if ($sFooter <> "") { // Footer exists, display echo "" . $sFooter . "
"; } } // Validate page request function IsPageRequest() { global $objForm; if ($this->UseTokenInUrl) { if ($objForm) return ($this->TableVar == $objForm->GetValue("t")); if (@$_GET["t"] <> "") return ($this->TableVar == $_GET["t"]); } else { return TRUE; } } var $Token = ""; var $TokenTimeout = 0; var $CheckToken = EW_CHECK_TOKEN; var $CheckTokenFn = "ew_CheckToken"; var $CreateTokenFn = "ew_CreateToken"; // Valid Post function ValidPost() { if (!$this->CheckToken || !ew_IsHttpPost()) return TRUE; if (!isset($_POST[EW_TOKEN_NAME])) return FALSE; $fn = $this->CheckTokenFn; if (is_callable($fn)) return $fn($_POST[EW_TOKEN_NAME], $this->TokenTimeout); return FALSE; } // Create Token function CreateToken() { global $gsToken; if ($this->CheckToken) { $fn = $this->CreateTokenFn; if ($this->Token == "" && is_callable($fn)) // Create token $this->Token = $fn(); $gsToken = $this->Token; // Save to global variable } } // // Page class constructor // function __construct() { global $conn, $Language; global $UserTable, $UserTableConn; $this->FormActionName .= '_' . $this->FormName; $this->FormKeyName .= '_' . $this->FormName; $this->FormOldKeyName .= '_' . $this->FormName; $this->FormBlankRowName .= '_' . $this->FormName; $this->FormKeyCountName .= '_' . $this->FormName; $GLOBALS["Grid"] = &$this; $this->TokenTimeout = ew_SessionTimeoutTime(); // Language object if (!isset($Language)) $Language = new cLanguage(); // Parent constuctor parent::__construct(); // Table object (taccomodations) if (!isset($GLOBALS["taccomodations"]) || get_class($GLOBALS["taccomodations"]) == "ctaccomodations") { $GLOBALS["taccomodations"] = &$this; // $GLOBALS["MasterTable"] = &$GLOBALS["Table"]; // if (!isset($GLOBALS["Table"])) $GLOBALS["Table"] = &$GLOBALS["taccomodations"]; } $this->AddUrl = "taccomodationsadd.php"; // Table object (users) if (!isset($GLOBALS['users'])) $GLOBALS['users'] = new cusers(); // Page ID if (!defined("EW_PAGE_ID")) define("EW_PAGE_ID", 'grid', TRUE); // Table name (for backward compatibility) if (!defined("EW_TABLE_NAME")) define("EW_TABLE_NAME", 'taccomodations', TRUE); // Start timer if (!isset($GLOBALS["gTimer"])) $GLOBALS["gTimer"] = new cTimer(); // Open connection if (!isset($conn)) $conn = ew_Connect($this->DBID); // User table object (users) if (!isset($UserTable)) { $UserTable = new cusers(); $UserTableConn = Conn($UserTable->DBID); } // List options $this->ListOptions = new cListOptions(); $this->ListOptions->TableVar = $this->TableVar; // Other options $this->OtherOptions['addedit'] = new cListOptions(); $this->OtherOptions['addedit']->Tag = "div"; $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption"; } // // Page_Init // function Page_Init() { global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; // Security $Security = new cAdvancedSecurity(); if (!$Security->IsLoggedIn()) $Security->AutoLogin(); if ($Security->IsLoggedIn()) $Security->TablePermission_Loading(); $Security->LoadCurrentUserLevel($this->ProjectID . $this->TableName); if ($Security->IsLoggedIn()) $Security->TablePermission_Loaded(); if (!$Security->CanList()) { $Security->SaveLastUrl(); $this->setFailureMessage(ew_DeniedMsg()); // Set no permission $this->Page_Terminate(ew_GetUrl("index.php")); } // Get grid add count $gridaddcnt = @$_GET[EW_TABLE_GRID_ADD_ROW_COUNT]; if (is_numeric($gridaddcnt) && $gridaddcnt > 0) $this->GridAddRowCount = $gridaddcnt; // Set up list options $this->SetupListOptions(); $this->idOfferer->SetVisibility(); $this->Accom_Type->SetVisibility(); $this->Address->SetVisibility(); $this->Town->SetVisibility(); $this->District->SetVisibility(); $this->Region->SetVisibility(); $this->Beds->SetVisibility(); $this->Rooms->SetVisibility(); $this->Bathrooms->SetVisibility(); $this->Private_Kitchen->SetVisibility(); $this->Available_from->SetVisibility(); $this->Available_to->SetVisibility(); $this->Rel_type->SetVisibility(); // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); // Check token if (!$this->ValidPost()) { echo $Language->Phrase("InvalidPostRequest"); $this->Page_Terminate(); exit(); } // Process auto fill if (@$_POST["ajax"] == "autofill") { // Process auto fill for detail table 'tassigment' if (@$_POST["grid"] == "ftassigmentgrid") { if (!isset($GLOBALS["tassigment_grid"])) $GLOBALS["tassigment_grid"] = new ctassigment_grid; $GLOBALS["tassigment_grid"]->Page_Init(); $this->Page_Terminate(); exit(); } $results = $this->GetAutoFill(@$_POST["name"], @$_POST["q"]); if ($results) { // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); echo $results; $this->Page_Terminate(); exit(); } } // Create Token $this->CreateToken(); // Set up master detail parameters $this->SetUpMasterParms(); // Setup other options $this->SetupOtherOptions(); } // // Page_Terminate // function Page_Terminate($url = "") { global $gsExportFile, $gTmpImages; // Export global $EW_EXPORT, $taccomodations; if ($this->CustomExport <> "" && $this->CustomExport == $this->Export && array_key_exists($this->CustomExport, $EW_EXPORT)) { $sContent = ob_get_contents(); if ($gsExportFile == "") $gsExportFile = $this->TableVar; $class = $EW_EXPORT[$this->CustomExport]; if (class_exists($class)) { $doc = new $class($taccomodations); $doc->Text = $sContent; if ($this->Export == "email") echo $this->ExportEmail($doc->Text); else $doc->Export(); ew_DeleteTmpImages(); // Delete temp images exit(); } } // $GLOBALS["Table"] = &$GLOBALS["MasterTable"]; unset($GLOBALS["Grid"]); if ($url == "") return; $this->Page_Redirecting($url); // Go to URL if specified if ($url <> "") { if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); header("Location: " . $url); } exit(); } // Class variables var $ListOptions; // List options var $ExportOptions; // Export options var $SearchOptions; // Search options var $OtherOptions = array(); // Other options var $FilterOptions; // Filter options var $ListActions; // List actions var $SelectedCount = 0; var $SelectedIndex = 0; var $ShowOtherOptions = FALSE; var $DisplayRecs = 20; var $StartRec; var $StopRec; var $TotalRecs = 0; var $RecRange = 10; var $Pager; var $DefaultSearchWhere = ""; // Default search WHERE clause var $SearchWhere = ""; // Search WHERE clause var $RecCnt = 0; // Record count var $EditRowCnt; var $StartRowCnt = 1; var $RowCnt = 0; var $Attrs = array(); // Row attributes and cell attributes var $RowIndex = 0; // Row index var $KeyCount = 0; // Key count var $RowAction = ""; // Row action var $RowOldKey = ""; // Row old key (for copy) var $RecPerRow = 0; var $MultiColumnClass; var $MultiColumnEditClass = "col-sm-12"; var $MultiColumnCnt = 12; var $MultiColumnEditCnt = 12; var $GridCnt = 0; var $ColCnt = 0; var $DbMasterFilter = ""; // Master filter var $DbDetailFilter = ""; // Detail filter var $MasterRecordExists; var $MultiSelectKey; var $Command; var $RestoreSearch = FALSE; var $tassigment_Count; var $DetailPages; var $Recordset; var $OldRecordset; // // Page main // function Page_Main() { global $objForm, $Language, $gsFormError, $gsSearchError, $Security; // Search filters $sSrchAdvanced = ""; // Advanced search filter $sSrchBasic = ""; // Basic search filter $sFilter = ""; // Get command $this->Command = strtolower(@$_GET["cmd"]); if ($this->IsPageRequest()) { // Validate request // Set up records per page $this->SetUpDisplayRecs(); // Handle reset command $this->ResetCmd(); // Hide list options if ($this->Export <> "") { $this->ListOptions->HideAllOptions(array("sequence")); $this->ListOptions->UseDropDownButton = FALSE; // Disable drop down button $this->ListOptions->UseButtonGroup = FALSE; // Disable button group } elseif ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") { $this->ListOptions->HideAllOptions(); $this->ListOptions->UseDropDownButton = FALSE; // Disable drop down button $this->ListOptions->UseButtonGroup = FALSE; // Disable button group } // Show grid delete link for grid add / grid edit if ($this->AllowAddDeleteRow) { if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") { $item = $this->ListOptions->GetItem("griddelete"); if ($item) $item->Visible = TRUE; } } // Set up sorting order $this->SetUpSortOrder(); } // Restore display records if ($this->getRecordsPerPage() <> "") { $this->DisplayRecs = $this->getRecordsPerPage(); // Restore from Session } else { $this->DisplayRecs = 20; // Load default } // Load Sorting Order $this->LoadSortOrder(); // Build filter $sFilter = ""; if (!$Security->CanList()) $sFilter = "(0=1)"; // Filter all records // Restore master/detail filter $this->DbMasterFilter = $this->GetMasterFilter(); // Restore master filter $this->DbDetailFilter = $this->GetDetailFilter(); // Restore detail filter ew_AddFilter($sFilter, $this->DbDetailFilter); ew_AddFilter($sFilter, $this->SearchWhere); // Load master record if ($this->CurrentMode <> "add" && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "tofferers") { global $tofferers; $rsmaster = $tofferers->LoadRs($this->DbMasterFilter); $this->MasterRecordExists = ($rsmaster && !$rsmaster->EOF); if (!$this->MasterRecordExists) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record found $this->Page_Terminate("toffererslist.php"); // Return to master page } else { $tofferers->LoadListRowValues($rsmaster); $tofferers->RowType = EW_ROWTYPE_MASTER; // Master row $tofferers->RenderListRow(); $rsmaster->Close(); } } // Set up filter in session $this->setSessionWhere($sFilter); $this->CurrentFilter = ""; // Load record count first if (!$this->IsAddOrEdit()) { $bSelectLimit = $this->UseSelectLimit; if ($bSelectLimit) { $this->TotalRecs = $this->SelectRecordCount(); } else { if ($this->Recordset = $this->LoadRecordset()) $this->TotalRecs = $this->Recordset->RecordCount(); } } } // Set up number of records displayed per page function SetUpDisplayRecs() { $sWrk = @$_GET[EW_TABLE_REC_PER_PAGE]; if ($sWrk <> "") { if (is_numeric($sWrk)) { $this->DisplayRecs = intval($sWrk); } else { if (strtolower($sWrk) == "all") { // Display all records $this->DisplayRecs = -1; } else { $this->DisplayRecs = 20; // Non-numeric, load default } } $this->setRecordsPerPage($this->DisplayRecs); // Save to Session // Reset start position $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); } } // Exit inline mode function ClearInlineMode() { $this->LastAction = $this->CurrentAction; // Save last action $this->CurrentAction = ""; // Clear action $_SESSION[EW_SESSION_INLINE_MODE] = ""; // Clear inline mode } // Switch to Grid Add mode function GridAddMode() { $_SESSION[EW_SESSION_INLINE_MODE] = "gridadd"; // Enabled grid add } // Switch to Grid Edit mode function GridEditMode() { $_SESSION[EW_SESSION_INLINE_MODE] = "gridedit"; // Enable grid edit } // Perform update to grid function GridUpdate() { global $Language, $objForm, $gsFormError; $bGridUpdate = TRUE; // Get old recordset $this->CurrentFilter = $this->BuildKeyFilter(); if ($this->CurrentFilter == "") $this->CurrentFilter = "0=1"; $sSql = $this->SQL(); $conn = &$this->Connection(); if ($rs = $conn->Execute($sSql)) { $rsold = $rs->GetRows(); $rs->Close(); } // Call Grid Updating event if (!$this->Grid_Updating($rsold)) { if ($this->getFailureMessage() == "") $this->setFailureMessage($Language->Phrase("GridEditCancelled")); // Set grid edit cancelled message return FALSE; } $sKey = ""; // Update row index and get row key $objForm->Index = -1; $rowcnt = strval($objForm->GetValue($this->FormKeyCountName)); if ($rowcnt == "" || !is_numeric($rowcnt)) $rowcnt = 0; // Update all rows based on key for ($rowindex = 1; $rowindex <= $rowcnt; $rowindex++) { $objForm->Index = $rowindex; $rowkey = strval($objForm->GetValue($this->FormKeyName)); $rowaction = strval($objForm->GetValue($this->FormActionName)); // Load all values and keys if ($rowaction <> "insertdelete") { // Skip insert then deleted rows $this->LoadFormValues(); // Get form values if ($rowaction == "" || $rowaction == "edit" || $rowaction == "delete") { $bGridUpdate = $this->SetupKeyValues($rowkey); // Set up key values } else { $bGridUpdate = TRUE; } // Skip empty row if ($rowaction == "insert" && $this->EmptyRow()) { // No action required // Validate form and insert/update/delete record } elseif ($bGridUpdate) { if ($rowaction == "delete") { $this->CurrentFilter = $this->KeyFilter(); $bGridUpdate = $this->DeleteRows(); // Delete this row } else if (!$this->ValidateForm()) { $bGridUpdate = FALSE; // Form error, reset action $this->setFailureMessage($gsFormError); } else { if ($rowaction == "insert") { $bGridUpdate = $this->AddRow(); // Insert this row } else { if ($rowkey <> "") { $this->SendEmail = FALSE; // Do not send email on update success $bGridUpdate = $this->EditRow(); // Update this row } } // End update } } if ($bGridUpdate) { if ($sKey <> "") $sKey .= ", "; $sKey .= $rowkey; } else { break; } } } if ($bGridUpdate) { // Get new recordset if ($rs = $conn->Execute($sSql)) { $rsnew = $rs->GetRows(); $rs->Close(); } // Call Grid_Updated event $this->Grid_Updated($rsold, $rsnew); $this->ClearInlineMode(); // Clear inline edit mode } else { if ($this->getFailureMessage() == "") $this->setFailureMessage($Language->Phrase("UpdateFailed")); // Set update failed message } return $bGridUpdate; } // Build filter for all keys function BuildKeyFilter() { global $objForm; $sWrkFilter = ""; // Update row index and get row key $rowindex = 1; $objForm->Index = $rowindex; $sThisKey = strval($objForm->GetValue($this->FormKeyName)); while ($sThisKey <> "") { if ($this->SetupKeyValues($sThisKey)) { $sFilter = $this->KeyFilter(); if ($sWrkFilter <> "") $sWrkFilter .= " OR "; $sWrkFilter .= $sFilter; } else { $sWrkFilter = "0=1"; break; } // Update row index and get row key $rowindex++; // Next row $objForm->Index = $rowindex; $sThisKey = strval($objForm->GetValue($this->FormKeyName)); } return $sWrkFilter; } // Set up key values function SetupKeyValues($key) { $arrKeyFlds = explode($GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"], $key); if (count($arrKeyFlds) >= 1) { $this->idAccomodation->setFormValue($arrKeyFlds[0]); if (!is_numeric($this->idAccomodation->FormValue)) return FALSE; } return TRUE; } // Perform Grid Add function GridInsert() { global $Language, $objForm, $gsFormError; $rowindex = 1; $bGridInsert = FALSE; $conn = &$this->Connection(); // Call Grid Inserting event if (!$this->Grid_Inserting()) { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("GridAddCancelled")); // Set grid add cancelled message } return FALSE; } // Init key filter $sWrkFilter = ""; $addcnt = 0; $sKey = ""; // Get row count $objForm->Index = -1; $rowcnt = strval($objForm->GetValue($this->FormKeyCountName)); if ($rowcnt == "" || !is_numeric($rowcnt)) $rowcnt = 0; // Insert all rows for ($rowindex = 1; $rowindex <= $rowcnt; $rowindex++) { // Load current row values $objForm->Index = $rowindex; $rowaction = strval($objForm->GetValue($this->FormActionName)); if ($rowaction <> "" && $rowaction <> "insert") continue; // Skip if ($rowaction == "insert") { $this->RowOldKey = strval($objForm->GetValue($this->FormOldKeyName)); $this->LoadOldRecord(); // Load old recordset } $this->LoadFormValues(); // Get form values if (!$this->EmptyRow()) { $addcnt++; $this->SendEmail = FALSE; // Do not send email on insert success // Validate form if (!$this->ValidateForm()) { $bGridInsert = FALSE; // Form error, reset action $this->setFailureMessage($gsFormError); } else { $bGridInsert = $this->AddRow($this->OldRecordset); // Insert this row } if ($bGridInsert) { if ($sKey <> "") $sKey .= $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"]; $sKey .= $this->idAccomodation->CurrentValue; // Add filter for this record $sFilter = $this->KeyFilter(); if ($sWrkFilter <> "") $sWrkFilter .= " OR "; $sWrkFilter .= $sFilter; } else { break; } } } if ($addcnt == 0) { // No record inserted $this->ClearInlineMode(); // Clear grid add mode and return return TRUE; } if ($bGridInsert) { // Get new recordset $this->CurrentFilter = $sWrkFilter; $sSql = $this->SQL(); if ($rs = $conn->Execute($sSql)) { $rsnew = $rs->GetRows(); $rs->Close(); } // Call Grid_Inserted event $this->Grid_Inserted($rsnew); $this->ClearInlineMode(); // Clear grid add mode } else { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("InsertFailed")); // Set insert failed message } } return $bGridInsert; } // Check if empty row function EmptyRow() { global $objForm; if ($objForm->HasValue("x_idOfferer") && $objForm->HasValue("o_idOfferer") && $this->idOfferer->CurrentValue <> $this->idOfferer->OldValue) return FALSE; if ($objForm->HasValue("x_Accom_Type") && $objForm->HasValue("o_Accom_Type") && $this->Accom_Type->CurrentValue <> $this->Accom_Type->OldValue) return FALSE; if ($objForm->HasValue("x_Address") && $objForm->HasValue("o_Address") && $this->Address->CurrentValue <> $this->Address->OldValue) return FALSE; if ($objForm->HasValue("x_Town") && $objForm->HasValue("o_Town") && $this->Town->CurrentValue <> $this->Town->OldValue) return FALSE; if ($objForm->HasValue("x_District") && $objForm->HasValue("o_District") && $this->District->CurrentValue <> $this->District->OldValue) return FALSE; if ($objForm->HasValue("x_Region") && $objForm->HasValue("o_Region") && $this->Region->CurrentValue <> $this->Region->OldValue) return FALSE; if ($objForm->HasValue("x_Beds") && $objForm->HasValue("o_Beds") && $this->Beds->CurrentValue <> $this->Beds->OldValue) return FALSE; if ($objForm->HasValue("x_Rooms") && $objForm->HasValue("o_Rooms") && $this->Rooms->CurrentValue <> $this->Rooms->OldValue) return FALSE; if ($objForm->HasValue("x_Bathrooms") && $objForm->HasValue("o_Bathrooms") && $this->Bathrooms->CurrentValue <> $this->Bathrooms->OldValue) return FALSE; if ($objForm->HasValue("x_Private_Kitchen") && $objForm->HasValue("o_Private_Kitchen") && ew_ConvertToBool($this->Private_Kitchen->CurrentValue) <> ew_ConvertToBool($this->Private_Kitchen->OldValue)) return FALSE; if ($objForm->HasValue("x_Available_from") && $objForm->HasValue("o_Available_from") && $this->Available_from->CurrentValue <> $this->Available_from->OldValue) return FALSE; if ($objForm->HasValue("x_Available_to") && $objForm->HasValue("o_Available_to") && $this->Available_to->CurrentValue <> $this->Available_to->OldValue) return FALSE; if ($objForm->HasValue("x_Rel_type") && $objForm->HasValue("o_Rel_type") && $this->Rel_type->CurrentValue <> $this->Rel_type->OldValue) return FALSE; return TRUE; } // Validate grid form function ValidateGridForm() { global $objForm; // Get row count $objForm->Index = -1; $rowcnt = strval($objForm->GetValue($this->FormKeyCountName)); if ($rowcnt == "" || !is_numeric($rowcnt)) $rowcnt = 0; // Validate all records for ($rowindex = 1; $rowindex <= $rowcnt; $rowindex++) { // Load current row values $objForm->Index = $rowindex; $rowaction = strval($objForm->GetValue($this->FormActionName)); if ($rowaction <> "delete" && $rowaction <> "insertdelete") { $this->LoadFormValues(); // Get form values if ($rowaction == "insert" && $this->EmptyRow()) { // Ignore } else if (!$this->ValidateForm()) { return FALSE; } } } return TRUE; } // Get all form values of the grid function GetGridFormValues() { global $objForm; // Get row count $objForm->Index = -1; $rowcnt = strval($objForm->GetValue($this->FormKeyCountName)); if ($rowcnt == "" || !is_numeric($rowcnt)) $rowcnt = 0; $rows = array(); // Loop through all records for ($rowindex = 1; $rowindex <= $rowcnt; $rowindex++) { // Load current row values $objForm->Index = $rowindex; $rowaction = strval($objForm->GetValue($this->FormActionName)); if ($rowaction <> "delete" && $rowaction <> "insertdelete") { $this->LoadFormValues(); // Get form values if ($rowaction == "insert" && $this->EmptyRow()) { // Ignore } else { $rows[] = $this->GetFieldValues("FormValue"); // Return row as array } } } return $rows; // Return as array of array } // Restore form values for current row function RestoreCurrentRowFormValues($idx) { global $objForm; // Get row based on current index $objForm->Index = $idx; $this->LoadFormValues(); // Load form values } // Set up sort parameters function SetUpSortOrder() { // Check for "order" parameter if (@$_GET["order"] <> "") { $this->CurrentOrder = ew_StripSlashes(@$_GET["order"]); $this->CurrentOrderType = @$_GET["ordertype"]; $this->setStartRecordNumber(1); // Reset start position } } // Load sort order parameters function LoadSortOrder() { $sOrderBy = $this->getSessionOrderBy(); // Get ORDER BY from Session if ($sOrderBy == "") { if ($this->getSqlOrderBy() <> "") { $sOrderBy = $this->getSqlOrderBy(); $this->setSessionOrderBy($sOrderBy); } } } // Reset command // - cmd=reset (Reset search parameters) // - cmd=resetall (Reset search and master/detail parameters) // - cmd=resetsort (Reset sort parameters) function ResetCmd() { // Check if reset command if (substr($this->Command,0,5) == "reset") { // Reset master/detail keys if ($this->Command == "resetall") { $this->setCurrentMasterTable(""); // Clear master table $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; $this->idOfferer->setSessionValue(""); } // Reset sorting order if ($this->Command == "resetsort") { $sOrderBy = ""; $this->setSessionOrderBy($sOrderBy); } // Reset start position $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); } } // Set up list options function SetupListOptions() { global $Security, $Language; // "griddelete" if ($this->AllowAddDeleteRow) { $item = &$this->ListOptions->Add("griddelete"); $item->CssStyle = "white-space: nowrap;"; $item->OnLeft = FALSE; $item->Visible = FALSE; // Default hidden } // Add group option item $item = &$this->ListOptions->Add($this->ListOptions->GroupOptionName); $item->Body = ""; $item->OnLeft = FALSE; $item->Visible = FALSE; // "view" $item = &$this->ListOptions->Add("view"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $Security->CanView(); $item->OnLeft = FALSE; // "edit" $item = &$this->ListOptions->Add("edit"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $Security->CanEdit(); $item->OnLeft = FALSE; // "delete" $item = &$this->ListOptions->Add("delete"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $Security->CanDelete(); $item->OnLeft = FALSE; // Drop down button for ListOptions $this->ListOptions->UseImageAndText = TRUE; $this->ListOptions->UseDropDownButton = FALSE; $this->ListOptions->DropDownButtonPhrase = $Language->Phrase("ButtonListOptions"); $this->ListOptions->UseButtonGroup = FALSE; if ($this->ListOptions->UseButtonGroup && ew_IsMobile()) $this->ListOptions->UseDropDownButton = TRUE; $this->ListOptions->ButtonClass = "btn-sm"; // Class for button group $item = &$this->ListOptions->GetItem($this->ListOptions->GroupOptionName); $item->Visible = $this->ListOptions->GroupOptionVisible(); } // Render list options function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // Set up row action and key if (is_numeric($this->RowIndex) && $this->CurrentMode <> "view") { $objForm->Index = $this->RowIndex; $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName); $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName); $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName); $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName); if ($this->RowAction <> "") $this->MultiSelectKey .= "RowAction . "\">"; if ($objForm->HasValue($this->FormOldKeyName)) $this->RowOldKey = strval($objForm->GetValue($this->FormOldKeyName)); if ($this->RowOldKey <> "") $this->MultiSelectKey .= "RowOldKey) . "\">"; if ($this->RowAction == "delete") { $rowkey = $objForm->GetValue($this->FormKeyName); $this->SetupKeyValues($rowkey); } if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) $this->MultiSelectKey .= ""; } // "delete" if ($this->AllowAddDeleteRow) { if ($this->CurrentMode == "add" || $this->CurrentMode == "copy" || $this->CurrentMode == "edit") { $option = &$this->ListOptions; $option->UseButtonGroup = TRUE; // Use button group for grid delete button $option->UseImageAndText = TRUE; // Use image and text for grid delete button $oListOpt = &$option->Items["griddelete"]; if (!$Security->CanDelete() && is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) { // Do not allow delete existing record $oListOpt->Body = " "; } else { $oListOpt->Body = "Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" onclick=\"return ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . ""; } } } if ($this->CurrentMode == "view") { // View mode // "view" $oListOpt = &$this->ListOptions->Items["view"]; $viewcaption = ew_HtmlTitle($Language->Phrase("ViewLink")); if ($Security->CanView()) { $oListOpt->Body = "ViewUrl) . "\">" . $Language->Phrase("ViewLink") . ""; } else { $oListOpt->Body = ""; } // "edit" $oListOpt = &$this->ListOptions->Items["edit"]; $editcaption = ew_HtmlTitle($Language->Phrase("EditLink")); if ($Security->CanEdit()) { $oListOpt->Body = "Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . ""; } else { $oListOpt->Body = ""; } // "delete" $oListOpt = &$this->ListOptions->Items["delete"]; if ($Security->CanDelete()) $oListOpt->Body = "Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . ""; else $oListOpt->Body = ""; } // End View mode if ($this->CurrentMode == "edit" && is_numeric($this->RowIndex)) { $this->MultiSelectKey .= "idAccomodation->CurrentValue . "\">"; } $this->RenderListOptionsExt(); } // Set record key function SetRecordKey(&$key, $rs) { $key = ""; if ($key <> "") $key .= $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"]; $key .= $rs->fields('idAccomodation'); } // Set up other options function SetupOtherOptions() { global $Language, $Security; $option = &$this->OtherOptions["addedit"]; $option->UseDropDownButton = FALSE; $option->DropDownButtonPhrase = $Language->Phrase("ButtonAddEdit"); $option->UseButtonGroup = TRUE; $option->ButtonClass = "btn-sm"; // Class for button group $item = &$option->Add($option->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; // Add if ($this->CurrentMode == "view") { // Check view mode $item = &$option->Add("add"); $addcaption = ew_HtmlTitle($Language->Phrase("AddLink")); $item->Body = "AddUrl) . "\">" . $Language->Phrase("AddLink") . ""; $item->Visible = ($this->AddUrl <> "" && $Security->CanAdd()); } } // Render other options function RenderOtherOptions() { global $Language, $Security; $options = &$this->OtherOptions; if (($this->CurrentMode == "add" || $this->CurrentMode == "copy" || $this->CurrentMode == "edit") && $this->CurrentAction != "F") { // Check add/copy/edit mode if ($this->AllowAddDeleteRow) { $option = &$options["addedit"]; $option->UseDropDownButton = FALSE; $option->UseImageAndText = TRUE; $item = &$option->Add("addblankrow"); $item->Body = "Phrase("AddBlankRow")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("AddBlankRow")) . "\" href=\"javascript:void(0);\" onclick=\"ew_AddGridRow(this);\">" . $Language->Phrase("AddBlankRow") . ""; $item->Visible = $Security->CanAdd(); $this->ShowOtherOptions = $item->Visible; } } if ($this->CurrentMode == "view") { // Check view mode $option = &$options["addedit"]; $item = &$option->GetItem("add"); $this->ShowOtherOptions = $item && $item->Visible; } } function RenderListOptionsExt() { global $Security, $Language; } // Set up starting record parameters function SetUpStartRec() { if ($this->DisplayRecs == 0) return; if ($this->IsPageRequest()) { // Validate request if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter $this->StartRec = $_GET[EW_TABLE_START_REC]; $this->setStartRecordNumber($this->StartRec); } elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") { $PageNo = $_GET[EW_TABLE_PAGE_NO]; if (is_numeric($PageNo)) { $this->StartRec = ($PageNo-1)*$this->DisplayRecs+1; if ($this->StartRec <= 0) { $this->StartRec = 1; } elseif ($this->StartRec >= intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1) { $this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; } $this->setStartRecordNumber($this->StartRec); } } } $this->StartRec = $this->getStartRecordNumber(); // Check if correct start record counter if (!is_numeric($this->StartRec) || $this->StartRec == "") { // Avoid invalid start record counter $this->StartRec = 1; // Reset start record counter $this->setStartRecordNumber($this->StartRec); } elseif (intval($this->StartRec) > intval($this->TotalRecs)) { // Avoid starting record > total records $this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to last page first record $this->setStartRecordNumber($this->StartRec); } elseif (($this->StartRec-1) % $this->DisplayRecs <> 0) { $this->StartRec = intval(($this->StartRec-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to page boundary $this->setStartRecordNumber($this->StartRec); } } // Get upload files function GetUploadFiles() { global $objForm, $Language; // Get upload data } // Load default values function LoadDefaultValues() { $this->idOfferer->CurrentValue = NULL; $this->idOfferer->OldValue = $this->idOfferer->CurrentValue; $this->Accom_Type->CurrentValue = NULL; $this->Accom_Type->OldValue = $this->Accom_Type->CurrentValue; $this->Address->CurrentValue = NULL; $this->Address->OldValue = $this->Address->CurrentValue; $this->Town->CurrentValue = NULL; $this->Town->OldValue = $this->Town->CurrentValue; $this->District->CurrentValue = NULL; $this->District->OldValue = $this->District->CurrentValue; $this->Region->CurrentValue = NULL; $this->Region->OldValue = $this->Region->CurrentValue; $this->Beds->CurrentValue = NULL; $this->Beds->OldValue = $this->Beds->CurrentValue; $this->Rooms->CurrentValue = NULL; $this->Rooms->OldValue = $this->Rooms->CurrentValue; $this->Bathrooms->CurrentValue = NULL; $this->Bathrooms->OldValue = $this->Bathrooms->CurrentValue; $this->Private_Kitchen->CurrentValue = NULL; $this->Private_Kitchen->OldValue = $this->Private_Kitchen->CurrentValue; $this->Available_from->CurrentValue = NULL; $this->Available_from->OldValue = $this->Available_from->CurrentValue; $this->Available_to->CurrentValue = NULL; $this->Available_to->OldValue = $this->Available_to->CurrentValue; $this->Rel_type->CurrentValue = NULL; $this->Rel_type->OldValue = $this->Rel_type->CurrentValue; } // Load form values function LoadFormValues() { // Load from form global $objForm; $objForm->FormName = $this->FormName; if (!$this->idOfferer->FldIsDetailKey) { $this->idOfferer->setFormValue($objForm->GetValue("x_idOfferer")); } $this->idOfferer->setOldValue($objForm->GetValue("o_idOfferer")); if (!$this->Accom_Type->FldIsDetailKey) { $this->Accom_Type->setFormValue($objForm->GetValue("x_Accom_Type")); } $this->Accom_Type->setOldValue($objForm->GetValue("o_Accom_Type")); if (!$this->Address->FldIsDetailKey) { $this->Address->setFormValue($objForm->GetValue("x_Address")); } $this->Address->setOldValue($objForm->GetValue("o_Address")); if (!$this->Town->FldIsDetailKey) { $this->Town->setFormValue($objForm->GetValue("x_Town")); } $this->Town->setOldValue($objForm->GetValue("o_Town")); if (!$this->District->FldIsDetailKey) { $this->District->setFormValue($objForm->GetValue("x_District")); } $this->District->setOldValue($objForm->GetValue("o_District")); if (!$this->Region->FldIsDetailKey) { $this->Region->setFormValue($objForm->GetValue("x_Region")); } $this->Region->setOldValue($objForm->GetValue("o_Region")); if (!$this->Beds->FldIsDetailKey) { $this->Beds->setFormValue($objForm->GetValue("x_Beds")); } $this->Beds->setOldValue($objForm->GetValue("o_Beds")); if (!$this->Rooms->FldIsDetailKey) { $this->Rooms->setFormValue($objForm->GetValue("x_Rooms")); } $this->Rooms->setOldValue($objForm->GetValue("o_Rooms")); if (!$this->Bathrooms->FldIsDetailKey) { $this->Bathrooms->setFormValue($objForm->GetValue("x_Bathrooms")); } $this->Bathrooms->setOldValue($objForm->GetValue("o_Bathrooms")); if (!$this->Private_Kitchen->FldIsDetailKey) { $this->Private_Kitchen->setFormValue($objForm->GetValue("x_Private_Kitchen")); } $this->Private_Kitchen->setOldValue($objForm->GetValue("o_Private_Kitchen")); if (!$this->Available_from->FldIsDetailKey) { $this->Available_from->setFormValue($objForm->GetValue("x_Available_from")); $this->Available_from->CurrentValue = ew_UnFormatDateTime($this->Available_from->CurrentValue, 7); } $this->Available_from->setOldValue($objForm->GetValue("o_Available_from")); if (!$this->Available_to->FldIsDetailKey) { $this->Available_to->setFormValue($objForm->GetValue("x_Available_to")); $this->Available_to->CurrentValue = ew_UnFormatDateTime($this->Available_to->CurrentValue, 7); } $this->Available_to->setOldValue($objForm->GetValue("o_Available_to")); if (!$this->Rel_type->FldIsDetailKey) { $this->Rel_type->setFormValue($objForm->GetValue("x_Rel_type")); } $this->Rel_type->setOldValue($objForm->GetValue("o_Rel_type")); if (!$this->idAccomodation->FldIsDetailKey && $this->CurrentAction <> "gridadd" && $this->CurrentAction <> "add") $this->idAccomodation->setFormValue($objForm->GetValue("x_idAccomodation")); } // Restore form values function RestoreFormValues() { global $objForm; if ($this->CurrentAction <> "gridadd" && $this->CurrentAction <> "add") $this->idAccomodation->CurrentValue = $this->idAccomodation->FormValue; $this->idOfferer->CurrentValue = $this->idOfferer->FormValue; $this->Accom_Type->CurrentValue = $this->Accom_Type->FormValue; $this->Address->CurrentValue = $this->Address->FormValue; $this->Town->CurrentValue = $this->Town->FormValue; $this->District->CurrentValue = $this->District->FormValue; $this->Region->CurrentValue = $this->Region->FormValue; $this->Beds->CurrentValue = $this->Beds->FormValue; $this->Rooms->CurrentValue = $this->Rooms->FormValue; $this->Bathrooms->CurrentValue = $this->Bathrooms->FormValue; $this->Private_Kitchen->CurrentValue = $this->Private_Kitchen->FormValue; $this->Available_from->CurrentValue = $this->Available_from->FormValue; $this->Available_from->CurrentValue = ew_UnFormatDateTime($this->Available_from->CurrentValue, 7); $this->Available_to->CurrentValue = $this->Available_to->FormValue; $this->Available_to->CurrentValue = ew_UnFormatDateTime($this->Available_to->CurrentValue, 7); $this->Rel_type->CurrentValue = $this->Rel_type->FormValue; } // Load recordset function LoadRecordset($offset = -1, $rowcnt = -1) { // Load List page SQL $sSql = $this->SelectSQL(); $conn = &$this->Connection(); // Load recordset $dbtype = ew_GetConnectionType($this->DBID); if ($this->UseSelectLimit) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; if ($dbtype == "MSSQL") { $rs = $conn->SelectLimit($sSql, $rowcnt, $offset, array("_hasOrderBy" => trim($this->getOrderBy()) || trim($this->getSessionOrderBy()))); } else { $rs = $conn->SelectLimit($sSql, $rowcnt, $offset); } $conn->raiseErrorFn = ''; } else { $rs = ew_LoadRecordset($sSql, $conn); } // Call Recordset Selected event $this->Recordset_Selected($rs); return $rs; } // Load row based on key values function LoadRow() { global $Security, $Language; $sFilter = $this->KeyFilter(); // Call Row Selecting event $this->Row_Selecting($sFilter); // Load SQL based on filter $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn = &$this->Connection(); $res = FALSE; $rs = ew_LoadRecordset($sSql, $conn); if ($rs && !$rs->EOF) { $res = TRUE; $this->LoadRowValues($rs); // Load row values $rs->Close(); } return $res; } // Load row values from recordset function LoadRowValues(&$rs) { if (!$rs || $rs->EOF) return; // Call Row Selected event $row = &$rs->fields; $this->Row_Selected($row); $this->idAccomodation->setDbValue($rs->fields('idAccomodation')); $this->idOfferer->setDbValue($rs->fields('idOfferer')); $this->Accom_Type->setDbValue($rs->fields('Accom_Type')); $this->Address->setDbValue($rs->fields('Address')); $this->Town->setDbValue($rs->fields('Town')); $this->District->setDbValue($rs->fields('District')); $this->Region->setDbValue($rs->fields('Region')); $this->Beds->setDbValue($rs->fields('Beds')); $this->Rooms->setDbValue($rs->fields('Rooms')); $this->Bathrooms->setDbValue($rs->fields('Bathrooms')); $this->Private_Kitchen->setDbValue($rs->fields('Private_Kitchen')); $this->Auton_heating->setDbValue($rs->fields('Auton_heating')); $this->Arch_barriers->setDbValue($rs->fields('Arch_barriers')); $this->Furnisched->setDbValue($rs->fields('Furnisched')); $this->Private_entrance->setDbValue($rs->fields('Private_entrance')); $this->Time_restrictions->setDbValue($rs->fields('Time_restrictions')); $this->Time_restr_from->setDbValue($rs->fields('Time_restr_from')); $this->Time_restr_to->setDbValue($rs->fields('Time_restr_to')); $this->Services_access->setDbValue($rs->fields('Services_access')); $this->Available_from->setDbValue($rs->fields('Available_from')); $this->Available_to->setDbValue($rs->fields('Available_to')); $this->Rel_type->setDbValue($rs->fields('Rel_type')); $this->offer_woman->setDbValue($rs->fields('offer_woman')); $this->offer_children->setDbValue($rs->fields('offer_children')); $this->offer_family->setDbValue($rs->fields('offer_family')); $this->offer_man->setDbValue($rs->fields('offer_man')); $this->offer_elderly->setDbValue($rs->fields('offer_elderly')); $this->offer_disabled->setDbValue($rs->fields('offer_disabled')); $this->offer_sick->setDbValue($rs->fields('offer_sick')); $this->offer_christian->setDbValue($rs->fields('offer_christian')); $this->offer_muslim->setDbValue($rs->fields('offer_muslim')); $this->offer_other->setDbValue($rs->fields('offer_other')); $this->verify_date->setDbValue($rs->fields('verify_date')); $this->verify_by->setDbValue($rs->fields('verify_by')); $this->verify_phone->setDbValue($rs->fields('verify_phone')); $this->verify_email->setDbValue($rs->fields('verify_email')); $this->Outcome->setDbValue($rs->fields('Outcome')); $this->Outcome_type->setDbValue($rs->fields('Outcome_type')); $this->Rel_doc->Upload->DbValue = $rs->fields('Rel_doc'); $this->Rel_doc->CurrentValue = $this->Rel_doc->Upload->DbValue; $this->Rel_doc->Upload->Index = $this->RowIndex; $this->Rel_doc_type->setDbValue($rs->fields('Rel_doc_type')); $this->Rel_doc_size->setDbValue($rs->fields('Rel_doc_size')); } // Load DbValue from recordset function LoadDbValues(&$rs) { if (!$rs || !is_array($rs) && $rs->EOF) return; $row = is_array($rs) ? $rs : $rs->fields; $this->idAccomodation->DbValue = $row['idAccomodation']; $this->idOfferer->DbValue = $row['idOfferer']; $this->Accom_Type->DbValue = $row['Accom_Type']; $this->Address->DbValue = $row['Address']; $this->Town->DbValue = $row['Town']; $this->District->DbValue = $row['District']; $this->Region->DbValue = $row['Region']; $this->Beds->DbValue = $row['Beds']; $this->Rooms->DbValue = $row['Rooms']; $this->Bathrooms->DbValue = $row['Bathrooms']; $this->Private_Kitchen->DbValue = $row['Private_Kitchen']; $this->Auton_heating->DbValue = $row['Auton_heating']; $this->Arch_barriers->DbValue = $row['Arch_barriers']; $this->Furnisched->DbValue = $row['Furnisched']; $this->Private_entrance->DbValue = $row['Private_entrance']; $this->Time_restrictions->DbValue = $row['Time_restrictions']; $this->Time_restr_from->DbValue = $row['Time_restr_from']; $this->Time_restr_to->DbValue = $row['Time_restr_to']; $this->Services_access->DbValue = $row['Services_access']; $this->Available_from->DbValue = $row['Available_from']; $this->Available_to->DbValue = $row['Available_to']; $this->Rel_type->DbValue = $row['Rel_type']; $this->offer_woman->DbValue = $row['offer_woman']; $this->offer_children->DbValue = $row['offer_children']; $this->offer_family->DbValue = $row['offer_family']; $this->offer_man->DbValue = $row['offer_man']; $this->offer_elderly->DbValue = $row['offer_elderly']; $this->offer_disabled->DbValue = $row['offer_disabled']; $this->offer_sick->DbValue = $row['offer_sick']; $this->offer_christian->DbValue = $row['offer_christian']; $this->offer_muslim->DbValue = $row['offer_muslim']; $this->offer_other->DbValue = $row['offer_other']; $this->verify_date->DbValue = $row['verify_date']; $this->verify_by->DbValue = $row['verify_by']; $this->verify_phone->DbValue = $row['verify_phone']; $this->verify_email->DbValue = $row['verify_email']; $this->Outcome->DbValue = $row['Outcome']; $this->Outcome_type->DbValue = $row['Outcome_type']; $this->Rel_doc->Upload->DbValue = $row['Rel_doc']; $this->Rel_doc_type->DbValue = $row['Rel_doc_type']; $this->Rel_doc_size->DbValue = $row['Rel_doc_size']; } // Load old record function LoadOldRecord() { // Load key values from Session $bValidKey = TRUE; $arKeys[] = $this->RowOldKey; $cnt = count($arKeys); if ($cnt >= 1) { if (strval($arKeys[0]) <> "") $this->idAccomodation->CurrentValue = strval($arKeys[0]); // idAccomodation else $bValidKey = FALSE; } else { $bValidKey = FALSE; } // Load old recordset if ($bValidKey) { $this->CurrentFilter = $this->KeyFilter(); $sSql = $this->SQL(); $conn = &$this->Connection(); $this->OldRecordset = ew_LoadRecordset($sSql, $conn); $this->LoadRowValues($this->OldRecordset); // Load row values } else { $this->OldRecordset = NULL; } return $bValidKey; } // Render row values based on field settings function RenderRow() { global $Security, $Language, $gsLanguage; // Initialize URLs $this->ViewUrl = $this->GetViewUrl(); $this->EditUrl = $this->GetEditUrl(); $this->CopyUrl = $this->GetCopyUrl(); $this->DeleteUrl = $this->GetDeleteUrl(); // Call Row_Rendering event $this->Row_Rendering(); // Common render codes for all row types // idAccomodation // idOfferer // Accom_Type // Address // Town // District // Region // Beds // Rooms // Bathrooms // Private_Kitchen // Auton_heating // Arch_barriers // Furnisched // Private_entrance // Time_restrictions // Time_restr_from // Time_restr_to // Services_access // Available_from // Available_to // Rel_type // offer_woman // offer_children // offer_family // offer_man // offer_elderly // offer_disabled // offer_sick // offer_christian // offer_muslim // offer_other // verify_date // verify_by // verify_phone // verify_email // Outcome // Outcome_type // Rel_doc // Rel_doc_type $this->Rel_doc_type->CellCssStyle = "white-space: nowrap;"; // Rel_doc_size $this->Rel_doc_size->CellCssStyle = "white-space: nowrap;"; if ($this->RowType == EW_ROWTYPE_VIEW) { // View row // idAccomodation $this->idAccomodation->ViewValue = $this->idAccomodation->CurrentValue; $this->idAccomodation->ViewCustomAttributes = ""; // idOfferer $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; if (strval($this->idOfferer->CurrentValue) <> "") { $sFilterWrk = "`idOfferer`" . ew_SearchString("=", $this->idOfferer->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $arwrk[2] = $rswrk->fields('Disp2Fld'); $arwrk[3] = $rswrk->fields('Disp3Fld'); $this->idOfferer->ViewValue = $this->idOfferer->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; } } else { $this->idOfferer->ViewValue = NULL; } $this->idOfferer->ViewCustomAttributes = ""; // Accom_Type if (strval($this->Accom_Type->CurrentValue) <> "") { $sFilterWrk = "`Accom_Type`" . ew_SearchString("=", $this->Accom_Type->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Accom_Type`, `Description_IT` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Accom_Type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Accom_Type->ViewValue = $this->Accom_Type->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Accom_Type->ViewValue = $this->Accom_Type->CurrentValue; } } else { $this->Accom_Type->ViewValue = NULL; } $this->Accom_Type->ViewCustomAttributes = ""; // Address $this->Address->ViewValue = $this->Address->CurrentValue; $this->Address->ViewCustomAttributes = ""; // Town $this->Town->ViewValue = $this->Town->CurrentValue; $this->Town->ViewCustomAttributes = ""; // District $this->District->ViewValue = $this->District->CurrentValue; $this->District->ViewCustomAttributes = ""; // Region $this->Region->ViewValue = $this->Region->CurrentValue; $this->Region->ViewCustomAttributes = ""; // Beds $this->Beds->ViewValue = $this->Beds->CurrentValue; $this->Beds->ViewCustomAttributes = ""; // Rooms $this->Rooms->ViewValue = $this->Rooms->CurrentValue; $this->Rooms->ViewCustomAttributes = ""; // Bathrooms $this->Bathrooms->ViewValue = $this->Bathrooms->CurrentValue; $this->Bathrooms->ViewCustomAttributes = ""; // Private_Kitchen if (ew_ConvertToBool($this->Private_Kitchen->CurrentValue)) { $this->Private_Kitchen->ViewValue = $this->Private_Kitchen->FldTagCaption(1) <> "" ? $this->Private_Kitchen->FldTagCaption(1) : "Y"; } else { $this->Private_Kitchen->ViewValue = $this->Private_Kitchen->FldTagCaption(2) <> "" ? $this->Private_Kitchen->FldTagCaption(2) : "N"; } $this->Private_Kitchen->ViewCustomAttributes = ""; // Auton_heating if (ew_ConvertToBool($this->Auton_heating->CurrentValue)) { $this->Auton_heating->ViewValue = $this->Auton_heating->FldTagCaption(1) <> "" ? $this->Auton_heating->FldTagCaption(1) : "Y"; } else { $this->Auton_heating->ViewValue = $this->Auton_heating->FldTagCaption(2) <> "" ? $this->Auton_heating->FldTagCaption(2) : "N"; } $this->Auton_heating->ViewCustomAttributes = ""; // Arch_barriers if (ew_ConvertToBool($this->Arch_barriers->CurrentValue)) { $this->Arch_barriers->ViewValue = $this->Arch_barriers->FldTagCaption(1) <> "" ? $this->Arch_barriers->FldTagCaption(1) : "Y"; } else { $this->Arch_barriers->ViewValue = $this->Arch_barriers->FldTagCaption(2) <> "" ? $this->Arch_barriers->FldTagCaption(2) : "N"; } $this->Arch_barriers->ViewCustomAttributes = ""; // Furnisched if (ew_ConvertToBool($this->Furnisched->CurrentValue)) { $this->Furnisched->ViewValue = $this->Furnisched->FldTagCaption(1) <> "" ? $this->Furnisched->FldTagCaption(1) : "Y"; } else { $this->Furnisched->ViewValue = $this->Furnisched->FldTagCaption(2) <> "" ? $this->Furnisched->FldTagCaption(2) : "N"; } $this->Furnisched->ViewCustomAttributes = ""; // Private_entrance if (ew_ConvertToBool($this->Private_entrance->CurrentValue)) { $this->Private_entrance->ViewValue = $this->Private_entrance->FldTagCaption(1) <> "" ? $this->Private_entrance->FldTagCaption(1) : "Y"; } else { $this->Private_entrance->ViewValue = $this->Private_entrance->FldTagCaption(2) <> "" ? $this->Private_entrance->FldTagCaption(2) : "N"; } $this->Private_entrance->ViewCustomAttributes = ""; // Time_restrictions if (ew_ConvertToBool($this->Time_restrictions->CurrentValue)) { $this->Time_restrictions->ViewValue = $this->Time_restrictions->FldTagCaption(1) <> "" ? $this->Time_restrictions->FldTagCaption(1) : "Y"; } else { $this->Time_restrictions->ViewValue = $this->Time_restrictions->FldTagCaption(2) <> "" ? $this->Time_restrictions->FldTagCaption(2) : "N"; } $this->Time_restrictions->ViewCustomAttributes = ""; // Time_restr_from $this->Time_restr_from->ViewValue = $this->Time_restr_from->CurrentValue; $this->Time_restr_from->ViewValue = ew_FormatDateTime($this->Time_restr_from->ViewValue, 4); $this->Time_restr_from->ViewCustomAttributes = ""; // Time_restr_to $this->Time_restr_to->ViewValue = $this->Time_restr_to->CurrentValue; $this->Time_restr_to->ViewValue = ew_FormatDateTime($this->Time_restr_to->ViewValue, 4); $this->Time_restr_to->ViewCustomAttributes = ""; // Services_access if (ew_ConvertToBool($this->Services_access->CurrentValue)) { $this->Services_access->ViewValue = $this->Services_access->FldTagCaption(1) <> "" ? $this->Services_access->FldTagCaption(1) : "Y"; } else { $this->Services_access->ViewValue = $this->Services_access->FldTagCaption(2) <> "" ? $this->Services_access->FldTagCaption(2) : "N"; } $this->Services_access->ViewCustomAttributes = ""; // Available_from $this->Available_from->ViewValue = $this->Available_from->CurrentValue; $this->Available_from->ViewValue = ew_FormatDateTime($this->Available_from->ViewValue, 7); $this->Available_from->ViewCustomAttributes = ""; // Available_to $this->Available_to->ViewValue = $this->Available_to->CurrentValue; $this->Available_to->ViewValue = ew_FormatDateTime($this->Available_to->ViewValue, 7); $this->Available_to->ViewCustomAttributes = ""; // Rel_type if (strval($this->Rel_type->CurrentValue) <> "") { $sFilterWrk = "`Rel_type`" . ew_SearchString("=", $this->Rel_type->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Rel_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Rel_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Rel_type->ViewValue = $this->Rel_type->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Rel_type->ViewValue = $this->Rel_type->CurrentValue; } } else { $this->Rel_type->ViewValue = NULL; } $this->Rel_type->ViewCustomAttributes = ""; // offer_woman if (ew_ConvertToBool($this->offer_woman->CurrentValue)) { $this->offer_woman->ViewValue = $this->offer_woman->FldTagCaption(1) <> "" ? $this->offer_woman->FldTagCaption(1) : "Y"; } else { $this->offer_woman->ViewValue = $this->offer_woman->FldTagCaption(2) <> "" ? $this->offer_woman->FldTagCaption(2) : "N"; } $this->offer_woman->ViewCustomAttributes = ""; // offer_children if (ew_ConvertToBool($this->offer_children->CurrentValue)) { $this->offer_children->ViewValue = $this->offer_children->FldTagCaption(1) <> "" ? $this->offer_children->FldTagCaption(1) : "Y"; } else { $this->offer_children->ViewValue = $this->offer_children->FldTagCaption(2) <> "" ? $this->offer_children->FldTagCaption(2) : "N"; } $this->offer_children->ViewCustomAttributes = ""; // offer_family if (ew_ConvertToBool($this->offer_family->CurrentValue)) { $this->offer_family->ViewValue = $this->offer_family->FldTagCaption(1) <> "" ? $this->offer_family->FldTagCaption(1) : "Y"; } else { $this->offer_family->ViewValue = $this->offer_family->FldTagCaption(2) <> "" ? $this->offer_family->FldTagCaption(2) : "N"; } $this->offer_family->ViewCustomAttributes = ""; // offer_man if (ew_ConvertToBool($this->offer_man->CurrentValue)) { $this->offer_man->ViewValue = $this->offer_man->FldTagCaption(1) <> "" ? $this->offer_man->FldTagCaption(1) : "Y"; } else { $this->offer_man->ViewValue = $this->offer_man->FldTagCaption(2) <> "" ? $this->offer_man->FldTagCaption(2) : "N"; } $this->offer_man->ViewCustomAttributes = ""; // offer_elderly if (ew_ConvertToBool($this->offer_elderly->CurrentValue)) { $this->offer_elderly->ViewValue = $this->offer_elderly->FldTagCaption(1) <> "" ? $this->offer_elderly->FldTagCaption(1) : "Y"; } else { $this->offer_elderly->ViewValue = $this->offer_elderly->FldTagCaption(2) <> "" ? $this->offer_elderly->FldTagCaption(2) : "N"; } $this->offer_elderly->ViewCustomAttributes = ""; // offer_disabled if (ew_ConvertToBool($this->offer_disabled->CurrentValue)) { $this->offer_disabled->ViewValue = $this->offer_disabled->FldTagCaption(1) <> "" ? $this->offer_disabled->FldTagCaption(1) : "Y"; } else { $this->offer_disabled->ViewValue = $this->offer_disabled->FldTagCaption(2) <> "" ? $this->offer_disabled->FldTagCaption(2) : "N"; } $this->offer_disabled->ViewCustomAttributes = ""; // offer_sick if (ew_ConvertToBool($this->offer_sick->CurrentValue)) { $this->offer_sick->ViewValue = $this->offer_sick->FldTagCaption(1) <> "" ? $this->offer_sick->FldTagCaption(1) : "Y"; } else { $this->offer_sick->ViewValue = $this->offer_sick->FldTagCaption(2) <> "" ? $this->offer_sick->FldTagCaption(2) : "N"; } $this->offer_sick->ViewCustomAttributes = ""; // offer_christian if (ew_ConvertToBool($this->offer_christian->CurrentValue)) { $this->offer_christian->ViewValue = $this->offer_christian->FldTagCaption(1) <> "" ? $this->offer_christian->FldTagCaption(1) : "Y"; } else { $this->offer_christian->ViewValue = $this->offer_christian->FldTagCaption(2) <> "" ? $this->offer_christian->FldTagCaption(2) : "N"; } $this->offer_christian->ViewCustomAttributes = ""; // offer_muslim if (ew_ConvertToBool($this->offer_muslim->CurrentValue)) { $this->offer_muslim->ViewValue = $this->offer_muslim->FldTagCaption(1) <> "" ? $this->offer_muslim->FldTagCaption(1) : "Y"; } else { $this->offer_muslim->ViewValue = $this->offer_muslim->FldTagCaption(2) <> "" ? $this->offer_muslim->FldTagCaption(2) : "N"; } $this->offer_muslim->ViewCustomAttributes = ""; // offer_other $this->offer_other->ViewValue = $this->offer_other->CurrentValue; $this->offer_other->ViewCustomAttributes = ""; // verify_date $this->verify_date->ViewValue = $this->verify_date->CurrentValue; $this->verify_date->ViewValue = ew_FormatDateTime($this->verify_date->ViewValue, 7); $this->verify_date->ViewCustomAttributes = ""; // verify_by $this->verify_by->ViewValue = $this->verify_by->CurrentValue; $this->verify_by->ViewCustomAttributes = ""; // verify_phone $this->verify_phone->ViewValue = $this->verify_phone->CurrentValue; $this->verify_phone->ViewCustomAttributes = ""; // verify_email $this->verify_email->ViewValue = $this->verify_email->CurrentValue; $this->verify_email->ViewCustomAttributes = ""; // Outcome if (strval($this->Outcome->CurrentValue) <> "") { $sFilterWrk = "`Outcome`" . ew_SearchString("=", $this->Outcome->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Outcome`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcome`"; $sWhereWrk = ""; $this->Outcome->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Outcome`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcome`"; $sWhereWrk = ""; $this->Outcome->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Outcome`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcome`"; $sWhereWrk = ""; $this->Outcome->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Outcome, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Outcome->ViewValue = $this->Outcome->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Outcome->ViewValue = $this->Outcome->CurrentValue; } } else { $this->Outcome->ViewValue = NULL; } $this->Outcome->ViewCustomAttributes = ""; // Outcome_type if (strval($this->Outcome_type->CurrentValue) <> "") { $sFilterWrk = "`Outcome_type`" . ew_SearchString("=", $this->Outcome_type->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Outcome_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcometype`"; $sWhereWrk = ""; $this->Outcome_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Outcome_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcometype`"; $sWhereWrk = ""; $this->Outcome_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Outcome_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `toutcometype`"; $sWhereWrk = ""; $this->Outcome_type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Outcome_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Outcome_type->ViewValue = $this->Outcome_type->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Outcome_type->ViewValue = $this->Outcome_type->CurrentValue; } } else { $this->Outcome_type->ViewValue = NULL; } $this->Outcome_type->ViewCustomAttributes = ""; // idOfferer $this->idOfferer->LinkCustomAttributes = ""; if (!ew_Empty($this->idOfferer->CurrentValue)) { $this->idOfferer->HrefValue = "tofferersview.php?showdetail=&idOfferer=" . $this->idOfferer->CurrentValue; // Add prefix/suffix $this->idOfferer->LinkAttrs["target"] = ""; // Add target if ($this->Export <> "") $this->idOfferer->HrefValue = ew_ConvertFullUrl($this->idOfferer->HrefValue); } else { $this->idOfferer->HrefValue = ""; } $this->idOfferer->TooltipValue = ""; // Accom_Type $this->Accom_Type->LinkCustomAttributes = ""; $this->Accom_Type->HrefValue = ""; $this->Accom_Type->TooltipValue = ""; // Address $this->Address->LinkCustomAttributes = ""; $this->Address->HrefValue = ""; $this->Address->TooltipValue = ""; // Town $this->Town->LinkCustomAttributes = ""; $this->Town->HrefValue = ""; $this->Town->TooltipValue = ""; // District $this->District->LinkCustomAttributes = ""; $this->District->HrefValue = ""; $this->District->TooltipValue = ""; // Region $this->Region->LinkCustomAttributes = ""; $this->Region->HrefValue = ""; $this->Region->TooltipValue = ""; // Beds $this->Beds->LinkCustomAttributes = ""; $this->Beds->HrefValue = ""; $this->Beds->TooltipValue = ""; // Rooms $this->Rooms->LinkCustomAttributes = ""; $this->Rooms->HrefValue = ""; $this->Rooms->TooltipValue = ""; // Bathrooms $this->Bathrooms->LinkCustomAttributes = ""; $this->Bathrooms->HrefValue = ""; $this->Bathrooms->TooltipValue = ""; // Private_Kitchen $this->Private_Kitchen->LinkCustomAttributes = ""; $this->Private_Kitchen->HrefValue = ""; $this->Private_Kitchen->TooltipValue = ""; // Available_from $this->Available_from->LinkCustomAttributes = ""; $this->Available_from->HrefValue = ""; $this->Available_from->TooltipValue = ""; // Available_to $this->Available_to->LinkCustomAttributes = ""; $this->Available_to->HrefValue = ""; $this->Available_to->TooltipValue = ""; // Rel_type $this->Rel_type->LinkCustomAttributes = ""; $this->Rel_type->HrefValue = ""; $this->Rel_type->TooltipValue = ""; } elseif ($this->RowType == EW_ROWTYPE_ADD) { // Add row // idOfferer $this->idOfferer->EditAttrs["class"] = "form-control"; $this->idOfferer->EditCustomAttributes = ""; if ($this->idOfferer->getSessionValue() <> "") { $this->idOfferer->CurrentValue = $this->idOfferer->getSessionValue(); $this->idOfferer->OldValue = $this->idOfferer->CurrentValue; $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; if (strval($this->idOfferer->CurrentValue) <> "") { $sFilterWrk = "`idOfferer`" . ew_SearchString("=", $this->idOfferer->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $arwrk[2] = $rswrk->fields('Disp2Fld'); $arwrk[3] = $rswrk->fields('Disp3Fld'); $this->idOfferer->ViewValue = $this->idOfferer->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; } } else { $this->idOfferer->ViewValue = NULL; } $this->idOfferer->ViewCustomAttributes = ""; } else { $this->idOfferer->EditValue = ew_HtmlEncode($this->idOfferer->CurrentValue); if (strval($this->idOfferer->CurrentValue) <> "") { $sFilterWrk = "`idOfferer`" . ew_SearchString("=", $this->idOfferer->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld')); $arwrk[2] = ew_HtmlEncode($rswrk->fields('Disp2Fld')); $arwrk[3] = ew_HtmlEncode($rswrk->fields('Disp3Fld')); $this->idOfferer->EditValue = $this->idOfferer->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idOfferer->EditValue = ew_HtmlEncode($this->idOfferer->CurrentValue); } } else { $this->idOfferer->EditValue = NULL; } $this->idOfferer->PlaceHolder = ew_RemoveHtml($this->idOfferer->FldCaption()); } // Accom_Type $this->Accom_Type->EditAttrs["class"] = "form-control"; $this->Accom_Type->EditCustomAttributes = ""; if (trim(strval($this->Accom_Type->CurrentValue)) == "") { $sFilterWrk = "0=1"; } else { $sFilterWrk = "`Accom_Type`" . ew_SearchString("=", $this->Accom_Type->CurrentValue, EW_DATATYPE_STRING, ""); } switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Accom_Type`, `Description_IT` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Accom_Type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); $arwrk = ($rswrk) ? $rswrk->GetRows() : array(); if ($rswrk) $rswrk->Close(); $this->Accom_Type->EditValue = $arwrk; // Address $this->Address->EditAttrs["class"] = "form-control"; $this->Address->EditCustomAttributes = ""; $this->Address->EditValue = ew_HtmlEncode($this->Address->CurrentValue); $this->Address->PlaceHolder = ew_RemoveHtml($this->Address->FldCaption()); // Town $this->Town->EditAttrs["class"] = "form-control"; $this->Town->EditCustomAttributes = ""; $this->Town->EditValue = ew_HtmlEncode($this->Town->CurrentValue); $this->Town->PlaceHolder = ew_RemoveHtml($this->Town->FldCaption()); // District $this->District->EditAttrs["class"] = "form-control"; $this->District->EditCustomAttributes = ""; $this->District->EditValue = ew_HtmlEncode($this->District->CurrentValue); $this->District->PlaceHolder = ew_RemoveHtml($this->District->FldCaption()); // Region $this->Region->EditAttrs["class"] = "form-control"; $this->Region->EditCustomAttributes = ""; $this->Region->EditValue = ew_HtmlEncode($this->Region->CurrentValue); $this->Region->PlaceHolder = ew_RemoveHtml($this->Region->FldCaption()); // Beds $this->Beds->EditAttrs["class"] = "form-control"; $this->Beds->EditCustomAttributes = ""; $this->Beds->EditValue = ew_HtmlEncode($this->Beds->CurrentValue); $this->Beds->PlaceHolder = ew_RemoveHtml($this->Beds->FldCaption()); // Rooms $this->Rooms->EditAttrs["class"] = "form-control"; $this->Rooms->EditCustomAttributes = ""; $this->Rooms->EditValue = ew_HtmlEncode($this->Rooms->CurrentValue); $this->Rooms->PlaceHolder = ew_RemoveHtml($this->Rooms->FldCaption()); // Bathrooms $this->Bathrooms->EditAttrs["class"] = "form-control"; $this->Bathrooms->EditCustomAttributes = ""; $this->Bathrooms->EditValue = ew_HtmlEncode($this->Bathrooms->CurrentValue); $this->Bathrooms->PlaceHolder = ew_RemoveHtml($this->Bathrooms->FldCaption()); // Private_Kitchen $this->Private_Kitchen->EditCustomAttributes = ""; $this->Private_Kitchen->EditValue = $this->Private_Kitchen->Options(FALSE); // Available_from $this->Available_from->EditAttrs["class"] = "form-control"; $this->Available_from->EditCustomAttributes = ""; $this->Available_from->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->Available_from->CurrentValue, 7)); $this->Available_from->PlaceHolder = ew_RemoveHtml($this->Available_from->FldCaption()); // Available_to $this->Available_to->EditAttrs["class"] = "form-control"; $this->Available_to->EditCustomAttributes = ""; $this->Available_to->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->Available_to->CurrentValue, 7)); $this->Available_to->PlaceHolder = ew_RemoveHtml($this->Available_to->FldCaption()); // Rel_type $this->Rel_type->EditAttrs["class"] = "form-control"; $this->Rel_type->EditCustomAttributes = ""; if (trim(strval($this->Rel_type->CurrentValue)) == "") { $sFilterWrk = "0=1"; } else { $sFilterWrk = "`Rel_type`" . ew_SearchString("=", $this->Rel_type->CurrentValue, EW_DATATYPE_STRING, ""); } switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Rel_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Rel_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); $arwrk = ($rswrk) ? $rswrk->GetRows() : array(); if ($rswrk) $rswrk->Close(); $this->Rel_type->EditValue = $arwrk; // Add refer script // idOfferer $this->idOfferer->LinkCustomAttributes = ""; if (!ew_Empty($this->idOfferer->CurrentValue)) { $this->idOfferer->HrefValue = "tofferersview.php?showdetail=&idOfferer=" . $this->idOfferer->CurrentValue; // Add prefix/suffix $this->idOfferer->LinkAttrs["target"] = ""; // Add target if ($this->Export <> "") $this->idOfferer->HrefValue = ew_ConvertFullUrl($this->idOfferer->HrefValue); } else { $this->idOfferer->HrefValue = ""; } // Accom_Type $this->Accom_Type->LinkCustomAttributes = ""; $this->Accom_Type->HrefValue = ""; // Address $this->Address->LinkCustomAttributes = ""; $this->Address->HrefValue = ""; // Town $this->Town->LinkCustomAttributes = ""; $this->Town->HrefValue = ""; // District $this->District->LinkCustomAttributes = ""; $this->District->HrefValue = ""; // Region $this->Region->LinkCustomAttributes = ""; $this->Region->HrefValue = ""; // Beds $this->Beds->LinkCustomAttributes = ""; $this->Beds->HrefValue = ""; // Rooms $this->Rooms->LinkCustomAttributes = ""; $this->Rooms->HrefValue = ""; // Bathrooms $this->Bathrooms->LinkCustomAttributes = ""; $this->Bathrooms->HrefValue = ""; // Private_Kitchen $this->Private_Kitchen->LinkCustomAttributes = ""; $this->Private_Kitchen->HrefValue = ""; // Available_from $this->Available_from->LinkCustomAttributes = ""; $this->Available_from->HrefValue = ""; // Available_to $this->Available_to->LinkCustomAttributes = ""; $this->Available_to->HrefValue = ""; // Rel_type $this->Rel_type->LinkCustomAttributes = ""; $this->Rel_type->HrefValue = ""; } elseif ($this->RowType == EW_ROWTYPE_EDIT) { // Edit row // idOfferer $this->idOfferer->EditAttrs["class"] = "form-control"; $this->idOfferer->EditCustomAttributes = ""; if ($this->idOfferer->getSessionValue() <> "") { $this->idOfferer->CurrentValue = $this->idOfferer->getSessionValue(); $this->idOfferer->OldValue = $this->idOfferer->CurrentValue; $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; if (strval($this->idOfferer->CurrentValue) <> "") { $sFilterWrk = "`idOfferer`" . ew_SearchString("=", $this->idOfferer->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $arwrk[2] = $rswrk->fields('Disp2Fld'); $arwrk[3] = $rswrk->fields('Disp3Fld'); $this->idOfferer->ViewValue = $this->idOfferer->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; } } else { $this->idOfferer->ViewValue = NULL; } $this->idOfferer->ViewCustomAttributes = ""; } else { $this->idOfferer->EditValue = ew_HtmlEncode($this->idOfferer->CurrentValue); if (strval($this->idOfferer->CurrentValue) <> "") { $sFilterWrk = "`idOfferer`" . ew_SearchString("=", $this->idOfferer->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = ""; $this->idOfferer->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld')); $arwrk[2] = ew_HtmlEncode($rswrk->fields('Disp2Fld')); $arwrk[3] = ew_HtmlEncode($rswrk->fields('Disp3Fld')); $this->idOfferer->EditValue = $this->idOfferer->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idOfferer->EditValue = ew_HtmlEncode($this->idOfferer->CurrentValue); } } else { $this->idOfferer->EditValue = NULL; } $this->idOfferer->PlaceHolder = ew_RemoveHtml($this->idOfferer->FldCaption()); } // Accom_Type $this->Accom_Type->EditAttrs["class"] = "form-control"; $this->Accom_Type->EditCustomAttributes = ""; if (trim(strval($this->Accom_Type->CurrentValue)) == "") { $sFilterWrk = "0=1"; } else { $sFilterWrk = "`Accom_Type`" . ew_SearchString("=", $this->Accom_Type->CurrentValue, EW_DATATYPE_STRING, ""); } switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Accom_Type`, `Description_IT` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Accom_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Accom_Type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); $arwrk = ($rswrk) ? $rswrk->GetRows() : array(); if ($rswrk) $rswrk->Close(); $this->Accom_Type->EditValue = $arwrk; // Address $this->Address->EditAttrs["class"] = "form-control"; $this->Address->EditCustomAttributes = ""; $this->Address->EditValue = ew_HtmlEncode($this->Address->CurrentValue); $this->Address->PlaceHolder = ew_RemoveHtml($this->Address->FldCaption()); // Town $this->Town->EditAttrs["class"] = "form-control"; $this->Town->EditCustomAttributes = ""; $this->Town->EditValue = ew_HtmlEncode($this->Town->CurrentValue); $this->Town->PlaceHolder = ew_RemoveHtml($this->Town->FldCaption()); // District $this->District->EditAttrs["class"] = "form-control"; $this->District->EditCustomAttributes = ""; $this->District->EditValue = ew_HtmlEncode($this->District->CurrentValue); $this->District->PlaceHolder = ew_RemoveHtml($this->District->FldCaption()); // Region $this->Region->EditAttrs["class"] = "form-control"; $this->Region->EditCustomAttributes = ""; $this->Region->EditValue = ew_HtmlEncode($this->Region->CurrentValue); $this->Region->PlaceHolder = ew_RemoveHtml($this->Region->FldCaption()); // Beds $this->Beds->EditAttrs["class"] = "form-control"; $this->Beds->EditCustomAttributes = ""; $this->Beds->EditValue = ew_HtmlEncode($this->Beds->CurrentValue); $this->Beds->PlaceHolder = ew_RemoveHtml($this->Beds->FldCaption()); // Rooms $this->Rooms->EditAttrs["class"] = "form-control"; $this->Rooms->EditCustomAttributes = ""; $this->Rooms->EditValue = ew_HtmlEncode($this->Rooms->CurrentValue); $this->Rooms->PlaceHolder = ew_RemoveHtml($this->Rooms->FldCaption()); // Bathrooms $this->Bathrooms->EditAttrs["class"] = "form-control"; $this->Bathrooms->EditCustomAttributes = ""; $this->Bathrooms->EditValue = ew_HtmlEncode($this->Bathrooms->CurrentValue); $this->Bathrooms->PlaceHolder = ew_RemoveHtml($this->Bathrooms->FldCaption()); // Private_Kitchen $this->Private_Kitchen->EditCustomAttributes = ""; $this->Private_Kitchen->EditValue = $this->Private_Kitchen->Options(FALSE); // Available_from $this->Available_from->EditAttrs["class"] = "form-control"; $this->Available_from->EditCustomAttributes = ""; $this->Available_from->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->Available_from->CurrentValue, 7)); $this->Available_from->PlaceHolder = ew_RemoveHtml($this->Available_from->FldCaption()); // Available_to $this->Available_to->EditAttrs["class"] = "form-control"; $this->Available_to->EditCustomAttributes = ""; $this->Available_to->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->Available_to->CurrentValue, 7)); $this->Available_to->PlaceHolder = ew_RemoveHtml($this->Available_to->FldCaption()); // Rel_type $this->Rel_type->EditAttrs["class"] = "form-control"; $this->Rel_type->EditCustomAttributes = ""; if (trim(strval($this->Rel_type->CurrentValue)) == "") { $sFilterWrk = "0=1"; } else { $sFilterWrk = "`Rel_type`" . ew_SearchString("=", $this->Rel_type->CurrentValue, EW_DATATYPE_STRING, ""); } switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Rel_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Rel_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Rel_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); $arwrk = ($rswrk) ? $rswrk->GetRows() : array(); if ($rswrk) $rswrk->Close(); $this->Rel_type->EditValue = $arwrk; // Edit refer script // idOfferer $this->idOfferer->LinkCustomAttributes = ""; if (!ew_Empty($this->idOfferer->CurrentValue)) { $this->idOfferer->HrefValue = "tofferersview.php?showdetail=&idOfferer=" . $this->idOfferer->CurrentValue; // Add prefix/suffix $this->idOfferer->LinkAttrs["target"] = ""; // Add target if ($this->Export <> "") $this->idOfferer->HrefValue = ew_ConvertFullUrl($this->idOfferer->HrefValue); } else { $this->idOfferer->HrefValue = ""; } // Accom_Type $this->Accom_Type->LinkCustomAttributes = ""; $this->Accom_Type->HrefValue = ""; // Address $this->Address->LinkCustomAttributes = ""; $this->Address->HrefValue = ""; // Town $this->Town->LinkCustomAttributes = ""; $this->Town->HrefValue = ""; // District $this->District->LinkCustomAttributes = ""; $this->District->HrefValue = ""; // Region $this->Region->LinkCustomAttributes = ""; $this->Region->HrefValue = ""; // Beds $this->Beds->LinkCustomAttributes = ""; $this->Beds->HrefValue = ""; // Rooms $this->Rooms->LinkCustomAttributes = ""; $this->Rooms->HrefValue = ""; // Bathrooms $this->Bathrooms->LinkCustomAttributes = ""; $this->Bathrooms->HrefValue = ""; // Private_Kitchen $this->Private_Kitchen->LinkCustomAttributes = ""; $this->Private_Kitchen->HrefValue = ""; // Available_from $this->Available_from->LinkCustomAttributes = ""; $this->Available_from->HrefValue = ""; // Available_to $this->Available_to->LinkCustomAttributes = ""; $this->Available_to->HrefValue = ""; // Rel_type $this->Rel_type->LinkCustomAttributes = ""; $this->Rel_type->HrefValue = ""; } if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) { // Add / Edit / Search row $this->SetupFieldTitles(); } // Call Row Rendered event if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT) $this->Row_Rendered(); } // Validate form function ValidateForm() { global $Language, $gsFormError; // Check if validation required if (!EW_SERVER_VALIDATE) return ($gsFormError == ""); if (!$this->idOfferer->FldIsDetailKey && !is_null($this->idOfferer->FormValue) && $this->idOfferer->FormValue == "") { ew_AddMessage($gsFormError, str_replace("%s", $this->idOfferer->FldCaption(), $this->idOfferer->ReqErrMsg)); } if (!ew_CheckInteger($this->idOfferer->FormValue)) { ew_AddMessage($gsFormError, $this->idOfferer->FldErrMsg()); } if (!ew_CheckInteger($this->Beds->FormValue)) { ew_AddMessage($gsFormError, $this->Beds->FldErrMsg()); } if (!ew_CheckInteger($this->Rooms->FormValue)) { ew_AddMessage($gsFormError, $this->Rooms->FldErrMsg()); } if (!ew_CheckInteger($this->Bathrooms->FormValue)) { ew_AddMessage($gsFormError, $this->Bathrooms->FldErrMsg()); } if (!ew_CheckEuroDate($this->Available_from->FormValue)) { ew_AddMessage($gsFormError, $this->Available_from->FldErrMsg()); } if (!ew_CheckEuroDate($this->Available_to->FormValue)) { ew_AddMessage($gsFormError, $this->Available_to->FldErrMsg()); } // Return validate result $ValidateForm = ($gsFormError == ""); // Call Form_CustomValidate event $sFormCustomError = ""; $ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError); if ($sFormCustomError <> "") { ew_AddMessage($gsFormError, $sFormCustomError); } return $ValidateForm; } // // Delete records based on current filter // function DeleteRows() { global $Language, $Security; if (!$Security->CanDelete()) { $this->setFailureMessage($Language->Phrase("NoDeletePermission")); // No delete permission return FALSE; } $DeleteRows = TRUE; $sSql = $this->SQL(); $conn = &$this->Connection(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } elseif ($rs->EOF) { $this->setFailureMessage($Language->Phrase("NoRecord")); // No record found $rs->Close(); return FALSE; //} else { // $this->LoadRowValues($rs); // Load row values } $rows = ($rs) ? $rs->GetRows() : array(); // Clone old rows $rsold = $rows; if ($rs) $rs->Close(); // Call row deleting event if ($DeleteRows) { foreach ($rsold as $row) { $DeleteRows = $this->Row_Deleting($row); if (!$DeleteRows) break; } } if ($DeleteRows) { $sKey = ""; foreach ($rsold as $row) { $sThisKey = ""; if ($sThisKey <> "") $sThisKey .= $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"]; $sThisKey .= $row['idAccomodation']; $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $DeleteRows = $this->Delete($row); // Delete $conn->raiseErrorFn = ''; if ($DeleteRows === FALSE) break; if ($sKey <> "") $sKey .= ", "; $sKey .= $sThisKey; } } else { // Set up error message if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") { // Use the message, do nothing } elseif ($this->CancelMessage <> "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("DeleteCancelled")); } } if ($DeleteRows) { } else { } // Call Row Deleted event if ($DeleteRows) { foreach ($rsold as $row) { $this->Row_Deleted($row); } } return $DeleteRows; } // Update record based on key values function EditRow() { global $Security, $Language; $sFilter = $this->KeyFilter(); $sFilter = $this->ApplyUserIDFilters($sFilter); $conn = &$this->Connection(); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) return FALSE; if ($rs->EOF) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record message $EditRow = FALSE; // Update Failed } else { // Save old values $rsold = &$rs->fields; $this->LoadDbValues($rsold); $this->Rel_doc->OldUploadPath = "uploads/accom/".$this->idAccomodation->DbValue; $this->Rel_doc->UploadPath = $this->Rel_doc->OldUploadPath; $rsnew = array(); // idOfferer $this->idOfferer->SetDbValueDef($rsnew, $this->idOfferer->CurrentValue, 0, $this->idOfferer->ReadOnly); // Accom_Type $this->Accom_Type->SetDbValueDef($rsnew, $this->Accom_Type->CurrentValue, NULL, $this->Accom_Type->ReadOnly); // Address $this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, NULL, $this->Address->ReadOnly); // Town $this->Town->SetDbValueDef($rsnew, $this->Town->CurrentValue, NULL, $this->Town->ReadOnly); // District $this->District->SetDbValueDef($rsnew, $this->District->CurrentValue, NULL, $this->District->ReadOnly); // Region $this->Region->SetDbValueDef($rsnew, $this->Region->CurrentValue, NULL, $this->Region->ReadOnly); // Beds $this->Beds->SetDbValueDef($rsnew, $this->Beds->CurrentValue, NULL, $this->Beds->ReadOnly); // Rooms $this->Rooms->SetDbValueDef($rsnew, $this->Rooms->CurrentValue, NULL, $this->Rooms->ReadOnly); // Bathrooms $this->Bathrooms->SetDbValueDef($rsnew, $this->Bathrooms->CurrentValue, NULL, $this->Bathrooms->ReadOnly); // Private_Kitchen $this->Private_Kitchen->SetDbValueDef($rsnew, ((strval($this->Private_Kitchen->CurrentValue) == "Y") ? "Y" : "N"), NULL, $this->Private_Kitchen->ReadOnly); // Available_from $this->Available_from->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Available_from->CurrentValue, 7), NULL, $this->Available_from->ReadOnly); // Available_to $this->Available_to->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Available_to->CurrentValue, 7), NULL, $this->Available_to->ReadOnly); // Rel_type $this->Rel_type->SetDbValueDef($rsnew, $this->Rel_type->CurrentValue, NULL, $this->Rel_type->ReadOnly); // Check referential integrity for master table 'tofferers' $bValidMasterRecord = TRUE; $sMasterFilter = $this->SqlMasterFilter_tofferers(); $KeyValue = isset($rsnew['idOfferer']) ? $rsnew['idOfferer'] : $rsold['idOfferer']; if (strval($KeyValue) <> "") { $sMasterFilter = str_replace("@idOfferer@", ew_AdjustSql($KeyValue), $sMasterFilter); } else { $bValidMasterRecord = FALSE; } if ($bValidMasterRecord) { if (!isset($GLOBALS["tofferers"])) $GLOBALS["tofferers"] = new ctofferers(); $rsmaster = $GLOBALS["tofferers"]->LoadRs($sMasterFilter); $bValidMasterRecord = ($rsmaster && !$rsmaster->EOF); $rsmaster->Close(); } if (!$bValidMasterRecord) { $sRelatedRecordMsg = str_replace("%t", "tofferers", $Language->Phrase("RelatedRecordRequired")); $this->setFailureMessage($sRelatedRecordMsg); $rs->Close(); return FALSE; } // Call Row Updating event $bUpdateRow = $this->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; if (count($rsnew) > 0) $EditRow = $this->Update($rsnew, "", $rsold); else $EditRow = TRUE; // No field to update $conn->raiseErrorFn = ''; if ($EditRow) { } } else { if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") { // Use the message, do nothing } elseif ($this->CancelMessage <> "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("UpdateCancelled")); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) $this->Row_Updated($rsold, $rsnew); $rs->Close(); return $EditRow; } // Add record function AddRow($rsold = NULL) { global $Language, $Security; // Set up foreign key field value from Session if ($this->getCurrentMasterTable() == "tofferers") { $this->idOfferer->CurrentValue = $this->idOfferer->getSessionValue(); } // Check referential integrity for master table 'tofferers' $bValidMasterRecord = TRUE; $sMasterFilter = $this->SqlMasterFilter_tofferers(); if (strval($this->idOfferer->CurrentValue) <> "") { $sMasterFilter = str_replace("@idOfferer@", ew_AdjustSql($this->idOfferer->CurrentValue, "DB"), $sMasterFilter); } else { $bValidMasterRecord = FALSE; } if ($bValidMasterRecord) { if (!isset($GLOBALS["tofferers"])) $GLOBALS["tofferers"] = new ctofferers(); $rsmaster = $GLOBALS["tofferers"]->LoadRs($sMasterFilter); $bValidMasterRecord = ($rsmaster && !$rsmaster->EOF); $rsmaster->Close(); } if (!$bValidMasterRecord) { $sRelatedRecordMsg = str_replace("%t", "tofferers", $Language->Phrase("RelatedRecordRequired")); $this->setFailureMessage($sRelatedRecordMsg); return FALSE; } $conn = &$this->Connection(); // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); $this->Rel_doc->OldUploadPath = "uploads/accom/".$this->idAccomodation->DbValue; $this->Rel_doc->UploadPath = $this->Rel_doc->OldUploadPath; } $rsnew = array(); // idOfferer $this->idOfferer->SetDbValueDef($rsnew, $this->idOfferer->CurrentValue, 0, FALSE); // Accom_Type $this->Accom_Type->SetDbValueDef($rsnew, $this->Accom_Type->CurrentValue, NULL, FALSE); // Address $this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, NULL, FALSE); // Town $this->Town->SetDbValueDef($rsnew, $this->Town->CurrentValue, NULL, FALSE); // District $this->District->SetDbValueDef($rsnew, $this->District->CurrentValue, NULL, FALSE); // Region $this->Region->SetDbValueDef($rsnew, $this->Region->CurrentValue, NULL, FALSE); // Beds $this->Beds->SetDbValueDef($rsnew, $this->Beds->CurrentValue, NULL, FALSE); // Rooms $this->Rooms->SetDbValueDef($rsnew, $this->Rooms->CurrentValue, NULL, FALSE); // Bathrooms $this->Bathrooms->SetDbValueDef($rsnew, $this->Bathrooms->CurrentValue, NULL, FALSE); // Private_Kitchen $this->Private_Kitchen->SetDbValueDef($rsnew, ((strval($this->Private_Kitchen->CurrentValue) == "Y") ? "Y" : "N"), NULL, FALSE); // Available_from $this->Available_from->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Available_from->CurrentValue, 7), NULL, FALSE); // Available_to $this->Available_to->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Available_to->CurrentValue, 7), NULL, FALSE); // Rel_type $this->Rel_type->SetDbValueDef($rsnew, $this->Rel_type->CurrentValue, NULL, FALSE); // Call Row Inserting event $rs = ($rsold == NULL) ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") { // Use the message, do nothing } elseif ($this->CancelMessage <> "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } if ($AddRow) { // Call Row Inserted event $rs = ($rsold == NULL) ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; } // Set up master/detail based on QueryString function SetUpMasterParms() { // Hide foreign keys $sMasterTblVar = $this->getCurrentMasterTable(); if ($sMasterTblVar == "tofferers") { $this->idOfferer->Visible = FALSE; if ($GLOBALS["tofferers"]->EventCancelled) $this->EventCancelled = TRUE; } $this->DbMasterFilter = $this->GetMasterFilter(); // Get master filter $this->DbDetailFilter = $this->GetDetailFilter(); // Get detail filter } // Setup lookup filters of a field function SetupLookupFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; switch ($fld->FldVar) { case "x_idOfferer": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer` AS `LinkFld`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = "{filter}"; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer` AS `LinkFld`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = "{filter}"; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer` AS `LinkFld`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tofferers`"; $sWhereWrk = "{filter}"; $this->idOfferer->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`idOfferer` = {filter_value}', "t0" => "3", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Accom_Type": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Accom_Type` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Accom_Type` AS `LinkFld`, `Description_IT` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Accom_Type` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccom_type`"; $sWhereWrk = ""; $this->Accom_Type->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`Accom_Type` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Accom_Type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Rel_type": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Rel_type` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Rel_type` AS `LinkFld`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Rel_type` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `trel_type`"; $sWhereWrk = ""; $this->Rel_type->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`Rel_type` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Rel_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; } } // Setup AutoSuggest filters of a field function SetupAutoSuggestFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; switch ($fld->FldVar) { case "x_idOfferer": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld` FROM `tofferers`"; $sWhereWrk = "`Name` LIKE '{query_value}%' OR CONCAT(`Name`,'" . ew_ValueSeparator(1, $this->idOfferer) . "',`Surname`,'" . ew_ValueSeparator(2, $this->idOfferer) . "',`Institution_Name`) LIKE '{query_value}%'"; $this->idOfferer->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld` FROM `tofferers`"; $sWhereWrk = "`Name` LIKE '{query_value}%' OR CONCAT(`Name`,'" . ew_ValueSeparator(1, $this->idOfferer) . "',`Surname`,'" . ew_ValueSeparator(2, $this->idOfferer) . "',`Institution_Name`) LIKE '{query_value}%'"; $this->idOfferer->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idOfferer`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `Institution_Name` AS `Disp3Fld` FROM `tofferers`"; $sWhereWrk = "`Name` LIKE '{query_value}%' OR CONCAT(`Name`,'" . ew_ValueSeparator(1, $this->idOfferer) . "',`Surname`,'" . ew_ValueSeparator(2, $this->idOfferer) . "',`Institution_Name`) LIKE '{query_value}%'"; $this->idOfferer->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->idOfferer, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; } } // Page Load event function Page_Load() { //echo "Page Load"; } // Page Unload event function Page_Unload() { //echo "Page Unload"; } // Page Redirecting event function Page_Redirecting(&$url) { // Example: //$url = "your URL"; } // Message Showing event // $type = ''|'success'|'failure'|'warning' function Message_Showing(&$msg, $type) { if ($type == 'success') { //$msg = "your success message"; } elseif ($type == 'failure') { //$msg = "your failure message"; } elseif ($type == 'warning') { //$msg = "your warning message"; } else { //$msg = "your message"; } } // Page Render event function Page_Render() { //echo "Page Render"; } // Page Data Rendering event function Page_DataRendering(&$header) { // Example: //$header = "your header"; } // Page Data Rendered event function Page_DataRendered(&$footer) { // Example: //$footer = "your footer"; } // Form Custom Validate event function Form_CustomValidate(&$CustomError) { // Return error message in CustomError return TRUE; } } ?>