UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token return $PageUrl; } // Page URLs var $AddUrl; var $EditUrl; var $CopyUrl; var $DeleteUrl; var $ViewUrl; var $ListUrl; // Export URLs var $ExportPrintUrl; var $ExportHtmlUrl; var $ExportExcelUrl; var $ExportWordUrl; var $ExportXmlUrl; var $ExportCsvUrl; var $ExportPdfUrl; // Custom export var $ExportExcelCustom = FALSE; var $ExportWordCustom = FALSE; var $ExportPdfCustom = FALSE; var $ExportEmailCustom = FALSE; // Update URLs var $InlineAddUrl; var $InlineCopyUrl; var $InlineEditUrl; var $GridAddUrl; var $GridEditUrl; var $MultiDeleteUrl; var $MultiUpdateUrl; // 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 .= "
" . $sMessage . "
"; $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session } // Warning message $sWarningMessage = $this->getWarningMessage(); if (method_exists($this, "Message_Showing")) $this->Message_Showing($sWarningMessage, "warning"); if ($sWarningMessage <> "") { // Message in Session, display if (!$hidden) $sWarningMessage = "" . $sWarningMessage; $html .= "
" . $sWarningMessage . "
"; $_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; // Clear message in Session } // Success message $sSuccessMessage = $this->getSuccessMessage(); if (method_exists($this, "Message_Showing")) $this->Message_Showing($sSuccessMessage, "success"); if ($sSuccessMessage <> "") { // Message in Session, display if (!$hidden) $sSuccessMessage = "" . $sSuccessMessage; $html .= "
" . $sSuccessMessage . "
"; $_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; // Clear message in Session } // Failure message $sErrorMessage = $this->getFailureMessage(); if (method_exists($this, "Message_Showing")) $this->Message_Showing($sErrorMessage, "failure"); if ($sErrorMessage <> "") { // Message in Session, display if (!$hidden) $sErrorMessage = "" . $sErrorMessage; $html .= "
" . $sErrorMessage . "
"; $_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; // Clear message in Session } echo "
" . $html . "
"; } var $PageHeader; var $PageFooter; // Show Page Header function ShowPageHeader() { $sHeader = $this->PageHeader; $this->Page_DataRendering($sHeader); if ($sHeader <> "") { // Header exists, display echo "

" . $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; $GLOBALS["Page"] = &$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["Table"] = &$GLOBALS["taccomodations"]; } // Initialize URLs $this->ExportPrintUrl = $this->PageUrl() . "export=print"; $this->ExportExcelUrl = $this->PageUrl() . "export=excel"; $this->ExportWordUrl = $this->PageUrl() . "export=word"; $this->ExportHtmlUrl = $this->PageUrl() . "export=html"; $this->ExportXmlUrl = $this->PageUrl() . "export=xml"; $this->ExportCsvUrl = $this->PageUrl() . "export=csv"; $this->ExportPdfUrl = $this->PageUrl() . "export=pdf"; $this->AddUrl = "taccomodationsadd.php?" . EW_TABLE_SHOW_DETAIL . "="; $this->InlineAddUrl = $this->PageUrl() . "a=add"; $this->GridAddUrl = $this->PageUrl() . "a=gridadd"; $this->GridEditUrl = $this->PageUrl() . "a=gridedit"; $this->MultiDeleteUrl = "taccomodationsdelete.php"; $this->MultiUpdateUrl = "taccomodationsupdate.php"; // Table object (tofferers) if (!isset($GLOBALS['tofferers'])) $GLOBALS['tofferers'] = new ctofferers(); // Table object (users) if (!isset($GLOBALS['users'])) $GLOBALS['users'] = new cusers(); // Page ID if (!defined("EW_PAGE_ID")) define("EW_PAGE_ID", 'list', 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; // Export options $this->ExportOptions = new cListOptions(); $this->ExportOptions->Tag = "div"; $this->ExportOptions->TagClassName = "ewExportOption"; // Other options $this->OtherOptions['addedit'] = new cListOptions(); $this->OtherOptions['addedit']->Tag = "div"; $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption"; $this->OtherOptions['detail'] = new cListOptions(); $this->OtherOptions['detail']->Tag = "div"; $this->OtherOptions['detail']->TagClassName = "ewDetailOption"; $this->OtherOptions['action'] = new cListOptions(); $this->OtherOptions['action']->Tag = "div"; $this->OtherOptions['action']->TagClassName = "ewActionOption"; // Filter options $this->FilterOptions = new cListOptions(); $this->FilterOptions->Tag = "div"; $this->FilterOptions->TagClassName = "ewFilterOption ftaccomodationslistsrch"; // List actions $this->ListActions = new cListActions(); } // // 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 export parameters $custom = ""; if (@$_GET["export"] <> "") { $this->Export = $_GET["export"]; $custom = @$_GET["custom"]; } elseif (@$_POST["export"] <> "") { $this->Export = $_POST["export"]; $custom = @$_POST["custom"]; } elseif (ew_IsHttpPost()) { if (@$_POST["exporttype"] <> "") $this->Export = $_POST["exporttype"]; $custom = @$_POST["custom"]; } else { $this->setExportReturnUrl(ew_CurrentUrl()); } $gsExportFile = $this->TableVar; // Get export file, used in header // Get custom export parameters if ($this->Export <> "" && $custom <> "") { $this->CustomExport = $this->Export; $this->Export = "print"; } $gsCustomExport = $this->CustomExport; $gsExport = $this->Export; // Get export parameter, used in header // Update Export URLs if (defined("EW_USE_PHPEXCEL")) $this->ExportExcelCustom = FALSE; if ($this->ExportExcelCustom) $this->ExportExcelUrl .= "&custom=1"; if (defined("EW_USE_PHPWORD")) $this->ExportWordCustom = FALSE; if ($this->ExportWordCustom) $this->ExportWordUrl .= "&custom=1"; if ($this->ExportPdfCustom) $this->ExportPdfUrl .= "&custom=1"; $this->CurrentAction = (@$_GET["a"] <> "") ? $_GET["a"] : @$_POST["a_list"]; // Set up current action // 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(); // Setup export options $this->SetupExportOptions(); $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(); // Set up custom action (compatible with old version) foreach ($this->CustomActions as $name => $action) $this->ListActions->Add($name, $action); // Show checkbox column if multiple action foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_MULTIPLE && $listaction->Allow) { $this->ListOptions->Items["checkbox"]->Visible = TRUE; break; } } } // // Page_Terminate // function Page_Terminate($url = "") { global $gsExportFile, $gTmpImages; // Page Unload event $this->Page_Unload(); // Global Page Unloaded event (in userfn*.php) Page_Unloaded(); // 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(); } } $this->Page_Redirecting($url); // Close connection ew_CloseConn(); // 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 $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 // Process list action first if ($this->ProcessListAction()) // Ajax request $this->Page_Terminate(); // Set up records per page $this->SetUpDisplayRecs(); // Handle reset command $this->ResetCmd(); // Set up Breadcrumb if ($this->Export == "") $this->SetupBreadcrumb(); // 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 } // Hide options if ($this->Export <> "" || $this->CurrentAction <> "") { $this->ExportOptions->HideAllOptions(); $this->FilterOptions->HideAllOptions(); } // Hide other options if ($this->Export <> "") { foreach ($this->OtherOptions as &$option) $option->HideAllOptions(); } // Get default search criteria ew_AddFilter($this->DefaultSearchWhere, $this->BasicSearchWhere(TRUE)); ew_AddFilter($this->DefaultSearchWhere, $this->AdvancedSearchWhere(TRUE)); // Get basic search values $this->LoadBasicSearchValues(); // Get and validate search values for advanced search $this->LoadSearchValues(); // Get search values // Process filter list $this->ProcessFilterList(); if (!$this->ValidateSearch()) $this->setFailureMessage($gsSearchError); // Restore search parms from Session if not searching / reset / export if (($this->Export <> "" || $this->Command <> "search" && $this->Command <> "reset" && $this->Command <> "resetall") && $this->CheckSearchParms()) $this->RestoreSearchParms(); // Call Recordset SearchValidated event $this->Recordset_SearchValidated(); // Set up sorting order $this->SetUpSortOrder(); // Get basic search criteria if ($gsSearchError == "") $sSrchBasic = $this->BasicSearchWhere(); // Get search criteria for advanced search if ($gsSearchError == "") $sSrchAdvanced = $this->AdvancedSearchWhere(); } // Restore display records if ($this->getRecordsPerPage() <> "") { $this->DisplayRecs = $this->getRecordsPerPage(); // Restore from Session } else { $this->DisplayRecs = 20; // Load default } // Load Sorting Order $this->LoadSortOrder(); // Load search default if no existing search criteria if (!$this->CheckSearchParms()) { // Load basic search from default $this->BasicSearch->LoadDefault(); if ($this->BasicSearch->Keyword != "") $sSrchBasic = $this->BasicSearchWhere(); // Load advanced search from default if ($this->LoadAdvancedSearchDefault()) { $sSrchAdvanced = $this->AdvancedSearchWhere(); } } // Build search criteria ew_AddFilter($this->SearchWhere, $sSrchAdvanced); ew_AddFilter($this->SearchWhere, $sSrchBasic); // Call Recordset_Searching event $this->Recordset_Searching($this->SearchWhere); // Save search criteria if ($this->Command == "search" && !$this->RestoreSearch) { $this->setSearchWhere($this->SearchWhere); // Save to Session $this->StartRec = 1; // Reset start record counter $this->setStartRecordNumber($this->StartRec); } else { $this->SearchWhere = $this->getSearchWhere(); } // 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 = ""; // Export data only if ($this->CustomExport == "" && in_array($this->Export, array("html","word","excel","xml","csv","email","pdf"))) { $this->ExportData(); $this->Page_Terminate(); // Terminate response exit(); } // 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(); } } // Search options $this->SetupSearchOptions(); } // 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); } } // 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; } // Get list of filters function GetFilterList() { global $UserProfile; // Load server side filters if (EW_SEARCH_FILTER_OPTION == "Server") { $sSavedFilterList = isset($UserProfile) ? $UserProfile->GetSearchFilters(CurrentUserName(), "ftaccomodationslistsrch") : ""; } else { $sSavedFilterList = ""; } // Initialize $sFilterList = ""; $sFilterList = ew_Concat($sFilterList, $this->idAccomodation->AdvancedSearch->ToJSON(), ","); // Field idAccomodation $sFilterList = ew_Concat($sFilterList, $this->idOfferer->AdvancedSearch->ToJSON(), ","); // Field idOfferer $sFilterList = ew_Concat($sFilterList, $this->Accom_Type->AdvancedSearch->ToJSON(), ","); // Field Accom_Type $sFilterList = ew_Concat($sFilterList, $this->Address->AdvancedSearch->ToJSON(), ","); // Field Address $sFilterList = ew_Concat($sFilterList, $this->Town->AdvancedSearch->ToJSON(), ","); // Field Town $sFilterList = ew_Concat($sFilterList, $this->District->AdvancedSearch->ToJSON(), ","); // Field District $sFilterList = ew_Concat($sFilterList, $this->Region->AdvancedSearch->ToJSON(), ","); // Field Region $sFilterList = ew_Concat($sFilterList, $this->Beds->AdvancedSearch->ToJSON(), ","); // Field Beds $sFilterList = ew_Concat($sFilterList, $this->Rooms->AdvancedSearch->ToJSON(), ","); // Field Rooms $sFilterList = ew_Concat($sFilterList, $this->Bathrooms->AdvancedSearch->ToJSON(), ","); // Field Bathrooms $sFilterList = ew_Concat($sFilterList, $this->Private_Kitchen->AdvancedSearch->ToJSON(), ","); // Field Private_Kitchen $sFilterList = ew_Concat($sFilterList, $this->Auton_heating->AdvancedSearch->ToJSON(), ","); // Field Auton_heating $sFilterList = ew_Concat($sFilterList, $this->Arch_barriers->AdvancedSearch->ToJSON(), ","); // Field Arch_barriers $sFilterList = ew_Concat($sFilterList, $this->Furnisched->AdvancedSearch->ToJSON(), ","); // Field Furnisched $sFilterList = ew_Concat($sFilterList, $this->Private_entrance->AdvancedSearch->ToJSON(), ","); // Field Private_entrance $sFilterList = ew_Concat($sFilterList, $this->Time_restrictions->AdvancedSearch->ToJSON(), ","); // Field Time_restrictions $sFilterList = ew_Concat($sFilterList, $this->Time_restr_from->AdvancedSearch->ToJSON(), ","); // Field Time_restr_from $sFilterList = ew_Concat($sFilterList, $this->Time_restr_to->AdvancedSearch->ToJSON(), ","); // Field Time_restr_to $sFilterList = ew_Concat($sFilterList, $this->Services_access->AdvancedSearch->ToJSON(), ","); // Field Services_access $sFilterList = ew_Concat($sFilterList, $this->Available_from->AdvancedSearch->ToJSON(), ","); // Field Available_from $sFilterList = ew_Concat($sFilterList, $this->Available_to->AdvancedSearch->ToJSON(), ","); // Field Available_to $sFilterList = ew_Concat($sFilterList, $this->Rel_type->AdvancedSearch->ToJSON(), ","); // Field Rel_type $sFilterList = ew_Concat($sFilterList, $this->offer_woman->AdvancedSearch->ToJSON(), ","); // Field offer_woman $sFilterList = ew_Concat($sFilterList, $this->offer_children->AdvancedSearch->ToJSON(), ","); // Field offer_children $sFilterList = ew_Concat($sFilterList, $this->offer_family->AdvancedSearch->ToJSON(), ","); // Field offer_family $sFilterList = ew_Concat($sFilterList, $this->offer_man->AdvancedSearch->ToJSON(), ","); // Field offer_man $sFilterList = ew_Concat($sFilterList, $this->offer_elderly->AdvancedSearch->ToJSON(), ","); // Field offer_elderly $sFilterList = ew_Concat($sFilterList, $this->offer_disabled->AdvancedSearch->ToJSON(), ","); // Field offer_disabled $sFilterList = ew_Concat($sFilterList, $this->offer_sick->AdvancedSearch->ToJSON(), ","); // Field offer_sick $sFilterList = ew_Concat($sFilterList, $this->offer_christian->AdvancedSearch->ToJSON(), ","); // Field offer_christian $sFilterList = ew_Concat($sFilterList, $this->offer_muslim->AdvancedSearch->ToJSON(), ","); // Field offer_muslim $sFilterList = ew_Concat($sFilterList, $this->offer_other->AdvancedSearch->ToJSON(), ","); // Field offer_other $sFilterList = ew_Concat($sFilterList, $this->verify_date->AdvancedSearch->ToJSON(), ","); // Field verify_date $sFilterList = ew_Concat($sFilterList, $this->verify_by->AdvancedSearch->ToJSON(), ","); // Field verify_by $sFilterList = ew_Concat($sFilterList, $this->verify_phone->AdvancedSearch->ToJSON(), ","); // Field verify_phone $sFilterList = ew_Concat($sFilterList, $this->verify_email->AdvancedSearch->ToJSON(), ","); // Field verify_email $sFilterList = ew_Concat($sFilterList, $this->Outcome->AdvancedSearch->ToJSON(), ","); // Field Outcome $sFilterList = ew_Concat($sFilterList, $this->Outcome_type->AdvancedSearch->ToJSON(), ","); // Field Outcome_type $sFilterList = ew_Concat($sFilterList, $this->Rel_doc->AdvancedSearch->ToJSON(), ","); // Field Rel_doc if ($this->BasicSearch->Keyword <> "") { $sWrk = "\"" . EW_TABLE_BASIC_SEARCH . "\":\"" . ew_JsEncode2($this->BasicSearch->Keyword) . "\",\"" . EW_TABLE_BASIC_SEARCH_TYPE . "\":\"" . ew_JsEncode2($this->BasicSearch->Type) . "\""; $sFilterList = ew_Concat($sFilterList, $sWrk, ","); } $sFilterList = preg_replace('/,$/', "", $sFilterList); // Return filter list in json if ($sFilterList <> "") $sFilterList = "\"data\":{" . $sFilterList . "}"; if ($sSavedFilterList <> "") { if ($sFilterList <> "") $sFilterList .= ","; $sFilterList .= "\"filters\":" . $sSavedFilterList; } return ($sFilterList <> "") ? "{" . $sFilterList . "}" : "null"; } // Process filter list function ProcessFilterList() { global $UserProfile; if (@$_POST["ajax"] == "savefilters") { // Save filter request (Ajax) $filters = ew_StripSlashes(@$_POST["filters"]); $UserProfile->SetSearchFilters(CurrentUserName(), "ftaccomodationslistsrch", $filters); // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); echo ew_ArrayToJson(array(array("success" => TRUE))); // Success $this->Page_Terminate(); exit(); } elseif (@$_POST["cmd"] == "resetfilter") { $this->RestoreFilterList(); } } // Restore list of filters function RestoreFilterList() { // Return if not reset filter if (@$_POST["cmd"] <> "resetfilter") return FALSE; $filter = json_decode(ew_StripSlashes(@$_POST["filter"]), TRUE); $this->Command = "search"; // Field idAccomodation $this->idAccomodation->AdvancedSearch->SearchValue = @$filter["x_idAccomodation"]; $this->idAccomodation->AdvancedSearch->SearchOperator = @$filter["z_idAccomodation"]; $this->idAccomodation->AdvancedSearch->SearchCondition = @$filter["v_idAccomodation"]; $this->idAccomodation->AdvancedSearch->SearchValue2 = @$filter["y_idAccomodation"]; $this->idAccomodation->AdvancedSearch->SearchOperator2 = @$filter["w_idAccomodation"]; $this->idAccomodation->AdvancedSearch->Save(); // Field idOfferer $this->idOfferer->AdvancedSearch->SearchValue = @$filter["x_idOfferer"]; $this->idOfferer->AdvancedSearch->SearchOperator = @$filter["z_idOfferer"]; $this->idOfferer->AdvancedSearch->SearchCondition = @$filter["v_idOfferer"]; $this->idOfferer->AdvancedSearch->SearchValue2 = @$filter["y_idOfferer"]; $this->idOfferer->AdvancedSearch->SearchOperator2 = @$filter["w_idOfferer"]; $this->idOfferer->AdvancedSearch->Save(); // Field Accom_Type $this->Accom_Type->AdvancedSearch->SearchValue = @$filter["x_Accom_Type"]; $this->Accom_Type->AdvancedSearch->SearchOperator = @$filter["z_Accom_Type"]; $this->Accom_Type->AdvancedSearch->SearchCondition = @$filter["v_Accom_Type"]; $this->Accom_Type->AdvancedSearch->SearchValue2 = @$filter["y_Accom_Type"]; $this->Accom_Type->AdvancedSearch->SearchOperator2 = @$filter["w_Accom_Type"]; $this->Accom_Type->AdvancedSearch->Save(); // Field Address $this->Address->AdvancedSearch->SearchValue = @$filter["x_Address"]; $this->Address->AdvancedSearch->SearchOperator = @$filter["z_Address"]; $this->Address->AdvancedSearch->SearchCondition = @$filter["v_Address"]; $this->Address->AdvancedSearch->SearchValue2 = @$filter["y_Address"]; $this->Address->AdvancedSearch->SearchOperator2 = @$filter["w_Address"]; $this->Address->AdvancedSearch->Save(); // Field Town $this->Town->AdvancedSearch->SearchValue = @$filter["x_Town"]; $this->Town->AdvancedSearch->SearchOperator = @$filter["z_Town"]; $this->Town->AdvancedSearch->SearchCondition = @$filter["v_Town"]; $this->Town->AdvancedSearch->SearchValue2 = @$filter["y_Town"]; $this->Town->AdvancedSearch->SearchOperator2 = @$filter["w_Town"]; $this->Town->AdvancedSearch->Save(); // Field District $this->District->AdvancedSearch->SearchValue = @$filter["x_District"]; $this->District->AdvancedSearch->SearchOperator = @$filter["z_District"]; $this->District->AdvancedSearch->SearchCondition = @$filter["v_District"]; $this->District->AdvancedSearch->SearchValue2 = @$filter["y_District"]; $this->District->AdvancedSearch->SearchOperator2 = @$filter["w_District"]; $this->District->AdvancedSearch->Save(); // Field Region $this->Region->AdvancedSearch->SearchValue = @$filter["x_Region"]; $this->Region->AdvancedSearch->SearchOperator = @$filter["z_Region"]; $this->Region->AdvancedSearch->SearchCondition = @$filter["v_Region"]; $this->Region->AdvancedSearch->SearchValue2 = @$filter["y_Region"]; $this->Region->AdvancedSearch->SearchOperator2 = @$filter["w_Region"]; $this->Region->AdvancedSearch->Save(); // Field Beds $this->Beds->AdvancedSearch->SearchValue = @$filter["x_Beds"]; $this->Beds->AdvancedSearch->SearchOperator = @$filter["z_Beds"]; $this->Beds->AdvancedSearch->SearchCondition = @$filter["v_Beds"]; $this->Beds->AdvancedSearch->SearchValue2 = @$filter["y_Beds"]; $this->Beds->AdvancedSearch->SearchOperator2 = @$filter["w_Beds"]; $this->Beds->AdvancedSearch->Save(); // Field Rooms $this->Rooms->AdvancedSearch->SearchValue = @$filter["x_Rooms"]; $this->Rooms->AdvancedSearch->SearchOperator = @$filter["z_Rooms"]; $this->Rooms->AdvancedSearch->SearchCondition = @$filter["v_Rooms"]; $this->Rooms->AdvancedSearch->SearchValue2 = @$filter["y_Rooms"]; $this->Rooms->AdvancedSearch->SearchOperator2 = @$filter["w_Rooms"]; $this->Rooms->AdvancedSearch->Save(); // Field Bathrooms $this->Bathrooms->AdvancedSearch->SearchValue = @$filter["x_Bathrooms"]; $this->Bathrooms->AdvancedSearch->SearchOperator = @$filter["z_Bathrooms"]; $this->Bathrooms->AdvancedSearch->SearchCondition = @$filter["v_Bathrooms"]; $this->Bathrooms->AdvancedSearch->SearchValue2 = @$filter["y_Bathrooms"]; $this->Bathrooms->AdvancedSearch->SearchOperator2 = @$filter["w_Bathrooms"]; $this->Bathrooms->AdvancedSearch->Save(); // Field Private_Kitchen $this->Private_Kitchen->AdvancedSearch->SearchValue = @$filter["x_Private_Kitchen"]; $this->Private_Kitchen->AdvancedSearch->SearchOperator = @$filter["z_Private_Kitchen"]; $this->Private_Kitchen->AdvancedSearch->SearchCondition = @$filter["v_Private_Kitchen"]; $this->Private_Kitchen->AdvancedSearch->SearchValue2 = @$filter["y_Private_Kitchen"]; $this->Private_Kitchen->AdvancedSearch->SearchOperator2 = @$filter["w_Private_Kitchen"]; $this->Private_Kitchen->AdvancedSearch->Save(); // Field Auton_heating $this->Auton_heating->AdvancedSearch->SearchValue = @$filter["x_Auton_heating"]; $this->Auton_heating->AdvancedSearch->SearchOperator = @$filter["z_Auton_heating"]; $this->Auton_heating->AdvancedSearch->SearchCondition = @$filter["v_Auton_heating"]; $this->Auton_heating->AdvancedSearch->SearchValue2 = @$filter["y_Auton_heating"]; $this->Auton_heating->AdvancedSearch->SearchOperator2 = @$filter["w_Auton_heating"]; $this->Auton_heating->AdvancedSearch->Save(); // Field Arch_barriers $this->Arch_barriers->AdvancedSearch->SearchValue = @$filter["x_Arch_barriers"]; $this->Arch_barriers->AdvancedSearch->SearchOperator = @$filter["z_Arch_barriers"]; $this->Arch_barriers->AdvancedSearch->SearchCondition = @$filter["v_Arch_barriers"]; $this->Arch_barriers->AdvancedSearch->SearchValue2 = @$filter["y_Arch_barriers"]; $this->Arch_barriers->AdvancedSearch->SearchOperator2 = @$filter["w_Arch_barriers"]; $this->Arch_barriers->AdvancedSearch->Save(); // Field Furnisched $this->Furnisched->AdvancedSearch->SearchValue = @$filter["x_Furnisched"]; $this->Furnisched->AdvancedSearch->SearchOperator = @$filter["z_Furnisched"]; $this->Furnisched->AdvancedSearch->SearchCondition = @$filter["v_Furnisched"]; $this->Furnisched->AdvancedSearch->SearchValue2 = @$filter["y_Furnisched"]; $this->Furnisched->AdvancedSearch->SearchOperator2 = @$filter["w_Furnisched"]; $this->Furnisched->AdvancedSearch->Save(); // Field Private_entrance $this->Private_entrance->AdvancedSearch->SearchValue = @$filter["x_Private_entrance"]; $this->Private_entrance->AdvancedSearch->SearchOperator = @$filter["z_Private_entrance"]; $this->Private_entrance->AdvancedSearch->SearchCondition = @$filter["v_Private_entrance"]; $this->Private_entrance->AdvancedSearch->SearchValue2 = @$filter["y_Private_entrance"]; $this->Private_entrance->AdvancedSearch->SearchOperator2 = @$filter["w_Private_entrance"]; $this->Private_entrance->AdvancedSearch->Save(); // Field Time_restrictions $this->Time_restrictions->AdvancedSearch->SearchValue = @$filter["x_Time_restrictions"]; $this->Time_restrictions->AdvancedSearch->SearchOperator = @$filter["z_Time_restrictions"]; $this->Time_restrictions->AdvancedSearch->SearchCondition = @$filter["v_Time_restrictions"]; $this->Time_restrictions->AdvancedSearch->SearchValue2 = @$filter["y_Time_restrictions"]; $this->Time_restrictions->AdvancedSearch->SearchOperator2 = @$filter["w_Time_restrictions"]; $this->Time_restrictions->AdvancedSearch->Save(); // Field Time_restr_from $this->Time_restr_from->AdvancedSearch->SearchValue = @$filter["x_Time_restr_from"]; $this->Time_restr_from->AdvancedSearch->SearchOperator = @$filter["z_Time_restr_from"]; $this->Time_restr_from->AdvancedSearch->SearchCondition = @$filter["v_Time_restr_from"]; $this->Time_restr_from->AdvancedSearch->SearchValue2 = @$filter["y_Time_restr_from"]; $this->Time_restr_from->AdvancedSearch->SearchOperator2 = @$filter["w_Time_restr_from"]; $this->Time_restr_from->AdvancedSearch->Save(); // Field Time_restr_to $this->Time_restr_to->AdvancedSearch->SearchValue = @$filter["x_Time_restr_to"]; $this->Time_restr_to->AdvancedSearch->SearchOperator = @$filter["z_Time_restr_to"]; $this->Time_restr_to->AdvancedSearch->SearchCondition = @$filter["v_Time_restr_to"]; $this->Time_restr_to->AdvancedSearch->SearchValue2 = @$filter["y_Time_restr_to"]; $this->Time_restr_to->AdvancedSearch->SearchOperator2 = @$filter["w_Time_restr_to"]; $this->Time_restr_to->AdvancedSearch->Save(); // Field Services_access $this->Services_access->AdvancedSearch->SearchValue = @$filter["x_Services_access"]; $this->Services_access->AdvancedSearch->SearchOperator = @$filter["z_Services_access"]; $this->Services_access->AdvancedSearch->SearchCondition = @$filter["v_Services_access"]; $this->Services_access->AdvancedSearch->SearchValue2 = @$filter["y_Services_access"]; $this->Services_access->AdvancedSearch->SearchOperator2 = @$filter["w_Services_access"]; $this->Services_access->AdvancedSearch->Save(); // Field Available_from $this->Available_from->AdvancedSearch->SearchValue = @$filter["x_Available_from"]; $this->Available_from->AdvancedSearch->SearchOperator = @$filter["z_Available_from"]; $this->Available_from->AdvancedSearch->SearchCondition = @$filter["v_Available_from"]; $this->Available_from->AdvancedSearch->SearchValue2 = @$filter["y_Available_from"]; $this->Available_from->AdvancedSearch->SearchOperator2 = @$filter["w_Available_from"]; $this->Available_from->AdvancedSearch->Save(); // Field Available_to $this->Available_to->AdvancedSearch->SearchValue = @$filter["x_Available_to"]; $this->Available_to->AdvancedSearch->SearchOperator = @$filter["z_Available_to"]; $this->Available_to->AdvancedSearch->SearchCondition = @$filter["v_Available_to"]; $this->Available_to->AdvancedSearch->SearchValue2 = @$filter["y_Available_to"]; $this->Available_to->AdvancedSearch->SearchOperator2 = @$filter["w_Available_to"]; $this->Available_to->AdvancedSearch->Save(); // Field Rel_type $this->Rel_type->AdvancedSearch->SearchValue = @$filter["x_Rel_type"]; $this->Rel_type->AdvancedSearch->SearchOperator = @$filter["z_Rel_type"]; $this->Rel_type->AdvancedSearch->SearchCondition = @$filter["v_Rel_type"]; $this->Rel_type->AdvancedSearch->SearchValue2 = @$filter["y_Rel_type"]; $this->Rel_type->AdvancedSearch->SearchOperator2 = @$filter["w_Rel_type"]; $this->Rel_type->AdvancedSearch->Save(); // Field offer_woman $this->offer_woman->AdvancedSearch->SearchValue = @$filter["x_offer_woman"]; $this->offer_woman->AdvancedSearch->SearchOperator = @$filter["z_offer_woman"]; $this->offer_woman->AdvancedSearch->SearchCondition = @$filter["v_offer_woman"]; $this->offer_woman->AdvancedSearch->SearchValue2 = @$filter["y_offer_woman"]; $this->offer_woman->AdvancedSearch->SearchOperator2 = @$filter["w_offer_woman"]; $this->offer_woman->AdvancedSearch->Save(); // Field offer_children $this->offer_children->AdvancedSearch->SearchValue = @$filter["x_offer_children"]; $this->offer_children->AdvancedSearch->SearchOperator = @$filter["z_offer_children"]; $this->offer_children->AdvancedSearch->SearchCondition = @$filter["v_offer_children"]; $this->offer_children->AdvancedSearch->SearchValue2 = @$filter["y_offer_children"]; $this->offer_children->AdvancedSearch->SearchOperator2 = @$filter["w_offer_children"]; $this->offer_children->AdvancedSearch->Save(); // Field offer_family $this->offer_family->AdvancedSearch->SearchValue = @$filter["x_offer_family"]; $this->offer_family->AdvancedSearch->SearchOperator = @$filter["z_offer_family"]; $this->offer_family->AdvancedSearch->SearchCondition = @$filter["v_offer_family"]; $this->offer_family->AdvancedSearch->SearchValue2 = @$filter["y_offer_family"]; $this->offer_family->AdvancedSearch->SearchOperator2 = @$filter["w_offer_family"]; $this->offer_family->AdvancedSearch->Save(); // Field offer_man $this->offer_man->AdvancedSearch->SearchValue = @$filter["x_offer_man"]; $this->offer_man->AdvancedSearch->SearchOperator = @$filter["z_offer_man"]; $this->offer_man->AdvancedSearch->SearchCondition = @$filter["v_offer_man"]; $this->offer_man->AdvancedSearch->SearchValue2 = @$filter["y_offer_man"]; $this->offer_man->AdvancedSearch->SearchOperator2 = @$filter["w_offer_man"]; $this->offer_man->AdvancedSearch->Save(); // Field offer_elderly $this->offer_elderly->AdvancedSearch->SearchValue = @$filter["x_offer_elderly"]; $this->offer_elderly->AdvancedSearch->SearchOperator = @$filter["z_offer_elderly"]; $this->offer_elderly->AdvancedSearch->SearchCondition = @$filter["v_offer_elderly"]; $this->offer_elderly->AdvancedSearch->SearchValue2 = @$filter["y_offer_elderly"]; $this->offer_elderly->AdvancedSearch->SearchOperator2 = @$filter["w_offer_elderly"]; $this->offer_elderly->AdvancedSearch->Save(); // Field offer_disabled $this->offer_disabled->AdvancedSearch->SearchValue = @$filter["x_offer_disabled"]; $this->offer_disabled->AdvancedSearch->SearchOperator = @$filter["z_offer_disabled"]; $this->offer_disabled->AdvancedSearch->SearchCondition = @$filter["v_offer_disabled"]; $this->offer_disabled->AdvancedSearch->SearchValue2 = @$filter["y_offer_disabled"]; $this->offer_disabled->AdvancedSearch->SearchOperator2 = @$filter["w_offer_disabled"]; $this->offer_disabled->AdvancedSearch->Save(); // Field offer_sick $this->offer_sick->AdvancedSearch->SearchValue = @$filter["x_offer_sick"]; $this->offer_sick->AdvancedSearch->SearchOperator = @$filter["z_offer_sick"]; $this->offer_sick->AdvancedSearch->SearchCondition = @$filter["v_offer_sick"]; $this->offer_sick->AdvancedSearch->SearchValue2 = @$filter["y_offer_sick"]; $this->offer_sick->AdvancedSearch->SearchOperator2 = @$filter["w_offer_sick"]; $this->offer_sick->AdvancedSearch->Save(); // Field offer_christian $this->offer_christian->AdvancedSearch->SearchValue = @$filter["x_offer_christian"]; $this->offer_christian->AdvancedSearch->SearchOperator = @$filter["z_offer_christian"]; $this->offer_christian->AdvancedSearch->SearchCondition = @$filter["v_offer_christian"]; $this->offer_christian->AdvancedSearch->SearchValue2 = @$filter["y_offer_christian"]; $this->offer_christian->AdvancedSearch->SearchOperator2 = @$filter["w_offer_christian"]; $this->offer_christian->AdvancedSearch->Save(); // Field offer_muslim $this->offer_muslim->AdvancedSearch->SearchValue = @$filter["x_offer_muslim"]; $this->offer_muslim->AdvancedSearch->SearchOperator = @$filter["z_offer_muslim"]; $this->offer_muslim->AdvancedSearch->SearchCondition = @$filter["v_offer_muslim"]; $this->offer_muslim->AdvancedSearch->SearchValue2 = @$filter["y_offer_muslim"]; $this->offer_muslim->AdvancedSearch->SearchOperator2 = @$filter["w_offer_muslim"]; $this->offer_muslim->AdvancedSearch->Save(); // Field offer_other $this->offer_other->AdvancedSearch->SearchValue = @$filter["x_offer_other"]; $this->offer_other->AdvancedSearch->SearchOperator = @$filter["z_offer_other"]; $this->offer_other->AdvancedSearch->SearchCondition = @$filter["v_offer_other"]; $this->offer_other->AdvancedSearch->SearchValue2 = @$filter["y_offer_other"]; $this->offer_other->AdvancedSearch->SearchOperator2 = @$filter["w_offer_other"]; $this->offer_other->AdvancedSearch->Save(); // Field verify_date $this->verify_date->AdvancedSearch->SearchValue = @$filter["x_verify_date"]; $this->verify_date->AdvancedSearch->SearchOperator = @$filter["z_verify_date"]; $this->verify_date->AdvancedSearch->SearchCondition = @$filter["v_verify_date"]; $this->verify_date->AdvancedSearch->SearchValue2 = @$filter["y_verify_date"]; $this->verify_date->AdvancedSearch->SearchOperator2 = @$filter["w_verify_date"]; $this->verify_date->AdvancedSearch->Save(); // Field verify_by $this->verify_by->AdvancedSearch->SearchValue = @$filter["x_verify_by"]; $this->verify_by->AdvancedSearch->SearchOperator = @$filter["z_verify_by"]; $this->verify_by->AdvancedSearch->SearchCondition = @$filter["v_verify_by"]; $this->verify_by->AdvancedSearch->SearchValue2 = @$filter["y_verify_by"]; $this->verify_by->AdvancedSearch->SearchOperator2 = @$filter["w_verify_by"]; $this->verify_by->AdvancedSearch->Save(); // Field verify_phone $this->verify_phone->AdvancedSearch->SearchValue = @$filter["x_verify_phone"]; $this->verify_phone->AdvancedSearch->SearchOperator = @$filter["z_verify_phone"]; $this->verify_phone->AdvancedSearch->SearchCondition = @$filter["v_verify_phone"]; $this->verify_phone->AdvancedSearch->SearchValue2 = @$filter["y_verify_phone"]; $this->verify_phone->AdvancedSearch->SearchOperator2 = @$filter["w_verify_phone"]; $this->verify_phone->AdvancedSearch->Save(); // Field verify_email $this->verify_email->AdvancedSearch->SearchValue = @$filter["x_verify_email"]; $this->verify_email->AdvancedSearch->SearchOperator = @$filter["z_verify_email"]; $this->verify_email->AdvancedSearch->SearchCondition = @$filter["v_verify_email"]; $this->verify_email->AdvancedSearch->SearchValue2 = @$filter["y_verify_email"]; $this->verify_email->AdvancedSearch->SearchOperator2 = @$filter["w_verify_email"]; $this->verify_email->AdvancedSearch->Save(); // Field Outcome $this->Outcome->AdvancedSearch->SearchValue = @$filter["x_Outcome"]; $this->Outcome->AdvancedSearch->SearchOperator = @$filter["z_Outcome"]; $this->Outcome->AdvancedSearch->SearchCondition = @$filter["v_Outcome"]; $this->Outcome->AdvancedSearch->SearchValue2 = @$filter["y_Outcome"]; $this->Outcome->AdvancedSearch->SearchOperator2 = @$filter["w_Outcome"]; $this->Outcome->AdvancedSearch->Save(); // Field Outcome_type $this->Outcome_type->AdvancedSearch->SearchValue = @$filter["x_Outcome_type"]; $this->Outcome_type->AdvancedSearch->SearchOperator = @$filter["z_Outcome_type"]; $this->Outcome_type->AdvancedSearch->SearchCondition = @$filter["v_Outcome_type"]; $this->Outcome_type->AdvancedSearch->SearchValue2 = @$filter["y_Outcome_type"]; $this->Outcome_type->AdvancedSearch->SearchOperator2 = @$filter["w_Outcome_type"]; $this->Outcome_type->AdvancedSearch->Save(); // Field Rel_doc $this->Rel_doc->AdvancedSearch->SearchValue = @$filter["x_Rel_doc"]; $this->Rel_doc->AdvancedSearch->SearchOperator = @$filter["z_Rel_doc"]; $this->Rel_doc->AdvancedSearch->SearchCondition = @$filter["v_Rel_doc"]; $this->Rel_doc->AdvancedSearch->SearchValue2 = @$filter["y_Rel_doc"]; $this->Rel_doc->AdvancedSearch->SearchOperator2 = @$filter["w_Rel_doc"]; $this->Rel_doc->AdvancedSearch->Save(); $this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]); $this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]); } // Advanced search WHERE clause based on QueryString function AdvancedSearchWhere($Default = FALSE) { global $Security; $sWhere = ""; if (!$Security->CanSearch()) return ""; $this->BuildSearchSql($sWhere, $this->idAccomodation, $Default, FALSE); // idAccomodation $this->BuildSearchSql($sWhere, $this->idOfferer, $Default, FALSE); // idOfferer $this->BuildSearchSql($sWhere, $this->Accom_Type, $Default, FALSE); // Accom_Type $this->BuildSearchSql($sWhere, $this->Address, $Default, FALSE); // Address $this->BuildSearchSql($sWhere, $this->Town, $Default, FALSE); // Town $this->BuildSearchSql($sWhere, $this->District, $Default, FALSE); // District $this->BuildSearchSql($sWhere, $this->Region, $Default, FALSE); // Region $this->BuildSearchSql($sWhere, $this->Beds, $Default, FALSE); // Beds $this->BuildSearchSql($sWhere, $this->Rooms, $Default, FALSE); // Rooms $this->BuildSearchSql($sWhere, $this->Bathrooms, $Default, FALSE); // Bathrooms $this->BuildSearchSql($sWhere, $this->Private_Kitchen, $Default, FALSE); // Private_Kitchen $this->BuildSearchSql($sWhere, $this->Auton_heating, $Default, FALSE); // Auton_heating $this->BuildSearchSql($sWhere, $this->Arch_barriers, $Default, FALSE); // Arch_barriers $this->BuildSearchSql($sWhere, $this->Furnisched, $Default, FALSE); // Furnisched $this->BuildSearchSql($sWhere, $this->Private_entrance, $Default, FALSE); // Private_entrance $this->BuildSearchSql($sWhere, $this->Time_restrictions, $Default, FALSE); // Time_restrictions $this->BuildSearchSql($sWhere, $this->Time_restr_from, $Default, FALSE); // Time_restr_from $this->BuildSearchSql($sWhere, $this->Time_restr_to, $Default, FALSE); // Time_restr_to $this->BuildSearchSql($sWhere, $this->Services_access, $Default, FALSE); // Services_access $this->BuildSearchSql($sWhere, $this->Available_from, $Default, FALSE); // Available_from $this->BuildSearchSql($sWhere, $this->Available_to, $Default, FALSE); // Available_to $this->BuildSearchSql($sWhere, $this->Rel_type, $Default, FALSE); // Rel_type $this->BuildSearchSql($sWhere, $this->offer_woman, $Default, FALSE); // offer_woman $this->BuildSearchSql($sWhere, $this->offer_children, $Default, FALSE); // offer_children $this->BuildSearchSql($sWhere, $this->offer_family, $Default, FALSE); // offer_family $this->BuildSearchSql($sWhere, $this->offer_man, $Default, FALSE); // offer_man $this->BuildSearchSql($sWhere, $this->offer_elderly, $Default, FALSE); // offer_elderly $this->BuildSearchSql($sWhere, $this->offer_disabled, $Default, FALSE); // offer_disabled $this->BuildSearchSql($sWhere, $this->offer_sick, $Default, FALSE); // offer_sick $this->BuildSearchSql($sWhere, $this->offer_christian, $Default, FALSE); // offer_christian $this->BuildSearchSql($sWhere, $this->offer_muslim, $Default, FALSE); // offer_muslim $this->BuildSearchSql($sWhere, $this->offer_other, $Default, FALSE); // offer_other $this->BuildSearchSql($sWhere, $this->verify_date, $Default, FALSE); // verify_date $this->BuildSearchSql($sWhere, $this->verify_by, $Default, FALSE); // verify_by $this->BuildSearchSql($sWhere, $this->verify_phone, $Default, FALSE); // verify_phone $this->BuildSearchSql($sWhere, $this->verify_email, $Default, FALSE); // verify_email $this->BuildSearchSql($sWhere, $this->Outcome, $Default, FALSE); // Outcome $this->BuildSearchSql($sWhere, $this->Outcome_type, $Default, FALSE); // Outcome_type $this->BuildSearchSql($sWhere, $this->Rel_doc, $Default, FALSE); // Rel_doc // Set up search parm if (!$Default && $sWhere <> "") { $this->Command = "search"; } if (!$Default && $this->Command == "search") { $this->idAccomodation->AdvancedSearch->Save(); // idAccomodation $this->idOfferer->AdvancedSearch->Save(); // idOfferer $this->Accom_Type->AdvancedSearch->Save(); // Accom_Type $this->Address->AdvancedSearch->Save(); // Address $this->Town->AdvancedSearch->Save(); // Town $this->District->AdvancedSearch->Save(); // District $this->Region->AdvancedSearch->Save(); // Region $this->Beds->AdvancedSearch->Save(); // Beds $this->Rooms->AdvancedSearch->Save(); // Rooms $this->Bathrooms->AdvancedSearch->Save(); // Bathrooms $this->Private_Kitchen->AdvancedSearch->Save(); // Private_Kitchen $this->Auton_heating->AdvancedSearch->Save(); // Auton_heating $this->Arch_barriers->AdvancedSearch->Save(); // Arch_barriers $this->Furnisched->AdvancedSearch->Save(); // Furnisched $this->Private_entrance->AdvancedSearch->Save(); // Private_entrance $this->Time_restrictions->AdvancedSearch->Save(); // Time_restrictions $this->Time_restr_from->AdvancedSearch->Save(); // Time_restr_from $this->Time_restr_to->AdvancedSearch->Save(); // Time_restr_to $this->Services_access->AdvancedSearch->Save(); // Services_access $this->Available_from->AdvancedSearch->Save(); // Available_from $this->Available_to->AdvancedSearch->Save(); // Available_to $this->Rel_type->AdvancedSearch->Save(); // Rel_type $this->offer_woman->AdvancedSearch->Save(); // offer_woman $this->offer_children->AdvancedSearch->Save(); // offer_children $this->offer_family->AdvancedSearch->Save(); // offer_family $this->offer_man->AdvancedSearch->Save(); // offer_man $this->offer_elderly->AdvancedSearch->Save(); // offer_elderly $this->offer_disabled->AdvancedSearch->Save(); // offer_disabled $this->offer_sick->AdvancedSearch->Save(); // offer_sick $this->offer_christian->AdvancedSearch->Save(); // offer_christian $this->offer_muslim->AdvancedSearch->Save(); // offer_muslim $this->offer_other->AdvancedSearch->Save(); // offer_other $this->verify_date->AdvancedSearch->Save(); // verify_date $this->verify_by->AdvancedSearch->Save(); // verify_by $this->verify_phone->AdvancedSearch->Save(); // verify_phone $this->verify_email->AdvancedSearch->Save(); // verify_email $this->Outcome->AdvancedSearch->Save(); // Outcome $this->Outcome_type->AdvancedSearch->Save(); // Outcome_type $this->Rel_doc->AdvancedSearch->Save(); // Rel_doc } return $sWhere; } // Build search SQL function BuildSearchSql(&$Where, &$Fld, $Default, $MultiValue) { $FldParm = substr($Fld->FldVar, 2); $FldVal = ($Default) ? $Fld->AdvancedSearch->SearchValueDefault : $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"] $FldOpr = ($Default) ? $Fld->AdvancedSearch->SearchOperatorDefault : $Fld->AdvancedSearch->SearchOperator; // @$_GET["z_$FldParm"] $FldCond = ($Default) ? $Fld->AdvancedSearch->SearchConditionDefault : $Fld->AdvancedSearch->SearchCondition; // @$_GET["v_$FldParm"] $FldVal2 = ($Default) ? $Fld->AdvancedSearch->SearchValue2Default : $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"] $FldOpr2 = ($Default) ? $Fld->AdvancedSearch->SearchOperator2Default : $Fld->AdvancedSearch->SearchOperator2; // @$_GET["w_$FldParm"] $sWrk = ""; //$FldVal = ew_StripSlashes($FldVal); if (is_array($FldVal)) $FldVal = implode(",", $FldVal); //$FldVal2 = ew_StripSlashes($FldVal2); if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2); $FldOpr = strtoupper(trim($FldOpr)); if ($FldOpr == "") $FldOpr = "="; $FldOpr2 = strtoupper(trim($FldOpr2)); if ($FldOpr2 == "") $FldOpr2 = "="; if (EW_SEARCH_MULTI_VALUE_OPTION == 1) $MultiValue = FALSE; if ($MultiValue) { $sWrk1 = ($FldVal <> "") ? ew_GetMultiSearchSql($Fld, $FldOpr, $FldVal, $this->DBID) : ""; // Field value 1 $sWrk2 = ($FldVal2 <> "") ? ew_GetMultiSearchSql($Fld, $FldOpr2, $FldVal2, $this->DBID) : ""; // Field value 2 $sWrk = $sWrk1; // Build final SQL if ($sWrk2 <> "") $sWrk = ($sWrk <> "") ? "($sWrk) $FldCond ($sWrk2)" : $sWrk2; } else { $FldVal = $this->ConvertSearchValue($Fld, $FldVal); $FldVal2 = $this->ConvertSearchValue($Fld, $FldVal2); $sWrk = ew_GetSearchSql($Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2, $this->DBID); } ew_AddFilter($Where, $sWrk); } // Convert search value function ConvertSearchValue(&$Fld, $FldVal) { if ($FldVal == EW_NULL_VALUE || $FldVal == EW_NOT_NULL_VALUE) return $FldVal; $Value = $FldVal; if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) { if ($FldVal <> "") $Value = ($FldVal == "1" || strtolower(strval($FldVal)) == "y" || strtolower(strval($FldVal)) == "t") ? $Fld->TrueValue : $Fld->FalseValue; } elseif ($Fld->FldDataType == EW_DATATYPE_DATE || $Fld->FldDataType == EW_DATATYPE_TIME) { if ($FldVal <> "") $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat); } return $Value; } // Return basic search SQL function BasicSearchSQL($arKeywords, $type) { $sWhere = ""; $this->BuildBasicSearchSQL($sWhere, $this->Accom_Type, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Address, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Town, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->District, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Region, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Rel_type, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->offer_other, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->verify_by, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->verify_phone, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->verify_email, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Outcome, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Outcome_type, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Rel_doc, $arKeywords, $type); return $sWhere; } // Build basic search SQL function BuildBasicSearchSQL(&$Where, &$Fld, $arKeywords, $type) { global $EW_BASIC_SEARCH_IGNORE_PATTERN; $sDefCond = ($type == "OR") ? "OR" : "AND"; $arSQL = array(); // Array for SQL parts $arCond = array(); // Array for search conditions $cnt = count($arKeywords); $j = 0; // Number of SQL parts for ($i = 0; $i < $cnt; $i++) { $Keyword = $arKeywords[$i]; $Keyword = trim($Keyword); if ($EW_BASIC_SEARCH_IGNORE_PATTERN <> "") { $Keyword = preg_replace($EW_BASIC_SEARCH_IGNORE_PATTERN, "\\", $Keyword); $ar = explode("\\", $Keyword); } else { $ar = array($Keyword); } foreach ($ar as $Keyword) { if ($Keyword <> "") { $sWrk = ""; if ($Keyword == "OR" && $type == "") { if ($j > 0) $arCond[$j-1] = "OR"; } elseif ($Keyword == EW_NULL_VALUE) { $sWrk = $Fld->FldExpression . " IS NULL"; } elseif ($Keyword == EW_NOT_NULL_VALUE) { $sWrk = $Fld->FldExpression . " IS NOT NULL"; } elseif ($Fld->FldIsVirtual) { $sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue("%" . $Keyword . "%", EW_DATATYPE_STRING, $this->DBID), $this->DBID); } elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) { $sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue("%" . $Keyword . "%", EW_DATATYPE_STRING, $this->DBID), $this->DBID); } if ($sWrk <> "") { $arSQL[$j] = $sWrk; $arCond[$j] = $sDefCond; $j += 1; } } } } $cnt = count($arSQL); $bQuoted = FALSE; $sSql = ""; if ($cnt > 0) { for ($i = 0; $i < $cnt-1; $i++) { if ($arCond[$i] == "OR") { if (!$bQuoted) $sSql .= "("; $bQuoted = TRUE; } $sSql .= $arSQL[$i]; if ($bQuoted && $arCond[$i] <> "OR") { $sSql .= ")"; $bQuoted = FALSE; } $sSql .= " " . $arCond[$i] . " "; } $sSql .= $arSQL[$cnt-1]; if ($bQuoted) $sSql .= ")"; } if ($sSql <> "") { if ($Where <> "") $Where .= " OR "; $Where .= "(" . $sSql . ")"; } } // Return basic search WHERE clause based on search keyword and type function BasicSearchWhere($Default = FALSE) { global $Security; $sSearchStr = ""; if (!$Security->CanSearch()) return ""; $sSearchKeyword = ($Default) ? $this->BasicSearch->KeywordDefault : $this->BasicSearch->Keyword; $sSearchType = ($Default) ? $this->BasicSearch->TypeDefault : $this->BasicSearch->Type; if ($sSearchKeyword <> "") { $sSearch = trim($sSearchKeyword); if ($sSearchType <> "=") { $ar = array(); // Match quoted keywords (i.e.: "...") if (preg_match_all('/"([^"]*)"/i', $sSearch, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $p = strpos($sSearch, $match[0]); $str = substr($sSearch, 0, $p); $sSearch = substr($sSearch, $p + strlen($match[0])); if (strlen(trim($str)) > 0) $ar = array_merge($ar, explode(" ", trim($str))); $ar[] = $match[1]; // Save quoted keyword } } // Match individual keywords if (strlen(trim($sSearch)) > 0) $ar = array_merge($ar, explode(" ", trim($sSearch))); // Search keyword in any fields if (($sSearchType == "OR" || $sSearchType == "AND") && $this->BasicSearch->BasicSearchAnyFields) { foreach ($ar as $sKeyword) { if ($sKeyword <> "") { if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " "; $sSearchStr .= "(" . $this->BasicSearchSQL(array($sKeyword), $sSearchType) . ")"; } } } else { $sSearchStr = $this->BasicSearchSQL($ar, $sSearchType); } } else { $sSearchStr = $this->BasicSearchSQL(array($sSearch), $sSearchType); } if (!$Default) $this->Command = "search"; } if (!$Default && $this->Command == "search") { $this->BasicSearch->setKeyword($sSearchKeyword); $this->BasicSearch->setType($sSearchType); } return $sSearchStr; } // Check if search parm exists function CheckSearchParms() { // Check basic search if ($this->BasicSearch->IssetSession()) return TRUE; if ($this->idAccomodation->AdvancedSearch->IssetSession()) return TRUE; if ($this->idOfferer->AdvancedSearch->IssetSession()) return TRUE; if ($this->Accom_Type->AdvancedSearch->IssetSession()) return TRUE; if ($this->Address->AdvancedSearch->IssetSession()) return TRUE; if ($this->Town->AdvancedSearch->IssetSession()) return TRUE; if ($this->District->AdvancedSearch->IssetSession()) return TRUE; if ($this->Region->AdvancedSearch->IssetSession()) return TRUE; if ($this->Beds->AdvancedSearch->IssetSession()) return TRUE; if ($this->Rooms->AdvancedSearch->IssetSession()) return TRUE; if ($this->Bathrooms->AdvancedSearch->IssetSession()) return TRUE; if ($this->Private_Kitchen->AdvancedSearch->IssetSession()) return TRUE; if ($this->Auton_heating->AdvancedSearch->IssetSession()) return TRUE; if ($this->Arch_barriers->AdvancedSearch->IssetSession()) return TRUE; if ($this->Furnisched->AdvancedSearch->IssetSession()) return TRUE; if ($this->Private_entrance->AdvancedSearch->IssetSession()) return TRUE; if ($this->Time_restrictions->AdvancedSearch->IssetSession()) return TRUE; if ($this->Time_restr_from->AdvancedSearch->IssetSession()) return TRUE; if ($this->Time_restr_to->AdvancedSearch->IssetSession()) return TRUE; if ($this->Services_access->AdvancedSearch->IssetSession()) return TRUE; if ($this->Available_from->AdvancedSearch->IssetSession()) return TRUE; if ($this->Available_to->AdvancedSearch->IssetSession()) return TRUE; if ($this->Rel_type->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_woman->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_children->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_family->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_man->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_elderly->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_disabled->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_sick->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_christian->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_muslim->AdvancedSearch->IssetSession()) return TRUE; if ($this->offer_other->AdvancedSearch->IssetSession()) return TRUE; if ($this->verify_date->AdvancedSearch->IssetSession()) return TRUE; if ($this->verify_by->AdvancedSearch->IssetSession()) return TRUE; if ($this->verify_phone->AdvancedSearch->IssetSession()) return TRUE; if ($this->verify_email->AdvancedSearch->IssetSession()) return TRUE; if ($this->Outcome->AdvancedSearch->IssetSession()) return TRUE; if ($this->Outcome_type->AdvancedSearch->IssetSession()) return TRUE; if ($this->Rel_doc->AdvancedSearch->IssetSession()) return TRUE; return FALSE; } // Clear all search parameters function ResetSearchParms() { // Clear search WHERE clause $this->SearchWhere = ""; $this->setSearchWhere($this->SearchWhere); // Clear basic search parameters $this->ResetBasicSearchParms(); // Clear advanced search parameters $this->ResetAdvancedSearchParms(); } // Load advanced search default values function LoadAdvancedSearchDefault() { return FALSE; } // Clear all basic search parameters function ResetBasicSearchParms() { $this->BasicSearch->UnsetSession(); } // Clear all advanced search parameters function ResetAdvancedSearchParms() { $this->idAccomodation->AdvancedSearch->UnsetSession(); $this->idOfferer->AdvancedSearch->UnsetSession(); $this->Accom_Type->AdvancedSearch->UnsetSession(); $this->Address->AdvancedSearch->UnsetSession(); $this->Town->AdvancedSearch->UnsetSession(); $this->District->AdvancedSearch->UnsetSession(); $this->Region->AdvancedSearch->UnsetSession(); $this->Beds->AdvancedSearch->UnsetSession(); $this->Rooms->AdvancedSearch->UnsetSession(); $this->Bathrooms->AdvancedSearch->UnsetSession(); $this->Private_Kitchen->AdvancedSearch->UnsetSession(); $this->Auton_heating->AdvancedSearch->UnsetSession(); $this->Arch_barriers->AdvancedSearch->UnsetSession(); $this->Furnisched->AdvancedSearch->UnsetSession(); $this->Private_entrance->AdvancedSearch->UnsetSession(); $this->Time_restrictions->AdvancedSearch->UnsetSession(); $this->Time_restr_from->AdvancedSearch->UnsetSession(); $this->Time_restr_to->AdvancedSearch->UnsetSession(); $this->Services_access->AdvancedSearch->UnsetSession(); $this->Available_from->AdvancedSearch->UnsetSession(); $this->Available_to->AdvancedSearch->UnsetSession(); $this->Rel_type->AdvancedSearch->UnsetSession(); $this->offer_woman->AdvancedSearch->UnsetSession(); $this->offer_children->AdvancedSearch->UnsetSession(); $this->offer_family->AdvancedSearch->UnsetSession(); $this->offer_man->AdvancedSearch->UnsetSession(); $this->offer_elderly->AdvancedSearch->UnsetSession(); $this->offer_disabled->AdvancedSearch->UnsetSession(); $this->offer_sick->AdvancedSearch->UnsetSession(); $this->offer_christian->AdvancedSearch->UnsetSession(); $this->offer_muslim->AdvancedSearch->UnsetSession(); $this->offer_other->AdvancedSearch->UnsetSession(); $this->verify_date->AdvancedSearch->UnsetSession(); $this->verify_by->AdvancedSearch->UnsetSession(); $this->verify_phone->AdvancedSearch->UnsetSession(); $this->verify_email->AdvancedSearch->UnsetSession(); $this->Outcome->AdvancedSearch->UnsetSession(); $this->Outcome_type->AdvancedSearch->UnsetSession(); $this->Rel_doc->AdvancedSearch->UnsetSession(); } // Restore all search parameters function RestoreSearchParms() { $this->RestoreSearch = TRUE; // Restore basic search values $this->BasicSearch->Load(); // Restore advanced search values $this->idAccomodation->AdvancedSearch->Load(); $this->idOfferer->AdvancedSearch->Load(); $this->Accom_Type->AdvancedSearch->Load(); $this->Address->AdvancedSearch->Load(); $this->Town->AdvancedSearch->Load(); $this->District->AdvancedSearch->Load(); $this->Region->AdvancedSearch->Load(); $this->Beds->AdvancedSearch->Load(); $this->Rooms->AdvancedSearch->Load(); $this->Bathrooms->AdvancedSearch->Load(); $this->Private_Kitchen->AdvancedSearch->Load(); $this->Auton_heating->AdvancedSearch->Load(); $this->Arch_barriers->AdvancedSearch->Load(); $this->Furnisched->AdvancedSearch->Load(); $this->Private_entrance->AdvancedSearch->Load(); $this->Time_restrictions->AdvancedSearch->Load(); $this->Time_restr_from->AdvancedSearch->Load(); $this->Time_restr_to->AdvancedSearch->Load(); $this->Services_access->AdvancedSearch->Load(); $this->Available_from->AdvancedSearch->Load(); $this->Available_to->AdvancedSearch->Load(); $this->Rel_type->AdvancedSearch->Load(); $this->offer_woman->AdvancedSearch->Load(); $this->offer_children->AdvancedSearch->Load(); $this->offer_family->AdvancedSearch->Load(); $this->offer_man->AdvancedSearch->Load(); $this->offer_elderly->AdvancedSearch->Load(); $this->offer_disabled->AdvancedSearch->Load(); $this->offer_sick->AdvancedSearch->Load(); $this->offer_christian->AdvancedSearch->Load(); $this->offer_muslim->AdvancedSearch->Load(); $this->offer_other->AdvancedSearch->Load(); $this->verify_date->AdvancedSearch->Load(); $this->verify_by->AdvancedSearch->Load(); $this->verify_phone->AdvancedSearch->Load(); $this->verify_email->AdvancedSearch->Load(); $this->Outcome->AdvancedSearch->Load(); $this->Outcome_type->AdvancedSearch->Load(); $this->Rel_doc->AdvancedSearch->Load(); } // Set up sort parameters function SetUpSortOrder() { // Check for "order" parameter if (@$_GET["order"] <> "") { $this->CurrentOrder = ew_StripSlashes(@$_GET["order"]); $this->CurrentOrderType = @$_GET["ordertype"]; $this->UpdateSort($this->idOfferer); // idOfferer $this->UpdateSort($this->Accom_Type); // Accom_Type $this->UpdateSort($this->Address); // Address $this->UpdateSort($this->Town); // Town $this->UpdateSort($this->District); // District $this->UpdateSort($this->Region); // Region $this->UpdateSort($this->Beds); // Beds $this->UpdateSort($this->Rooms); // Rooms $this->UpdateSort($this->Bathrooms); // Bathrooms $this->UpdateSort($this->Private_Kitchen); // Private_Kitchen $this->UpdateSort($this->Available_from); // Available_from $this->UpdateSort($this->Available_to); // Available_to $this->UpdateSort($this->Rel_type); // Rel_type $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 search criteria if ($this->Command == "reset" || $this->Command == "resetall") $this->ResetSearchParms(); // 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); $this->idOfferer->setSort(""); $this->Accom_Type->setSort(""); $this->Address->setSort(""); $this->Town->setSort(""); $this->District->setSort(""); $this->Region->setSort(""); $this->Beds->setSort(""); $this->Rooms->setSort(""); $this->Bathrooms->setSort(""); $this->Private_Kitchen->setSort(""); $this->Available_from->setSort(""); $this->Available_to->setSort(""); $this->Rel_type->setSort(""); } // Reset start position $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); } } // Set up list options function SetupListOptions() { global $Security, $Language; // 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; // "detail_tassigment" $item = &$this->ListOptions->Add("detail_tassigment"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $Security->AllowList(CurrentProjectID() . 'tassigment') && !$this->ShowMultipleDetails; $item->OnLeft = FALSE; $item->ShowInButtonGroup = FALSE; if (!isset($GLOBALS["tassigment_grid"])) $GLOBALS["tassigment_grid"] = new ctassigment_grid; // Multiple details if ($this->ShowMultipleDetails) { $item = &$this->ListOptions->Add("details"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $this->ShowMultipleDetails; $item->OnLeft = FALSE; $item->ShowInButtonGroup = FALSE; } // Set up detail pages $pages = new cSubPages(); $pages->Add("tassigment"); $this->DetailPages = $pages; // List actions $item = &$this->ListOptions->Add("listactions"); $item->CssStyle = "white-space: nowrap;"; $item->OnLeft = FALSE; $item->Visible = FALSE; $item->ShowInButtonGroup = FALSE; $item->ShowInDropDown = FALSE; // "checkbox" $item = &$this->ListOptions->Add("checkbox"); $item->Visible = FALSE; $item->OnLeft = FALSE; $item->Header = ""; $item->ShowInDropDown = FALSE; $item->ShowInButtonGroup = FALSE; // Drop down button for ListOptions $this->ListOptions->UseImageAndText = TRUE; $this->ListOptions->UseDropDownButton = FALSE; $this->ListOptions->DropDownButtonPhrase = $Language->Phrase("ButtonListOptions"); $this->ListOptions->UseButtonGroup = TRUE; if ($this->ListOptions->UseButtonGroup && ew_IsMobile()) $this->ListOptions->UseDropDownButton = TRUE; $this->ListOptions->ButtonClass = "btn-sm"; // Class for button group // Call ListOptions_Load event $this->ListOptions_Load(); $this->SetupListOptionsExt(); $item = &$this->ListOptions->GetItem($this->ListOptions->GroupOptionName); $item->Visible = $this->ListOptions->GroupOptionVisible(); } // Render list options function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // "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 = ""; // Set up list action buttons $oListOpt = &$this->ListOptions->GetItem("listactions"); if ($oListOpt && $this->Export == "" && $this->CurrentAction == "") { $body = ""; $links = array(); foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) { $action = $listaction->Action; $caption = $listaction->Caption; $icon = ($listaction->Icon <> "") ? "Icon)) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"> " : ""; $links[] = "
  • KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "
  • "; if (count($links) == 1) // Single button $body = "KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . ""; } } if (count($links) > 1) { // More than one buttons, use dropdown $body = ""; $content = ""; foreach ($links as $link) $content .= "
  • " . $link . "
  • "; $body .= ""; $body = "
    " . $body . "
    "; } if (count($links) > 0) { $oListOpt->Body = $body; $oListOpt->Visible = TRUE; } } $DetailViewTblVar = ""; $DetailCopyTblVar = ""; $DetailEditTblVar = ""; // "detail_tassigment" $oListOpt = &$this->ListOptions->Items["detail_tassigment"]; if ($Security->AllowList(CurrentProjectID() . 'tassigment')) { $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("tassigment", "TblCaption"); $body .= str_replace("%c", $this->tassigment_Count, $Language->Phrase("DetailCount")); $body = "idAccomodation->CurrentValue)) . "") . "\">" . $body . ""; $links = ""; if ($GLOBALS["tassigment_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'tassigment')) { $links .= "
  • Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=tassigment")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "
  • "; if ($DetailViewTblVar <> "") $DetailViewTblVar .= ","; $DetailViewTblVar .= "tassigment"; } if ($GLOBALS["tassigment_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'tassigment')) { $links .= "
  • Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=tassigment")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "
  • "; if ($DetailEditTblVar <> "") $DetailEditTblVar .= ","; $DetailEditTblVar .= "tassigment"; } if ($links <> "") { $body .= ""; $body .= ""; } $body = "
    " . $body . "
    "; $oListOpt->Body = $body; if ($this->ShowMultipleDetails) $oListOpt->Visible = FALSE; } if ($this->ShowMultipleDetails) { $body = $Language->Phrase("MultipleMasterDetails"); $body = "
    "; $links = ""; if ($DetailViewTblVar <> "") { $links .= "
  • Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "
  • "; } if ($DetailEditTblVar <> "") { $links .= "
  • Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "
  • "; } if ($DetailCopyTblVar <> "") { $links .= "
  • Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "
  • "; } if ($links <> "") { $body .= ""; $body .= ""; } $body .= "
    "; // Multiple details $oListOpt = &$this->ListOptions->Items["details"]; $oListOpt->Body = $body; } // "checkbox" $oListOpt = &$this->ListOptions->Items["checkbox"]; $oListOpt->Body = "idAccomodation->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>"; $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); } // Set up other options function SetupOtherOptions() { global $Language, $Security; $options = &$this->OtherOptions; $option = $options["addedit"]; // Add $item = &$option->Add("add"); $addcaption = ew_HtmlTitle($Language->Phrase("AddLink")); $item->Body = "AddUrl) . "\">" . $Language->Phrase("AddLink") . ""; $item->Visible = ($this->AddUrl <> "" && $Security->CanAdd()); $option = $options["detail"]; $DetailTableLink = ""; $item = &$option->Add("detailadd_tassigment"); $url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . "=tassigment"); $caption = $Language->Phrase("Add") . " " . $this->TableCaption() . "/" . $GLOBALS["tassigment"]->TableCaption(); $item->Body = "" . $caption . ""; $item->Visible = ($GLOBALS["tassigment"]->DetailAdd && $Security->AllowAdd(CurrentProjectID() . 'tassigment') && $Security->CanAdd()); if ($item->Visible) { if ($DetailTableLink <> "") $DetailTableLink .= ","; $DetailTableLink .= "tassigment"; } // Add multiple details if ($this->ShowMultipleDetails) { $item = &$option->Add("detailsadd"); $url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailTableLink); $item->Body = "Phrase("AddMasterDetailLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("AddMasterDetailLink")) . "\" href=\"" . ew_HtmlEncode($url) . "\">" . $Language->Phrase("AddMasterDetailLink") . ""; $item->Visible = ($DetailTableLink <> "" && $Security->CanAdd()); // Hide single master/detail items $ar = explode(",", $DetailTableLink); $cnt = count($ar); for ($i = 0; $i < $cnt; $i++) { if ($item = &$option->GetItem("detailadd_" . $ar[$i])) $item->Visible = FALSE; } } $option = $options["action"]; // Set up options default foreach ($options as &$option) { $option->UseImageAndText = TRUE; $option->UseDropDownButton = TRUE; $option->UseButtonGroup = TRUE; $option->ButtonClass = "btn-sm"; // Class for button group $item = &$option->Add($option->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } $options["addedit"]->DropDownButtonPhrase = $Language->Phrase("ButtonAddEdit"); $options["detail"]->DropDownButtonPhrase = $Language->Phrase("ButtonDetails"); $options["action"]->DropDownButtonPhrase = $Language->Phrase("ButtonActions"); // Filter button $item = &$this->FilterOptions->Add("savecurrentfilter"); $item->Body = "" . $Language->Phrase("SaveCurrentFilter") . ""; $item->Visible = TRUE; $item = &$this->FilterOptions->Add("deletefilter"); $item->Body = "" . $Language->Phrase("DeleteFilter") . ""; $item->Visible = TRUE; $this->FilterOptions->UseDropDownButton = TRUE; $this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton; $this->FilterOptions->DropDownButtonPhrase = $Language->Phrase("Filters"); // Add group option item $item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } // Render other options function RenderOtherOptions() { global $Language, $Security; $options = &$this->OtherOptions; $option = &$options["action"]; // Set up list action buttons foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_MULTIPLE) { $item = &$option->Add("custom_" . $listaction->Action); $caption = $listaction->Caption; $icon = ($listaction->Icon <> "") ? "Icon) . "\" data-caption=\"" . ew_HtmlEncode($caption) . "\"> " : $caption; $item->Body = "ToJson(TRUE) . "));return false;\">" . $icon . ""; $item->Visible = $listaction->Allow; } } // Hide grid edit and other options if ($this->TotalRecs <= 0) { $option = &$options["addedit"]; $item = &$option->GetItem("gridedit"); if ($item) $item->Visible = FALSE; $option = &$options["action"]; $option->HideAllOptions(); } } // Process list action function ProcessListAction() { global $Language, $Security; $userlist = ""; $user = ""; $sFilter = $this->GetKeyFilter(); $UserAction = @$_POST["useraction"]; if ($sFilter <> "" && $UserAction <> "") { // Check permission first $ActionCaption = $UserAction; if (array_key_exists($UserAction, $this->ListActions->Items)) { $ActionCaption = $this->ListActions->Items[$UserAction]->Caption; if (!$this->ListActions->Items[$UserAction]->Allow) { $errmsg = str_replace('%s', $ActionCaption, $Language->Phrase("CustomActionNotAllowed")); if (@$_POST["ajax"] == $UserAction) // Ajax echo "

    " . $errmsg . "

    "; else $this->setFailureMessage($errmsg); return FALSE; } } $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn = &$this->Connection(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; $this->CurrentAction = $UserAction; // Call row action event if ($rs && !$rs->EOF) { $conn->BeginTrans(); $this->SelectedCount = $rs->RecordCount(); $this->SelectedIndex = 0; while (!$rs->EOF) { $this->SelectedIndex++; $row = $rs->fields; $Processed = $this->Row_CustomAction($UserAction, $row); if (!$Processed) break; $rs->MoveNext(); } if ($Processed) { $conn->CommitTrans(); // Commit the changes if ($this->getSuccessMessage() == "") $this->setSuccessMessage(str_replace('%s', $ActionCaption, $Language->Phrase("CustomActionCompleted"))); // Set up success message } else { $conn->RollbackTrans(); // Rollback changes // 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(str_replace('%s', $ActionCaption, $Language->Phrase("CustomActionFailed"))); } } } if ($rs) $rs->Close(); $this->CurrentAction = ""; // Clear action if (@$_POST["ajax"] == $UserAction) { // Ajax if ($this->getSuccessMessage() <> "") { echo "

    " . $this->getSuccessMessage() . "

    "; $this->ClearSuccessMessage(); // Clear message } if ($this->getFailureMessage() <> "") { echo "

    " . $this->getFailureMessage() . "

    "; $this->ClearFailureMessage(); // Clear message } return TRUE; } } return FALSE; // Not ajax request } // Set up search options function SetupSearchOptions() { global $Language; $this->SearchOptions = new cListOptions(); $this->SearchOptions->Tag = "div"; $this->SearchOptions->TagClassName = "ewSearchOption"; // Search button $item = &$this->SearchOptions->Add("searchtoggle"); $SearchToggleClass = ($this->SearchWhere <> "") ? " active" : ""; $item->Body = ""; $item->Visible = TRUE; // Show all button $item = &$this->SearchOptions->Add("showall"); $item->Body = "Phrase("ShowAll") . "\" data-caption=\"" . $Language->Phrase("ShowAll") . "\" href=\"" . $this->PageUrl() . "cmd=reset\">" . $Language->Phrase("ShowAllBtn") . ""; $item->Visible = ($this->SearchWhere <> $this->DefaultSearchWhere && $this->SearchWhere <> "0=101"); // Button group for search $this->SearchOptions->UseDropDownButton = FALSE; $this->SearchOptions->UseImageAndText = TRUE; $this->SearchOptions->UseButtonGroup = TRUE; $this->SearchOptions->DropDownButtonPhrase = $Language->Phrase("ButtonSearch"); // Add group option item $item = &$this->SearchOptions->Add($this->SearchOptions->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; // Hide search options if ($this->Export <> "" || $this->CurrentAction <> "") $this->SearchOptions->HideAllOptions(); global $Security; if (!$Security->CanSearch()) { $this->SearchOptions->HideAllOptions(); $this->FilterOptions->HideAllOptions(); } } function SetupListOptionsExt() { global $Security, $Language; // Hide detail items for dropdown if necessary $this->ListOptions->HideDetailItemsForDropDown(); } function RenderListOptionsExt() { global $Security, $Language; $links = ""; $btngrps = ""; $sSqlWrk = "`idkAccomodation`=" . ew_AdjustSql($this->idAccomodation->CurrentValue, $this->DBID) . ""; // Column "detail_tassigment" if ($this->DetailPages->Items["tassigment"]->Visible) { $link = ""; $option = &$this->ListOptions->Items["detail_tassigment"]; $url = "tassigmentpreview.php?t=taccomodations&f=" . ew_Encrypt($sSqlWrk); $btngrp = "
    "; if ($Security->AllowList(CurrentProjectID() . 'tassigment')) { $label = $Language->TablePhrase("tassigment", "TblCaption"); $label .= " " . ew_JsEncode2(str_replace("%c", $this->tassigment_Count, $Language->Phrase("DetailCount"))); $link = "
  • " . $label . "
  • "; $links .= $link; $detaillnk = ew_JsEncode3("tassigmentlist.php?" . EW_TABLE_SHOW_MASTER . "=taccomodations&fk_idAccomodation=" . urlencode(strval($this->idAccomodation->CurrentValue)) . ""); $btngrp .= ""; } if ($GLOBALS["tassigment_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'tassigment')) $btngrp .= ""; if ($GLOBALS["tassigment_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'tassigment')) $btngrp .= ""; $btngrp .= "
    "; if ($link <> "") { $btngrps .= $btngrp; $option->Body .= "
    " . $link . $btngrp . "
    "; } } // Hide detail items if necessary $this->ListOptions->HideDetailItemsForDropDown(); // Column "preview" $option = &$this->ListOptions->GetItem("preview"); if (!$option) { // Add preview column $option = &$this->ListOptions->Add("preview"); $option->OnLeft = FALSE; if ($option->OnLeft) { $option->MoveTo($this->ListOptions->ItemPos("checkbox") + 1); } else { $option->MoveTo($this->ListOptions->ItemPos("checkbox")); } $option->Visible = !($this->Export <> "" || $this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit"); $option->ShowInDropDown = FALSE; $option->ShowInButtonGroup = FALSE; } if ($option) { $option->Body = ""; $option->Body .= "
    " . $links . $btngrps . "
    "; if ($option->Visible) $option->Visible = $links <> ""; } // Column "details" (Multiple details) $option = &$this->ListOptions->GetItem("details"); if ($option) { $option->Body .= "
    " . $links . $btngrps . "
    "; if ($option->Visible) $option->Visible = $links <> ""; } } // 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); } } // Load basic search values function LoadBasicSearchValues() { $this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH]; if ($this->BasicSearch->Keyword <> "") $this->Command = "search"; $this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE]; } // Load search values for validation function LoadSearchValues() { global $objForm; // Load search values // idAccomodation $this->idAccomodation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_idAccomodation"]); if ($this->idAccomodation->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->idAccomodation->AdvancedSearch->SearchOperator = @$_GET["z_idAccomodation"]; // idOfferer $this->idOfferer->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_idOfferer"]); if ($this->idOfferer->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->idOfferer->AdvancedSearch->SearchOperator = @$_GET["z_idOfferer"]; // Accom_Type $this->Accom_Type->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Accom_Type"]); if ($this->Accom_Type->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Accom_Type->AdvancedSearch->SearchOperator = @$_GET["z_Accom_Type"]; // Address $this->Address->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Address"]); if ($this->Address->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Address->AdvancedSearch->SearchOperator = @$_GET["z_Address"]; // Town $this->Town->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Town"]); if ($this->Town->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Town->AdvancedSearch->SearchOperator = @$_GET["z_Town"]; // District $this->District->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_District"]); if ($this->District->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->District->AdvancedSearch->SearchOperator = @$_GET["z_District"]; // Region $this->Region->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Region"]); if ($this->Region->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Region->AdvancedSearch->SearchOperator = @$_GET["z_Region"]; // Beds $this->Beds->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Beds"]); if ($this->Beds->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Beds->AdvancedSearch->SearchOperator = @$_GET["z_Beds"]; // Rooms $this->Rooms->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Rooms"]); if ($this->Rooms->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Rooms->AdvancedSearch->SearchOperator = @$_GET["z_Rooms"]; // Bathrooms $this->Bathrooms->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Bathrooms"]); if ($this->Bathrooms->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Bathrooms->AdvancedSearch->SearchOperator = @$_GET["z_Bathrooms"]; // Private_Kitchen $this->Private_Kitchen->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Private_Kitchen"]); if ($this->Private_Kitchen->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Private_Kitchen->AdvancedSearch->SearchOperator = @$_GET["z_Private_Kitchen"]; // Auton_heating $this->Auton_heating->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Auton_heating"]); if ($this->Auton_heating->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Auton_heating->AdvancedSearch->SearchOperator = @$_GET["z_Auton_heating"]; // Arch_barriers $this->Arch_barriers->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Arch_barriers"]); if ($this->Arch_barriers->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Arch_barriers->AdvancedSearch->SearchOperator = @$_GET["z_Arch_barriers"]; // Furnisched $this->Furnisched->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Furnisched"]); if ($this->Furnisched->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Furnisched->AdvancedSearch->SearchOperator = @$_GET["z_Furnisched"]; // Private_entrance $this->Private_entrance->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Private_entrance"]); if ($this->Private_entrance->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Private_entrance->AdvancedSearch->SearchOperator = @$_GET["z_Private_entrance"]; // Time_restrictions $this->Time_restrictions->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Time_restrictions"]); if ($this->Time_restrictions->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Time_restrictions->AdvancedSearch->SearchOperator = @$_GET["z_Time_restrictions"]; // Time_restr_from $this->Time_restr_from->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Time_restr_from"]); if ($this->Time_restr_from->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Time_restr_from->AdvancedSearch->SearchOperator = @$_GET["z_Time_restr_from"]; // Time_restr_to $this->Time_restr_to->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Time_restr_to"]); if ($this->Time_restr_to->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Time_restr_to->AdvancedSearch->SearchOperator = @$_GET["z_Time_restr_to"]; // Services_access $this->Services_access->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Services_access"]); if ($this->Services_access->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Services_access->AdvancedSearch->SearchOperator = @$_GET["z_Services_access"]; // Available_from $this->Available_from->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Available_from"]); if ($this->Available_from->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Available_from->AdvancedSearch->SearchOperator = @$_GET["z_Available_from"]; // Available_to $this->Available_to->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Available_to"]); if ($this->Available_to->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Available_to->AdvancedSearch->SearchOperator = @$_GET["z_Available_to"]; // Rel_type $this->Rel_type->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Rel_type"]); if ($this->Rel_type->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Rel_type->AdvancedSearch->SearchOperator = @$_GET["z_Rel_type"]; // offer_woman $this->offer_woman->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_woman"]); if ($this->offer_woman->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_woman->AdvancedSearch->SearchOperator = @$_GET["z_offer_woman"]; // offer_children $this->offer_children->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_children"]); if ($this->offer_children->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_children->AdvancedSearch->SearchOperator = @$_GET["z_offer_children"]; // offer_family $this->offer_family->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_family"]); if ($this->offer_family->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_family->AdvancedSearch->SearchOperator = @$_GET["z_offer_family"]; // offer_man $this->offer_man->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_man"]); if ($this->offer_man->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_man->AdvancedSearch->SearchOperator = @$_GET["z_offer_man"]; // offer_elderly $this->offer_elderly->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_elderly"]); if ($this->offer_elderly->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_elderly->AdvancedSearch->SearchOperator = @$_GET["z_offer_elderly"]; // offer_disabled $this->offer_disabled->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_disabled"]); if ($this->offer_disabled->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_disabled->AdvancedSearch->SearchOperator = @$_GET["z_offer_disabled"]; // offer_sick $this->offer_sick->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_sick"]); if ($this->offer_sick->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_sick->AdvancedSearch->SearchOperator = @$_GET["z_offer_sick"]; // offer_christian $this->offer_christian->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_christian"]); if ($this->offer_christian->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_christian->AdvancedSearch->SearchOperator = @$_GET["z_offer_christian"]; // offer_muslim $this->offer_muslim->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_muslim"]); if ($this->offer_muslim->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_muslim->AdvancedSearch->SearchOperator = @$_GET["z_offer_muslim"]; // offer_other $this->offer_other->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_offer_other"]); if ($this->offer_other->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->offer_other->AdvancedSearch->SearchOperator = @$_GET["z_offer_other"]; // verify_date $this->verify_date->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_verify_date"]); if ($this->verify_date->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->verify_date->AdvancedSearch->SearchOperator = @$_GET["z_verify_date"]; // verify_by $this->verify_by->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_verify_by"]); if ($this->verify_by->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->verify_by->AdvancedSearch->SearchOperator = @$_GET["z_verify_by"]; // verify_phone $this->verify_phone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_verify_phone"]); if ($this->verify_phone->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->verify_phone->AdvancedSearch->SearchOperator = @$_GET["z_verify_phone"]; // verify_email $this->verify_email->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_verify_email"]); if ($this->verify_email->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->verify_email->AdvancedSearch->SearchOperator = @$_GET["z_verify_email"]; // Outcome $this->Outcome->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Outcome"]); if ($this->Outcome->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Outcome->AdvancedSearch->SearchOperator = @$_GET["z_Outcome"]; // Outcome_type $this->Outcome_type->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Outcome_type"]); if ($this->Outcome_type->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Outcome_type->AdvancedSearch->SearchOperator = @$_GET["z_Outcome_type"]; // Rel_doc $this->Rel_doc->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Rel_doc"]); if ($this->Rel_doc->AdvancedSearch->SearchValue <> "") $this->Command = "search"; $this->Rel_doc->AdvancedSearch->SearchOperator = @$_GET["z_Rel_doc"]; } // 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_type->setDbValue($rs->fields('Rel_doc_type')); $this->Rel_doc_size->setDbValue($rs->fields('Rel_doc_size')); if (!isset($GLOBALS["tassigment_grid"])) $GLOBALS["tassigment_grid"] = new ctassigment_grid; $sDetailFilter = $GLOBALS["tassigment"]->SqlDetailFilter_taccomodations(); $sDetailFilter = str_replace("@idkAccomodation@", ew_AdjustSql($this->idAccomodation->DbValue, "DB"), $sDetailFilter); $GLOBALS["tassigment"]->setCurrentMasterTable("taccomodations"); $sDetailFilter = $GLOBALS["tassigment"]->ApplyUserIDFilters($sDetailFilter); $this->tassigment_Count = $GLOBALS["tassigment"]->LoadRecordCount($sDetailFilter); } // 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; if (strval($this->getKey("idAccomodation")) <> "") $this->idAccomodation->CurrentValue = $this->getKey("idAccomodation"); // idAccomodation 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->InlineEditUrl = $this->GetInlineEditUrl(); $this->CopyUrl = $this->GetCopyUrl(); $this->InlineCopyUrl = $this->GetInlineCopyUrl(); $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_SEARCH) { // Search row // idOfferer $this->idOfferer->EditAttrs["class"] = "form-control"; $this->idOfferer->EditCustomAttributes = ""; $this->idOfferer->EditValue = ew_HtmlEncode($this->idOfferer->AdvancedSearch->SearchValue); $this->idOfferer->PlaceHolder = ew_RemoveHtml($this->idOfferer->FldCaption()); // Accom_Type $this->Accom_Type->EditAttrs["class"] = "form-control"; $this->Accom_Type->EditCustomAttributes = ""; // Address $this->Address->EditAttrs["class"] = "form-control"; $this->Address->EditCustomAttributes = ""; $this->Address->EditValue = ew_HtmlEncode($this->Address->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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->AdvancedSearch->SearchValue); $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(ew_UnFormatDateTime($this->Available_from->AdvancedSearch->SearchValue, 7), 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(ew_UnFormatDateTime($this->Available_to->AdvancedSearch->SearchValue, 7), 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 ($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 search function ValidateSearch() { global $gsSearchError; // Initialize $gsSearchError = ""; // Check if validation required if (!EW_SERVER_VALIDATE) return TRUE; // Return validate result $ValidateSearch = ($gsSearchError == ""); // Call Form_CustomValidate event $sFormCustomError = ""; $ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError); if ($sFormCustomError <> "") { ew_AddMessage($gsSearchError, $sFormCustomError); } return $ValidateSearch; } // Load advanced search function LoadAdvancedSearch() { $this->idAccomodation->AdvancedSearch->Load(); $this->idOfferer->AdvancedSearch->Load(); $this->Accom_Type->AdvancedSearch->Load(); $this->Address->AdvancedSearch->Load(); $this->Town->AdvancedSearch->Load(); $this->District->AdvancedSearch->Load(); $this->Region->AdvancedSearch->Load(); $this->Beds->AdvancedSearch->Load(); $this->Rooms->AdvancedSearch->Load(); $this->Bathrooms->AdvancedSearch->Load(); $this->Private_Kitchen->AdvancedSearch->Load(); $this->Auton_heating->AdvancedSearch->Load(); $this->Arch_barriers->AdvancedSearch->Load(); $this->Furnisched->AdvancedSearch->Load(); $this->Private_entrance->AdvancedSearch->Load(); $this->Time_restrictions->AdvancedSearch->Load(); $this->Time_restr_from->AdvancedSearch->Load(); $this->Time_restr_to->AdvancedSearch->Load(); $this->Services_access->AdvancedSearch->Load(); $this->Available_from->AdvancedSearch->Load(); $this->Available_to->AdvancedSearch->Load(); $this->Rel_type->AdvancedSearch->Load(); $this->offer_woman->AdvancedSearch->Load(); $this->offer_children->AdvancedSearch->Load(); $this->offer_family->AdvancedSearch->Load(); $this->offer_man->AdvancedSearch->Load(); $this->offer_elderly->AdvancedSearch->Load(); $this->offer_disabled->AdvancedSearch->Load(); $this->offer_sick->AdvancedSearch->Load(); $this->offer_christian->AdvancedSearch->Load(); $this->offer_muslim->AdvancedSearch->Load(); $this->offer_other->AdvancedSearch->Load(); $this->verify_date->AdvancedSearch->Load(); $this->verify_by->AdvancedSearch->Load(); $this->verify_phone->AdvancedSearch->Load(); $this->verify_email->AdvancedSearch->Load(); $this->Outcome->AdvancedSearch->Load(); $this->Outcome_type->AdvancedSearch->Load(); $this->Rel_doc->AdvancedSearch->Load(); } // Set up export options function SetupExportOptions() { global $Language; // Printer friendly $item = &$this->ExportOptions->Add("print"); $item->Body = "ExportPrintUrl . "\" class=\"ewExportLink ewPrint\" title=\"" . ew_HtmlEncode($Language->Phrase("PrinterFriendlyText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("PrinterFriendlyText")) . "\">" . $Language->Phrase("PrinterFriendly") . ""; $item->Visible = TRUE; // Export to Excel $item = &$this->ExportOptions->Add("excel"); $item->Body = "ExportExcelUrl . "\" class=\"ewExportLink ewExcel\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToExcelText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToExcelText")) . "\">" . $Language->Phrase("ExportToExcel") . ""; $item->Visible = TRUE; // Export to Word $item = &$this->ExportOptions->Add("word"); $item->Body = "ExportWordUrl . "\" class=\"ewExportLink ewWord\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToWordText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToWordText")) . "\">" . $Language->Phrase("ExportToWord") . ""; $item->Visible = TRUE; // Export to Html $item = &$this->ExportOptions->Add("html"); $item->Body = "ExportHtmlUrl . "\" class=\"ewExportLink ewHtml\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToHtmlText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToHtmlText")) . "\">" . $Language->Phrase("ExportToHtml") . ""; $item->Visible = TRUE; // Export to Xml $item = &$this->ExportOptions->Add("xml"); $item->Body = "ExportXmlUrl . "\" class=\"ewExportLink ewXml\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToXmlText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToXmlText")) . "\">" . $Language->Phrase("ExportToXml") . ""; $item->Visible = FALSE; // Export to Csv $item = &$this->ExportOptions->Add("csv"); $item->Body = "ExportCsvUrl . "\" class=\"ewExportLink ewCsv\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToCsvText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToCsvText")) . "\">" . $Language->Phrase("ExportToCsv") . ""; $item->Visible = TRUE; // Export to Pdf $item = &$this->ExportOptions->Add("pdf"); $item->Body = "ExportPdfUrl . "\" class=\"ewExportLink ewPdf\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToPDFText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToPDFText")) . "\">" . $Language->Phrase("ExportToPDF") . ""; $item->Visible = FALSE; // Export to Email $item = &$this->ExportOptions->Add("email"); $url = ""; $item->Body = ""; $item->Visible = TRUE; // Drop down button for export $this->ExportOptions->UseButtonGroup = TRUE; $this->ExportOptions->UseImageAndText = TRUE; $this->ExportOptions->UseDropDownButton = TRUE; if ($this->ExportOptions->UseButtonGroup && ew_IsMobile()) $this->ExportOptions->UseDropDownButton = TRUE; $this->ExportOptions->DropDownButtonPhrase = $Language->Phrase("ButtonExport"); // Add group option item $item = &$this->ExportOptions->Add($this->ExportOptions->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } // Export data in HTML/CSV/Word/Excel/XML/Email/PDF format function ExportData() { $utf8 = (strtolower(EW_CHARSET) == "utf-8"); $bSelectLimit = $this->UseSelectLimit; // Load recordset if ($bSelectLimit) { $this->TotalRecs = $this->SelectRecordCount(); } else { if (!$this->Recordset) $this->Recordset = $this->LoadRecordset(); $rs = &$this->Recordset; if ($rs) $this->TotalRecs = $rs->RecordCount(); } $this->StartRec = 1; // Export all if ($this->ExportAll) { set_time_limit(EW_EXPORT_ALL_TIME_LIMIT); $this->DisplayRecs = $this->TotalRecs; $this->StopRec = $this->TotalRecs; } else { // Export one page only $this->SetUpStartRec(); // Set up start record position // Set the last record to display if ($this->DisplayRecs <= 0) { $this->StopRec = $this->TotalRecs; } else { $this->StopRec = $this->StartRec + $this->DisplayRecs - 1; } } if ($bSelectLimit) $rs = $this->LoadRecordset($this->StartRec-1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs); if (!$rs) { header("Content-Type:"); // Remove header header("Content-Disposition:"); $this->ShowMessage(); return; } $this->ExportDoc = ew_ExportDocument($this, "h"); $Doc = &$this->ExportDoc; if ($bSelectLimit) { $this->StartRec = 1; $this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs; } else { //$this->StartRec = $this->StartRec; //$this->StopRec = $this->StopRec; } // Call Page Exporting server event $this->ExportDoc->ExportCustom = !$this->Page_Exporting(); $ParentTable = ""; // Export master record if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "tofferers") { global $tofferers; if (!isset($tofferers)) $tofferers = new ctofferers; $rsmaster = $tofferers->LoadRs($this->DbMasterFilter); // Load master record if ($rsmaster && !$rsmaster->EOF) { $ExportStyle = $Doc->Style; $Doc->SetStyle("v"); // Change to vertical if ($this->Export <> "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) { $Doc->Table = &$tofferers; $tofferers->ExportDocument($Doc, $rsmaster, 1, 1); $Doc->ExportEmptyRow(); $Doc->Table = &$this; } $Doc->SetStyle($ExportStyle); // Restore $rsmaster->Close(); } } $sHeader = $this->PageHeader; $this->Page_DataRendering($sHeader); $Doc->Text .= $sHeader; $this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, ""); $sFooter = $this->PageFooter; $this->Page_DataRendered($sFooter); $Doc->Text .= $sFooter; // Close recordset $rs->Close(); // Call Page Exported server event $this->Page_Exported(); // Export header and footer $Doc->ExportHeaderAndFooter(); // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); // Write debug message if enabled if (EW_DEBUG_ENABLED && $this->Export <> "pdf") echo ew_DebugMsg(); // Output data if ($this->Export == "email") { echo $this->ExportEmail($Doc->Text); } else { $Doc->Export(); } } // Export email function ExportEmail($EmailContent) { global $gTmpImages, $Language; $sSender = @$_POST["sender"]; $sRecipient = @$_POST["recipient"]; $sCc = @$_POST["cc"]; $sBcc = @$_POST["bcc"]; $sContentType = @$_POST["contenttype"]; // Subject $sSubject = ew_StripSlashes(@$_POST["subject"]); $sEmailSubject = $sSubject; // Message $sContent = ew_StripSlashes(@$_POST["message"]); $sEmailMessage = $sContent; // Check sender if ($sSender == "") { return "

    " . $Language->Phrase("EnterSenderEmail") . "

    "; } if (!ew_CheckEmail($sSender)) { return "

    " . $Language->Phrase("EnterProperSenderEmail") . "

    "; } // Check recipient if (!ew_CheckEmailList($sRecipient, EW_MAX_EMAIL_RECIPIENT)) { return "

    " . $Language->Phrase("EnterProperRecipientEmail") . "

    "; } // Check cc if (!ew_CheckEmailList($sCc, EW_MAX_EMAIL_RECIPIENT)) { return "

    " . $Language->Phrase("EnterProperCcEmail") . "

    "; } // Check bcc if (!ew_CheckEmailList($sBcc, EW_MAX_EMAIL_RECIPIENT)) { return "

    " . $Language->Phrase("EnterProperBccEmail") . "

    "; } // Check email sent count if (!isset($_SESSION[EW_EXPORT_EMAIL_COUNTER])) $_SESSION[EW_EXPORT_EMAIL_COUNTER] = 0; if (intval($_SESSION[EW_EXPORT_EMAIL_COUNTER]) > EW_MAX_EMAIL_SENT_COUNT) { return "

    " . $Language->Phrase("ExceedMaxEmailExport") . "

    "; } // Send email $Email = new cEmail(); $Email->Sender = $sSender; // Sender $Email->Recipient = $sRecipient; // Recipient $Email->Cc = $sCc; // Cc $Email->Bcc = $sBcc; // Bcc $Email->Subject = $sEmailSubject; // Subject $Email->Format = ($sContentType == "url") ? "text" : "html"; if ($sEmailMessage <> "") { $sEmailMessage = ew_RemoveXSS($sEmailMessage); $sEmailMessage .= ($sContentType == "url") ? "\r\n\r\n" : "

    "; } if ($sContentType == "url") { $sUrl = ew_ConvertFullUrl(ew_CurrentPage() . "?" . $this->ExportQueryString()); $sEmailMessage .= $sUrl; // Send URL only } else { foreach ($gTmpImages as $tmpimage) $Email->AddEmbeddedImage($tmpimage); $sEmailMessage .= ew_CleanEmailContent($EmailContent); // Send HTML } $Email->Content = $sEmailMessage; // Content $EventArgs = array(); if ($this->Recordset) { $this->RecCnt = $this->StartRec - 1; $this->Recordset->MoveFirst(); if ($this->StartRec > 1) $this->Recordset->Move($this->StartRec - 1); $EventArgs["rs"] = &$this->Recordset; } $bEmailSent = FALSE; if ($this->Email_Sending($Email, $EventArgs)) $bEmailSent = $Email->Send(); // Check email sent status if ($bEmailSent) { // Update email sent count $_SESSION[EW_EXPORT_EMAIL_COUNTER]++; // Sent email success return "

    " . $Language->Phrase("SendEmailSuccess") . "

    "; // Set up success message } else { // Sent email failure return "

    " . $Email->SendErrDescription . "

    "; } } // Export QueryString function ExportQueryString() { // Initialize $sQry = "export=html"; // Build QueryString for search if ($this->BasicSearch->getKeyword() <> "") { $sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . urlencode($this->BasicSearch->getKeyword()) . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . urlencode($this->BasicSearch->getType()); } $this->AddSearchQueryString($sQry, $this->idAccomodation); // idAccomodation $this->AddSearchQueryString($sQry, $this->idOfferer); // idOfferer $this->AddSearchQueryString($sQry, $this->Accom_Type); // Accom_Type $this->AddSearchQueryString($sQry, $this->Address); // Address $this->AddSearchQueryString($sQry, $this->Town); // Town $this->AddSearchQueryString($sQry, $this->District); // District $this->AddSearchQueryString($sQry, $this->Region); // Region $this->AddSearchQueryString($sQry, $this->Beds); // Beds $this->AddSearchQueryString($sQry, $this->Rooms); // Rooms $this->AddSearchQueryString($sQry, $this->Bathrooms); // Bathrooms $this->AddSearchQueryString($sQry, $this->Private_Kitchen); // Private_Kitchen $this->AddSearchQueryString($sQry, $this->Auton_heating); // Auton_heating $this->AddSearchQueryString($sQry, $this->Arch_barriers); // Arch_barriers $this->AddSearchQueryString($sQry, $this->Furnisched); // Furnisched $this->AddSearchQueryString($sQry, $this->Private_entrance); // Private_entrance $this->AddSearchQueryString($sQry, $this->Time_restrictions); // Time_restrictions $this->AddSearchQueryString($sQry, $this->Time_restr_from); // Time_restr_from $this->AddSearchQueryString($sQry, $this->Time_restr_to); // Time_restr_to $this->AddSearchQueryString($sQry, $this->Services_access); // Services_access $this->AddSearchQueryString($sQry, $this->Available_from); // Available_from $this->AddSearchQueryString($sQry, $this->Available_to); // Available_to $this->AddSearchQueryString($sQry, $this->Rel_type); // Rel_type $this->AddSearchQueryString($sQry, $this->offer_woman); // offer_woman $this->AddSearchQueryString($sQry, $this->offer_children); // offer_children $this->AddSearchQueryString($sQry, $this->offer_family); // offer_family $this->AddSearchQueryString($sQry, $this->offer_man); // offer_man $this->AddSearchQueryString($sQry, $this->offer_elderly); // offer_elderly $this->AddSearchQueryString($sQry, $this->offer_disabled); // offer_disabled $this->AddSearchQueryString($sQry, $this->offer_sick); // offer_sick $this->AddSearchQueryString($sQry, $this->offer_christian); // offer_christian $this->AddSearchQueryString($sQry, $this->offer_muslim); // offer_muslim $this->AddSearchQueryString($sQry, $this->offer_other); // offer_other $this->AddSearchQueryString($sQry, $this->verify_date); // verify_date $this->AddSearchQueryString($sQry, $this->verify_by); // verify_by $this->AddSearchQueryString($sQry, $this->verify_phone); // verify_phone $this->AddSearchQueryString($sQry, $this->verify_email); // verify_email $this->AddSearchQueryString($sQry, $this->Outcome); // Outcome $this->AddSearchQueryString($sQry, $this->Outcome_type); // Outcome_type // Build QueryString for pager $sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . urlencode($this->getRecordsPerPage()) . "&" . EW_TABLE_START_REC . "=" . urlencode($this->getStartRecordNumber()); return $sQry; } // Add search QueryString function AddSearchQueryString(&$Qry, &$Fld) { $FldSearchValue = $Fld->AdvancedSearch->getValue("x"); $FldParm = substr($Fld->FldVar,2); if (strval($FldSearchValue) <> "") { $Qry .= "&x_" . $FldParm . "=" . urlencode($FldSearchValue) . "&z_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("z")); } $FldSearchValue2 = $Fld->AdvancedSearch->getValue("y"); if (strval($FldSearchValue2) <> "") { $Qry .= "&v_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("v")) . "&y_" . $FldParm . "=" . urlencode($FldSearchValue2) . "&w_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("w")); } } // Set up master/detail based on QueryString function SetUpMasterParms() { $bValidMaster = FALSE; // Get the keys for master table if (isset($_GET[EW_TABLE_SHOW_MASTER])) { $sMasterTblVar = $_GET[EW_TABLE_SHOW_MASTER]; if ($sMasterTblVar == "") { $bValidMaster = TRUE; $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; } if ($sMasterTblVar == "tofferers") { $bValidMaster = TRUE; if (@$_GET["fk_idOfferer"] <> "") { $GLOBALS["tofferers"]->idOfferer->setQueryStringValue($_GET["fk_idOfferer"]); $this->idOfferer->setQueryStringValue($GLOBALS["tofferers"]->idOfferer->QueryStringValue); $this->idOfferer->setSessionValue($this->idOfferer->QueryStringValue); if (!is_numeric($GLOBALS["tofferers"]->idOfferer->QueryStringValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } } elseif (isset($_POST[EW_TABLE_SHOW_MASTER])) { $sMasterTblVar = $_POST[EW_TABLE_SHOW_MASTER]; if ($sMasterTblVar == "") { $bValidMaster = TRUE; $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; } if ($sMasterTblVar == "tofferers") { $bValidMaster = TRUE; if (@$_POST["fk_idOfferer"] <> "") { $GLOBALS["tofferers"]->idOfferer->setFormValue($_POST["fk_idOfferer"]); $this->idOfferer->setFormValue($GLOBALS["tofferers"]->idOfferer->FormValue); $this->idOfferer->setSessionValue($this->idOfferer->FormValue); if (!is_numeric($GLOBALS["tofferers"]->idOfferer->FormValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } } if ($bValidMaster) { // Update URL $this->AddUrl = $this->AddMasterUrl($this->AddUrl); $this->InlineAddUrl = $this->AddMasterUrl($this->InlineAddUrl); $this->GridAddUrl = $this->AddMasterUrl($this->GridAddUrl); $this->GridEditUrl = $this->AddMasterUrl($this->GridEditUrl); // Save current master table $this->setCurrentMasterTable($sMasterTblVar); // Reset start record counter (new master key) $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); // Clear previous master key from Session if ($sMasterTblVar <> "tofferers") { if ($this->idOfferer->CurrentValue == "") $this->idOfferer->setSessionValue(""); } } $this->DbMasterFilter = $this->GetMasterFilter(); // Get master filter $this->DbDetailFilter = $this->GetDetailFilter(); // Get detail filter } // Set up Breadcrumb function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/")+1); $url = preg_replace('/\?cmd=reset(all){0,1}$/i', '', $url); // Remove cmd=reset / cmd=resetall $Breadcrumb->Add("list", $this->TableVar, $url, "", $this->TableVar, TRUE); } // Setup lookup filters of a field function SetupLookupFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; if ($pageId == "list") { switch ($fld->FldVar) { } } elseif ($pageId == "extbs") { switch ($fld->FldVar) { } } } // Setup AutoSuggest filters of a field function SetupAutoSuggestFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; if ($pageId == "list") { switch ($fld->FldVar) { } } elseif ($pageId == "extbs") { switch ($fld->FldVar) { } } } // 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; } // ListOptions Load event function ListOptions_Load() { // Example: //$opt = &$this->ListOptions->Add("new"); //$opt->Header = "xxx"; //$opt->OnLeft = TRUE; // Link on left //$opt->MoveTo(0); // Move to first column } // ListOptions Rendered event function ListOptions_Rendered() { // Example: //$this->ListOptions->Items["new"]->Body = "xxx"; } // Row Custom Action event function Row_CustomAction($action, $row) { // Return FALSE to abort return TRUE; } // Page Exporting event // $this->ExportDoc = export document object function Page_Exporting() { //$this->ExportDoc->Text = "my header"; // Export header //return FALSE; // Return FALSE to skip default export and use Row_Export event return TRUE; // Return TRUE to use default export and skip Row_Export event } // Row Export event // $this->ExportDoc = export document object function Row_Export($rs) { //$this->ExportDoc->Text .= "my content"; // Build HTML with field value: $rs["MyField"] or $this->MyField->ViewValue } // Page Exported event // $this->ExportDoc = export document object function Page_Exported() { //$this->ExportDoc->Text .= "my footer"; // Export footer //echo $this->ExportDoc->Text; } } ?> Page_Init(); // Page main $taccomodations_list->Page_Main(); // Global Page Rendering event (in userfn*.php) Page_Rendering(); // Page Rendering event $taccomodations_list->Page_Render(); ?> Export == "") { ?>
    Export == "") { ?>
    Export == "") { ?> Render(); ?> TotalRecs > 0 && $taccomodations_list->ExportOptions->Visible()) { ?> ExportOptions->Render("body") ?> SearchOptions->Visible()) { ?> SearchOptions->Render("body") ?> FilterOptions->Visible()) { ?> FilterOptions->Render("body") ?> Export == "") { ?> SelectionForm(); ?>
    Export == "") || (EW_EXPORT_MASTER_RECORD && $taccomodations->Export == "print")) { ?> DbMasterFilter <> "" && $taccomodations->getCurrentMasterTable() == "tofferers") { if ($taccomodations_list->MasterRecordExists) { ?> UseSelectLimit; if ($bSelectLimit) { if ($taccomodations_list->TotalRecs <= 0) $taccomodations_list->TotalRecs = $taccomodations->SelectRecordCount(); } else { if (!$taccomodations_list->Recordset && ($taccomodations_list->Recordset = $taccomodations_list->LoadRecordset())) $taccomodations_list->TotalRecs = $taccomodations_list->Recordset->RecordCount(); } $taccomodations_list->StartRec = 1; if ($taccomodations_list->DisplayRecs <= 0 || ($taccomodations->Export <> "" && $taccomodations->ExportAll)) // Display all records $taccomodations_list->DisplayRecs = $taccomodations_list->TotalRecs; if (!($taccomodations->Export <> "" && $taccomodations->ExportAll)) $taccomodations_list->SetUpStartRec(); // Set up start record position if ($bSelectLimit) $taccomodations_list->Recordset = $taccomodations_list->LoadRecordset($taccomodations_list->StartRec-1, $taccomodations_list->DisplayRecs); // Set no record found message if ($taccomodations->CurrentAction == "" && $taccomodations_list->TotalRecs == 0) { if (!$Security->CanList()) $taccomodations_list->setWarningMessage(ew_DeniedMsg()); if ($taccomodations_list->SearchWhere == "0=101") $taccomodations_list->setWarningMessage($Language->Phrase("EnterSearchCriteria")); else $taccomodations_list->setWarningMessage($Language->Phrase("NoRecord")); } $taccomodations_list->RenderOtherOptions(); ?> CanSearch()) { ?> Export == "" && $taccomodations->CurrentAction == "") { ?>
    SearchWhere <> "") ? " in" : ""; ?>
    LoadAdvancedSearch(); // Load advanced search // Render for search $taccomodations->RowType = EW_ROWTYPE_SEARCH; // Render row $taccomodations->ResetAttrs(); $taccomodations_list->RenderRow(); ?>
    Private_Kitchen->Visible) { // Private_Kitchen ?>
    Phrase("=") ?>
    Private_Kitchen->EditAttributes() ?>>
    ">
    ShowPageHeader(); ?> ShowMessage(); ?> TotalRecs > 0 || $taccomodations->CurrentAction <> "") { ?>
    Export == "") { ?>
    CurrentAction <> "gridadd" && $taccomodations->CurrentAction <> "gridedit") { ?>
    Pager)) $taccomodations_list->Pager = new cNumericPager($taccomodations_list->StartRec, $taccomodations_list->DisplayRecs, $taccomodations_list->TotalRecs, $taccomodations_list->RecRange) ?> Pager->RecordCount > 0 && $taccomodations_list->Pager->Visible) { ?>
    Phrase("Record") ?> Pager->FromIndex ?> Phrase("To") ?> Pager->ToIndex ?> Phrase("Of") ?> Pager->RecordCount ?>
    TotalRecs > 0 && (!EW_AUTO_HIDE_PAGE_SIZE_SELECTOR || $taccomodations_list->Pager->Visible)) { ?>
    OtherOptions as &$option) $option->Render("body"); ?>
    CheckToken) { ?> getCurrentMasterTable() == "tofferers" && $taccomodations->CurrentAction <> "") { ?>
    ewGridMiddlePanel"> TotalRecs > 0 || $taccomodations->CurrentAction == "gridedit") { ?> TableCustomInnerHtml ?> RowType = EW_ROWTYPE_HEADER; // Render list options $taccomodations_list->RenderListOptions(); // Render list options (header, left) $taccomodations_list->ListOptions->Render("header", "left"); ?> idOfferer->Visible) { // idOfferer ?> SortUrl($taccomodations->idOfferer) == "") { ?> Accom_Type->Visible) { // Accom_Type ?> SortUrl($taccomodations->Accom_Type) == "") { ?> Address->Visible) { // Address ?> SortUrl($taccomodations->Address) == "") { ?> Town->Visible) { // Town ?> SortUrl($taccomodations->Town) == "") { ?> District->Visible) { // District ?> SortUrl($taccomodations->District) == "") { ?> Region->Visible) { // Region ?> SortUrl($taccomodations->Region) == "") { ?> Beds->Visible) { // Beds ?> SortUrl($taccomodations->Beds) == "") { ?> Rooms->Visible) { // Rooms ?> SortUrl($taccomodations->Rooms) == "") { ?> Bathrooms->Visible) { // Bathrooms ?> SortUrl($taccomodations->Bathrooms) == "") { ?> Private_Kitchen->Visible) { // Private_Kitchen ?> SortUrl($taccomodations->Private_Kitchen) == "") { ?> Available_from->Visible) { // Available_from ?> SortUrl($taccomodations->Available_from) == "") { ?> Available_to->Visible) { // Available_to ?> SortUrl($taccomodations->Available_to) == "") { ?> Rel_type->Visible) { // Rel_type ?> SortUrl($taccomodations->Rel_type) == "") { ?> ListOptions->Render("header", "right"); ?> ExportAll && $taccomodations->Export <> "") { $taccomodations_list->StopRec = $taccomodations_list->TotalRecs; } else { // Set the last record to display if ($taccomodations_list->TotalRecs > $taccomodations_list->StartRec + $taccomodations_list->DisplayRecs - 1) $taccomodations_list->StopRec = $taccomodations_list->StartRec + $taccomodations_list->DisplayRecs - 1; else $taccomodations_list->StopRec = $taccomodations_list->TotalRecs; } $taccomodations_list->RecCnt = $taccomodations_list->StartRec - 1; if ($taccomodations_list->Recordset && !$taccomodations_list->Recordset->EOF) { $taccomodations_list->Recordset->MoveFirst(); $bSelectLimit = $taccomodations_list->UseSelectLimit; if (!$bSelectLimit && $taccomodations_list->StartRec > 1) $taccomodations_list->Recordset->Move($taccomodations_list->StartRec - 1); } elseif (!$taccomodations->AllowAddDeleteRow && $taccomodations_list->StopRec == 0) { $taccomodations_list->StopRec = $taccomodations->GridAddRowCount; } // Initialize aggregate $taccomodations->RowType = EW_ROWTYPE_AGGREGATEINIT; $taccomodations->ResetAttrs(); $taccomodations_list->RenderRow(); while ($taccomodations_list->RecCnt < $taccomodations_list->StopRec) { $taccomodations_list->RecCnt++; if (intval($taccomodations_list->RecCnt) >= intval($taccomodations_list->StartRec)) { $taccomodations_list->RowCnt++; // Set up key count $taccomodations_list->KeyCount = $taccomodations_list->RowIndex; // Init row class and style $taccomodations->ResetAttrs(); $taccomodations->CssClass = ""; if ($taccomodations->CurrentAction == "gridadd") { } else { $taccomodations_list->LoadRowValues($taccomodations_list->Recordset); // Load row values } $taccomodations->RowType = EW_ROWTYPE_VIEW; // Render view // Set up row id / data-rowindex $taccomodations->RowAttrs = array_merge($taccomodations->RowAttrs, array('data-rowindex'=>$taccomodations_list->RowCnt, 'id'=>'r' . $taccomodations_list->RowCnt . '_taccomodations', 'data-rowtype'=>$taccomodations->RowType)); // Render row $taccomodations_list->RenderRow(); // Render list options $taccomodations_list->RenderListOptions(); ?> RowAttributes() ?>> ListOptions->Render("body", "left", $taccomodations_list->RowCnt); ?> idOfferer->Visible) { // idOfferer ?> Accom_Type->Visible) { // Accom_Type ?> Address->Visible) { // Address ?> Town->Visible) { // Town ?> District->Visible) { // District ?> Region->Visible) { // Region ?> Beds->Visible) { // Beds ?> Rooms->Visible) { // Rooms ?> Bathrooms->Visible) { // Bathrooms ?> Private_Kitchen->Visible) { // Private_Kitchen ?> Available_from->Visible) { // Available_from ?> Available_to->Visible) { // Available_to ?> Rel_type->Visible) { // Rel_type ?> ListOptions->Render("body", "right", $taccomodations_list->RowCnt); ?> CurrentAction <> "gridadd") $taccomodations_list->Recordset->MoveNext(); } ?>
    idOfferer->FldCaption() ?>
    idOfferer->FldCaption() ?>idOfferer->getSort() == "ASC") { ?>idOfferer->getSort() == "DESC") { ?>
    Accom_Type->FldCaption() ?>
    Accom_Type->FldCaption() ?>Accom_Type->getSort() == "ASC") { ?>Accom_Type->getSort() == "DESC") { ?>
    Address->FldCaption() ?>
    Address->FldCaption() ?>Phrase("SrchLegend") ?>Address->getSort() == "ASC") { ?>Address->getSort() == "DESC") { ?>
    Town->FldCaption() ?>
    Town->FldCaption() ?>Phrase("SrchLegend") ?>Town->getSort() == "ASC") { ?>Town->getSort() == "DESC") { ?>
    District->FldCaption() ?>
    District->FldCaption() ?>Phrase("SrchLegend") ?>District->getSort() == "ASC") { ?>District->getSort() == "DESC") { ?>
    Region->FldCaption() ?>
    Region->FldCaption() ?>Phrase("SrchLegend") ?>Region->getSort() == "ASC") { ?>Region->getSort() == "DESC") { ?>
    Beds->FldCaption() ?>
    Beds->FldCaption() ?>Beds->getSort() == "ASC") { ?>Beds->getSort() == "DESC") { ?>
    Rooms->FldCaption() ?>
    Rooms->FldCaption() ?>Rooms->getSort() == "ASC") { ?>Rooms->getSort() == "DESC") { ?>
    Bathrooms->FldCaption() ?>
    Bathrooms->FldCaption() ?>Bathrooms->getSort() == "ASC") { ?>Bathrooms->getSort() == "DESC") { ?>
    Private_Kitchen->FldCaption() ?>
    Private_Kitchen->FldCaption() ?>Private_Kitchen->getSort() == "ASC") { ?>Private_Kitchen->getSort() == "DESC") { ?>
    Available_from->FldCaption() ?>
    Available_from->FldCaption() ?>Available_from->getSort() == "ASC") { ?>Available_from->getSort() == "DESC") { ?>
    Available_to->FldCaption() ?>
    Available_to->FldCaption() ?>Available_to->getSort() == "ASC") { ?>Available_to->getSort() == "DESC") { ?>
    Rel_type->FldCaption() ?>
    Rel_type->FldCaption() ?>Rel_type->getSort() == "ASC") { ?>Rel_type->getSort() == "DESC") { ?>
    idOfferer->CellAttributes() ?>> idOfferer->ViewAttributes() ?>> idOfferer->ListViewValue())) && $taccomodations->idOfferer->LinkAttributes() <> "") { ?> idOfferer->LinkAttributes() ?>>idOfferer->ListViewValue() ?> idOfferer->ListViewValue() ?> RowCnt ?>"> Accom_Type->CellAttributes() ?>> Accom_Type->ViewAttributes() ?>> Accom_Type->ListViewValue() ?> Address->CellAttributes() ?>> Address->ViewAttributes() ?>> Address->ListViewValue() ?> Town->CellAttributes() ?>> Town->ViewAttributes() ?>> Town->ListViewValue() ?> District->CellAttributes() ?>> District->ViewAttributes() ?>> District->ListViewValue() ?> Region->CellAttributes() ?>> Region->ViewAttributes() ?>> Region->ListViewValue() ?> Beds->CellAttributes() ?>> Beds->ViewAttributes() ?>> Beds->ListViewValue() ?> Rooms->CellAttributes() ?>> Rooms->ViewAttributes() ?>> Rooms->ListViewValue() ?> Bathrooms->CellAttributes() ?>> Bathrooms->ViewAttributes() ?>> Bathrooms->ListViewValue() ?> Private_Kitchen->CellAttributes() ?>> Private_Kitchen->ViewAttributes() ?>> Private_Kitchen->ListViewValue() ?> Available_from->CellAttributes() ?>> Available_from->ViewAttributes() ?>> Available_from->ListViewValue() ?> Available_to->CellAttributes() ?>> Available_to->ViewAttributes() ?>> Available_to->ListViewValue() ?> Rel_type->CellAttributes() ?>> Rel_type->ViewAttributes() ?>> Rel_type->ListViewValue() ?>
    CurrentAction == "") { ?>
    Recordset) $taccomodations_list->Recordset->Close(); ?> Export == "") { ?>
    TotalRecs == 0 && $taccomodations->CurrentAction == "") { // Show other options ?>
    OtherOptions as &$option) { $option->ButtonClass = ""; $option->Render("body", ""); } ?>
    Export == "") { ?> ShowPageFooter(); if (EW_DEBUG_ENABLED) echo ew_DebugMsg(); ?> Export == "") { ?> Page_Terminate(); ?>