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 .= "
" . $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 (tospiti) if (!isset($GLOBALS["tospiti"]) || get_class($GLOBALS["tospiti"]) == "ctospiti") { $GLOBALS["tospiti"] = &$this; $GLOBALS["Table"] = &$GLOBALS["tospiti"]; } // 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 = "tospitiadd.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 = "tospitidelete.php"; $this->MultiUpdateUrl = "tospitiupdate.php"; // 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", 'tospiti', 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 ftospitilistsrch"; // 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->idSeeker->SetVisibility(); $this->idSeeker->Visible = !$this->IsAdd() && !$this->IsCopy() && !$this->IsGridAdd(); $this->UNHCR_code->SetVisibility(); $this->Name->SetVisibility(); $this->Surname->SetVisibility(); $this->BirthDate->SetVisibility(); $this->BirthPlace->SetVisibility(); $this->Nationality->SetVisibility(); $this->Sex->SetVisibility(); $this->Householder->SetVisibility(); $this->Travel_number->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(); // 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, $tospiti; 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($tospiti); $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 ew_AddFilter($sFilter, $this->DbDetailFilter); ew_AddFilter($sFilter, $this->SearchWhere); // 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->idSeeker->setFormValue($arrKeyFlds[0]); if (!is_numeric($this->idSeeker->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(), "ftospitilistsrch") : ""; } else { $sSavedFilterList = ""; } // Initialize $sFilterList = ""; $sFilterList = ew_Concat($sFilterList, $this->Desk->AdvancedSearch->ToJSON(), ","); // Field Desk $sFilterList = ew_Concat($sFilterList, $this->UNHCR_code->AdvancedSearch->ToJSON(), ","); // Field UNHCR_code $sFilterList = ew_Concat($sFilterList, $this->Name->AdvancedSearch->ToJSON(), ","); // Field Name $sFilterList = ew_Concat($sFilterList, $this->Surname->AdvancedSearch->ToJSON(), ","); // Field Surname $sFilterList = ew_Concat($sFilterList, $this->BirthDate->AdvancedSearch->ToJSON(), ","); // Field BirthDate $sFilterList = ew_Concat($sFilterList, $this->BirthPlace->AdvancedSearch->ToJSON(), ","); // Field BirthPlace $sFilterList = ew_Concat($sFilterList, $this->Nationality->AdvancedSearch->ToJSON(), ","); // Field Nationality $sFilterList = ew_Concat($sFilterList, $this->Citizenship->AdvancedSearch->ToJSON(), ","); // Field Citizenship $sFilterList = ew_Concat($sFilterList, $this->Sex->AdvancedSearch->ToJSON(), ","); // Field Sex $sFilterList = ew_Concat($sFilterList, $this->Phone->AdvancedSearch->ToJSON(), ","); // Field Phone $sFilterList = ew_Concat($sFilterList, $this->_Email->AdvancedSearch->ToJSON(), ","); // Field Email $sFilterList = ew_Concat($sFilterList, $this->Religion->AdvancedSearch->ToJSON(), ","); // Field Religion $sFilterList = ew_Concat($sFilterList, $this->Place_of_Residence->AdvancedSearch->ToJSON(), ","); // Field Place_of_Residence $sFilterList = ew_Concat($sFilterList, $this->Address_of_Residence->AdvancedSearch->ToJSON(), ","); // Field Address_of_Residence $sFilterList = ew_Concat($sFilterList, $this->Town_of_residence->AdvancedSearch->ToJSON(), ","); // Field Town_of_residence $sFilterList = ew_Concat($sFilterList, $this->Place_of_Transit->AdvancedSearch->ToJSON(), ","); // Field Place_of_Transit $sFilterList = ew_Concat($sFilterList, $this->Address_of_Transit->AdvancedSearch->ToJSON(), ","); // Field Address_of_Transit $sFilterList = ew_Concat($sFilterList, $this->Town_of_transit->AdvancedSearch->ToJSON(), ","); // Field Town_of_transit $sFilterList = ew_Concat($sFilterList, $this->domicile_description->AdvancedSearch->ToJSON(), ","); // Field domicile_description $sFilterList = ew_Concat($sFilterList, $this->Disabled->AdvancedSearch->ToJSON(), ","); // Field Disabled $sFilterList = ew_Concat($sFilterList, $this->Sick->AdvancedSearch->ToJSON(), ","); // Field Sick $sFilterList = ew_Concat($sFilterList, $this->Alone->AdvancedSearch->ToJSON(), ","); // Field Alone $sFilterList = ew_Concat($sFilterList, $this->Elderly->AdvancedSearch->ToJSON(), ","); // Field Elderly $sFilterList = ew_Concat($sFilterList, $this->Family->AdvancedSearch->ToJSON(), ","); // Field Family $sFilterList = ew_Concat($sFilterList, $this->Householder->AdvancedSearch->ToJSON(), ","); // Field Householder $sFilterList = ew_Concat($sFilterList, $this->Householder_id->AdvancedSearch->ToJSON(), ","); // Field Householder_id $sFilterList = ew_Concat($sFilterList, $this->Householder_reltype->AdvancedSearch->ToJSON(), ","); // Field Householder_reltype $sFilterList = ew_Concat($sFilterList, $this->Ethnic_group->AdvancedSearch->ToJSON(), ","); // Field Ethnic_group $sFilterList = ew_Concat($sFilterList, $this->Known_languages->AdvancedSearch->ToJSON(), ","); // Field Known_languages $sFilterList = ew_Concat($sFilterList, $this->Title_of_study->AdvancedSearch->ToJSON(), ","); // Field Title_of_study $sFilterList = ew_Concat($sFilterList, $this->Poss_destination_country->AdvancedSearch->ToJSON(), ","); // Field Poss_destination_country $sFilterList = ew_Concat($sFilterList, $this->Document_type->AdvancedSearch->ToJSON(), ","); // Field Document_type $sFilterList = ew_Concat($sFilterList, $this->Document_number->AdvancedSearch->ToJSON(), ","); // Field Document_number $sFilterList = ew_Concat($sFilterList, $this->Document_release->AdvancedSearch->ToJSON(), ","); // Field Document_release $sFilterList = ew_Concat($sFilterList, $this->Document_expiry->AdvancedSearch->ToJSON(), ","); // Field Document_expiry $sFilterList = ew_Concat($sFilterList, $this->Document_nationality->AdvancedSearch->ToJSON(), ","); // Field Document_nationality $sFilterList = ew_Concat($sFilterList, $this->other_documents->AdvancedSearch->ToJSON(), ","); // Field other_documents $sFilterList = ew_Concat($sFilterList, $this->Final_evaluation->AdvancedSearch->ToJSON(), ","); // Field Final_evaluation $sFilterList = ew_Concat($sFilterList, $this->photo->AdvancedSearch->ToJSON(), ","); // Field photo $sFilterList = ew_Concat($sFilterList, $this->doc_image->AdvancedSearch->ToJSON(), ","); // Field doc_image $sFilterList = ew_Concat($sFilterList, $this->Notes->AdvancedSearch->ToJSON(), ","); // Field Notes $sFilterList = ew_Concat($sFilterList, $this->Interview_1->AdvancedSearch->ToJSON(), ","); // Field Interview_1 $sFilterList = ew_Concat($sFilterList, $this->interview1_date->AdvancedSearch->ToJSON(), ","); // Field interview1_date $sFilterList = ew_Concat($sFilterList, $this->Interview_2->AdvancedSearch->ToJSON(), ","); // Field Interview_2 $sFilterList = ew_Concat($sFilterList, $this->interview_2_date->AdvancedSearch->ToJSON(), ","); // Field interview_2_date $sFilterList = ew_Concat($sFilterList, $this->Interview_3->AdvancedSearch->ToJSON(), ","); // Field Interview_3 $sFilterList = ew_Concat($sFilterList, $this->interview_3_date->AdvancedSearch->ToJSON(), ","); // Field interview_3_date $sFilterList = ew_Concat($sFilterList, $this->Zone_of_Transit->AdvancedSearch->ToJSON(), ","); // Field Zone_of_Transit $sFilterList = ew_Concat($sFilterList, $this->Travel_number->AdvancedSearch->ToJSON(), ","); // Field Travel_number $sFilterList = ew_Concat($sFilterList, $this->Travel_arrival_date->AdvancedSearch->ToJSON(), ","); // Field Travel_arrival_date $sFilterList = ew_Concat($sFilterList, $this->Travel_arrival_time->AdvancedSearch->ToJSON(), ","); // Field Travel_arrival_time $sFilterList = ew_Concat($sFilterList, $this->num_family->AdvancedSearch->ToJSON(), ","); // Field num_family $sFilterList = ew_Concat($sFilterList, $this->speak_ENG->AdvancedSearch->ToJSON(), ","); // Field speak_ENG $sFilterList = ew_Concat($sFilterList, $this->speak_FRA->AdvancedSearch->ToJSON(), ","); // Field speak_FRA $sFilterList = ew_Concat($sFilterList, $this->speak_ARA->AdvancedSearch->ToJSON(), ","); // Field speak_ARA $sFilterList = ew_Concat($sFilterList, $this->speak_ITA->AdvancedSearch->ToJSON(), ","); // Field speak_ITA $sFilterList = ew_Concat($sFilterList, $this->lives_with->AdvancedSearch->ToJSON(), ","); // Field lives_with $sFilterList = ew_Concat($sFilterList, $this->family_know->AdvancedSearch->ToJSON(), ","); // Field family_know $sFilterList = ew_Concat($sFilterList, $this->date_of_entry_transit->AdvancedSearch->ToJSON(), ","); // Field date_of_entry_transit $sFilterList = ew_Concat($sFilterList, $this->marital_status->AdvancedSearch->ToJSON(), ","); // Field marital_status $sFilterList = ew_Concat($sFilterList, $this->consort_id->AdvancedSearch->ToJSON(), ","); // Field consort_id $sFilterList = ew_Concat($sFilterList, $this->consort_info->AdvancedSearch->ToJSON(), ","); // Field consort_info $sFilterList = ew_Concat($sFilterList, $this->other_fam_in_italy->AdvancedSearch->ToJSON(), ","); // Field other_fam_in_italy $sFilterList = ew_Concat($sFilterList, $this->other_fam_in_europe->AdvancedSearch->ToJSON(), ","); // Field other_fam_in_europe $sFilterList = ew_Concat($sFilterList, $this->where_lived->AdvancedSearch->ToJSON(), ","); // Field where_lived $sFilterList = ew_Concat($sFilterList, $this->medical_situation->AdvancedSearch->ToJSON(), ","); // Field medical_situation $sFilterList = ew_Concat($sFilterList, $this->social_situation->AdvancedSearch->ToJSON(), ","); // Field social_situation $sFilterList = ew_Concat($sFilterList, $this->abuse_suffered->AdvancedSearch->ToJSON(), ","); // Field abuse_suffered $sFilterList = ew_Concat($sFilterList, $this->abuse_description->AdvancedSearch->ToJSON(), ","); // Field abuse_description $sFilterList = ew_Concat($sFilterList, $this->work_done->AdvancedSearch->ToJSON(), ","); // Field work_done $sFilterList = ew_Concat($sFilterList, $this->military_service->AdvancedSearch->ToJSON(), ","); // Field military_service $sFilterList = ew_Concat($sFilterList, $this->itinerary->AdvancedSearch->ToJSON(), ","); // Field itinerary $sFilterList = ew_Concat($sFilterList, $this->convictions->AdvancedSearch->ToJSON(), ","); // Field convictions $sFilterList = ew_Concat($sFilterList, $this->requested_asylum->AdvancedSearch->ToJSON(), ","); // Field requested_asylum $sFilterList = ew_Concat($sFilterList, $this->resettlement_application->AdvancedSearch->ToJSON(), ","); // Field resettlement_application $sFilterList = ew_Concat($sFilterList, $this->resettlement_country->AdvancedSearch->ToJSON(), ","); // Field resettlement_country $sFilterList = ew_Concat($sFilterList, $this->reunion_application->AdvancedSearch->ToJSON(), ","); // Field reunion_application $sFilterList = ew_Concat($sFilterList, $this->reunion_country->AdvancedSearch->ToJSON(), ","); // Field reunion_country $sFilterList = ew_Concat($sFilterList, $this->belongs_to_organization->AdvancedSearch->ToJSON(), ","); // Field belongs_to_organization $sFilterList = ew_Concat($sFilterList, $this->organizations->AdvancedSearch->ToJSON(), ","); // Field organizations $sFilterList = ew_Concat($sFilterList, $this->presentations->AdvancedSearch->ToJSON(), ","); // Field presentations $sFilterList = ew_Concat($sFilterList, $this->report->AdvancedSearch->ToJSON(), ","); // Field report 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(), "ftospitilistsrch", $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 Desk $this->Desk->AdvancedSearch->SearchValue = @$filter["x_Desk"]; $this->Desk->AdvancedSearch->SearchOperator = @$filter["z_Desk"]; $this->Desk->AdvancedSearch->SearchCondition = @$filter["v_Desk"]; $this->Desk->AdvancedSearch->SearchValue2 = @$filter["y_Desk"]; $this->Desk->AdvancedSearch->SearchOperator2 = @$filter["w_Desk"]; $this->Desk->AdvancedSearch->Save(); // Field UNHCR_code $this->UNHCR_code->AdvancedSearch->SearchValue = @$filter["x_UNHCR_code"]; $this->UNHCR_code->AdvancedSearch->SearchOperator = @$filter["z_UNHCR_code"]; $this->UNHCR_code->AdvancedSearch->SearchCondition = @$filter["v_UNHCR_code"]; $this->UNHCR_code->AdvancedSearch->SearchValue2 = @$filter["y_UNHCR_code"]; $this->UNHCR_code->AdvancedSearch->SearchOperator2 = @$filter["w_UNHCR_code"]; $this->UNHCR_code->AdvancedSearch->Save(); // Field Name $this->Name->AdvancedSearch->SearchValue = @$filter["x_Name"]; $this->Name->AdvancedSearch->SearchOperator = @$filter["z_Name"]; $this->Name->AdvancedSearch->SearchCondition = @$filter["v_Name"]; $this->Name->AdvancedSearch->SearchValue2 = @$filter["y_Name"]; $this->Name->AdvancedSearch->SearchOperator2 = @$filter["w_Name"]; $this->Name->AdvancedSearch->Save(); // Field Surname $this->Surname->AdvancedSearch->SearchValue = @$filter["x_Surname"]; $this->Surname->AdvancedSearch->SearchOperator = @$filter["z_Surname"]; $this->Surname->AdvancedSearch->SearchCondition = @$filter["v_Surname"]; $this->Surname->AdvancedSearch->SearchValue2 = @$filter["y_Surname"]; $this->Surname->AdvancedSearch->SearchOperator2 = @$filter["w_Surname"]; $this->Surname->AdvancedSearch->Save(); // Field BirthDate $this->BirthDate->AdvancedSearch->SearchValue = @$filter["x_BirthDate"]; $this->BirthDate->AdvancedSearch->SearchOperator = @$filter["z_BirthDate"]; $this->BirthDate->AdvancedSearch->SearchCondition = @$filter["v_BirthDate"]; $this->BirthDate->AdvancedSearch->SearchValue2 = @$filter["y_BirthDate"]; $this->BirthDate->AdvancedSearch->SearchOperator2 = @$filter["w_BirthDate"]; $this->BirthDate->AdvancedSearch->Save(); // Field BirthPlace $this->BirthPlace->AdvancedSearch->SearchValue = @$filter["x_BirthPlace"]; $this->BirthPlace->AdvancedSearch->SearchOperator = @$filter["z_BirthPlace"]; $this->BirthPlace->AdvancedSearch->SearchCondition = @$filter["v_BirthPlace"]; $this->BirthPlace->AdvancedSearch->SearchValue2 = @$filter["y_BirthPlace"]; $this->BirthPlace->AdvancedSearch->SearchOperator2 = @$filter["w_BirthPlace"]; $this->BirthPlace->AdvancedSearch->Save(); // Field Nationality $this->Nationality->AdvancedSearch->SearchValue = @$filter["x_Nationality"]; $this->Nationality->AdvancedSearch->SearchOperator = @$filter["z_Nationality"]; $this->Nationality->AdvancedSearch->SearchCondition = @$filter["v_Nationality"]; $this->Nationality->AdvancedSearch->SearchValue2 = @$filter["y_Nationality"]; $this->Nationality->AdvancedSearch->SearchOperator2 = @$filter["w_Nationality"]; $this->Nationality->AdvancedSearch->Save(); // Field Citizenship $this->Citizenship->AdvancedSearch->SearchValue = @$filter["x_Citizenship"]; $this->Citizenship->AdvancedSearch->SearchOperator = @$filter["z_Citizenship"]; $this->Citizenship->AdvancedSearch->SearchCondition = @$filter["v_Citizenship"]; $this->Citizenship->AdvancedSearch->SearchValue2 = @$filter["y_Citizenship"]; $this->Citizenship->AdvancedSearch->SearchOperator2 = @$filter["w_Citizenship"]; $this->Citizenship->AdvancedSearch->Save(); // Field Sex $this->Sex->AdvancedSearch->SearchValue = @$filter["x_Sex"]; $this->Sex->AdvancedSearch->SearchOperator = @$filter["z_Sex"]; $this->Sex->AdvancedSearch->SearchCondition = @$filter["v_Sex"]; $this->Sex->AdvancedSearch->SearchValue2 = @$filter["y_Sex"]; $this->Sex->AdvancedSearch->SearchOperator2 = @$filter["w_Sex"]; $this->Sex->AdvancedSearch->Save(); // Field Phone $this->Phone->AdvancedSearch->SearchValue = @$filter["x_Phone"]; $this->Phone->AdvancedSearch->SearchOperator = @$filter["z_Phone"]; $this->Phone->AdvancedSearch->SearchCondition = @$filter["v_Phone"]; $this->Phone->AdvancedSearch->SearchValue2 = @$filter["y_Phone"]; $this->Phone->AdvancedSearch->SearchOperator2 = @$filter["w_Phone"]; $this->Phone->AdvancedSearch->Save(); // Field Email $this->_Email->AdvancedSearch->SearchValue = @$filter["x__Email"]; $this->_Email->AdvancedSearch->SearchOperator = @$filter["z__Email"]; $this->_Email->AdvancedSearch->SearchCondition = @$filter["v__Email"]; $this->_Email->AdvancedSearch->SearchValue2 = @$filter["y__Email"]; $this->_Email->AdvancedSearch->SearchOperator2 = @$filter["w__Email"]; $this->_Email->AdvancedSearch->Save(); // Field Religion $this->Religion->AdvancedSearch->SearchValue = @$filter["x_Religion"]; $this->Religion->AdvancedSearch->SearchOperator = @$filter["z_Religion"]; $this->Religion->AdvancedSearch->SearchCondition = @$filter["v_Religion"]; $this->Religion->AdvancedSearch->SearchValue2 = @$filter["y_Religion"]; $this->Religion->AdvancedSearch->SearchOperator2 = @$filter["w_Religion"]; $this->Religion->AdvancedSearch->Save(); // Field Place_of_Residence $this->Place_of_Residence->AdvancedSearch->SearchValue = @$filter["x_Place_of_Residence"]; $this->Place_of_Residence->AdvancedSearch->SearchOperator = @$filter["z_Place_of_Residence"]; $this->Place_of_Residence->AdvancedSearch->SearchCondition = @$filter["v_Place_of_Residence"]; $this->Place_of_Residence->AdvancedSearch->SearchValue2 = @$filter["y_Place_of_Residence"]; $this->Place_of_Residence->AdvancedSearch->SearchOperator2 = @$filter["w_Place_of_Residence"]; $this->Place_of_Residence->AdvancedSearch->Save(); // Field Address_of_Residence $this->Address_of_Residence->AdvancedSearch->SearchValue = @$filter["x_Address_of_Residence"]; $this->Address_of_Residence->AdvancedSearch->SearchOperator = @$filter["z_Address_of_Residence"]; $this->Address_of_Residence->AdvancedSearch->SearchCondition = @$filter["v_Address_of_Residence"]; $this->Address_of_Residence->AdvancedSearch->SearchValue2 = @$filter["y_Address_of_Residence"]; $this->Address_of_Residence->AdvancedSearch->SearchOperator2 = @$filter["w_Address_of_Residence"]; $this->Address_of_Residence->AdvancedSearch->Save(); // Field Town_of_residence $this->Town_of_residence->AdvancedSearch->SearchValue = @$filter["x_Town_of_residence"]; $this->Town_of_residence->AdvancedSearch->SearchOperator = @$filter["z_Town_of_residence"]; $this->Town_of_residence->AdvancedSearch->SearchCondition = @$filter["v_Town_of_residence"]; $this->Town_of_residence->AdvancedSearch->SearchValue2 = @$filter["y_Town_of_residence"]; $this->Town_of_residence->AdvancedSearch->SearchOperator2 = @$filter["w_Town_of_residence"]; $this->Town_of_residence->AdvancedSearch->Save(); // Field Place_of_Transit $this->Place_of_Transit->AdvancedSearch->SearchValue = @$filter["x_Place_of_Transit"]; $this->Place_of_Transit->AdvancedSearch->SearchOperator = @$filter["z_Place_of_Transit"]; $this->Place_of_Transit->AdvancedSearch->SearchCondition = @$filter["v_Place_of_Transit"]; $this->Place_of_Transit->AdvancedSearch->SearchValue2 = @$filter["y_Place_of_Transit"]; $this->Place_of_Transit->AdvancedSearch->SearchOperator2 = @$filter["w_Place_of_Transit"]; $this->Place_of_Transit->AdvancedSearch->Save(); // Field Address_of_Transit $this->Address_of_Transit->AdvancedSearch->SearchValue = @$filter["x_Address_of_Transit"]; $this->Address_of_Transit->AdvancedSearch->SearchOperator = @$filter["z_Address_of_Transit"]; $this->Address_of_Transit->AdvancedSearch->SearchCondition = @$filter["v_Address_of_Transit"]; $this->Address_of_Transit->AdvancedSearch->SearchValue2 = @$filter["y_Address_of_Transit"]; $this->Address_of_Transit->AdvancedSearch->SearchOperator2 = @$filter["w_Address_of_Transit"]; $this->Address_of_Transit->AdvancedSearch->Save(); // Field Town_of_transit $this->Town_of_transit->AdvancedSearch->SearchValue = @$filter["x_Town_of_transit"]; $this->Town_of_transit->AdvancedSearch->SearchOperator = @$filter["z_Town_of_transit"]; $this->Town_of_transit->AdvancedSearch->SearchCondition = @$filter["v_Town_of_transit"]; $this->Town_of_transit->AdvancedSearch->SearchValue2 = @$filter["y_Town_of_transit"]; $this->Town_of_transit->AdvancedSearch->SearchOperator2 = @$filter["w_Town_of_transit"]; $this->Town_of_transit->AdvancedSearch->Save(); // Field domicile_description $this->domicile_description->AdvancedSearch->SearchValue = @$filter["x_domicile_description"]; $this->domicile_description->AdvancedSearch->SearchOperator = @$filter["z_domicile_description"]; $this->domicile_description->AdvancedSearch->SearchCondition = @$filter["v_domicile_description"]; $this->domicile_description->AdvancedSearch->SearchValue2 = @$filter["y_domicile_description"]; $this->domicile_description->AdvancedSearch->SearchOperator2 = @$filter["w_domicile_description"]; $this->domicile_description->AdvancedSearch->Save(); // Field Disabled $this->Disabled->AdvancedSearch->SearchValue = @$filter["x_Disabled"]; $this->Disabled->AdvancedSearch->SearchOperator = @$filter["z_Disabled"]; $this->Disabled->AdvancedSearch->SearchCondition = @$filter["v_Disabled"]; $this->Disabled->AdvancedSearch->SearchValue2 = @$filter["y_Disabled"]; $this->Disabled->AdvancedSearch->SearchOperator2 = @$filter["w_Disabled"]; $this->Disabled->AdvancedSearch->Save(); // Field Sick $this->Sick->AdvancedSearch->SearchValue = @$filter["x_Sick"]; $this->Sick->AdvancedSearch->SearchOperator = @$filter["z_Sick"]; $this->Sick->AdvancedSearch->SearchCondition = @$filter["v_Sick"]; $this->Sick->AdvancedSearch->SearchValue2 = @$filter["y_Sick"]; $this->Sick->AdvancedSearch->SearchOperator2 = @$filter["w_Sick"]; $this->Sick->AdvancedSearch->Save(); // Field Alone $this->Alone->AdvancedSearch->SearchValue = @$filter["x_Alone"]; $this->Alone->AdvancedSearch->SearchOperator = @$filter["z_Alone"]; $this->Alone->AdvancedSearch->SearchCondition = @$filter["v_Alone"]; $this->Alone->AdvancedSearch->SearchValue2 = @$filter["y_Alone"]; $this->Alone->AdvancedSearch->SearchOperator2 = @$filter["w_Alone"]; $this->Alone->AdvancedSearch->Save(); // Field Elderly $this->Elderly->AdvancedSearch->SearchValue = @$filter["x_Elderly"]; $this->Elderly->AdvancedSearch->SearchOperator = @$filter["z_Elderly"]; $this->Elderly->AdvancedSearch->SearchCondition = @$filter["v_Elderly"]; $this->Elderly->AdvancedSearch->SearchValue2 = @$filter["y_Elderly"]; $this->Elderly->AdvancedSearch->SearchOperator2 = @$filter["w_Elderly"]; $this->Elderly->AdvancedSearch->Save(); // Field Family $this->Family->AdvancedSearch->SearchValue = @$filter["x_Family"]; $this->Family->AdvancedSearch->SearchOperator = @$filter["z_Family"]; $this->Family->AdvancedSearch->SearchCondition = @$filter["v_Family"]; $this->Family->AdvancedSearch->SearchValue2 = @$filter["y_Family"]; $this->Family->AdvancedSearch->SearchOperator2 = @$filter["w_Family"]; $this->Family->AdvancedSearch->Save(); // Field Householder $this->Householder->AdvancedSearch->SearchValue = @$filter["x_Householder"]; $this->Householder->AdvancedSearch->SearchOperator = @$filter["z_Householder"]; $this->Householder->AdvancedSearch->SearchCondition = @$filter["v_Householder"]; $this->Householder->AdvancedSearch->SearchValue2 = @$filter["y_Householder"]; $this->Householder->AdvancedSearch->SearchOperator2 = @$filter["w_Householder"]; $this->Householder->AdvancedSearch->Save(); // Field Householder_id $this->Householder_id->AdvancedSearch->SearchValue = @$filter["x_Householder_id"]; $this->Householder_id->AdvancedSearch->SearchOperator = @$filter["z_Householder_id"]; $this->Householder_id->AdvancedSearch->SearchCondition = @$filter["v_Householder_id"]; $this->Householder_id->AdvancedSearch->SearchValue2 = @$filter["y_Householder_id"]; $this->Householder_id->AdvancedSearch->SearchOperator2 = @$filter["w_Householder_id"]; $this->Householder_id->AdvancedSearch->Save(); // Field Householder_reltype $this->Householder_reltype->AdvancedSearch->SearchValue = @$filter["x_Householder_reltype"]; $this->Householder_reltype->AdvancedSearch->SearchOperator = @$filter["z_Householder_reltype"]; $this->Householder_reltype->AdvancedSearch->SearchCondition = @$filter["v_Householder_reltype"]; $this->Householder_reltype->AdvancedSearch->SearchValue2 = @$filter["y_Householder_reltype"]; $this->Householder_reltype->AdvancedSearch->SearchOperator2 = @$filter["w_Householder_reltype"]; $this->Householder_reltype->AdvancedSearch->Save(); // Field Ethnic_group $this->Ethnic_group->AdvancedSearch->SearchValue = @$filter["x_Ethnic_group"]; $this->Ethnic_group->AdvancedSearch->SearchOperator = @$filter["z_Ethnic_group"]; $this->Ethnic_group->AdvancedSearch->SearchCondition = @$filter["v_Ethnic_group"]; $this->Ethnic_group->AdvancedSearch->SearchValue2 = @$filter["y_Ethnic_group"]; $this->Ethnic_group->AdvancedSearch->SearchOperator2 = @$filter["w_Ethnic_group"]; $this->Ethnic_group->AdvancedSearch->Save(); // Field Known_languages $this->Known_languages->AdvancedSearch->SearchValue = @$filter["x_Known_languages"]; $this->Known_languages->AdvancedSearch->SearchOperator = @$filter["z_Known_languages"]; $this->Known_languages->AdvancedSearch->SearchCondition = @$filter["v_Known_languages"]; $this->Known_languages->AdvancedSearch->SearchValue2 = @$filter["y_Known_languages"]; $this->Known_languages->AdvancedSearch->SearchOperator2 = @$filter["w_Known_languages"]; $this->Known_languages->AdvancedSearch->Save(); // Field Title_of_study $this->Title_of_study->AdvancedSearch->SearchValue = @$filter["x_Title_of_study"]; $this->Title_of_study->AdvancedSearch->SearchOperator = @$filter["z_Title_of_study"]; $this->Title_of_study->AdvancedSearch->SearchCondition = @$filter["v_Title_of_study"]; $this->Title_of_study->AdvancedSearch->SearchValue2 = @$filter["y_Title_of_study"]; $this->Title_of_study->AdvancedSearch->SearchOperator2 = @$filter["w_Title_of_study"]; $this->Title_of_study->AdvancedSearch->Save(); // Field Poss_destination_country $this->Poss_destination_country->AdvancedSearch->SearchValue = @$filter["x_Poss_destination_country"]; $this->Poss_destination_country->AdvancedSearch->SearchOperator = @$filter["z_Poss_destination_country"]; $this->Poss_destination_country->AdvancedSearch->SearchCondition = @$filter["v_Poss_destination_country"]; $this->Poss_destination_country->AdvancedSearch->SearchValue2 = @$filter["y_Poss_destination_country"]; $this->Poss_destination_country->AdvancedSearch->SearchOperator2 = @$filter["w_Poss_destination_country"]; $this->Poss_destination_country->AdvancedSearch->Save(); // Field Document_type $this->Document_type->AdvancedSearch->SearchValue = @$filter["x_Document_type"]; $this->Document_type->AdvancedSearch->SearchOperator = @$filter["z_Document_type"]; $this->Document_type->AdvancedSearch->SearchCondition = @$filter["v_Document_type"]; $this->Document_type->AdvancedSearch->SearchValue2 = @$filter["y_Document_type"]; $this->Document_type->AdvancedSearch->SearchOperator2 = @$filter["w_Document_type"]; $this->Document_type->AdvancedSearch->Save(); // Field Document_number $this->Document_number->AdvancedSearch->SearchValue = @$filter["x_Document_number"]; $this->Document_number->AdvancedSearch->SearchOperator = @$filter["z_Document_number"]; $this->Document_number->AdvancedSearch->SearchCondition = @$filter["v_Document_number"]; $this->Document_number->AdvancedSearch->SearchValue2 = @$filter["y_Document_number"]; $this->Document_number->AdvancedSearch->SearchOperator2 = @$filter["w_Document_number"]; $this->Document_number->AdvancedSearch->Save(); // Field Document_release $this->Document_release->AdvancedSearch->SearchValue = @$filter["x_Document_release"]; $this->Document_release->AdvancedSearch->SearchOperator = @$filter["z_Document_release"]; $this->Document_release->AdvancedSearch->SearchCondition = @$filter["v_Document_release"]; $this->Document_release->AdvancedSearch->SearchValue2 = @$filter["y_Document_release"]; $this->Document_release->AdvancedSearch->SearchOperator2 = @$filter["w_Document_release"]; $this->Document_release->AdvancedSearch->Save(); // Field Document_expiry $this->Document_expiry->AdvancedSearch->SearchValue = @$filter["x_Document_expiry"]; $this->Document_expiry->AdvancedSearch->SearchOperator = @$filter["z_Document_expiry"]; $this->Document_expiry->AdvancedSearch->SearchCondition = @$filter["v_Document_expiry"]; $this->Document_expiry->AdvancedSearch->SearchValue2 = @$filter["y_Document_expiry"]; $this->Document_expiry->AdvancedSearch->SearchOperator2 = @$filter["w_Document_expiry"]; $this->Document_expiry->AdvancedSearch->Save(); // Field Document_nationality $this->Document_nationality->AdvancedSearch->SearchValue = @$filter["x_Document_nationality"]; $this->Document_nationality->AdvancedSearch->SearchOperator = @$filter["z_Document_nationality"]; $this->Document_nationality->AdvancedSearch->SearchCondition = @$filter["v_Document_nationality"]; $this->Document_nationality->AdvancedSearch->SearchValue2 = @$filter["y_Document_nationality"]; $this->Document_nationality->AdvancedSearch->SearchOperator2 = @$filter["w_Document_nationality"]; $this->Document_nationality->AdvancedSearch->Save(); // Field other_documents $this->other_documents->AdvancedSearch->SearchValue = @$filter["x_other_documents"]; $this->other_documents->AdvancedSearch->SearchOperator = @$filter["z_other_documents"]; $this->other_documents->AdvancedSearch->SearchCondition = @$filter["v_other_documents"]; $this->other_documents->AdvancedSearch->SearchValue2 = @$filter["y_other_documents"]; $this->other_documents->AdvancedSearch->SearchOperator2 = @$filter["w_other_documents"]; $this->other_documents->AdvancedSearch->Save(); // Field Final_evaluation $this->Final_evaluation->AdvancedSearch->SearchValue = @$filter["x_Final_evaluation"]; $this->Final_evaluation->AdvancedSearch->SearchOperator = @$filter["z_Final_evaluation"]; $this->Final_evaluation->AdvancedSearch->SearchCondition = @$filter["v_Final_evaluation"]; $this->Final_evaluation->AdvancedSearch->SearchValue2 = @$filter["y_Final_evaluation"]; $this->Final_evaluation->AdvancedSearch->SearchOperator2 = @$filter["w_Final_evaluation"]; $this->Final_evaluation->AdvancedSearch->Save(); // Field photo $this->photo->AdvancedSearch->SearchValue = @$filter["x_photo"]; $this->photo->AdvancedSearch->SearchOperator = @$filter["z_photo"]; $this->photo->AdvancedSearch->SearchCondition = @$filter["v_photo"]; $this->photo->AdvancedSearch->SearchValue2 = @$filter["y_photo"]; $this->photo->AdvancedSearch->SearchOperator2 = @$filter["w_photo"]; $this->photo->AdvancedSearch->Save(); // Field doc_image $this->doc_image->AdvancedSearch->SearchValue = @$filter["x_doc_image"]; $this->doc_image->AdvancedSearch->SearchOperator = @$filter["z_doc_image"]; $this->doc_image->AdvancedSearch->SearchCondition = @$filter["v_doc_image"]; $this->doc_image->AdvancedSearch->SearchValue2 = @$filter["y_doc_image"]; $this->doc_image->AdvancedSearch->SearchOperator2 = @$filter["w_doc_image"]; $this->doc_image->AdvancedSearch->Save(); // Field Notes $this->Notes->AdvancedSearch->SearchValue = @$filter["x_Notes"]; $this->Notes->AdvancedSearch->SearchOperator = @$filter["z_Notes"]; $this->Notes->AdvancedSearch->SearchCondition = @$filter["v_Notes"]; $this->Notes->AdvancedSearch->SearchValue2 = @$filter["y_Notes"]; $this->Notes->AdvancedSearch->SearchOperator2 = @$filter["w_Notes"]; $this->Notes->AdvancedSearch->Save(); // Field Interview_1 $this->Interview_1->AdvancedSearch->SearchValue = @$filter["x_Interview_1"]; $this->Interview_1->AdvancedSearch->SearchOperator = @$filter["z_Interview_1"]; $this->Interview_1->AdvancedSearch->SearchCondition = @$filter["v_Interview_1"]; $this->Interview_1->AdvancedSearch->SearchValue2 = @$filter["y_Interview_1"]; $this->Interview_1->AdvancedSearch->SearchOperator2 = @$filter["w_Interview_1"]; $this->Interview_1->AdvancedSearch->Save(); // Field interview1_date $this->interview1_date->AdvancedSearch->SearchValue = @$filter["x_interview1_date"]; $this->interview1_date->AdvancedSearch->SearchOperator = @$filter["z_interview1_date"]; $this->interview1_date->AdvancedSearch->SearchCondition = @$filter["v_interview1_date"]; $this->interview1_date->AdvancedSearch->SearchValue2 = @$filter["y_interview1_date"]; $this->interview1_date->AdvancedSearch->SearchOperator2 = @$filter["w_interview1_date"]; $this->interview1_date->AdvancedSearch->Save(); // Field Interview_2 $this->Interview_2->AdvancedSearch->SearchValue = @$filter["x_Interview_2"]; $this->Interview_2->AdvancedSearch->SearchOperator = @$filter["z_Interview_2"]; $this->Interview_2->AdvancedSearch->SearchCondition = @$filter["v_Interview_2"]; $this->Interview_2->AdvancedSearch->SearchValue2 = @$filter["y_Interview_2"]; $this->Interview_2->AdvancedSearch->SearchOperator2 = @$filter["w_Interview_2"]; $this->Interview_2->AdvancedSearch->Save(); // Field interview_2_date $this->interview_2_date->AdvancedSearch->SearchValue = @$filter["x_interview_2_date"]; $this->interview_2_date->AdvancedSearch->SearchOperator = @$filter["z_interview_2_date"]; $this->interview_2_date->AdvancedSearch->SearchCondition = @$filter["v_interview_2_date"]; $this->interview_2_date->AdvancedSearch->SearchValue2 = @$filter["y_interview_2_date"]; $this->interview_2_date->AdvancedSearch->SearchOperator2 = @$filter["w_interview_2_date"]; $this->interview_2_date->AdvancedSearch->Save(); // Field Interview_3 $this->Interview_3->AdvancedSearch->SearchValue = @$filter["x_Interview_3"]; $this->Interview_3->AdvancedSearch->SearchOperator = @$filter["z_Interview_3"]; $this->Interview_3->AdvancedSearch->SearchCondition = @$filter["v_Interview_3"]; $this->Interview_3->AdvancedSearch->SearchValue2 = @$filter["y_Interview_3"]; $this->Interview_3->AdvancedSearch->SearchOperator2 = @$filter["w_Interview_3"]; $this->Interview_3->AdvancedSearch->Save(); // Field interview_3_date $this->interview_3_date->AdvancedSearch->SearchValue = @$filter["x_interview_3_date"]; $this->interview_3_date->AdvancedSearch->SearchOperator = @$filter["z_interview_3_date"]; $this->interview_3_date->AdvancedSearch->SearchCondition = @$filter["v_interview_3_date"]; $this->interview_3_date->AdvancedSearch->SearchValue2 = @$filter["y_interview_3_date"]; $this->interview_3_date->AdvancedSearch->SearchOperator2 = @$filter["w_interview_3_date"]; $this->interview_3_date->AdvancedSearch->Save(); // Field Zone_of_Transit $this->Zone_of_Transit->AdvancedSearch->SearchValue = @$filter["x_Zone_of_Transit"]; $this->Zone_of_Transit->AdvancedSearch->SearchOperator = @$filter["z_Zone_of_Transit"]; $this->Zone_of_Transit->AdvancedSearch->SearchCondition = @$filter["v_Zone_of_Transit"]; $this->Zone_of_Transit->AdvancedSearch->SearchValue2 = @$filter["y_Zone_of_Transit"]; $this->Zone_of_Transit->AdvancedSearch->SearchOperator2 = @$filter["w_Zone_of_Transit"]; $this->Zone_of_Transit->AdvancedSearch->Save(); // Field Travel_number $this->Travel_number->AdvancedSearch->SearchValue = @$filter["x_Travel_number"]; $this->Travel_number->AdvancedSearch->SearchOperator = @$filter["z_Travel_number"]; $this->Travel_number->AdvancedSearch->SearchCondition = @$filter["v_Travel_number"]; $this->Travel_number->AdvancedSearch->SearchValue2 = @$filter["y_Travel_number"]; $this->Travel_number->AdvancedSearch->SearchOperator2 = @$filter["w_Travel_number"]; $this->Travel_number->AdvancedSearch->Save(); // Field Travel_arrival_date $this->Travel_arrival_date->AdvancedSearch->SearchValue = @$filter["x_Travel_arrival_date"]; $this->Travel_arrival_date->AdvancedSearch->SearchOperator = @$filter["z_Travel_arrival_date"]; $this->Travel_arrival_date->AdvancedSearch->SearchCondition = @$filter["v_Travel_arrival_date"]; $this->Travel_arrival_date->AdvancedSearch->SearchValue2 = @$filter["y_Travel_arrival_date"]; $this->Travel_arrival_date->AdvancedSearch->SearchOperator2 = @$filter["w_Travel_arrival_date"]; $this->Travel_arrival_date->AdvancedSearch->Save(); // Field Travel_arrival_time $this->Travel_arrival_time->AdvancedSearch->SearchValue = @$filter["x_Travel_arrival_time"]; $this->Travel_arrival_time->AdvancedSearch->SearchOperator = @$filter["z_Travel_arrival_time"]; $this->Travel_arrival_time->AdvancedSearch->SearchCondition = @$filter["v_Travel_arrival_time"]; $this->Travel_arrival_time->AdvancedSearch->SearchValue2 = @$filter["y_Travel_arrival_time"]; $this->Travel_arrival_time->AdvancedSearch->SearchOperator2 = @$filter["w_Travel_arrival_time"]; $this->Travel_arrival_time->AdvancedSearch->Save(); // Field num_family $this->num_family->AdvancedSearch->SearchValue = @$filter["x_num_family"]; $this->num_family->AdvancedSearch->SearchOperator = @$filter["z_num_family"]; $this->num_family->AdvancedSearch->SearchCondition = @$filter["v_num_family"]; $this->num_family->AdvancedSearch->SearchValue2 = @$filter["y_num_family"]; $this->num_family->AdvancedSearch->SearchOperator2 = @$filter["w_num_family"]; $this->num_family->AdvancedSearch->Save(); // Field speak_ENG $this->speak_ENG->AdvancedSearch->SearchValue = @$filter["x_speak_ENG"]; $this->speak_ENG->AdvancedSearch->SearchOperator = @$filter["z_speak_ENG"]; $this->speak_ENG->AdvancedSearch->SearchCondition = @$filter["v_speak_ENG"]; $this->speak_ENG->AdvancedSearch->SearchValue2 = @$filter["y_speak_ENG"]; $this->speak_ENG->AdvancedSearch->SearchOperator2 = @$filter["w_speak_ENG"]; $this->speak_ENG->AdvancedSearch->Save(); // Field speak_FRA $this->speak_FRA->AdvancedSearch->SearchValue = @$filter["x_speak_FRA"]; $this->speak_FRA->AdvancedSearch->SearchOperator = @$filter["z_speak_FRA"]; $this->speak_FRA->AdvancedSearch->SearchCondition = @$filter["v_speak_FRA"]; $this->speak_FRA->AdvancedSearch->SearchValue2 = @$filter["y_speak_FRA"]; $this->speak_FRA->AdvancedSearch->SearchOperator2 = @$filter["w_speak_FRA"]; $this->speak_FRA->AdvancedSearch->Save(); // Field speak_ARA $this->speak_ARA->AdvancedSearch->SearchValue = @$filter["x_speak_ARA"]; $this->speak_ARA->AdvancedSearch->SearchOperator = @$filter["z_speak_ARA"]; $this->speak_ARA->AdvancedSearch->SearchCondition = @$filter["v_speak_ARA"]; $this->speak_ARA->AdvancedSearch->SearchValue2 = @$filter["y_speak_ARA"]; $this->speak_ARA->AdvancedSearch->SearchOperator2 = @$filter["w_speak_ARA"]; $this->speak_ARA->AdvancedSearch->Save(); // Field speak_ITA $this->speak_ITA->AdvancedSearch->SearchValue = @$filter["x_speak_ITA"]; $this->speak_ITA->AdvancedSearch->SearchOperator = @$filter["z_speak_ITA"]; $this->speak_ITA->AdvancedSearch->SearchCondition = @$filter["v_speak_ITA"]; $this->speak_ITA->AdvancedSearch->SearchValue2 = @$filter["y_speak_ITA"]; $this->speak_ITA->AdvancedSearch->SearchOperator2 = @$filter["w_speak_ITA"]; $this->speak_ITA->AdvancedSearch->Save(); // Field lives_with $this->lives_with->AdvancedSearch->SearchValue = @$filter["x_lives_with"]; $this->lives_with->AdvancedSearch->SearchOperator = @$filter["z_lives_with"]; $this->lives_with->AdvancedSearch->SearchCondition = @$filter["v_lives_with"]; $this->lives_with->AdvancedSearch->SearchValue2 = @$filter["y_lives_with"]; $this->lives_with->AdvancedSearch->SearchOperator2 = @$filter["w_lives_with"]; $this->lives_with->AdvancedSearch->Save(); // Field family_know $this->family_know->AdvancedSearch->SearchValue = @$filter["x_family_know"]; $this->family_know->AdvancedSearch->SearchOperator = @$filter["z_family_know"]; $this->family_know->AdvancedSearch->SearchCondition = @$filter["v_family_know"]; $this->family_know->AdvancedSearch->SearchValue2 = @$filter["y_family_know"]; $this->family_know->AdvancedSearch->SearchOperator2 = @$filter["w_family_know"]; $this->family_know->AdvancedSearch->Save(); // Field date_of_entry_transit $this->date_of_entry_transit->AdvancedSearch->SearchValue = @$filter["x_date_of_entry_transit"]; $this->date_of_entry_transit->AdvancedSearch->SearchOperator = @$filter["z_date_of_entry_transit"]; $this->date_of_entry_transit->AdvancedSearch->SearchCondition = @$filter["v_date_of_entry_transit"]; $this->date_of_entry_transit->AdvancedSearch->SearchValue2 = @$filter["y_date_of_entry_transit"]; $this->date_of_entry_transit->AdvancedSearch->SearchOperator2 = @$filter["w_date_of_entry_transit"]; $this->date_of_entry_transit->AdvancedSearch->Save(); // Field marital_status $this->marital_status->AdvancedSearch->SearchValue = @$filter["x_marital_status"]; $this->marital_status->AdvancedSearch->SearchOperator = @$filter["z_marital_status"]; $this->marital_status->AdvancedSearch->SearchCondition = @$filter["v_marital_status"]; $this->marital_status->AdvancedSearch->SearchValue2 = @$filter["y_marital_status"]; $this->marital_status->AdvancedSearch->SearchOperator2 = @$filter["w_marital_status"]; $this->marital_status->AdvancedSearch->Save(); // Field consort_id $this->consort_id->AdvancedSearch->SearchValue = @$filter["x_consort_id"]; $this->consort_id->AdvancedSearch->SearchOperator = @$filter["z_consort_id"]; $this->consort_id->AdvancedSearch->SearchCondition = @$filter["v_consort_id"]; $this->consort_id->AdvancedSearch->SearchValue2 = @$filter["y_consort_id"]; $this->consort_id->AdvancedSearch->SearchOperator2 = @$filter["w_consort_id"]; $this->consort_id->AdvancedSearch->Save(); // Field consort_info $this->consort_info->AdvancedSearch->SearchValue = @$filter["x_consort_info"]; $this->consort_info->AdvancedSearch->SearchOperator = @$filter["z_consort_info"]; $this->consort_info->AdvancedSearch->SearchCondition = @$filter["v_consort_info"]; $this->consort_info->AdvancedSearch->SearchValue2 = @$filter["y_consort_info"]; $this->consort_info->AdvancedSearch->SearchOperator2 = @$filter["w_consort_info"]; $this->consort_info->AdvancedSearch->Save(); // Field other_fam_in_italy $this->other_fam_in_italy->AdvancedSearch->SearchValue = @$filter["x_other_fam_in_italy"]; $this->other_fam_in_italy->AdvancedSearch->SearchOperator = @$filter["z_other_fam_in_italy"]; $this->other_fam_in_italy->AdvancedSearch->SearchCondition = @$filter["v_other_fam_in_italy"]; $this->other_fam_in_italy->AdvancedSearch->SearchValue2 = @$filter["y_other_fam_in_italy"]; $this->other_fam_in_italy->AdvancedSearch->SearchOperator2 = @$filter["w_other_fam_in_italy"]; $this->other_fam_in_italy->AdvancedSearch->Save(); // Field other_fam_in_europe $this->other_fam_in_europe->AdvancedSearch->SearchValue = @$filter["x_other_fam_in_europe"]; $this->other_fam_in_europe->AdvancedSearch->SearchOperator = @$filter["z_other_fam_in_europe"]; $this->other_fam_in_europe->AdvancedSearch->SearchCondition = @$filter["v_other_fam_in_europe"]; $this->other_fam_in_europe->AdvancedSearch->SearchValue2 = @$filter["y_other_fam_in_europe"]; $this->other_fam_in_europe->AdvancedSearch->SearchOperator2 = @$filter["w_other_fam_in_europe"]; $this->other_fam_in_europe->AdvancedSearch->Save(); // Field where_lived $this->where_lived->AdvancedSearch->SearchValue = @$filter["x_where_lived"]; $this->where_lived->AdvancedSearch->SearchOperator = @$filter["z_where_lived"]; $this->where_lived->AdvancedSearch->SearchCondition = @$filter["v_where_lived"]; $this->where_lived->AdvancedSearch->SearchValue2 = @$filter["y_where_lived"]; $this->where_lived->AdvancedSearch->SearchOperator2 = @$filter["w_where_lived"]; $this->where_lived->AdvancedSearch->Save(); // Field medical_situation $this->medical_situation->AdvancedSearch->SearchValue = @$filter["x_medical_situation"]; $this->medical_situation->AdvancedSearch->SearchOperator = @$filter["z_medical_situation"]; $this->medical_situation->AdvancedSearch->SearchCondition = @$filter["v_medical_situation"]; $this->medical_situation->AdvancedSearch->SearchValue2 = @$filter["y_medical_situation"]; $this->medical_situation->AdvancedSearch->SearchOperator2 = @$filter["w_medical_situation"]; $this->medical_situation->AdvancedSearch->Save(); // Field social_situation $this->social_situation->AdvancedSearch->SearchValue = @$filter["x_social_situation"]; $this->social_situation->AdvancedSearch->SearchOperator = @$filter["z_social_situation"]; $this->social_situation->AdvancedSearch->SearchCondition = @$filter["v_social_situation"]; $this->social_situation->AdvancedSearch->SearchValue2 = @$filter["y_social_situation"]; $this->social_situation->AdvancedSearch->SearchOperator2 = @$filter["w_social_situation"]; $this->social_situation->AdvancedSearch->Save(); // Field abuse_suffered $this->abuse_suffered->AdvancedSearch->SearchValue = @$filter["x_abuse_suffered"]; $this->abuse_suffered->AdvancedSearch->SearchOperator = @$filter["z_abuse_suffered"]; $this->abuse_suffered->AdvancedSearch->SearchCondition = @$filter["v_abuse_suffered"]; $this->abuse_suffered->AdvancedSearch->SearchValue2 = @$filter["y_abuse_suffered"]; $this->abuse_suffered->AdvancedSearch->SearchOperator2 = @$filter["w_abuse_suffered"]; $this->abuse_suffered->AdvancedSearch->Save(); // Field abuse_description $this->abuse_description->AdvancedSearch->SearchValue = @$filter["x_abuse_description"]; $this->abuse_description->AdvancedSearch->SearchOperator = @$filter["z_abuse_description"]; $this->abuse_description->AdvancedSearch->SearchCondition = @$filter["v_abuse_description"]; $this->abuse_description->AdvancedSearch->SearchValue2 = @$filter["y_abuse_description"]; $this->abuse_description->AdvancedSearch->SearchOperator2 = @$filter["w_abuse_description"]; $this->abuse_description->AdvancedSearch->Save(); // Field work_done $this->work_done->AdvancedSearch->SearchValue = @$filter["x_work_done"]; $this->work_done->AdvancedSearch->SearchOperator = @$filter["z_work_done"]; $this->work_done->AdvancedSearch->SearchCondition = @$filter["v_work_done"]; $this->work_done->AdvancedSearch->SearchValue2 = @$filter["y_work_done"]; $this->work_done->AdvancedSearch->SearchOperator2 = @$filter["w_work_done"]; $this->work_done->AdvancedSearch->Save(); // Field military_service $this->military_service->AdvancedSearch->SearchValue = @$filter["x_military_service"]; $this->military_service->AdvancedSearch->SearchOperator = @$filter["z_military_service"]; $this->military_service->AdvancedSearch->SearchCondition = @$filter["v_military_service"]; $this->military_service->AdvancedSearch->SearchValue2 = @$filter["y_military_service"]; $this->military_service->AdvancedSearch->SearchOperator2 = @$filter["w_military_service"]; $this->military_service->AdvancedSearch->Save(); // Field itinerary $this->itinerary->AdvancedSearch->SearchValue = @$filter["x_itinerary"]; $this->itinerary->AdvancedSearch->SearchOperator = @$filter["z_itinerary"]; $this->itinerary->AdvancedSearch->SearchCondition = @$filter["v_itinerary"]; $this->itinerary->AdvancedSearch->SearchValue2 = @$filter["y_itinerary"]; $this->itinerary->AdvancedSearch->SearchOperator2 = @$filter["w_itinerary"]; $this->itinerary->AdvancedSearch->Save(); // Field convictions $this->convictions->AdvancedSearch->SearchValue = @$filter["x_convictions"]; $this->convictions->AdvancedSearch->SearchOperator = @$filter["z_convictions"]; $this->convictions->AdvancedSearch->SearchCondition = @$filter["v_convictions"]; $this->convictions->AdvancedSearch->SearchValue2 = @$filter["y_convictions"]; $this->convictions->AdvancedSearch->SearchOperator2 = @$filter["w_convictions"]; $this->convictions->AdvancedSearch->Save(); // Field requested_asylum $this->requested_asylum->AdvancedSearch->SearchValue = @$filter["x_requested_asylum"]; $this->requested_asylum->AdvancedSearch->SearchOperator = @$filter["z_requested_asylum"]; $this->requested_asylum->AdvancedSearch->SearchCondition = @$filter["v_requested_asylum"]; $this->requested_asylum->AdvancedSearch->SearchValue2 = @$filter["y_requested_asylum"]; $this->requested_asylum->AdvancedSearch->SearchOperator2 = @$filter["w_requested_asylum"]; $this->requested_asylum->AdvancedSearch->Save(); // Field resettlement_application $this->resettlement_application->AdvancedSearch->SearchValue = @$filter["x_resettlement_application"]; $this->resettlement_application->AdvancedSearch->SearchOperator = @$filter["z_resettlement_application"]; $this->resettlement_application->AdvancedSearch->SearchCondition = @$filter["v_resettlement_application"]; $this->resettlement_application->AdvancedSearch->SearchValue2 = @$filter["y_resettlement_application"]; $this->resettlement_application->AdvancedSearch->SearchOperator2 = @$filter["w_resettlement_application"]; $this->resettlement_application->AdvancedSearch->Save(); // Field resettlement_country $this->resettlement_country->AdvancedSearch->SearchValue = @$filter["x_resettlement_country"]; $this->resettlement_country->AdvancedSearch->SearchOperator = @$filter["z_resettlement_country"]; $this->resettlement_country->AdvancedSearch->SearchCondition = @$filter["v_resettlement_country"]; $this->resettlement_country->AdvancedSearch->SearchValue2 = @$filter["y_resettlement_country"]; $this->resettlement_country->AdvancedSearch->SearchOperator2 = @$filter["w_resettlement_country"]; $this->resettlement_country->AdvancedSearch->Save(); // Field reunion_application $this->reunion_application->AdvancedSearch->SearchValue = @$filter["x_reunion_application"]; $this->reunion_application->AdvancedSearch->SearchOperator = @$filter["z_reunion_application"]; $this->reunion_application->AdvancedSearch->SearchCondition = @$filter["v_reunion_application"]; $this->reunion_application->AdvancedSearch->SearchValue2 = @$filter["y_reunion_application"]; $this->reunion_application->AdvancedSearch->SearchOperator2 = @$filter["w_reunion_application"]; $this->reunion_application->AdvancedSearch->Save(); // Field reunion_country $this->reunion_country->AdvancedSearch->SearchValue = @$filter["x_reunion_country"]; $this->reunion_country->AdvancedSearch->SearchOperator = @$filter["z_reunion_country"]; $this->reunion_country->AdvancedSearch->SearchCondition = @$filter["v_reunion_country"]; $this->reunion_country->AdvancedSearch->SearchValue2 = @$filter["y_reunion_country"]; $this->reunion_country->AdvancedSearch->SearchOperator2 = @$filter["w_reunion_country"]; $this->reunion_country->AdvancedSearch->Save(); // Field belongs_to_organization $this->belongs_to_organization->AdvancedSearch->SearchValue = @$filter["x_belongs_to_organization"]; $this->belongs_to_organization->AdvancedSearch->SearchOperator = @$filter["z_belongs_to_organization"]; $this->belongs_to_organization->AdvancedSearch->SearchCondition = @$filter["v_belongs_to_organization"]; $this->belongs_to_organization->AdvancedSearch->SearchValue2 = @$filter["y_belongs_to_organization"]; $this->belongs_to_organization->AdvancedSearch->SearchOperator2 = @$filter["w_belongs_to_organization"]; $this->belongs_to_organization->AdvancedSearch->Save(); // Field organizations $this->organizations->AdvancedSearch->SearchValue = @$filter["x_organizations"]; $this->organizations->AdvancedSearch->SearchOperator = @$filter["z_organizations"]; $this->organizations->AdvancedSearch->SearchCondition = @$filter["v_organizations"]; $this->organizations->AdvancedSearch->SearchValue2 = @$filter["y_organizations"]; $this->organizations->AdvancedSearch->SearchOperator2 = @$filter["w_organizations"]; $this->organizations->AdvancedSearch->Save(); // Field presentations $this->presentations->AdvancedSearch->SearchValue = @$filter["x_presentations"]; $this->presentations->AdvancedSearch->SearchOperator = @$filter["z_presentations"]; $this->presentations->AdvancedSearch->SearchCondition = @$filter["v_presentations"]; $this->presentations->AdvancedSearch->SearchValue2 = @$filter["y_presentations"]; $this->presentations->AdvancedSearch->SearchOperator2 = @$filter["w_presentations"]; $this->presentations->AdvancedSearch->Save(); // Field report $this->report->AdvancedSearch->SearchValue = @$filter["x_report"]; $this->report->AdvancedSearch->SearchOperator = @$filter["z_report"]; $this->report->AdvancedSearch->SearchCondition = @$filter["v_report"]; $this->report->AdvancedSearch->SearchValue2 = @$filter["y_report"]; $this->report->AdvancedSearch->SearchOperator2 = @$filter["w_report"]; $this->report->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->Desk, $Default, FALSE); // Desk $this->BuildSearchSql($sWhere, $this->UNHCR_code, $Default, FALSE); // UNHCR_code $this->BuildSearchSql($sWhere, $this->Name, $Default, FALSE); // Name $this->BuildSearchSql($sWhere, $this->Surname, $Default, FALSE); // Surname $this->BuildSearchSql($sWhere, $this->BirthDate, $Default, FALSE); // BirthDate $this->BuildSearchSql($sWhere, $this->BirthPlace, $Default, FALSE); // BirthPlace $this->BuildSearchSql($sWhere, $this->Nationality, $Default, FALSE); // Nationality $this->BuildSearchSql($sWhere, $this->Citizenship, $Default, FALSE); // Citizenship $this->BuildSearchSql($sWhere, $this->Sex, $Default, FALSE); // Sex $this->BuildSearchSql($sWhere, $this->Phone, $Default, FALSE); // Phone $this->BuildSearchSql($sWhere, $this->_Email, $Default, FALSE); // Email $this->BuildSearchSql($sWhere, $this->Religion, $Default, FALSE); // Religion $this->BuildSearchSql($sWhere, $this->Place_of_Residence, $Default, FALSE); // Place_of_Residence $this->BuildSearchSql($sWhere, $this->Address_of_Residence, $Default, FALSE); // Address_of_Residence $this->BuildSearchSql($sWhere, $this->Town_of_residence, $Default, FALSE); // Town_of_residence $this->BuildSearchSql($sWhere, $this->Place_of_Transit, $Default, FALSE); // Place_of_Transit $this->BuildSearchSql($sWhere, $this->Address_of_Transit, $Default, FALSE); // Address_of_Transit $this->BuildSearchSql($sWhere, $this->Town_of_transit, $Default, FALSE); // Town_of_transit $this->BuildSearchSql($sWhere, $this->domicile_description, $Default, FALSE); // domicile_description $this->BuildSearchSql($sWhere, $this->Disabled, $Default, FALSE); // Disabled $this->BuildSearchSql($sWhere, $this->Sick, $Default, FALSE); // Sick $this->BuildSearchSql($sWhere, $this->Alone, $Default, FALSE); // Alone $this->BuildSearchSql($sWhere, $this->Elderly, $Default, FALSE); // Elderly $this->BuildSearchSql($sWhere, $this->Family, $Default, FALSE); // Family $this->BuildSearchSql($sWhere, $this->Householder, $Default, FALSE); // Householder $this->BuildSearchSql($sWhere, $this->Householder_id, $Default, FALSE); // Householder_id $this->BuildSearchSql($sWhere, $this->Householder_reltype, $Default, FALSE); // Householder_reltype $this->BuildSearchSql($sWhere, $this->Ethnic_group, $Default, FALSE); // Ethnic_group $this->BuildSearchSql($sWhere, $this->Known_languages, $Default, FALSE); // Known_languages $this->BuildSearchSql($sWhere, $this->Title_of_study, $Default, FALSE); // Title_of_study $this->BuildSearchSql($sWhere, $this->Poss_destination_country, $Default, FALSE); // Poss_destination_country $this->BuildSearchSql($sWhere, $this->Document_type, $Default, FALSE); // Document_type $this->BuildSearchSql($sWhere, $this->Document_number, $Default, FALSE); // Document_number $this->BuildSearchSql($sWhere, $this->Document_release, $Default, FALSE); // Document_release $this->BuildSearchSql($sWhere, $this->Document_expiry, $Default, FALSE); // Document_expiry $this->BuildSearchSql($sWhere, $this->Document_nationality, $Default, FALSE); // Document_nationality $this->BuildSearchSql($sWhere, $this->other_documents, $Default, FALSE); // other_documents $this->BuildSearchSql($sWhere, $this->Final_evaluation, $Default, FALSE); // Final_evaluation $this->BuildSearchSql($sWhere, $this->photo, $Default, FALSE); // photo $this->BuildSearchSql($sWhere, $this->doc_image, $Default, FALSE); // doc_image $this->BuildSearchSql($sWhere, $this->Notes, $Default, FALSE); // Notes $this->BuildSearchSql($sWhere, $this->Interview_1, $Default, FALSE); // Interview_1 $this->BuildSearchSql($sWhere, $this->interview1_date, $Default, FALSE); // interview1_date $this->BuildSearchSql($sWhere, $this->Interview_2, $Default, FALSE); // Interview_2 $this->BuildSearchSql($sWhere, $this->interview_2_date, $Default, FALSE); // interview_2_date $this->BuildSearchSql($sWhere, $this->Interview_3, $Default, FALSE); // Interview_3 $this->BuildSearchSql($sWhere, $this->interview_3_date, $Default, FALSE); // interview_3_date $this->BuildSearchSql($sWhere, $this->Zone_of_Transit, $Default, FALSE); // Zone_of_Transit $this->BuildSearchSql($sWhere, $this->Travel_number, $Default, FALSE); // Travel_number $this->BuildSearchSql($sWhere, $this->Travel_arrival_date, $Default, FALSE); // Travel_arrival_date $this->BuildSearchSql($sWhere, $this->Travel_arrival_time, $Default, FALSE); // Travel_arrival_time $this->BuildSearchSql($sWhere, $this->num_family, $Default, FALSE); // num_family $this->BuildSearchSql($sWhere, $this->speak_ENG, $Default, FALSE); // speak_ENG $this->BuildSearchSql($sWhere, $this->speak_FRA, $Default, FALSE); // speak_FRA $this->BuildSearchSql($sWhere, $this->speak_ARA, $Default, FALSE); // speak_ARA $this->BuildSearchSql($sWhere, $this->speak_ITA, $Default, FALSE); // speak_ITA $this->BuildSearchSql($sWhere, $this->lives_with, $Default, FALSE); // lives_with $this->BuildSearchSql($sWhere, $this->family_know, $Default, FALSE); // family_know $this->BuildSearchSql($sWhere, $this->date_of_entry_transit, $Default, FALSE); // date_of_entry_transit $this->BuildSearchSql($sWhere, $this->marital_status, $Default, FALSE); // marital_status $this->BuildSearchSql($sWhere, $this->consort_id, $Default, FALSE); // consort_id $this->BuildSearchSql($sWhere, $this->consort_info, $Default, FALSE); // consort_info $this->BuildSearchSql($sWhere, $this->other_fam_in_italy, $Default, FALSE); // other_fam_in_italy $this->BuildSearchSql($sWhere, $this->other_fam_in_europe, $Default, FALSE); // other_fam_in_europe $this->BuildSearchSql($sWhere, $this->where_lived, $Default, FALSE); // where_lived $this->BuildSearchSql($sWhere, $this->medical_situation, $Default, FALSE); // medical_situation $this->BuildSearchSql($sWhere, $this->social_situation, $Default, FALSE); // social_situation $this->BuildSearchSql($sWhere, $this->abuse_suffered, $Default, FALSE); // abuse_suffered $this->BuildSearchSql($sWhere, $this->abuse_description, $Default, FALSE); // abuse_description $this->BuildSearchSql($sWhere, $this->work_done, $Default, FALSE); // work_done $this->BuildSearchSql($sWhere, $this->military_service, $Default, FALSE); // military_service $this->BuildSearchSql($sWhere, $this->itinerary, $Default, FALSE); // itinerary $this->BuildSearchSql($sWhere, $this->convictions, $Default, FALSE); // convictions $this->BuildSearchSql($sWhere, $this->requested_asylum, $Default, FALSE); // requested_asylum $this->BuildSearchSql($sWhere, $this->resettlement_application, $Default, FALSE); // resettlement_application $this->BuildSearchSql($sWhere, $this->resettlement_country, $Default, FALSE); // resettlement_country $this->BuildSearchSql($sWhere, $this->reunion_application, $Default, FALSE); // reunion_application $this->BuildSearchSql($sWhere, $this->reunion_country, $Default, FALSE); // reunion_country $this->BuildSearchSql($sWhere, $this->belongs_to_organization, $Default, FALSE); // belongs_to_organization $this->BuildSearchSql($sWhere, $this->organizations, $Default, FALSE); // organizations $this->BuildSearchSql($sWhere, $this->presentations, $Default, FALSE); // presentations $this->BuildSearchSql($sWhere, $this->report, $Default, FALSE); // report // Set up search parm if (!$Default && $sWhere <> "") { $this->Command = "search"; } if (!$Default && $this->Command == "search") { $this->Desk->AdvancedSearch->Save(); // Desk $this->UNHCR_code->AdvancedSearch->Save(); // UNHCR_code $this->Name->AdvancedSearch->Save(); // Name $this->Surname->AdvancedSearch->Save(); // Surname $this->BirthDate->AdvancedSearch->Save(); // BirthDate $this->BirthPlace->AdvancedSearch->Save(); // BirthPlace $this->Nationality->AdvancedSearch->Save(); // Nationality $this->Citizenship->AdvancedSearch->Save(); // Citizenship $this->Sex->AdvancedSearch->Save(); // Sex $this->Phone->AdvancedSearch->Save(); // Phone $this->_Email->AdvancedSearch->Save(); // Email $this->Religion->AdvancedSearch->Save(); // Religion $this->Place_of_Residence->AdvancedSearch->Save(); // Place_of_Residence $this->Address_of_Residence->AdvancedSearch->Save(); // Address_of_Residence $this->Town_of_residence->AdvancedSearch->Save(); // Town_of_residence $this->Place_of_Transit->AdvancedSearch->Save(); // Place_of_Transit $this->Address_of_Transit->AdvancedSearch->Save(); // Address_of_Transit $this->Town_of_transit->AdvancedSearch->Save(); // Town_of_transit $this->domicile_description->AdvancedSearch->Save(); // domicile_description $this->Disabled->AdvancedSearch->Save(); // Disabled $this->Sick->AdvancedSearch->Save(); // Sick $this->Alone->AdvancedSearch->Save(); // Alone $this->Elderly->AdvancedSearch->Save(); // Elderly $this->Family->AdvancedSearch->Save(); // Family $this->Householder->AdvancedSearch->Save(); // Householder $this->Householder_id->AdvancedSearch->Save(); // Householder_id $this->Householder_reltype->AdvancedSearch->Save(); // Householder_reltype $this->Ethnic_group->AdvancedSearch->Save(); // Ethnic_group $this->Known_languages->AdvancedSearch->Save(); // Known_languages $this->Title_of_study->AdvancedSearch->Save(); // Title_of_study $this->Poss_destination_country->AdvancedSearch->Save(); // Poss_destination_country $this->Document_type->AdvancedSearch->Save(); // Document_type $this->Document_number->AdvancedSearch->Save(); // Document_number $this->Document_release->AdvancedSearch->Save(); // Document_release $this->Document_expiry->AdvancedSearch->Save(); // Document_expiry $this->Document_nationality->AdvancedSearch->Save(); // Document_nationality $this->other_documents->AdvancedSearch->Save(); // other_documents $this->Final_evaluation->AdvancedSearch->Save(); // Final_evaluation $this->photo->AdvancedSearch->Save(); // photo $this->doc_image->AdvancedSearch->Save(); // doc_image $this->Notes->AdvancedSearch->Save(); // Notes $this->Interview_1->AdvancedSearch->Save(); // Interview_1 $this->interview1_date->AdvancedSearch->Save(); // interview1_date $this->Interview_2->AdvancedSearch->Save(); // Interview_2 $this->interview_2_date->AdvancedSearch->Save(); // interview_2_date $this->Interview_3->AdvancedSearch->Save(); // Interview_3 $this->interview_3_date->AdvancedSearch->Save(); // interview_3_date $this->Zone_of_Transit->AdvancedSearch->Save(); // Zone_of_Transit $this->Travel_number->AdvancedSearch->Save(); // Travel_number $this->Travel_arrival_date->AdvancedSearch->Save(); // Travel_arrival_date $this->Travel_arrival_time->AdvancedSearch->Save(); // Travel_arrival_time $this->num_family->AdvancedSearch->Save(); // num_family $this->speak_ENG->AdvancedSearch->Save(); // speak_ENG $this->speak_FRA->AdvancedSearch->Save(); // speak_FRA $this->speak_ARA->AdvancedSearch->Save(); // speak_ARA $this->speak_ITA->AdvancedSearch->Save(); // speak_ITA $this->lives_with->AdvancedSearch->Save(); // lives_with $this->family_know->AdvancedSearch->Save(); // family_know $this->date_of_entry_transit->AdvancedSearch->Save(); // date_of_entry_transit $this->marital_status->AdvancedSearch->Save(); // marital_status $this->consort_id->AdvancedSearch->Save(); // consort_id $this->consort_info->AdvancedSearch->Save(); // consort_info $this->other_fam_in_italy->AdvancedSearch->Save(); // other_fam_in_italy $this->other_fam_in_europe->AdvancedSearch->Save(); // other_fam_in_europe $this->where_lived->AdvancedSearch->Save(); // where_lived $this->medical_situation->AdvancedSearch->Save(); // medical_situation $this->social_situation->AdvancedSearch->Save(); // social_situation $this->abuse_suffered->AdvancedSearch->Save(); // abuse_suffered $this->abuse_description->AdvancedSearch->Save(); // abuse_description $this->work_done->AdvancedSearch->Save(); // work_done $this->military_service->AdvancedSearch->Save(); // military_service $this->itinerary->AdvancedSearch->Save(); // itinerary $this->convictions->AdvancedSearch->Save(); // convictions $this->requested_asylum->AdvancedSearch->Save(); // requested_asylum $this->resettlement_application->AdvancedSearch->Save(); // resettlement_application $this->resettlement_country->AdvancedSearch->Save(); // resettlement_country $this->reunion_application->AdvancedSearch->Save(); // reunion_application $this->reunion_country->AdvancedSearch->Save(); // reunion_country $this->belongs_to_organization->AdvancedSearch->Save(); // belongs_to_organization $this->organizations->AdvancedSearch->Save(); // organizations $this->presentations->AdvancedSearch->Save(); // presentations $this->report->AdvancedSearch->Save(); // report } 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->UNHCR_code, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Name, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Surname, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->BirthDate, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->BirthPlace, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Nationality, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Citizenship, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Sex, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Phone, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->_Email, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Religion, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Place_of_Residence, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Address_of_Residence, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Town_of_residence, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Place_of_Transit, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Address_of_Transit, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Town_of_transit, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->domicile_description, $arKeywords, $type); $this->BuildBasicSearchSQL($sWhere, $this->Zone_of_Transit, $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->Desk->AdvancedSearch->IssetSession()) return TRUE; if ($this->UNHCR_code->AdvancedSearch->IssetSession()) return TRUE; if ($this->Name->AdvancedSearch->IssetSession()) return TRUE; if ($this->Surname->AdvancedSearch->IssetSession()) return TRUE; if ($this->BirthDate->AdvancedSearch->IssetSession()) return TRUE; if ($this->BirthPlace->AdvancedSearch->IssetSession()) return TRUE; if ($this->Nationality->AdvancedSearch->IssetSession()) return TRUE; if ($this->Citizenship->AdvancedSearch->IssetSession()) return TRUE; if ($this->Sex->AdvancedSearch->IssetSession()) return TRUE; if ($this->Phone->AdvancedSearch->IssetSession()) return TRUE; if ($this->_Email->AdvancedSearch->IssetSession()) return TRUE; if ($this->Religion->AdvancedSearch->IssetSession()) return TRUE; if ($this->Place_of_Residence->AdvancedSearch->IssetSession()) return TRUE; if ($this->Address_of_Residence->AdvancedSearch->IssetSession()) return TRUE; if ($this->Town_of_residence->AdvancedSearch->IssetSession()) return TRUE; if ($this->Place_of_Transit->AdvancedSearch->IssetSession()) return TRUE; if ($this->Address_of_Transit->AdvancedSearch->IssetSession()) return TRUE; if ($this->Town_of_transit->AdvancedSearch->IssetSession()) return TRUE; if ($this->domicile_description->AdvancedSearch->IssetSession()) return TRUE; if ($this->Disabled->AdvancedSearch->IssetSession()) return TRUE; if ($this->Sick->AdvancedSearch->IssetSession()) return TRUE; if ($this->Alone->AdvancedSearch->IssetSession()) return TRUE; if ($this->Elderly->AdvancedSearch->IssetSession()) return TRUE; if ($this->Family->AdvancedSearch->IssetSession()) return TRUE; if ($this->Householder->AdvancedSearch->IssetSession()) return TRUE; if ($this->Householder_id->AdvancedSearch->IssetSession()) return TRUE; if ($this->Householder_reltype->AdvancedSearch->IssetSession()) return TRUE; if ($this->Ethnic_group->AdvancedSearch->IssetSession()) return TRUE; if ($this->Known_languages->AdvancedSearch->IssetSession()) return TRUE; if ($this->Title_of_study->AdvancedSearch->IssetSession()) return TRUE; if ($this->Poss_destination_country->AdvancedSearch->IssetSession()) return TRUE; if ($this->Document_type->AdvancedSearch->IssetSession()) return TRUE; if ($this->Document_number->AdvancedSearch->IssetSession()) return TRUE; if ($this->Document_release->AdvancedSearch->IssetSession()) return TRUE; if ($this->Document_expiry->AdvancedSearch->IssetSession()) return TRUE; if ($this->Document_nationality->AdvancedSearch->IssetSession()) return TRUE; if ($this->other_documents->AdvancedSearch->IssetSession()) return TRUE; if ($this->Final_evaluation->AdvancedSearch->IssetSession()) return TRUE; if ($this->photo->AdvancedSearch->IssetSession()) return TRUE; if ($this->doc_image->AdvancedSearch->IssetSession()) return TRUE; if ($this->Notes->AdvancedSearch->IssetSession()) return TRUE; if ($this->Interview_1->AdvancedSearch->IssetSession()) return TRUE; if ($this->interview1_date->AdvancedSearch->IssetSession()) return TRUE; if ($this->Interview_2->AdvancedSearch->IssetSession()) return TRUE; if ($this->interview_2_date->AdvancedSearch->IssetSession()) return TRUE; if ($this->Interview_3->AdvancedSearch->IssetSession()) return TRUE; if ($this->interview_3_date->AdvancedSearch->IssetSession()) return TRUE; if ($this->Zone_of_Transit->AdvancedSearch->IssetSession()) return TRUE; if ($this->Travel_number->AdvancedSearch->IssetSession()) return TRUE; if ($this->Travel_arrival_date->AdvancedSearch->IssetSession()) return TRUE; if ($this->Travel_arrival_time->AdvancedSearch->IssetSession()) return TRUE; if ($this->num_family->AdvancedSearch->IssetSession()) return TRUE; if ($this->speak_ENG->AdvancedSearch->IssetSession()) return TRUE; if ($this->speak_FRA->AdvancedSearch->IssetSession()) return TRUE; if ($this->speak_ARA->AdvancedSearch->IssetSession()) return TRUE; if ($this->speak_ITA->AdvancedSearch->IssetSession()) return TRUE; if ($this->lives_with->AdvancedSearch->IssetSession()) return TRUE; if ($this->family_know->AdvancedSearch->IssetSession()) return TRUE; if ($this->date_of_entry_transit->AdvancedSearch->IssetSession()) return TRUE; if ($this->marital_status->AdvancedSearch->IssetSession()) return TRUE; if ($this->consort_id->AdvancedSearch->IssetSession()) return TRUE; if ($this->consort_info->AdvancedSearch->IssetSession()) return TRUE; if ($this->other_fam_in_italy->AdvancedSearch->IssetSession()) return TRUE; if ($this->other_fam_in_europe->AdvancedSearch->IssetSession()) return TRUE; if ($this->where_lived->AdvancedSearch->IssetSession()) return TRUE; if ($this->medical_situation->AdvancedSearch->IssetSession()) return TRUE; if ($this->social_situation->AdvancedSearch->IssetSession()) return TRUE; if ($this->abuse_suffered->AdvancedSearch->IssetSession()) return TRUE; if ($this->abuse_description->AdvancedSearch->IssetSession()) return TRUE; if ($this->work_done->AdvancedSearch->IssetSession()) return TRUE; if ($this->military_service->AdvancedSearch->IssetSession()) return TRUE; if ($this->itinerary->AdvancedSearch->IssetSession()) return TRUE; if ($this->convictions->AdvancedSearch->IssetSession()) return TRUE; if ($this->requested_asylum->AdvancedSearch->IssetSession()) return TRUE; if ($this->resettlement_application->AdvancedSearch->IssetSession()) return TRUE; if ($this->resettlement_country->AdvancedSearch->IssetSession()) return TRUE; if ($this->reunion_application->AdvancedSearch->IssetSession()) return TRUE; if ($this->reunion_country->AdvancedSearch->IssetSession()) return TRUE; if ($this->belongs_to_organization->AdvancedSearch->IssetSession()) return TRUE; if ($this->organizations->AdvancedSearch->IssetSession()) return TRUE; if ($this->presentations->AdvancedSearch->IssetSession()) return TRUE; if ($this->report->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->Desk->AdvancedSearch->UnsetSession(); $this->UNHCR_code->AdvancedSearch->UnsetSession(); $this->Name->AdvancedSearch->UnsetSession(); $this->Surname->AdvancedSearch->UnsetSession(); $this->BirthDate->AdvancedSearch->UnsetSession(); $this->BirthPlace->AdvancedSearch->UnsetSession(); $this->Nationality->AdvancedSearch->UnsetSession(); $this->Citizenship->AdvancedSearch->UnsetSession(); $this->Sex->AdvancedSearch->UnsetSession(); $this->Phone->AdvancedSearch->UnsetSession(); $this->_Email->AdvancedSearch->UnsetSession(); $this->Religion->AdvancedSearch->UnsetSession(); $this->Place_of_Residence->AdvancedSearch->UnsetSession(); $this->Address_of_Residence->AdvancedSearch->UnsetSession(); $this->Town_of_residence->AdvancedSearch->UnsetSession(); $this->Place_of_Transit->AdvancedSearch->UnsetSession(); $this->Address_of_Transit->AdvancedSearch->UnsetSession(); $this->Town_of_transit->AdvancedSearch->UnsetSession(); $this->domicile_description->AdvancedSearch->UnsetSession(); $this->Disabled->AdvancedSearch->UnsetSession(); $this->Sick->AdvancedSearch->UnsetSession(); $this->Alone->AdvancedSearch->UnsetSession(); $this->Elderly->AdvancedSearch->UnsetSession(); $this->Family->AdvancedSearch->UnsetSession(); $this->Householder->AdvancedSearch->UnsetSession(); $this->Householder_id->AdvancedSearch->UnsetSession(); $this->Householder_reltype->AdvancedSearch->UnsetSession(); $this->Ethnic_group->AdvancedSearch->UnsetSession(); $this->Known_languages->AdvancedSearch->UnsetSession(); $this->Title_of_study->AdvancedSearch->UnsetSession(); $this->Poss_destination_country->AdvancedSearch->UnsetSession(); $this->Document_type->AdvancedSearch->UnsetSession(); $this->Document_number->AdvancedSearch->UnsetSession(); $this->Document_release->AdvancedSearch->UnsetSession(); $this->Document_expiry->AdvancedSearch->UnsetSession(); $this->Document_nationality->AdvancedSearch->UnsetSession(); $this->other_documents->AdvancedSearch->UnsetSession(); $this->Final_evaluation->AdvancedSearch->UnsetSession(); $this->photo->AdvancedSearch->UnsetSession(); $this->doc_image->AdvancedSearch->UnsetSession(); $this->Notes->AdvancedSearch->UnsetSession(); $this->Interview_1->AdvancedSearch->UnsetSession(); $this->interview1_date->AdvancedSearch->UnsetSession(); $this->Interview_2->AdvancedSearch->UnsetSession(); $this->interview_2_date->AdvancedSearch->UnsetSession(); $this->Interview_3->AdvancedSearch->UnsetSession(); $this->interview_3_date->AdvancedSearch->UnsetSession(); $this->Zone_of_Transit->AdvancedSearch->UnsetSession(); $this->Travel_number->AdvancedSearch->UnsetSession(); $this->Travel_arrival_date->AdvancedSearch->UnsetSession(); $this->Travel_arrival_time->AdvancedSearch->UnsetSession(); $this->num_family->AdvancedSearch->UnsetSession(); $this->speak_ENG->AdvancedSearch->UnsetSession(); $this->speak_FRA->AdvancedSearch->UnsetSession(); $this->speak_ARA->AdvancedSearch->UnsetSession(); $this->speak_ITA->AdvancedSearch->UnsetSession(); $this->lives_with->AdvancedSearch->UnsetSession(); $this->family_know->AdvancedSearch->UnsetSession(); $this->date_of_entry_transit->AdvancedSearch->UnsetSession(); $this->marital_status->AdvancedSearch->UnsetSession(); $this->consort_id->AdvancedSearch->UnsetSession(); $this->consort_info->AdvancedSearch->UnsetSession(); $this->other_fam_in_italy->AdvancedSearch->UnsetSession(); $this->other_fam_in_europe->AdvancedSearch->UnsetSession(); $this->where_lived->AdvancedSearch->UnsetSession(); $this->medical_situation->AdvancedSearch->UnsetSession(); $this->social_situation->AdvancedSearch->UnsetSession(); $this->abuse_suffered->AdvancedSearch->UnsetSession(); $this->abuse_description->AdvancedSearch->UnsetSession(); $this->work_done->AdvancedSearch->UnsetSession(); $this->military_service->AdvancedSearch->UnsetSession(); $this->itinerary->AdvancedSearch->UnsetSession(); $this->convictions->AdvancedSearch->UnsetSession(); $this->requested_asylum->AdvancedSearch->UnsetSession(); $this->resettlement_application->AdvancedSearch->UnsetSession(); $this->resettlement_country->AdvancedSearch->UnsetSession(); $this->reunion_application->AdvancedSearch->UnsetSession(); $this->reunion_country->AdvancedSearch->UnsetSession(); $this->belongs_to_organization->AdvancedSearch->UnsetSession(); $this->organizations->AdvancedSearch->UnsetSession(); $this->presentations->AdvancedSearch->UnsetSession(); $this->report->AdvancedSearch->UnsetSession(); } // Restore all search parameters function RestoreSearchParms() { $this->RestoreSearch = TRUE; // Restore basic search values $this->BasicSearch->Load(); // Restore advanced search values $this->Desk->AdvancedSearch->Load(); $this->UNHCR_code->AdvancedSearch->Load(); $this->Name->AdvancedSearch->Load(); $this->Surname->AdvancedSearch->Load(); $this->BirthDate->AdvancedSearch->Load(); $this->BirthPlace->AdvancedSearch->Load(); $this->Nationality->AdvancedSearch->Load(); $this->Citizenship->AdvancedSearch->Load(); $this->Sex->AdvancedSearch->Load(); $this->Phone->AdvancedSearch->Load(); $this->_Email->AdvancedSearch->Load(); $this->Religion->AdvancedSearch->Load(); $this->Place_of_Residence->AdvancedSearch->Load(); $this->Address_of_Residence->AdvancedSearch->Load(); $this->Town_of_residence->AdvancedSearch->Load(); $this->Place_of_Transit->AdvancedSearch->Load(); $this->Address_of_Transit->AdvancedSearch->Load(); $this->Town_of_transit->AdvancedSearch->Load(); $this->domicile_description->AdvancedSearch->Load(); $this->Disabled->AdvancedSearch->Load(); $this->Sick->AdvancedSearch->Load(); $this->Alone->AdvancedSearch->Load(); $this->Elderly->AdvancedSearch->Load(); $this->Family->AdvancedSearch->Load(); $this->Householder->AdvancedSearch->Load(); $this->Householder_id->AdvancedSearch->Load(); $this->Householder_reltype->AdvancedSearch->Load(); $this->Ethnic_group->AdvancedSearch->Load(); $this->Known_languages->AdvancedSearch->Load(); $this->Title_of_study->AdvancedSearch->Load(); $this->Poss_destination_country->AdvancedSearch->Load(); $this->Document_type->AdvancedSearch->Load(); $this->Document_number->AdvancedSearch->Load(); $this->Document_release->AdvancedSearch->Load(); $this->Document_expiry->AdvancedSearch->Load(); $this->Document_nationality->AdvancedSearch->Load(); $this->other_documents->AdvancedSearch->Load(); $this->Final_evaluation->AdvancedSearch->Load(); $this->photo->AdvancedSearch->Load(); $this->doc_image->AdvancedSearch->Load(); $this->Notes->AdvancedSearch->Load(); $this->Interview_1->AdvancedSearch->Load(); $this->interview1_date->AdvancedSearch->Load(); $this->Interview_2->AdvancedSearch->Load(); $this->interview_2_date->AdvancedSearch->Load(); $this->Interview_3->AdvancedSearch->Load(); $this->interview_3_date->AdvancedSearch->Load(); $this->Zone_of_Transit->AdvancedSearch->Load(); $this->Travel_number->AdvancedSearch->Load(); $this->Travel_arrival_date->AdvancedSearch->Load(); $this->Travel_arrival_time->AdvancedSearch->Load(); $this->num_family->AdvancedSearch->Load(); $this->speak_ENG->AdvancedSearch->Load(); $this->speak_FRA->AdvancedSearch->Load(); $this->speak_ARA->AdvancedSearch->Load(); $this->speak_ITA->AdvancedSearch->Load(); $this->lives_with->AdvancedSearch->Load(); $this->family_know->AdvancedSearch->Load(); $this->date_of_entry_transit->AdvancedSearch->Load(); $this->marital_status->AdvancedSearch->Load(); $this->consort_id->AdvancedSearch->Load(); $this->consort_info->AdvancedSearch->Load(); $this->other_fam_in_italy->AdvancedSearch->Load(); $this->other_fam_in_europe->AdvancedSearch->Load(); $this->where_lived->AdvancedSearch->Load(); $this->medical_situation->AdvancedSearch->Load(); $this->social_situation->AdvancedSearch->Load(); $this->abuse_suffered->AdvancedSearch->Load(); $this->abuse_description->AdvancedSearch->Load(); $this->work_done->AdvancedSearch->Load(); $this->military_service->AdvancedSearch->Load(); $this->itinerary->AdvancedSearch->Load(); $this->convictions->AdvancedSearch->Load(); $this->requested_asylum->AdvancedSearch->Load(); $this->resettlement_application->AdvancedSearch->Load(); $this->resettlement_country->AdvancedSearch->Load(); $this->reunion_application->AdvancedSearch->Load(); $this->reunion_country->AdvancedSearch->Load(); $this->belongs_to_organization->AdvancedSearch->Load(); $this->organizations->AdvancedSearch->Load(); $this->presentations->AdvancedSearch->Load(); $this->report->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->idSeeker); // idSeeker $this->UpdateSort($this->UNHCR_code); // UNHCR_code $this->UpdateSort($this->Name); // Name $this->UpdateSort($this->Surname); // Surname $this->UpdateSort($this->BirthDate); // BirthDate $this->UpdateSort($this->BirthPlace); // BirthPlace $this->UpdateSort($this->Nationality); // Nationality $this->UpdateSort($this->Sex); // Sex $this->UpdateSort($this->Householder); // Householder $this->UpdateSort($this->Travel_number); // Travel_number $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 sorting order if ($this->Command == "resetsort") { $sOrderBy = ""; $this->setSessionOrderBy($sOrderBy); $this->setSessionOrderByList($sOrderBy); $this->idSeeker->setSort(""); $this->UNHCR_code->setSort(""); $this->Name->setSort(""); $this->Surname->setSort(""); $this->BirthDate->setSort(""); $this->BirthPlace->setSort(""); $this->Nationality->setSort(""); $this->Sex->setSort(""); $this->Householder->setSort(""); $this->Travel_number->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[] = "" . $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 = "`idkSeeker`=" . ew_AdjustSql($this->idSeeker->CurrentValue, $this->DBID) . ""; // Column "detail_tassigment" if ($this->DetailPages->Items["tassigment"]->Visible) { $link = ""; $option = &$this->ListOptions->Items["detail_tassigment"]; $url = "tassigmentpreview.php?t=tospiti&f=" . ew_Encrypt($sSqlWrk); $btngrp = "" . $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" : "" . $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->Desk); // Desk $this->AddSearchQueryString($sQry, $this->UNHCR_code); // UNHCR_code $this->AddSearchQueryString($sQry, $this->Name); // Name $this->AddSearchQueryString($sQry, $this->Surname); // Surname $this->AddSearchQueryString($sQry, $this->BirthDate); // BirthDate $this->AddSearchQueryString($sQry, $this->BirthPlace); // BirthPlace $this->AddSearchQueryString($sQry, $this->Nationality); // Nationality $this->AddSearchQueryString($sQry, $this->Citizenship); // Citizenship $this->AddSearchQueryString($sQry, $this->Sex); // Sex $this->AddSearchQueryString($sQry, $this->Phone); // Phone $this->AddSearchQueryString($sQry, $this->_Email); // Email $this->AddSearchQueryString($sQry, $this->Religion); // Religion $this->AddSearchQueryString($sQry, $this->Place_of_Residence); // Place_of_Residence $this->AddSearchQueryString($sQry, $this->Address_of_Residence); // Address_of_Residence $this->AddSearchQueryString($sQry, $this->Town_of_residence); // Town_of_residence $this->AddSearchQueryString($sQry, $this->Place_of_Transit); // Place_of_Transit $this->AddSearchQueryString($sQry, $this->Address_of_Transit); // Address_of_Transit $this->AddSearchQueryString($sQry, $this->Town_of_transit); // Town_of_transit $this->AddSearchQueryString($sQry, $this->domicile_description); // domicile_description $this->AddSearchQueryString($sQry, $this->Disabled); // Disabled $this->AddSearchQueryString($sQry, $this->Sick); // Sick $this->AddSearchQueryString($sQry, $this->Alone); // Alone $this->AddSearchQueryString($sQry, $this->Elderly); // Elderly $this->AddSearchQueryString($sQry, $this->Family); // Family $this->AddSearchQueryString($sQry, $this->Householder); // Householder $this->AddSearchQueryString($sQry, $this->Householder_id); // Householder_id $this->AddSearchQueryString($sQry, $this->Householder_reltype); // Householder_reltype $this->AddSearchQueryString($sQry, $this->Ethnic_group); // Ethnic_group $this->AddSearchQueryString($sQry, $this->Known_languages); // Known_languages $this->AddSearchQueryString($sQry, $this->Title_of_study); // Title_of_study $this->AddSearchQueryString($sQry, $this->Poss_destination_country); // Poss_destination_country $this->AddSearchQueryString($sQry, $this->Document_type); // Document_type $this->AddSearchQueryString($sQry, $this->Document_number); // Document_number $this->AddSearchQueryString($sQry, $this->Document_release); // Document_release $this->AddSearchQueryString($sQry, $this->Document_expiry); // Document_expiry $this->AddSearchQueryString($sQry, $this->Document_nationality); // Document_nationality $this->AddSearchQueryString($sQry, $this->other_documents); // other_documents $this->AddSearchQueryString($sQry, $this->Final_evaluation); // Final_evaluation $this->AddSearchQueryString($sQry, $this->Notes); // Notes $this->AddSearchQueryString($sQry, $this->Interview_1); // Interview_1 $this->AddSearchQueryString($sQry, $this->interview1_date); // interview1_date $this->AddSearchQueryString($sQry, $this->Interview_2); // Interview_2 $this->AddSearchQueryString($sQry, $this->interview_2_date); // interview_2_date $this->AddSearchQueryString($sQry, $this->Interview_3); // Interview_3 $this->AddSearchQueryString($sQry, $this->interview_3_date); // interview_3_date $this->AddSearchQueryString($sQry, $this->Zone_of_Transit); // Zone_of_Transit $this->AddSearchQueryString($sQry, $this->Travel_number); // Travel_number $this->AddSearchQueryString($sQry, $this->Travel_arrival_date); // Travel_arrival_date $this->AddSearchQueryString($sQry, $this->Travel_arrival_time); // Travel_arrival_time $this->AddSearchQueryString($sQry, $this->num_family); // num_family $this->AddSearchQueryString($sQry, $this->speak_ENG); // speak_ENG $this->AddSearchQueryString($sQry, $this->speak_FRA); // speak_FRA $this->AddSearchQueryString($sQry, $this->speak_ARA); // speak_ARA $this->AddSearchQueryString($sQry, $this->speak_ITA); // speak_ITA $this->AddSearchQueryString($sQry, $this->lives_with); // lives_with $this->AddSearchQueryString($sQry, $this->family_know); // family_know $this->AddSearchQueryString($sQry, $this->date_of_entry_transit); // date_of_entry_transit $this->AddSearchQueryString($sQry, $this->marital_status); // marital_status $this->AddSearchQueryString($sQry, $this->consort_id); // consort_id $this->AddSearchQueryString($sQry, $this->consort_info); // consort_info $this->AddSearchQueryString($sQry, $this->other_fam_in_italy); // other_fam_in_italy $this->AddSearchQueryString($sQry, $this->other_fam_in_europe); // other_fam_in_europe $this->AddSearchQueryString($sQry, $this->where_lived); // where_lived $this->AddSearchQueryString($sQry, $this->medical_situation); // medical_situation $this->AddSearchQueryString($sQry, $this->social_situation); // social_situation $this->AddSearchQueryString($sQry, $this->abuse_suffered); // abuse_suffered $this->AddSearchQueryString($sQry, $this->abuse_description); // abuse_description $this->AddSearchQueryString($sQry, $this->work_done); // work_done $this->AddSearchQueryString($sQry, $this->military_service); // military_service $this->AddSearchQueryString($sQry, $this->itinerary); // itinerary $this->AddSearchQueryString($sQry, $this->convictions); // convictions $this->AddSearchQueryString($sQry, $this->requested_asylum); // requested_asylum $this->AddSearchQueryString($sQry, $this->resettlement_application); // resettlement_application $this->AddSearchQueryString($sQry, $this->resettlement_country); // resettlement_country $this->AddSearchQueryString($sQry, $this->reunion_application); // reunion_application $this->AddSearchQueryString($sQry, $this->reunion_country); // reunion_country $this->AddSearchQueryString($sQry, $this->belongs_to_organization); // belongs_to_organization $this->AddSearchQueryString($sQry, $this->organizations); // organizations $this->AddSearchQueryString($sQry, $this->presentations); // presentations $this->AddSearchQueryString($sQry, $this->report); // report // 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 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) { case "x_Nationality": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Nationality->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Nationality->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Nationality->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`id_nation` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Nationality, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Citizenship": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Citizenship->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Citizenship->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = "{filter}"; $this->Citizenship->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`id_nation` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Citizenship, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Religion": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Religion` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Religion` AS `LinkFld`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Religion` AS `LinkFld`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`Religion` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Religion, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Place_of_Residence": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Residence->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Residence->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Residence->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`id_nation` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Place_of_Residence, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Place_of_Transit": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Transit->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Transit->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation` AS `LinkFld`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Transit->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => "", "f0" => '`id_nation` = {filter_value}', "t0" => "200", "fn0" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Place_of_Transit, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; } } } // Setup AutoSuggest filters of a field function SetupAutoSuggestFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; if ($pageId == "list") { switch ($fld->FldVar) { } } elseif ($pageId == "extbs") { switch ($fld->FldVar) { case "x_Nationality": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_en` LIKE '{query_value}%'"; $this->Nationality->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation`, `desc_it` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_it` LIKE '{query_value}%'"; $this->Nationality->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_en` LIKE '{query_value}%'"; $this->Nationality->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Nationality, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; case "x_Citizenship": $sSqlWrk = ""; switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_en` LIKE '{query_value}%'"; $this->Citizenship->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation`, `desc_it` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_it` LIKE '{query_value}%'"; $this->Citizenship->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld` FROM `tnations`"; $sWhereWrk = "`desc_en` LIKE '{query_value}%'"; $this->Citizenship->LookupFilters = array(); break; } $fld->LookupFilters += array("s" => $sSqlWrk, "d" => ""); $sSqlWrk = ""; $this->Lookup_Selecting($this->Citizenship, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES; if ($sSqlWrk <> "") $fld->LookupFilters["s"] .= $sSqlWrk; break; } } } // Page Load event function Page_Load() { //echo "Page Load"; } // Page Unload event function Page_Unload() { //echo "Page Unload"; } // Page Redirecting event function Page_Redirecting(&$url) { // Example: //$url = "your URL"; } // Message Showing event // $type = ''|'success'|'failure'|'warning' function Message_Showing(&$msg, $type) { if ($type == 'success') { //$msg = "your success message"; } elseif ($type == 'failure') { //$msg = "your failure message"; } elseif ($type == 'warning') { //$msg = "your warning message"; } else { //$msg = "your message"; } } // Page Render event function Page_Render() { //echo "Page Render"; } // Page Data Rendering event function Page_DataRendering(&$header) { // Example: //$header = "your header"; } // Page Data Rendered event function Page_DataRendered(&$footer) { // Example: //$footer = "your footer"; } // Form Custom Validate event function Form_CustomValidate(&$CustomError) { // Return error message in CustomError return TRUE; } // 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 $tospiti_list->Page_Main(); // Global Page Rendering event (in userfn*.php) Page_Rendering(); // Page Rendering event $tospiti_list->Page_Render(); ?> Export == "") { ?>