UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token return $PageUrl; } // 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"]; } // Table object (users) if (!isset($GLOBALS['users'])) $GLOBALS['users'] = new cusers(); // Page ID if (!defined("EW_PAGE_ID")) define("EW_PAGE_ID", 'delete', 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); } } // // 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->CanDelete()) { $Security->SaveLastUrl(); $this->setFailureMessage(ew_DeniedMsg()); // Set no permission if ($Security->CanList()) $this->Page_Terminate(ew_GetUrl("tospitilist.php")); else $this->Page_Terminate(ew_GetUrl("login.php")); } $this->CurrentAction = (@$_GET["a"] <> "") ? $_GET["a"] : @$_POST["a_list"]; // Set up current action $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(); } // Create Token $this->CreateToken(); } // // 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(); } var $DbMasterFilter = ""; var $DbDetailFilter = ""; var $StartRec; var $TotalRecs = 0; var $RecCnt; var $RecKeys = array(); var $Recordset; var $StartRowCnt = 1; var $RowCnt = 0; // // Page main // function Page_Main() { global $Language; // Set up Breadcrumb $this->SetupBreadcrumb(); // Load key parameters $this->RecKeys = $this->GetRecordKeys(); // Load record keys $sFilter = $this->GetKeyFilter(); if ($sFilter == "") $this->Page_Terminate("tospitilist.php"); // Prevent SQL injection, return to list // Set up filter (SQL WHHERE clause) and get return SQL // SQL constructor in tospiti class, tospitiinfo.php $this->CurrentFilter = $sFilter; // Get action if (@$_POST["a_delete"] <> "") { $this->CurrentAction = $_POST["a_delete"]; } elseif (@$_GET["a_delete"] == "1") { $this->CurrentAction = "D"; // Delete record directly } else { $this->CurrentAction = "I"; // Display record } if ($this->CurrentAction == "D") { $this->SendEmail = TRUE; // Send email on delete success if ($this->DeleteRows()) { // Delete rows if ($this->getSuccessMessage() == "") $this->setSuccessMessage($Language->Phrase("DeleteSuccess")); // Set up success message $this->Page_Terminate($this->getReturnUrl()); // Return to caller } else { // Delete failed $this->CurrentAction = "I"; // Display record } } if ($this->CurrentAction == "I") { // Load records for display if ($this->Recordset = $this->LoadRecordset()) $this->TotalRecs = $this->Recordset->RecordCount(); // Get record count if ($this->TotalRecs <= 0) { // No record found, exit if ($this->Recordset) $this->Recordset->Close(); $this->Page_Terminate("tospitilist.php"); // Return to list } } } // Load recordset function LoadRecordset($offset = -1, $rowcnt = -1) { // Load List page SQL $sSql = $this->SelectSQL(); $conn = &$this->Connection(); // Load recordset $dbtype = ew_GetConnectionType($this->DBID); if ($this->UseSelectLimit) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; if ($dbtype == "MSSQL") { $rs = $conn->SelectLimit($sSql, $rowcnt, $offset, array("_hasOrderBy" => trim($this->getOrderBy()) || trim($this->getSessionOrderByList()))); } else { $rs = $conn->SelectLimit($sSql, $rowcnt, $offset); } $conn->raiseErrorFn = ''; } else { $rs = ew_LoadRecordset($sSql, $conn); } // Call Recordset Selected event $this->Recordset_Selected($rs); return $rs; } // Load row based on key values function LoadRow() { global $Security, $Language; $sFilter = $this->KeyFilter(); // Call Row Selecting event $this->Row_Selecting($sFilter); // Load SQL based on filter $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn = &$this->Connection(); $res = FALSE; $rs = ew_LoadRecordset($sSql, $conn); if ($rs && !$rs->EOF) { $res = TRUE; $this->LoadRowValues($rs); // Load row values $rs->Close(); } return $res; } // Load row values from recordset function LoadRowValues(&$rs) { if (!$rs || $rs->EOF) return; // Call Row Selected event $row = &$rs->fields; $this->Row_Selected($row); $this->idSeeker->setDbValue($rs->fields('idSeeker')); $this->Desk->setDbValue($rs->fields('Desk')); $this->UNHCR_code->setDbValue($rs->fields('UNHCR_code')); $this->Name->setDbValue($rs->fields('Name')); $this->Surname->setDbValue($rs->fields('Surname')); $this->BirthDate->setDbValue($rs->fields('BirthDate')); $this->BirthPlace->setDbValue($rs->fields('BirthPlace')); $this->Nationality->setDbValue($rs->fields('Nationality')); if (array_key_exists('EV__Nationality', $rs->fields)) { $this->Nationality->VirtualValue = $rs->fields('EV__Nationality'); // Set up virtual field value } else { $this->Nationality->VirtualValue = ""; // Clear value } $this->Citizenship->setDbValue($rs->fields('Citizenship')); if (array_key_exists('EV__Citizenship', $rs->fields)) { $this->Citizenship->VirtualValue = $rs->fields('EV__Citizenship'); // Set up virtual field value } else { $this->Citizenship->VirtualValue = ""; // Clear value } $this->Sex->setDbValue($rs->fields('Sex')); $this->Phone->setDbValue($rs->fields('Phone')); $this->_Email->setDbValue($rs->fields('Email')); $this->Religion->setDbValue($rs->fields('Religion')); $this->Place_of_Residence->setDbValue($rs->fields('Place_of_Residence')); if (array_key_exists('EV__Place_of_Residence', $rs->fields)) { $this->Place_of_Residence->VirtualValue = $rs->fields('EV__Place_of_Residence'); // Set up virtual field value } else { $this->Place_of_Residence->VirtualValue = ""; // Clear value } $this->Address_of_Residence->setDbValue($rs->fields('Address_of_Residence')); $this->Town_of_residence->setDbValue($rs->fields('Town_of_residence')); $this->Place_of_Transit->setDbValue($rs->fields('Place_of_Transit')); if (array_key_exists('EV__Place_of_Transit', $rs->fields)) { $this->Place_of_Transit->VirtualValue = $rs->fields('EV__Place_of_Transit'); // Set up virtual field value } else { $this->Place_of_Transit->VirtualValue = ""; // Clear value } $this->Address_of_Transit->setDbValue($rs->fields('Address_of_Transit')); $this->Town_of_transit->setDbValue($rs->fields('Town_of_transit')); $this->domicile_description->setDbValue($rs->fields('domicile_description')); $this->Disabled->setDbValue($rs->fields('Disabled')); $this->Sick->setDbValue($rs->fields('Sick')); $this->Alone->setDbValue($rs->fields('Alone')); $this->Elderly->setDbValue($rs->fields('Elderly')); $this->Family->setDbValue($rs->fields('Family')); $this->Householder->setDbValue($rs->fields('Householder')); $this->Householder_id->setDbValue($rs->fields('Householder_id')); if (array_key_exists('EV__Householder_id', $rs->fields)) { $this->Householder_id->VirtualValue = $rs->fields('EV__Householder_id'); // Set up virtual field value } else { $this->Householder_id->VirtualValue = ""; // Clear value } $this->Householder_reltype->setDbValue($rs->fields('Householder_reltype')); $this->Ethnic_group->setDbValue($rs->fields('Ethnic_group')); $this->Known_languages->setDbValue($rs->fields('Known_languages')); $this->Title_of_study->setDbValue($rs->fields('Title_of_study')); $this->Poss_destination_country->setDbValue($rs->fields('Poss_destination_country')); $this->Document_type->setDbValue($rs->fields('Document_type')); $this->Document_number->setDbValue($rs->fields('Document_number')); $this->Document_release->setDbValue($rs->fields('Document_release')); $this->Document_expiry->setDbValue($rs->fields('Document_expiry')); $this->Document_nationality->setDbValue($rs->fields('Document_nationality')); if (array_key_exists('EV__Document_nationality', $rs->fields)) { $this->Document_nationality->VirtualValue = $rs->fields('EV__Document_nationality'); // Set up virtual field value } else { $this->Document_nationality->VirtualValue = ""; // Clear value } $this->other_documents->setDbValue($rs->fields('other_documents')); $this->Final_evaluation->setDbValue($rs->fields('Final_evaluation')); $this->photo->Upload->DbValue = $rs->fields('photo'); $this->photo->CurrentValue = $this->photo->Upload->DbValue; $this->doc_image->Upload->DbValue = $rs->fields('doc_image'); $this->doc_image->CurrentValue = $this->doc_image->Upload->DbValue; $this->Notes->setDbValue($rs->fields('Notes')); $this->Interview_1->setDbValue($rs->fields('Interview_1')); $this->interview1_date->setDbValue($rs->fields('interview1_date')); $this->Interview_2->setDbValue($rs->fields('Interview_2')); $this->interview_2_date->setDbValue($rs->fields('interview_2_date')); $this->Interview_3->setDbValue($rs->fields('Interview_3')); $this->interview_3_date->setDbValue($rs->fields('interview_3_date')); $this->Zone_of_Transit->setDbValue($rs->fields('Zone_of_Transit')); $this->Travel_number->setDbValue($rs->fields('Travel_number')); $this->Travel_arrival_date->setDbValue($rs->fields('Travel_arrival_date')); $this->Travel_arrival_time->setDbValue($rs->fields('Travel_arrival_time')); $this->num_family->setDbValue($rs->fields('num_family')); $this->speak_ENG->setDbValue($rs->fields('speak_ENG')); $this->speak_FRA->setDbValue($rs->fields('speak_FRA')); $this->speak_ARA->setDbValue($rs->fields('speak_ARA')); $this->speak_ITA->setDbValue($rs->fields('speak_ITA')); $this->lives_with->setDbValue($rs->fields('lives_with')); $this->family_know->setDbValue($rs->fields('family_know')); $this->date_of_entry_transit->setDbValue($rs->fields('date_of_entry_transit')); $this->marital_status->setDbValue($rs->fields('marital_status')); $this->consort_id->setDbValue($rs->fields('consort_id')); $this->consort_info->setDbValue($rs->fields('consort_info')); $this->other_fam_in_italy->setDbValue($rs->fields('other_fam_in_italy')); $this->other_fam_in_europe->setDbValue($rs->fields('other_fam_in_europe')); $this->where_lived->setDbValue($rs->fields('where_lived')); $this->medical_situation->setDbValue($rs->fields('medical_situation')); $this->social_situation->setDbValue($rs->fields('social_situation')); $this->abuse_suffered->setDbValue($rs->fields('abuse_suffered')); $this->abuse_description->setDbValue($rs->fields('abuse_description')); $this->work_done->setDbValue($rs->fields('work_done')); $this->military_service->setDbValue($rs->fields('military_service')); $this->itinerary->setDbValue($rs->fields('itinerary')); $this->convictions->setDbValue($rs->fields('convictions')); $this->requested_asylum->setDbValue($rs->fields('requested_asylum')); $this->resettlement_application->setDbValue($rs->fields('resettlement_application')); $this->resettlement_country->setDbValue($rs->fields('resettlement_country')); $this->reunion_application->setDbValue($rs->fields('reunion_application')); $this->reunion_country->setDbValue($rs->fields('reunion_country')); $this->belongs_to_organization->setDbValue($rs->fields('belongs_to_organization')); $this->organizations->setDbValue($rs->fields('organizations')); $this->presentations->setDbValue($rs->fields('presentations')); $this->report->setDbValue($rs->fields('report')); } // Load DbValue from recordset function LoadDbValues(&$rs) { if (!$rs || !is_array($rs) && $rs->EOF) return; $row = is_array($rs) ? $rs : $rs->fields; $this->idSeeker->DbValue = $row['idSeeker']; $this->Desk->DbValue = $row['Desk']; $this->UNHCR_code->DbValue = $row['UNHCR_code']; $this->Name->DbValue = $row['Name']; $this->Surname->DbValue = $row['Surname']; $this->BirthDate->DbValue = $row['BirthDate']; $this->BirthPlace->DbValue = $row['BirthPlace']; $this->Nationality->DbValue = $row['Nationality']; $this->Citizenship->DbValue = $row['Citizenship']; $this->Sex->DbValue = $row['Sex']; $this->Phone->DbValue = $row['Phone']; $this->_Email->DbValue = $row['Email']; $this->Religion->DbValue = $row['Religion']; $this->Place_of_Residence->DbValue = $row['Place_of_Residence']; $this->Address_of_Residence->DbValue = $row['Address_of_Residence']; $this->Town_of_residence->DbValue = $row['Town_of_residence']; $this->Place_of_Transit->DbValue = $row['Place_of_Transit']; $this->Address_of_Transit->DbValue = $row['Address_of_Transit']; $this->Town_of_transit->DbValue = $row['Town_of_transit']; $this->domicile_description->DbValue = $row['domicile_description']; $this->Disabled->DbValue = $row['Disabled']; $this->Sick->DbValue = $row['Sick']; $this->Alone->DbValue = $row['Alone']; $this->Elderly->DbValue = $row['Elderly']; $this->Family->DbValue = $row['Family']; $this->Householder->DbValue = $row['Householder']; $this->Householder_id->DbValue = $row['Householder_id']; $this->Householder_reltype->DbValue = $row['Householder_reltype']; $this->Ethnic_group->DbValue = $row['Ethnic_group']; $this->Known_languages->DbValue = $row['Known_languages']; $this->Title_of_study->DbValue = $row['Title_of_study']; $this->Poss_destination_country->DbValue = $row['Poss_destination_country']; $this->Document_type->DbValue = $row['Document_type']; $this->Document_number->DbValue = $row['Document_number']; $this->Document_release->DbValue = $row['Document_release']; $this->Document_expiry->DbValue = $row['Document_expiry']; $this->Document_nationality->DbValue = $row['Document_nationality']; $this->other_documents->DbValue = $row['other_documents']; $this->Final_evaluation->DbValue = $row['Final_evaluation']; $this->photo->Upload->DbValue = $row['photo']; $this->doc_image->Upload->DbValue = $row['doc_image']; $this->Notes->DbValue = $row['Notes']; $this->Interview_1->DbValue = $row['Interview_1']; $this->interview1_date->DbValue = $row['interview1_date']; $this->Interview_2->DbValue = $row['Interview_2']; $this->interview_2_date->DbValue = $row['interview_2_date']; $this->Interview_3->DbValue = $row['Interview_3']; $this->interview_3_date->DbValue = $row['interview_3_date']; $this->Zone_of_Transit->DbValue = $row['Zone_of_Transit']; $this->Travel_number->DbValue = $row['Travel_number']; $this->Travel_arrival_date->DbValue = $row['Travel_arrival_date']; $this->Travel_arrival_time->DbValue = $row['Travel_arrival_time']; $this->num_family->DbValue = $row['num_family']; $this->speak_ENG->DbValue = $row['speak_ENG']; $this->speak_FRA->DbValue = $row['speak_FRA']; $this->speak_ARA->DbValue = $row['speak_ARA']; $this->speak_ITA->DbValue = $row['speak_ITA']; $this->lives_with->DbValue = $row['lives_with']; $this->family_know->DbValue = $row['family_know']; $this->date_of_entry_transit->DbValue = $row['date_of_entry_transit']; $this->marital_status->DbValue = $row['marital_status']; $this->consort_id->DbValue = $row['consort_id']; $this->consort_info->DbValue = $row['consort_info']; $this->other_fam_in_italy->DbValue = $row['other_fam_in_italy']; $this->other_fam_in_europe->DbValue = $row['other_fam_in_europe']; $this->where_lived->DbValue = $row['where_lived']; $this->medical_situation->DbValue = $row['medical_situation']; $this->social_situation->DbValue = $row['social_situation']; $this->abuse_suffered->DbValue = $row['abuse_suffered']; $this->abuse_description->DbValue = $row['abuse_description']; $this->work_done->DbValue = $row['work_done']; $this->military_service->DbValue = $row['military_service']; $this->itinerary->DbValue = $row['itinerary']; $this->convictions->DbValue = $row['convictions']; $this->requested_asylum->DbValue = $row['requested_asylum']; $this->resettlement_application->DbValue = $row['resettlement_application']; $this->resettlement_country->DbValue = $row['resettlement_country']; $this->reunion_application->DbValue = $row['reunion_application']; $this->reunion_country->DbValue = $row['reunion_country']; $this->belongs_to_organization->DbValue = $row['belongs_to_organization']; $this->organizations->DbValue = $row['organizations']; $this->presentations->DbValue = $row['presentations']; $this->report->DbValue = $row['report']; } // Render row values based on field settings function RenderRow() { global $Security, $Language, $gsLanguage; // Initialize URLs // Call Row_Rendering event $this->Row_Rendering(); // Common render codes for all row types // idSeeker // Desk // UNHCR_code // Name // Surname // BirthDate // BirthPlace // Nationality // Citizenship // Sex // Phone // Email // Religion // Place_of_Residence // Address_of_Residence // Town_of_residence // Place_of_Transit // Address_of_Transit // Town_of_transit // domicile_description // Disabled // Sick // Alone // Elderly // Family // Householder // Householder_id // Householder_reltype // Ethnic_group // Known_languages // Title_of_study // Poss_destination_country // Document_type // Document_number // Document_release // Document_expiry // Document_nationality // other_documents // Final_evaluation // photo // doc_image // Notes // Interview_1 // interview1_date // Interview_2 // interview_2_date // Interview_3 // interview_3_date // Zone_of_Transit // Travel_number // Travel_arrival_date // Travel_arrival_time // num_family // speak_ENG // speak_FRA // speak_ARA // speak_ITA // lives_with // family_know // date_of_entry_transit // marital_status // consort_id // consort_info // other_fam_in_italy // other_fam_in_europe // where_lived // medical_situation // social_situation // abuse_suffered // abuse_description // work_done // military_service // itinerary // convictions // requested_asylum // resettlement_application // resettlement_country // reunion_application // reunion_country // belongs_to_organization // organizations // presentations // report if ($this->RowType == EW_ROWTYPE_VIEW) { // View row // idSeeker $this->idSeeker->ViewValue = $this->idSeeker->CurrentValue; $this->idSeeker->ViewCustomAttributes = ""; // Desk $this->Desk->ViewValue = $this->Desk->CurrentValue; $this->Desk->ViewCustomAttributes = ""; // UNHCR_code $this->UNHCR_code->ViewValue = $this->UNHCR_code->CurrentValue; $this->UNHCR_code->ViewCustomAttributes = ""; // Name $this->Name->ViewValue = $this->Name->CurrentValue; $this->Name->ViewCustomAttributes = ""; // Surname $this->Surname->ViewValue = $this->Surname->CurrentValue; $this->Surname->ViewCustomAttributes = ""; // BirthDate $this->BirthDate->ViewValue = $this->BirthDate->CurrentValue; $this->BirthDate->ViewValue = ew_FormatDateTime($this->BirthDate->ViewValue, 7); $this->BirthDate->ViewCustomAttributes = ""; // BirthPlace $this->BirthPlace->ViewValue = $this->BirthPlace->CurrentValue; $this->BirthPlace->ViewCustomAttributes = ""; // Nationality if ($this->Nationality->VirtualValue <> "") { $this->Nationality->ViewValue = $this->Nationality->VirtualValue; } else { $this->Nationality->ViewValue = $this->Nationality->CurrentValue; if (strval($this->Nationality->CurrentValue) <> "") { $sFilterWrk = "`id_nation`" . ew_SearchString("=", $this->Nationality->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Nationality->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Nationality->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Nationality->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Nationality, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Nationality->ViewValue = $this->Nationality->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Nationality->ViewValue = $this->Nationality->CurrentValue; } } else { $this->Nationality->ViewValue = NULL; } } $this->Nationality->ViewCustomAttributes = ""; // Sex if (strval($this->Sex->CurrentValue) <> "") { $this->Sex->ViewValue = $this->Sex->OptionCaption($this->Sex->CurrentValue); } else { $this->Sex->ViewValue = NULL; } $this->Sex->ViewCustomAttributes = ""; // Phone $this->Phone->ViewValue = $this->Phone->CurrentValue; $this->Phone->ViewCustomAttributes = ""; // Email $this->_Email->ViewValue = $this->_Email->CurrentValue; $this->_Email->ViewCustomAttributes = ""; // Religion if (strval($this->Religion->CurrentValue) <> "") { $sFilterWrk = "`Religion`" . ew_SearchString("=", $this->Religion->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Religion`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Religion`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Religion`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `treligion`"; $sWhereWrk = ""; $this->Religion->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Religion, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Religion->ViewValue = $this->Religion->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Religion->ViewValue = $this->Religion->CurrentValue; } } else { $this->Religion->ViewValue = NULL; } $this->Religion->ViewCustomAttributes = ""; // Place_of_Residence if ($this->Place_of_Residence->VirtualValue <> "") { $this->Place_of_Residence->ViewValue = $this->Place_of_Residence->VirtualValue; } else { if (strval($this->Place_of_Residence->CurrentValue) <> "") { $sFilterWrk = "`id_nation`" . ew_SearchString("=", $this->Place_of_Residence->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `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`, `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`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Residence->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Place_of_Residence, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Place_of_Residence->ViewValue = $this->Place_of_Residence->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Place_of_Residence->ViewValue = $this->Place_of_Residence->CurrentValue; } } else { $this->Place_of_Residence->ViewValue = NULL; } } $this->Place_of_Residence->ViewCustomAttributes = ""; // Address_of_Residence $this->Address_of_Residence->ViewValue = $this->Address_of_Residence->CurrentValue; $this->Address_of_Residence->ViewCustomAttributes = ""; // Town_of_residence $this->Town_of_residence->ViewValue = $this->Town_of_residence->CurrentValue; $this->Town_of_residence->ViewCustomAttributes = ""; // Place_of_Transit if ($this->Place_of_Transit->VirtualValue <> "") { $this->Place_of_Transit->ViewValue = $this->Place_of_Transit->VirtualValue; } else { if (strval($this->Place_of_Transit->CurrentValue) <> "") { $sFilterWrk = "`id_nation`" . ew_SearchString("=", $this->Place_of_Transit->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `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`, `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`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Place_of_Transit->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Place_of_Transit, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Place_of_Transit->ViewValue = $this->Place_of_Transit->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Place_of_Transit->ViewValue = $this->Place_of_Transit->CurrentValue; } } else { $this->Place_of_Transit->ViewValue = NULL; } } $this->Place_of_Transit->ViewCustomAttributes = ""; // Address_of_Transit $this->Address_of_Transit->ViewValue = $this->Address_of_Transit->CurrentValue; $this->Address_of_Transit->ViewCustomAttributes = ""; // Town_of_transit $this->Town_of_transit->ViewValue = $this->Town_of_transit->CurrentValue; $this->Town_of_transit->ViewCustomAttributes = ""; // domicile_description $this->domicile_description->ViewValue = $this->domicile_description->CurrentValue; $this->domicile_description->ViewCustomAttributes = ""; // Disabled if (ew_ConvertToBool($this->Disabled->CurrentValue)) { $this->Disabled->ViewValue = $this->Disabled->FldTagCaption(1) <> "" ? $this->Disabled->FldTagCaption(1) : "Y"; } else { $this->Disabled->ViewValue = $this->Disabled->FldTagCaption(2) <> "" ? $this->Disabled->FldTagCaption(2) : "N"; } $this->Disabled->ViewCustomAttributes = ""; // Sick if (ew_ConvertToBool($this->Sick->CurrentValue)) { $this->Sick->ViewValue = $this->Sick->FldTagCaption(1) <> "" ? $this->Sick->FldTagCaption(1) : "Y"; } else { $this->Sick->ViewValue = $this->Sick->FldTagCaption(2) <> "" ? $this->Sick->FldTagCaption(2) : "N"; } $this->Sick->ViewCustomAttributes = ""; // Alone if (ew_ConvertToBool($this->Alone->CurrentValue)) { $this->Alone->ViewValue = $this->Alone->FldTagCaption(1) <> "" ? $this->Alone->FldTagCaption(1) : "Y"; } else { $this->Alone->ViewValue = $this->Alone->FldTagCaption(2) <> "" ? $this->Alone->FldTagCaption(2) : "N"; } $this->Alone->ViewCustomAttributes = ""; // Elderly if (ew_ConvertToBool($this->Elderly->CurrentValue)) { $this->Elderly->ViewValue = $this->Elderly->FldTagCaption(1) <> "" ? $this->Elderly->FldTagCaption(1) : "Y"; } else { $this->Elderly->ViewValue = $this->Elderly->FldTagCaption(2) <> "" ? $this->Elderly->FldTagCaption(2) : "N"; } $this->Elderly->ViewCustomAttributes = ""; // Family if (ew_ConvertToBool($this->Family->CurrentValue)) { $this->Family->ViewValue = $this->Family->FldTagCaption(1) <> "" ? $this->Family->FldTagCaption(1) : "Y"; } else { $this->Family->ViewValue = $this->Family->FldTagCaption(2) <> "" ? $this->Family->FldTagCaption(2) : "N"; } $this->Family->ViewCustomAttributes = ""; // Householder if (ew_ConvertToBool($this->Householder->CurrentValue)) { $this->Householder->ViewValue = $this->Householder->FldTagCaption(1) <> "" ? $this->Householder->FldTagCaption(1) : "Y"; } else { $this->Householder->ViewValue = $this->Householder->FldTagCaption(2) <> "" ? $this->Householder->FldTagCaption(2) : "N"; } $this->Householder->ViewCustomAttributes = ""; // Householder_id if ($this->Householder_id->VirtualValue <> "") { $this->Householder_id->ViewValue = $this->Householder_id->VirtualValue; } else { $this->Householder_id->ViewValue = $this->Householder_id->CurrentValue; if (strval($this->Householder_id->CurrentValue) <> "") { $sFilterWrk = "`idSeeker`" . ew_SearchString("=", $this->Householder_id->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `vhouseholders`"; $sWhereWrk = ""; $this->Householder_id->LookupFilters = array("dx1" => '`Name`', "dx2" => '`Surname`', "df3" => "0", "dx3" => ew_CastDateFieldForLike('`BirthDate`', 0, "DB"), "dx4" => '`BirthPlace`'); break; case "it": $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `vhouseholders`"; $sWhereWrk = ""; $this->Householder_id->LookupFilters = array("dx1" => '`Name`', "dx2" => '`Surname`', "df3" => "0", "dx3" => ew_CastDateFieldForLike('`BirthDate`', 0, "DB"), "dx4" => '`BirthPlace`'); break; default: $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `vhouseholders`"; $sWhereWrk = ""; $this->Householder_id->LookupFilters = array("dx1" => '`Name`', "dx2" => '`Surname`', "df3" => "0", "dx3" => ew_CastDateFieldForLike('`BirthDate`', 0, "DB"), "dx4" => '`BirthPlace`'); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Householder_id, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $arwrk[2] = $rswrk->fields('Disp2Fld'); $arwrk[3] = ew_FormatDateTime($rswrk->fields('Disp3Fld'), 0); $arwrk[4] = $rswrk->fields('Disp4Fld'); $this->Householder_id->ViewValue = $this->Householder_id->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Householder_id->ViewValue = $this->Householder_id->CurrentValue; } } else { $this->Householder_id->ViewValue = NULL; } } $this->Householder_id->ViewCustomAttributes = ""; // Householder_reltype if (strval($this->Householder_reltype->CurrentValue) <> "") { $sFilterWrk = "`family_rel`" . ew_SearchString("=", $this->Householder_reltype->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `family_rel`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tfamily_rel`"; $sWhereWrk = ""; $this->Householder_reltype->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `family_rel`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tfamily_rel`"; $sWhereWrk = ""; $this->Householder_reltype->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `family_rel`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tfamily_rel`"; $sWhereWrk = ""; $this->Householder_reltype->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Householder_reltype, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Householder_reltype->ViewValue = $this->Householder_reltype->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Householder_reltype->ViewValue = $this->Householder_reltype->CurrentValue; } } else { $this->Householder_reltype->ViewValue = NULL; } $this->Householder_reltype->ViewCustomAttributes = ""; // Ethnic_group $this->Ethnic_group->ViewValue = $this->Ethnic_group->CurrentValue; $this->Ethnic_group->ViewCustomAttributes = ""; // Known_languages $this->Known_languages->ViewValue = $this->Known_languages->CurrentValue; $this->Known_languages->ViewCustomAttributes = ""; // Title_of_study $this->Title_of_study->ViewValue = $this->Title_of_study->CurrentValue; $this->Title_of_study->ViewCustomAttributes = ""; // Poss_destination_country $this->Poss_destination_country->ViewValue = $this->Poss_destination_country->CurrentValue; $this->Poss_destination_country->ViewCustomAttributes = ""; // Document_type if (strval($this->Document_type->CurrentValue) <> "") { $sFilterWrk = "`Doc_type`" . ew_SearchString("=", $this->Document_type->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Doc_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tdoc_type`"; $sWhereWrk = ""; $this->Document_type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Doc_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tdoc_type`"; $sWhereWrk = ""; $this->Document_type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Doc_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tdoc_type`"; $sWhereWrk = ""; $this->Document_type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Document_type, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Document_type->ViewValue = $this->Document_type->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Document_type->ViewValue = $this->Document_type->CurrentValue; } } else { $this->Document_type->ViewValue = NULL; } $this->Document_type->ViewCustomAttributes = ""; // Document_number $this->Document_number->ViewValue = $this->Document_number->CurrentValue; $this->Document_number->ViewCustomAttributes = ""; // Document_release $this->Document_release->ViewValue = $this->Document_release->CurrentValue; $this->Document_release->ViewValue = ew_FormatDateTime($this->Document_release->ViewValue, 7); $this->Document_release->ViewCustomAttributes = ""; // Document_expiry $this->Document_expiry->ViewValue = $this->Document_expiry->CurrentValue; $this->Document_expiry->ViewValue = ew_FormatDateTime($this->Document_expiry->ViewValue, 7); $this->Document_expiry->ViewCustomAttributes = ""; // Document_nationality if ($this->Document_nationality->VirtualValue <> "") { $this->Document_nationality->ViewValue = $this->Document_nationality->VirtualValue; } else { if (strval($this->Document_nationality->CurrentValue) <> "") { $sFilterWrk = "`id_nation`" . ew_SearchString("=", $this->Document_nationality->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Document_nationality->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `id_nation`, `desc_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Document_nationality->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `id_nation`, `desc_en` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tnations`"; $sWhereWrk = ""; $this->Document_nationality->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Document_nationality, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Document_nationality->ViewValue = $this->Document_nationality->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Document_nationality->ViewValue = $this->Document_nationality->CurrentValue; } } else { $this->Document_nationality->ViewValue = NULL; } } $this->Document_nationality->ViewCustomAttributes = ""; // other_documents $this->other_documents->ViewValue = $this->other_documents->CurrentValue; $this->other_documents->ViewCustomAttributes = ""; // Final_evaluation if (strval($this->Final_evaluation->CurrentValue) <> "") { $sFilterWrk = "`Eval_type`" . ew_SearchString("=", $this->Final_evaluation->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Eval_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `teval_type`"; $sWhereWrk = ""; $this->Final_evaluation->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Eval_type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `teval_type`"; $sWhereWrk = ""; $this->Final_evaluation->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Eval_type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `teval_type`"; $sWhereWrk = ""; $this->Final_evaluation->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Final_evaluation, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk; $rswrk = Conn()->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $arwrk = array(); $arwrk[1] = $rswrk->fields('DispFld'); $this->Final_evaluation->ViewValue = $this->Final_evaluation->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Final_evaluation->ViewValue = $this->Final_evaluation->CurrentValue; } } else { $this->Final_evaluation->ViewValue = NULL; } $this->Final_evaluation->ViewCustomAttributes = ""; // Notes $this->Notes->ViewValue = $this->Notes->CurrentValue; $this->Notes->ViewCustomAttributes = ""; // Interview_1 if (ew_ConvertToBool($this->Interview_1->CurrentValue)) { $this->Interview_1->ViewValue = $this->Interview_1->FldTagCaption(1) <> "" ? $this->Interview_1->FldTagCaption(1) : "Y"; } else { $this->Interview_1->ViewValue = $this->Interview_1->FldTagCaption(2) <> "" ? $this->Interview_1->FldTagCaption(2) : "N"; } $this->Interview_1->ViewCustomAttributes = ""; // interview1_date $this->interview1_date->ViewValue = $this->interview1_date->CurrentValue; $this->interview1_date->ViewValue = ew_FormatDateTime($this->interview1_date->ViewValue, 0); $this->interview1_date->ViewCustomAttributes = ""; // Interview_2 if (ew_ConvertToBool($this->Interview_2->CurrentValue)) { $this->Interview_2->ViewValue = $this->Interview_2->FldTagCaption(1) <> "" ? $this->Interview_2->FldTagCaption(1) : "Y"; } else { $this->Interview_2->ViewValue = $this->Interview_2->FldTagCaption(2) <> "" ? $this->Interview_2->FldTagCaption(2) : "N"; } $this->Interview_2->ViewCustomAttributes = ""; // interview_2_date $this->interview_2_date->ViewValue = $this->interview_2_date->CurrentValue; $this->interview_2_date->ViewValue = ew_FormatDateTime($this->interview_2_date->ViewValue, 0); $this->interview_2_date->ViewCustomAttributes = ""; // Interview_3 if (ew_ConvertToBool($this->Interview_3->CurrentValue)) { $this->Interview_3->ViewValue = $this->Interview_3->FldTagCaption(1) <> "" ? $this->Interview_3->FldTagCaption(1) : "Y"; } else { $this->Interview_3->ViewValue = $this->Interview_3->FldTagCaption(2) <> "" ? $this->Interview_3->FldTagCaption(2) : "N"; } $this->Interview_3->ViewCustomAttributes = ""; // interview_3_date $this->interview_3_date->ViewValue = $this->interview_3_date->CurrentValue; $this->interview_3_date->ViewValue = ew_FormatDateTime($this->interview_3_date->ViewValue, 0); $this->interview_3_date->ViewCustomAttributes = ""; // Zone_of_Transit $this->Zone_of_Transit->ViewValue = $this->Zone_of_Transit->CurrentValue; $this->Zone_of_Transit->ViewCustomAttributes = ""; // Travel_number $this->Travel_number->ViewValue = $this->Travel_number->CurrentValue; $this->Travel_number->ViewCustomAttributes = ""; // Travel_arrival_date $this->Travel_arrival_date->ViewValue = $this->Travel_arrival_date->CurrentValue; $this->Travel_arrival_date->ViewValue = ew_FormatDateTime($this->Travel_arrival_date->ViewValue, 0); $this->Travel_arrival_date->ViewCustomAttributes = ""; // Travel_arrival_time $this->Travel_arrival_time->ViewValue = $this->Travel_arrival_time->CurrentValue; $this->Travel_arrival_time->ViewValue = ew_FormatDateTime($this->Travel_arrival_time->ViewValue, 4); $this->Travel_arrival_time->ViewCustomAttributes = ""; // num_family $this->num_family->ViewValue = $this->num_family->CurrentValue; $this->num_family->ViewCustomAttributes = ""; // speak_ENG if (ew_ConvertToBool($this->speak_ENG->CurrentValue)) { $this->speak_ENG->ViewValue = $this->speak_ENG->FldTagCaption(1) <> "" ? $this->speak_ENG->FldTagCaption(1) : "Y"; } else { $this->speak_ENG->ViewValue = $this->speak_ENG->FldTagCaption(2) <> "" ? $this->speak_ENG->FldTagCaption(2) : "N"; } $this->speak_ENG->ViewCustomAttributes = ""; // speak_FRA if (ew_ConvertToBool($this->speak_FRA->CurrentValue)) { $this->speak_FRA->ViewValue = $this->speak_FRA->FldTagCaption(1) <> "" ? $this->speak_FRA->FldTagCaption(1) : "Y"; } else { $this->speak_FRA->ViewValue = $this->speak_FRA->FldTagCaption(2) <> "" ? $this->speak_FRA->FldTagCaption(2) : "N"; } $this->speak_FRA->ViewCustomAttributes = ""; // speak_ARA if (ew_ConvertToBool($this->speak_ARA->CurrentValue)) { $this->speak_ARA->ViewValue = $this->speak_ARA->FldTagCaption(1) <> "" ? $this->speak_ARA->FldTagCaption(1) : "Y"; } else { $this->speak_ARA->ViewValue = $this->speak_ARA->FldTagCaption(2) <> "" ? $this->speak_ARA->FldTagCaption(2) : "N"; } $this->speak_ARA->ViewCustomAttributes = ""; // speak_ITA if (ew_ConvertToBool($this->speak_ITA->CurrentValue)) { $this->speak_ITA->ViewValue = $this->speak_ITA->FldTagCaption(1) <> "" ? $this->speak_ITA->FldTagCaption(1) : "Y"; } else { $this->speak_ITA->ViewValue = $this->speak_ITA->FldTagCaption(2) <> "" ? $this->speak_ITA->FldTagCaption(2) : "N"; } $this->speak_ITA->ViewCustomAttributes = ""; // lives_with $this->lives_with->ViewValue = $this->lives_with->CurrentValue; $this->lives_with->ViewCustomAttributes = ""; // family_know if (ew_ConvertToBool($this->family_know->CurrentValue)) { $this->family_know->ViewValue = $this->family_know->FldTagCaption(1) <> "" ? $this->family_know->FldTagCaption(1) : "Y"; } else { $this->family_know->ViewValue = $this->family_know->FldTagCaption(2) <> "" ? $this->family_know->FldTagCaption(2) : "N"; } $this->family_know->ViewCustomAttributes = ""; // date_of_entry_transit $this->date_of_entry_transit->ViewValue = $this->date_of_entry_transit->CurrentValue; $this->date_of_entry_transit->ViewValue = ew_FormatDateTime($this->date_of_entry_transit->ViewValue, 0); $this->date_of_entry_transit->ViewCustomAttributes = ""; // marital_status $this->marital_status->ViewValue = $this->marital_status->CurrentValue; $this->marital_status->ViewCustomAttributes = ""; // consort_id $this->consort_id->ViewValue = $this->consort_id->CurrentValue; $this->consort_id->ViewCustomAttributes = ""; // abuse_suffered if (ew_ConvertToBool($this->abuse_suffered->CurrentValue)) { $this->abuse_suffered->ViewValue = $this->abuse_suffered->FldTagCaption(1) <> "" ? $this->abuse_suffered->FldTagCaption(1) : "Y"; } else { $this->abuse_suffered->ViewValue = $this->abuse_suffered->FldTagCaption(2) <> "" ? $this->abuse_suffered->FldTagCaption(2) : "N"; } $this->abuse_suffered->ViewCustomAttributes = ""; // military_service $this->military_service->ViewValue = $this->military_service->CurrentValue; $this->military_service->ViewCustomAttributes = ""; // convictions if (ew_ConvertToBool($this->convictions->CurrentValue)) { $this->convictions->ViewValue = $this->convictions->FldTagCaption(1) <> "" ? $this->convictions->FldTagCaption(1) : "Y"; } else { $this->convictions->ViewValue = $this->convictions->FldTagCaption(2) <> "" ? $this->convictions->FldTagCaption(2) : "N"; } $this->convictions->ViewCustomAttributes = ""; // resettlement_application if (ew_ConvertToBool($this->resettlement_application->CurrentValue)) { $this->resettlement_application->ViewValue = $this->resettlement_application->FldTagCaption(1) <> "" ? $this->resettlement_application->FldTagCaption(1) : "Y"; } else { $this->resettlement_application->ViewValue = $this->resettlement_application->FldTagCaption(2) <> "" ? $this->resettlement_application->FldTagCaption(2) : "N"; } $this->resettlement_application->ViewCustomAttributes = ""; // resettlement_country $this->resettlement_country->ViewValue = $this->resettlement_country->CurrentValue; $this->resettlement_country->ViewCustomAttributes = ""; // reunion_application if (ew_ConvertToBool($this->reunion_application->CurrentValue)) { $this->reunion_application->ViewValue = $this->reunion_application->FldTagCaption(1) <> "" ? $this->reunion_application->FldTagCaption(1) : "Y"; } else { $this->reunion_application->ViewValue = $this->reunion_application->FldTagCaption(2) <> "" ? $this->reunion_application->FldTagCaption(2) : "N"; } $this->reunion_application->ViewCustomAttributes = ""; // reunion_country $this->reunion_country->ViewValue = $this->reunion_country->CurrentValue; $this->reunion_country->ViewCustomAttributes = ""; // belongs_to_organization if (ew_ConvertToBool($this->belongs_to_organization->CurrentValue)) { $this->belongs_to_organization->ViewValue = $this->belongs_to_organization->FldTagCaption(1) <> "" ? $this->belongs_to_organization->FldTagCaption(1) : "Y"; } else { $this->belongs_to_organization->ViewValue = $this->belongs_to_organization->FldTagCaption(2) <> "" ? $this->belongs_to_organization->FldTagCaption(2) : "N"; } $this->belongs_to_organization->ViewCustomAttributes = ""; // organizations $this->organizations->ViewValue = $this->organizations->CurrentValue; $this->organizations->ViewCustomAttributes = ""; // idSeeker $this->idSeeker->LinkCustomAttributes = ""; if (!ew_Empty($this->idSeeker->CurrentValue)) { $this->idSeeker->HrefValue = "tospitiview.php?showdetail=&idSeeker=" . $this->idSeeker->CurrentValue; // Add prefix/suffix $this->idSeeker->LinkAttrs["target"] = ""; // Add target if ($this->Export <> "") $this->idSeeker->HrefValue = ew_ConvertFullUrl($this->idSeeker->HrefValue); } else { $this->idSeeker->HrefValue = ""; } $this->idSeeker->TooltipValue = ""; // UNHCR_code $this->UNHCR_code->LinkCustomAttributes = ""; $this->UNHCR_code->HrefValue = ""; $this->UNHCR_code->TooltipValue = ""; // Name $this->Name->LinkCustomAttributes = ""; $this->Name->HrefValue = ""; $this->Name->TooltipValue = ""; // Surname $this->Surname->LinkCustomAttributes = ""; $this->Surname->HrefValue = ""; $this->Surname->TooltipValue = ""; // BirthDate $this->BirthDate->LinkCustomAttributes = ""; $this->BirthDate->HrefValue = ""; $this->BirthDate->TooltipValue = ""; // BirthPlace $this->BirthPlace->LinkCustomAttributes = ""; $this->BirthPlace->HrefValue = ""; $this->BirthPlace->TooltipValue = ""; // Nationality $this->Nationality->LinkCustomAttributes = ""; $this->Nationality->HrefValue = ""; $this->Nationality->TooltipValue = ""; // Sex $this->Sex->LinkCustomAttributes = ""; $this->Sex->HrefValue = ""; $this->Sex->TooltipValue = ""; // Householder $this->Householder->LinkCustomAttributes = ""; $this->Householder->HrefValue = ""; $this->Householder->TooltipValue = ""; // Travel_number $this->Travel_number->LinkCustomAttributes = ""; $this->Travel_number->HrefValue = ""; $this->Travel_number->TooltipValue = ""; } // Call Row Rendered event if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT) $this->Row_Rendered(); } // // Delete records based on current filter // function DeleteRows() { global $Language, $Security; if (!$Security->CanDelete()) { $this->setFailureMessage($Language->Phrase("NoDeletePermission")); // No delete permission return FALSE; } $DeleteRows = TRUE; $sSql = $this->SQL(); $conn = &$this->Connection(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } elseif ($rs->EOF) { $this->setFailureMessage($Language->Phrase("NoRecord")); // No record found $rs->Close(); return FALSE; //} else { // $this->LoadRowValues($rs); // Load row values } $rows = ($rs) ? $rs->GetRows() : array(); $conn->BeginTrans(); // Clone old rows $rsold = $rows; if ($rs) $rs->Close(); // Call row deleting event if ($DeleteRows) { foreach ($rsold as $row) { $DeleteRows = $this->Row_Deleting($row); if (!$DeleteRows) break; } } if ($DeleteRows) { $sKey = ""; foreach ($rsold as $row) { $sThisKey = ""; if ($sThisKey <> "") $sThisKey .= $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"]; $sThisKey .= $row['idSeeker']; $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $DeleteRows = $this->Delete($row); // Delete $conn->raiseErrorFn = ''; if ($DeleteRows === FALSE) break; if ($sKey <> "") $sKey .= ", "; $sKey .= $sThisKey; } } else { // Set up error message if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") { // Use the message, do nothing } elseif ($this->CancelMessage <> "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("DeleteCancelled")); } } if ($DeleteRows) { $conn->CommitTrans(); // Commit the changes } else { $conn->RollbackTrans(); // Rollback changes } // Call Row Deleted event if ($DeleteRows) { foreach ($rsold as $row) { $this->Row_Deleted($row); } } return $DeleteRows; } // Set up Breadcrumb function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/")+1); $Breadcrumb->Add("list", $this->TableVar, $this->AddMasterUrl("tospitilist.php"), "", $this->TableVar, TRUE); $PageId = "delete"; $Breadcrumb->Add("delete", $PageId, $url); } // Setup lookup filters of a field function SetupLookupFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; switch ($fld->FldVar) { } } // Setup AutoSuggest filters of a field function SetupAutoSuggestFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; switch ($fld->FldVar) { } } // Page Load event function Page_Load() { //echo "Page Load"; } // Page Unload event function Page_Unload() { //echo "Page Unload"; } // Page Redirecting event function Page_Redirecting(&$url) { // Example: //$url = "your URL"; } // Message Showing event // $type = ''|'success'|'failure'|'warning' function Message_Showing(&$msg, $type) { if ($type == 'success') { //$msg = "your success message"; } elseif ($type == 'failure') { //$msg = "your failure message"; } elseif ($type == 'warning') { //$msg = "your warning message"; } else { //$msg = "your message"; } } // Page Render event function Page_Render() { //echo "Page Render"; } // Page Data Rendering event function Page_DataRendering(&$header) { // Example: //$header = "your header"; } // Page Data Rendered event function Page_DataRendered(&$footer) { // Example: //$footer = "your footer"; } } ?> Page_Init(); // Page main $tospiti_delete->Page_Main(); // Global Page Rendering event (in userfn*.php) Page_Rendering(); // Page Rendering event $tospiti_delete->Page_Render(); ?> ShowPageHeader(); ?> ShowMessage(); ?> ShowPageFooter(); if (EW_DEBUG_ENABLED) echo ew_DebugMsg(); ?> Page_Terminate(); ?>