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

" . $sHeader . "

"; } } // Show Page Footer function ShowPageFooter() { $sFooter = $this->PageFooter; $this->Page_DataRendered($sFooter); if ($sFooter <> "") { // Footer exists, display echo "

" . $sFooter . "

"; } } // Validate page request function IsPageRequest() { global $objForm; if ($this->UseTokenInUrl) { if ($objForm) return ($this->TableVar == $objForm->GetValue("t")); if (@$_GET["t"] <> "") return ($this->TableVar == $_GET["t"]); } else { return TRUE; } } var $Token = ""; var $TokenTimeout = 0; var $CheckToken = EW_CHECK_TOKEN; var $CheckTokenFn = "ew_CheckToken"; var $CreateTokenFn = "ew_CreateToken"; // Valid Post function ValidPost() { if (!$this->CheckToken || !ew_IsHttpPost()) return TRUE; if (!isset($_POST[EW_TOKEN_NAME])) return FALSE; $fn = $this->CheckTokenFn; if (is_callable($fn)) return $fn($_POST[EW_TOKEN_NAME], $this->TokenTimeout); return FALSE; } // Create Token function CreateToken() { global $gsToken; if ($this->CheckToken) { $fn = $this->CreateTokenFn; if ($this->Token == "" && is_callable($fn)) // Create token $this->Token = $fn(); $gsToken = $this->Token; // Save to global variable } } // // Page class constructor // function __construct() { global $conn, $Language; global $UserTable, $UserTableConn; $GLOBALS["Page"] = &$this; $this->TokenTimeout = ew_SessionTimeoutTime(); // Language object if (!isset($Language)) $Language = new cLanguage(); // Parent constuctor parent::__construct(); // Table object (tassigment) if (!isset($GLOBALS["tassigment"]) || get_class($GLOBALS["tassigment"]) == "ctassigment") { $GLOBALS["tassigment"] = &$this; $GLOBALS["Table"] = &$GLOBALS["tassigment"]; } // 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 = "tassigmentadd.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 = "tassigmentdelete.php"; $this->MultiUpdateUrl = "tassigmentupdate.php"; // Table object (taccomodations) if (!isset($GLOBALS['taccomodations'])) $GLOBALS['taccomodations'] = new ctaccomodations(); // Table object (users) if (!isset($GLOBALS['users'])) $GLOBALS['users'] = new cusers(); // Table object (tospiti) if (!isset($GLOBALS['tospiti'])) $GLOBALS['tospiti'] = new ctospiti(); // 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", 'tassigment', 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 ftassigmentlistsrch"; // 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->idkAccomodation->SetVisibility(); $this->idkSeeker->SetVisibility(); $this->Date_ass->SetVisibility(); $this->Date_end->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 'tass_notes' if (@$_POST["grid"] == "ftass_notesgrid") { if (!isset($GLOBALS["tass_notes_grid"])) $GLOBALS["tass_notes_grid"] = new ctass_notes_grid; $GLOBALS["tass_notes_grid"]->Page_Init(); $this->Page_Terminate(); exit(); } $results = $this->GetAutoFill(@$_POST["name"], @$_POST["q"]); if ($results) { // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); echo $results; $this->Page_Terminate(); exit(); } } // Create Token $this->CreateToken(); // Set up master detail parameters $this->SetUpMasterParms(); // Setup other options $this->SetupOtherOptions(); // Set up custom action (compatible with old version) foreach ($this->CustomActions as $name => $action) $this->ListActions->Add($name, $action); // Show checkbox column if multiple action foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_MULTIPLE && $listaction->Allow) { $this->ListOptions->Items["checkbox"]->Visible = TRUE; break; } } } // // Page_Terminate // function Page_Terminate($url = "") { global $gsExportFile, $gTmpImages; // Page Unload event $this->Page_Unload(); // Global Page Unloaded event (in userfn*.php) Page_Unloaded(); // Export global $EW_EXPORT, $tassigment; 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($tassigment); $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 $tass_notes_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(); } // Set up sorting order $this->SetUpSortOrder(); } // Restore display records if ($this->getRecordsPerPage() <> "") { $this->DisplayRecs = $this->getRecordsPerPage(); // Restore from Session } else { $this->DisplayRecs = 20; // Load default } // Load Sorting Order $this->LoadSortOrder(); // Build filter $sFilter = ""; if (!$Security->CanList()) $sFilter = "(0=1)"; // Filter all records // Restore master/detail filter $this->DbMasterFilter = $this->GetMasterFilter(); // Restore master filter $this->DbDetailFilter = $this->GetDetailFilter(); // Restore detail filter ew_AddFilter($sFilter, $this->DbDetailFilter); ew_AddFilter($sFilter, $this->SearchWhere); // Load master record if ($this->CurrentMode <> "add" && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "tospiti") { global $tospiti; $rsmaster = $tospiti->LoadRs($this->DbMasterFilter); $this->MasterRecordExists = ($rsmaster && !$rsmaster->EOF); if (!$this->MasterRecordExists) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record found $this->Page_Terminate("tospitilist.php"); // Return to master page } else { $tospiti->LoadListRowValues($rsmaster); $tospiti->RowType = EW_ROWTYPE_MASTER; // Master row $tospiti->RenderListRow(); $rsmaster->Close(); } } // Load master record if ($this->CurrentMode <> "add" && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "taccomodations") { global $taccomodations; $rsmaster = $taccomodations->LoadRs($this->DbMasterFilter); $this->MasterRecordExists = ($rsmaster && !$rsmaster->EOF); if (!$this->MasterRecordExists) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record found $this->Page_Terminate("taccomodationslist.php"); // Return to master page } else { $taccomodations->LoadListRowValues($rsmaster); $taccomodations->RowType = EW_ROWTYPE_MASTER; // Master row $taccomodations->RenderListRow(); $rsmaster->Close(); } } // Set up filter in session $this->setSessionWhere($sFilter); $this->CurrentFilter = ""; // Export data only if ($this->CustomExport == "" && in_array($this->Export, array("html","word","excel","xml","csv","email","pdf"))) { $this->ExportData(); $this->Page_Terminate(); // Terminate response exit(); } // Load record count first if (!$this->IsAddOrEdit()) { $bSelectLimit = $this->UseSelectLimit; if ($bSelectLimit) { $this->TotalRecs = $this->SelectRecordCount(); } else { if ($this->Recordset = $this->LoadRecordset()) $this->TotalRecs = $this->Recordset->RecordCount(); } } // Search options $this->SetupSearchOptions(); } // Set up number of records displayed per page function SetUpDisplayRecs() { $sWrk = @$_GET[EW_TABLE_REC_PER_PAGE]; if ($sWrk <> "") { if (is_numeric($sWrk)) { $this->DisplayRecs = intval($sWrk); } else { if (strtolower($sWrk) == "all") { // Display all records $this->DisplayRecs = -1; } else { $this->DisplayRecs = 20; // Non-numeric, load default } } $this->setRecordsPerPage($this->DisplayRecs); // Save to Session // Reset start position $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); } } // Build filter for all keys function BuildKeyFilter() { global $objForm; $sWrkFilter = ""; // Update row index and get row key $rowindex = 1; $objForm->Index = $rowindex; $sThisKey = strval($objForm->GetValue($this->FormKeyName)); while ($sThisKey <> "") { if ($this->SetupKeyValues($sThisKey)) { $sFilter = $this->KeyFilter(); if ($sWrkFilter <> "") $sWrkFilter .= " OR "; $sWrkFilter .= $sFilter; } else { $sWrkFilter = "0=1"; break; } // Update row index and get row key $rowindex++; // Next row $objForm->Index = $rowindex; $sThisKey = strval($objForm->GetValue($this->FormKeyName)); } return $sWrkFilter; } // Set up key values function SetupKeyValues($key) { $arrKeyFlds = explode($GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"], $key); if (count($arrKeyFlds) >= 1) { $this->idAssigment->setFormValue($arrKeyFlds[0]); if (!is_numeric($this->idAssigment->FormValue)) return FALSE; } return TRUE; } // 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->idkAccomodation); // idkAccomodation $this->UpdateSort($this->idkSeeker); // idkSeeker $this->UpdateSort($this->Date_ass); // Date_ass $this->UpdateSort($this->Date_end); // Date_end $this->setStartRecordNumber(1); // Reset start position } } // Load sort order parameters function LoadSortOrder() { $sOrderBy = $this->getSessionOrderBy(); // Get ORDER BY from Session if ($sOrderBy == "") { if ($this->getSqlOrderBy() <> "") { $sOrderBy = $this->getSqlOrderBy(); $this->setSessionOrderBy($sOrderBy); } } } // Reset command // - cmd=reset (Reset search parameters) // - cmd=resetall (Reset search and master/detail parameters) // - cmd=resetsort (Reset sort parameters) function ResetCmd() { // Check if reset command if (substr($this->Command,0,5) == "reset") { // Reset master/detail keys if ($this->Command == "resetall") { $this->setCurrentMasterTable(""); // Clear master table $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; $this->idkSeeker->setSessionValue(""); $this->idkAccomodation->setSessionValue(""); } // Reset sorting order if ($this->Command == "resetsort") { $sOrderBy = ""; $this->setSessionOrderBy($sOrderBy); $this->setSessionOrderByList($sOrderBy); $this->idkAccomodation->setSort(""); $this->idkSeeker->setSort(""); $this->Date_ass->setSort(""); $this->Date_end->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_tass_notes" $item = &$this->ListOptions->Add("detail_tass_notes"); $item->CssStyle = "white-space: nowrap;"; $item->Visible = $Security->AllowList(CurrentProjectID() . 'tass_notes') && !$this->ShowMultipleDetails; $item->OnLeft = FALSE; $item->ShowInButtonGroup = FALSE; if (!isset($GLOBALS["tass_notes_grid"])) $GLOBALS["tass_notes_grid"] = new ctass_notes_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("tass_notes"); $this->DetailPages = $pages; // List actions $item = &$this->ListOptions->Add("listactions"); $item->CssStyle = "white-space: nowrap;"; $item->OnLeft = FALSE; $item->Visible = FALSE; $item->ShowInButtonGroup = FALSE; $item->ShowInDropDown = FALSE; // "checkbox" $item = &$this->ListOptions->Add("checkbox"); $item->Visible = FALSE; $item->OnLeft = FALSE; $item->Header = ""; $item->ShowInDropDown = FALSE; $item->ShowInButtonGroup = FALSE; // Drop down button for ListOptions $this->ListOptions->UseImageAndText = TRUE; $this->ListOptions->UseDropDownButton = FALSE; $this->ListOptions->DropDownButtonPhrase = $Language->Phrase("ButtonListOptions"); $this->ListOptions->UseButtonGroup = TRUE; if ($this->ListOptions->UseButtonGroup && ew_IsMobile()) $this->ListOptions->UseDropDownButton = TRUE; $this->ListOptions->ButtonClass = "btn-sm"; // Class for button group // Call ListOptions_Load event $this->ListOptions_Load(); $this->SetupListOptionsExt(); $item = &$this->ListOptions->GetItem($this->ListOptions->GroupOptionName); $item->Visible = $this->ListOptions->GroupOptionVisible(); } // Render list options function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // "view" $oListOpt = &$this->ListOptions->Items["view"]; $viewcaption = ew_HtmlTitle($Language->Phrase("ViewLink")); if ($Security->CanView()) { $oListOpt->Body = "ViewUrl) . "\">" . $Language->Phrase("ViewLink") . ""; } else { $oListOpt->Body = ""; } // "edit" $oListOpt = &$this->ListOptions->Items["edit"]; $editcaption = ew_HtmlTitle($Language->Phrase("EditLink")); if ($Security->CanEdit()) { $oListOpt->Body = "Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . ""; } else { $oListOpt->Body = ""; } // "delete" $oListOpt = &$this->ListOptions->Items["delete"]; if ($Security->CanDelete()) $oListOpt->Body = "Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . ""; else $oListOpt->Body = ""; // Set up list action buttons $oListOpt = &$this->ListOptions->GetItem("listactions"); if ($oListOpt && $this->Export == "" && $this->CurrentAction == "") { $body = ""; $links = array(); foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) { $action = $listaction->Action; $caption = $listaction->Caption; $icon = ($listaction->Icon <> "") ? "Icon)) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"> " : ""; $links[] = "
  • KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "
  • "; if (count($links) == 1) // Single button $body = "KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . ""; } } if (count($links) > 1) { // More than one buttons, use dropdown $body = ""; $content = ""; foreach ($links as $link) $content .= "
  • " . $link . "
  • "; $body .= ""; $body = "
    " . $body . "
    "; } if (count($links) > 0) { $oListOpt->Body = $body; $oListOpt->Visible = TRUE; } } $DetailViewTblVar = ""; $DetailCopyTblVar = ""; $DetailEditTblVar = ""; // "detail_tass_notes" $oListOpt = &$this->ListOptions->Items["detail_tass_notes"]; if ($Security->AllowList(CurrentProjectID() . 'tass_notes')) { $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("tass_notes", "TblCaption"); $body .= str_replace("%c", $this->tass_notes_Count, $Language->Phrase("DetailCount")); $body = "idAssigment->CurrentValue)) . "") . "\">" . $body . ""; $links = ""; if ($GLOBALS["tass_notes_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'tass_notes')) { $links .= "
  • Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=tass_notes")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "
  • "; if ($DetailViewTblVar <> "") $DetailViewTblVar .= ","; $DetailViewTblVar .= "tass_notes"; } if ($GLOBALS["tass_notes_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'tass_notes')) { $links .= "
  • Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=tass_notes")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "
  • "; if ($DetailEditTblVar <> "") $DetailEditTblVar .= ","; $DetailEditTblVar .= "tass_notes"; } if ($links <> "") { $body .= ""; $body .= ""; } $body = "
    " . $body . "
    "; $oListOpt->Body = $body; if ($this->ShowMultipleDetails) $oListOpt->Visible = FALSE; } if ($this->ShowMultipleDetails) { $body = $Language->Phrase("MultipleMasterDetails"); $body = "
    "; $links = ""; if ($DetailViewTblVar <> "") { $links .= "
  • Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "
  • "; } if ($DetailEditTblVar <> "") { $links .= "
  • Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "
  • "; } if ($DetailCopyTblVar <> "") { $links .= "
  • Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "
  • "; } if ($links <> "") { $body .= ""; $body .= ""; } $body .= "
    "; // Multiple details $oListOpt = &$this->ListOptions->Items["details"]; $oListOpt->Body = $body; } // "checkbox" $oListOpt = &$this->ListOptions->Items["checkbox"]; $oListOpt->Body = "idAssigment->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>"; $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); } // Set up other options function SetupOtherOptions() { global $Language, $Security; $options = &$this->OtherOptions; $option = $options["addedit"]; // Add $item = &$option->Add("add"); $addcaption = ew_HtmlTitle($Language->Phrase("AddLink")); $item->Body = "AddUrl) . "\">" . $Language->Phrase("AddLink") . ""; $item->Visible = ($this->AddUrl <> "" && $Security->CanAdd()); $option = $options["detail"]; $DetailTableLink = ""; $item = &$option->Add("detailadd_tass_notes"); $url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . "=tass_notes"); $caption = $Language->Phrase("Add") . " " . $this->TableCaption() . "/" . $GLOBALS["tass_notes"]->TableCaption(); $item->Body = "" . $caption . ""; $item->Visible = ($GLOBALS["tass_notes"]->DetailAdd && $Security->AllowAdd(CurrentProjectID() . 'tass_notes') && $Security->CanAdd()); if ($item->Visible) { if ($DetailTableLink <> "") $DetailTableLink .= ","; $DetailTableLink .= "tass_notes"; } // Add multiple details if ($this->ShowMultipleDetails) { $item = &$option->Add("detailsadd"); $url = $this->GetAddUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailTableLink); $item->Body = "Phrase("AddMasterDetailLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("AddMasterDetailLink")) . "\" href=\"" . ew_HtmlEncode($url) . "\">" . $Language->Phrase("AddMasterDetailLink") . ""; $item->Visible = ($DetailTableLink <> "" && $Security->CanAdd()); // Hide single master/detail items $ar = explode(",", $DetailTableLink); $cnt = count($ar); for ($i = 0; $i < $cnt; $i++) { if ($item = &$option->GetItem("detailadd_" . $ar[$i])) $item->Visible = FALSE; } } $option = $options["action"]; // Set up options default foreach ($options as &$option) { $option->UseImageAndText = TRUE; $option->UseDropDownButton = TRUE; $option->UseButtonGroup = TRUE; $option->ButtonClass = "btn-sm"; // Class for button group $item = &$option->Add($option->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } $options["addedit"]->DropDownButtonPhrase = $Language->Phrase("ButtonAddEdit"); $options["detail"]->DropDownButtonPhrase = $Language->Phrase("ButtonDetails"); $options["action"]->DropDownButtonPhrase = $Language->Phrase("ButtonActions"); // Filter button $item = &$this->FilterOptions->Add("savecurrentfilter"); $item->Body = "" . $Language->Phrase("SaveCurrentFilter") . ""; $item->Visible = FALSE; $item = &$this->FilterOptions->Add("deletefilter"); $item->Body = "" . $Language->Phrase("DeleteFilter") . ""; $item->Visible = FALSE; $this->FilterOptions->UseDropDownButton = TRUE; $this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton; $this->FilterOptions->DropDownButtonPhrase = $Language->Phrase("Filters"); // Add group option item $item = &$this->FilterOptions->Add($this->FilterOptions->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } // Render other options function RenderOtherOptions() { global $Language, $Security; $options = &$this->OtherOptions; $option = &$options["action"]; // Set up list action buttons foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_MULTIPLE) { $item = &$option->Add("custom_" . $listaction->Action); $caption = $listaction->Caption; $icon = ($listaction->Icon <> "") ? "Icon) . "\" data-caption=\"" . ew_HtmlEncode($caption) . "\"> " : $caption; $item->Body = "ToJson(TRUE) . "));return false;\">" . $icon . ""; $item->Visible = $listaction->Allow; } } // Hide grid edit and other options if ($this->TotalRecs <= 0) { $option = &$options["addedit"]; $item = &$option->GetItem("gridedit"); if ($item) $item->Visible = FALSE; $option = &$options["action"]; $option->HideAllOptions(); } } // Process list action function ProcessListAction() { global $Language, $Security; $userlist = ""; $user = ""; $sFilter = $this->GetKeyFilter(); $UserAction = @$_POST["useraction"]; if ($sFilter <> "" && $UserAction <> "") { // Check permission first $ActionCaption = $UserAction; if (array_key_exists($UserAction, $this->ListActions->Items)) { $ActionCaption = $this->ListActions->Items[$UserAction]->Caption; if (!$this->ListActions->Items[$UserAction]->Allow) { $errmsg = str_replace('%s', $ActionCaption, $Language->Phrase("CustomActionNotAllowed")); if (@$_POST["ajax"] == $UserAction) // Ajax echo "

    " . $errmsg . "

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

    " . $this->getSuccessMessage() . "

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

    " . $this->getFailureMessage() . "

    "; $this->ClearFailureMessage(); // Clear message } return TRUE; } } return FALSE; // Not ajax request } // Set up search options function SetupSearchOptions() { global $Language; $this->SearchOptions = new cListOptions(); $this->SearchOptions->Tag = "div"; $this->SearchOptions->TagClassName = "ewSearchOption"; // 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 = "`idkAssignment`=" . ew_AdjustSql($this->idAssigment->CurrentValue, $this->DBID) . ""; // Column "detail_tass_notes" if ($this->DetailPages->Items["tass_notes"]->Visible) { $link = ""; $option = &$this->ListOptions->Items["detail_tass_notes"]; $url = "tass_notespreview.php?t=tassigment&f=" . ew_Encrypt($sSqlWrk); $btngrp = "
    "; if ($Security->AllowList(CurrentProjectID() . 'tass_notes')) { $label = $Language->TablePhrase("tass_notes", "TblCaption"); $label .= " " . ew_JsEncode2(str_replace("%c", $this->tass_notes_Count, $Language->Phrase("DetailCount"))); $link = "
  • " . $label . "
  • "; $links .= $link; $detaillnk = ew_JsEncode3("tass_noteslist.php?" . EW_TABLE_SHOW_MASTER . "=tassigment&fk_idAssigment=" . urlencode(strval($this->idAssigment->CurrentValue)) . ""); $btngrp .= ""; } if ($GLOBALS["tass_notes_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'tass_notes')) $btngrp .= ""; if ($GLOBALS["tass_notes_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'tass_notes')) $btngrp .= ""; $btngrp .= "
    "; if ($link <> "") { $btngrps .= $btngrp; $option->Body .= "
    " . $link . $btngrp . "
    "; } } // Hide detail items if necessary $this->ListOptions->HideDetailItemsForDropDown(); // Column "preview" $option = &$this->ListOptions->GetItem("preview"); if (!$option) { // Add preview column $option = &$this->ListOptions->Add("preview"); $option->OnLeft = FALSE; if ($option->OnLeft) { $option->MoveTo($this->ListOptions->ItemPos("checkbox") + 1); } else { $option->MoveTo($this->ListOptions->ItemPos("checkbox")); } $option->Visible = !($this->Export <> "" || $this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit"); $option->ShowInDropDown = FALSE; $option->ShowInButtonGroup = FALSE; } if ($option) { $option->Body = ""; $option->Body .= "
    " . $links . $btngrps . "
    "; if ($option->Visible) $option->Visible = $links <> ""; } // Column "details" (Multiple details) $option = &$this->ListOptions->GetItem("details"); if ($option) { $option->Body .= "
    " . $links . $btngrps . "
    "; if ($option->Visible) $option->Visible = $links <> ""; } } // Set up starting record parameters function SetUpStartRec() { if ($this->DisplayRecs == 0) return; if ($this->IsPageRequest()) { // Validate request if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter $this->StartRec = $_GET[EW_TABLE_START_REC]; $this->setStartRecordNumber($this->StartRec); } elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") { $PageNo = $_GET[EW_TABLE_PAGE_NO]; if (is_numeric($PageNo)) { $this->StartRec = ($PageNo-1)*$this->DisplayRecs+1; if ($this->StartRec <= 0) { $this->StartRec = 1; } elseif ($this->StartRec >= intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1) { $this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; } $this->setStartRecordNumber($this->StartRec); } } } $this->StartRec = $this->getStartRecordNumber(); // Check if correct start record counter if (!is_numeric($this->StartRec) || $this->StartRec == "") { // Avoid invalid start record counter $this->StartRec = 1; // Reset start record counter $this->setStartRecordNumber($this->StartRec); } elseif (intval($this->StartRec) > intval($this->TotalRecs)) { // Avoid starting record > total records $this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to last page first record $this->setStartRecordNumber($this->StartRec); } elseif (($this->StartRec-1) % $this->DisplayRecs <> 0) { $this->StartRec = intval(($this->StartRec-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to page boundary $this->setStartRecordNumber($this->StartRec); } } // Load 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->idAssigment->setDbValue($rs->fields('idAssigment')); $this->idkAccomodation->setDbValue($rs->fields('idkAccomodation')); if (array_key_exists('EV__idkAccomodation', $rs->fields)) { $this->idkAccomodation->VirtualValue = $rs->fields('EV__idkAccomodation'); // Set up virtual field value } else { $this->idkAccomodation->VirtualValue = ""; // Clear value } $this->idkSeeker->setDbValue($rs->fields('idkSeeker')); if (array_key_exists('EV__idkSeeker', $rs->fields)) { $this->idkSeeker->VirtualValue = $rs->fields('EV__idkSeeker'); // Set up virtual field value } else { $this->idkSeeker->VirtualValue = ""; // Clear value } $this->Date_ass->setDbValue($rs->fields('Date_ass')); $this->Date_end->setDbValue($rs->fields('Date_end')); if (!isset($GLOBALS["tass_notes_grid"])) $GLOBALS["tass_notes_grid"] = new ctass_notes_grid; $sDetailFilter = $GLOBALS["tass_notes"]->SqlDetailFilter_tassigment(); $sDetailFilter = str_replace("@idkAssignment@", ew_AdjustSql($this->idAssigment->DbValue, "DB"), $sDetailFilter); $GLOBALS["tass_notes"]->setCurrentMasterTable("tassigment"); $sDetailFilter = $GLOBALS["tass_notes"]->ApplyUserIDFilters($sDetailFilter); $this->tass_notes_Count = $GLOBALS["tass_notes"]->LoadRecordCount($sDetailFilter); } // Load DbValue from recordset function LoadDbValues(&$rs) { if (!$rs || !is_array($rs) && $rs->EOF) return; $row = is_array($rs) ? $rs : $rs->fields; $this->idAssigment->DbValue = $row['idAssigment']; $this->idkAccomodation->DbValue = $row['idkAccomodation']; $this->idkSeeker->DbValue = $row['idkSeeker']; $this->Date_ass->DbValue = $row['Date_ass']; $this->Date_end->DbValue = $row['Date_end']; } // Load old record function LoadOldRecord() { // Load key values from Session $bValidKey = TRUE; if (strval($this->getKey("idAssigment")) <> "") $this->idAssigment->CurrentValue = $this->getKey("idAssigment"); // idAssigment else $bValidKey = FALSE; // Load old recordset if ($bValidKey) { $this->CurrentFilter = $this->KeyFilter(); $sSql = $this->SQL(); $conn = &$this->Connection(); $this->OldRecordset = ew_LoadRecordset($sSql, $conn); $this->LoadRowValues($this->OldRecordset); // Load row values } else { $this->OldRecordset = NULL; } return $bValidKey; } // Render row values based on field settings function RenderRow() { global $Security, $Language, $gsLanguage; // Initialize URLs $this->ViewUrl = $this->GetViewUrl(); $this->EditUrl = $this->GetEditUrl(); $this->InlineEditUrl = $this->GetInlineEditUrl(); $this->CopyUrl = $this->GetCopyUrl(); $this->InlineCopyUrl = $this->GetInlineCopyUrl(); $this->DeleteUrl = $this->GetDeleteUrl(); // Call Row_Rendering event $this->Row_Rendering(); // Common render codes for all row types // idAssigment // idkAccomodation // idkSeeker // Date_ass // Date_end if ($this->RowType == EW_ROWTYPE_VIEW) { // View row // idAssigment $this->idAssigment->ViewValue = $this->idAssigment->CurrentValue; $this->idAssigment->ViewCustomAttributes = ""; // idkAccomodation if ($this->idkAccomodation->VirtualValue <> "") { $this->idkAccomodation->ViewValue = $this->idkAccomodation->VirtualValue; } else { $this->idkAccomodation->ViewValue = $this->idkAccomodation->CurrentValue; if (strval($this->idkAccomodation->CurrentValue) <> "") { $sFilterWrk = "`idAccomodation`" . ew_SearchString("=", $this->idkAccomodation->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idAccomodation`, `Town` AS `DispFld`, `Address` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccomodations`"; $sWhereWrk = ""; $this->idkAccomodation->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `idAccomodation`, `Town` AS `DispFld`, `Address` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccomodations`"; $sWhereWrk = ""; $this->idkAccomodation->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `idAccomodation`, `Town` AS `DispFld`, `Address` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `taccomodations`"; $sWhereWrk = ""; $this->idkAccomodation->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idkAccomodation, $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'); $this->idkAccomodation->ViewValue = $this->idkAccomodation->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idkAccomodation->ViewValue = $this->idkAccomodation->CurrentValue; } } else { $this->idkAccomodation->ViewValue = NULL; } } $this->idkAccomodation->ViewCustomAttributes = ""; // idkSeeker if ($this->idkSeeker->VirtualValue <> "") { $this->idkSeeker->ViewValue = $this->idkSeeker->VirtualValue; } else { $this->idkSeeker->ViewValue = $this->idkSeeker->CurrentValue; if (strval($this->idkSeeker->CurrentValue) <> "") { $sFilterWrk = "`idSeeker`" . ew_SearchString("=", $this->idkSeeker->CurrentValue, EW_DATATYPE_NUMBER, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `tospiti`"; $sWhereWrk = ""; $this->idkSeeker->LookupFilters = array("df3" => "7"); break; case "it": $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `tospiti`"; $sWhereWrk = ""; $this->idkSeeker->LookupFilters = array("df3" => "7"); break; default: $sSqlWrk = "SELECT `idSeeker`, `Name` AS `DispFld`, `Surname` AS `Disp2Fld`, `BirthDate` AS `Disp3Fld`, `BirthPlace` AS `Disp4Fld` FROM `tospiti`"; $sWhereWrk = ""; $this->idkSeeker->LookupFilters = array("df3" => "7"); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->idkSeeker, $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'), 7); $arwrk[4] = $rswrk->fields('Disp4Fld'); $this->idkSeeker->ViewValue = $this->idkSeeker->DisplayValue($arwrk); $rswrk->Close(); } else { $this->idkSeeker->ViewValue = $this->idkSeeker->CurrentValue; } } else { $this->idkSeeker->ViewValue = NULL; } } $this->idkSeeker->ViewCustomAttributes = ""; // Date_ass $this->Date_ass->ViewValue = $this->Date_ass->CurrentValue; $this->Date_ass->ViewValue = ew_FormatDateTime($this->Date_ass->ViewValue, 7); $this->Date_ass->ViewCustomAttributes = ""; // Date_end $this->Date_end->ViewValue = $this->Date_end->CurrentValue; $this->Date_end->ViewValue = ew_FormatDateTime($this->Date_end->ViewValue, 7); $this->Date_end->ViewCustomAttributes = ""; // idkAccomodation $this->idkAccomodation->LinkCustomAttributes = ""; if (!ew_Empty($this->idkAccomodation->CurrentValue)) { $this->idkAccomodation->HrefValue = "taccomodationsview.php?showdetail=&idAccomodation=" . $this->idkAccomodation->CurrentValue; // Add prefix/suffix $this->idkAccomodation->LinkAttrs["target"] = "_self"; // Add target if ($this->Export <> "") $this->idkAccomodation->HrefValue = ew_ConvertFullUrl($this->idkAccomodation->HrefValue); } else { $this->idkAccomodation->HrefValue = ""; } $this->idkAccomodation->TooltipValue = ""; // idkSeeker $this->idkSeeker->LinkCustomAttributes = ""; if (!ew_Empty($this->idkSeeker->CurrentValue)) { $this->idkSeeker->HrefValue = "tospitiview.php?showdetail=&idSeeker=" . $this->idkSeeker->CurrentValue; // Add prefix/suffix $this->idkSeeker->LinkAttrs["target"] = "_self"; // Add target if ($this->Export <> "") $this->idkSeeker->HrefValue = ew_ConvertFullUrl($this->idkSeeker->HrefValue); } else { $this->idkSeeker->HrefValue = ""; } $this->idkSeeker->TooltipValue = ""; // Date_ass $this->Date_ass->LinkCustomAttributes = ""; $this->Date_ass->HrefValue = ""; $this->Date_ass->TooltipValue = ""; // Date_end $this->Date_end->LinkCustomAttributes = ""; $this->Date_end->HrefValue = ""; $this->Date_end->TooltipValue = ""; } // Call Row Rendered event if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT) $this->Row_Rendered(); } // Set up export options function SetupExportOptions() { global $Language; // Printer friendly $item = &$this->ExportOptions->Add("print"); $item->Body = "ExportPrintUrl . "\" class=\"ewExportLink ewPrint\" title=\"" . ew_HtmlEncode($Language->Phrase("PrinterFriendlyText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("PrinterFriendlyText")) . "\">" . $Language->Phrase("PrinterFriendly") . ""; $item->Visible = TRUE; // Export to Excel $item = &$this->ExportOptions->Add("excel"); $item->Body = "ExportExcelUrl . "\" class=\"ewExportLink ewExcel\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToExcelText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToExcelText")) . "\">" . $Language->Phrase("ExportToExcel") . ""; $item->Visible = TRUE; // Export to Word $item = &$this->ExportOptions->Add("word"); $item->Body = "ExportWordUrl . "\" class=\"ewExportLink ewWord\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToWordText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToWordText")) . "\">" . $Language->Phrase("ExportToWord") . ""; $item->Visible = TRUE; // Export to Html $item = &$this->ExportOptions->Add("html"); $item->Body = "ExportHtmlUrl . "\" class=\"ewExportLink ewHtml\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToHtmlText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToHtmlText")) . "\">" . $Language->Phrase("ExportToHtml") . ""; $item->Visible = TRUE; // Export to Xml $item = &$this->ExportOptions->Add("xml"); $item->Body = "ExportXmlUrl . "\" class=\"ewExportLink ewXml\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToXmlText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToXmlText")) . "\">" . $Language->Phrase("ExportToXml") . ""; $item->Visible = FALSE; // Export to Csv $item = &$this->ExportOptions->Add("csv"); $item->Body = "ExportCsvUrl . "\" class=\"ewExportLink ewCsv\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToCsvText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToCsvText")) . "\">" . $Language->Phrase("ExportToCsv") . ""; $item->Visible = TRUE; // Export to Pdf $item = &$this->ExportOptions->Add("pdf"); $item->Body = "ExportPdfUrl . "\" class=\"ewExportLink ewPdf\" title=\"" . ew_HtmlEncode($Language->Phrase("ExportToPDFText")) . "\" data-caption=\"" . ew_HtmlEncode($Language->Phrase("ExportToPDFText")) . "\">" . $Language->Phrase("ExportToPDF") . ""; $item->Visible = FALSE; // Export to Email $item = &$this->ExportOptions->Add("email"); $url = ""; $item->Body = ""; $item->Visible = TRUE; // Drop down button for export $this->ExportOptions->UseButtonGroup = TRUE; $this->ExportOptions->UseImageAndText = TRUE; $this->ExportOptions->UseDropDownButton = TRUE; if ($this->ExportOptions->UseButtonGroup && ew_IsMobile()) $this->ExportOptions->UseDropDownButton = TRUE; $this->ExportOptions->DropDownButtonPhrase = $Language->Phrase("ButtonExport"); // Add group option item $item = &$this->ExportOptions->Add($this->ExportOptions->GroupOptionName); $item->Body = ""; $item->Visible = FALSE; } // Export data in HTML/CSV/Word/Excel/XML/Email/PDF format function ExportData() { $utf8 = (strtolower(EW_CHARSET) == "utf-8"); $bSelectLimit = $this->UseSelectLimit; // Load recordset if ($bSelectLimit) { $this->TotalRecs = $this->SelectRecordCount(); } else { if (!$this->Recordset) $this->Recordset = $this->LoadRecordset(); $rs = &$this->Recordset; if ($rs) $this->TotalRecs = $rs->RecordCount(); } $this->StartRec = 1; // Export all if ($this->ExportAll) { set_time_limit(EW_EXPORT_ALL_TIME_LIMIT); $this->DisplayRecs = $this->TotalRecs; $this->StopRec = $this->TotalRecs; } else { // Export one page only $this->SetUpStartRec(); // Set up start record position // Set the last record to display if ($this->DisplayRecs <= 0) { $this->StopRec = $this->TotalRecs; } else { $this->StopRec = $this->StartRec + $this->DisplayRecs - 1; } } if ($bSelectLimit) $rs = $this->LoadRecordset($this->StartRec-1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs); if (!$rs) { header("Content-Type:"); // Remove header header("Content-Disposition:"); $this->ShowMessage(); return; } $this->ExportDoc = ew_ExportDocument($this, "h"); $Doc = &$this->ExportDoc; if ($bSelectLimit) { $this->StartRec = 1; $this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs; } else { //$this->StartRec = $this->StartRec; //$this->StopRec = $this->StopRec; } // Call Page Exporting server event $this->ExportDoc->ExportCustom = !$this->Page_Exporting(); $ParentTable = ""; // Export master record if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "tospiti") { global $tospiti; if (!isset($tospiti)) $tospiti = new ctospiti; $rsmaster = $tospiti->LoadRs($this->DbMasterFilter); // Load master record if ($rsmaster && !$rsmaster->EOF) { $ExportStyle = $Doc->Style; $Doc->SetStyle("v"); // Change to vertical if ($this->Export <> "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) { $Doc->Table = &$tospiti; $tospiti->ExportDocument($Doc, $rsmaster, 1, 1); $Doc->ExportEmptyRow(); $Doc->Table = &$this; } $Doc->SetStyle($ExportStyle); // Restore $rsmaster->Close(); } } // Export master record if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() <> "" && $this->getCurrentMasterTable() == "taccomodations") { global $taccomodations; if (!isset($taccomodations)) $taccomodations = new ctaccomodations; $rsmaster = $taccomodations->LoadRs($this->DbMasterFilter); // Load master record if ($rsmaster && !$rsmaster->EOF) { $ExportStyle = $Doc->Style; $Doc->SetStyle("v"); // Change to vertical if ($this->Export <> "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) { $Doc->Table = &$taccomodations; $taccomodations->ExportDocument($Doc, $rsmaster, 1, 1); $Doc->ExportEmptyRow(); $Doc->Table = &$this; } $Doc->SetStyle($ExportStyle); // Restore $rsmaster->Close(); } } $sHeader = $this->PageHeader; $this->Page_DataRendering($sHeader); $Doc->Text .= $sHeader; $this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, ""); $sFooter = $this->PageFooter; $this->Page_DataRendered($sFooter); $Doc->Text .= $sFooter; // Close recordset $rs->Close(); // Call Page Exported server event $this->Page_Exported(); // Export header and footer $Doc->ExportHeaderAndFooter(); // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); // Write debug message if enabled if (EW_DEBUG_ENABLED && $this->Export <> "pdf") echo ew_DebugMsg(); // Output data if ($this->Export == "email") { echo $this->ExportEmail($Doc->Text); } else { $Doc->Export(); } } // Export email function ExportEmail($EmailContent) { global $gTmpImages, $Language; $sSender = @$_POST["sender"]; $sRecipient = @$_POST["recipient"]; $sCc = @$_POST["cc"]; $sBcc = @$_POST["bcc"]; $sContentType = @$_POST["contenttype"]; // Subject $sSubject = ew_StripSlashes(@$_POST["subject"]); $sEmailSubject = $sSubject; // Message $sContent = ew_StripSlashes(@$_POST["message"]); $sEmailMessage = $sContent; // Check sender if ($sSender == "") { return "

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    " . $Email->SendErrDescription . "

    "; } } // Export QueryString function ExportQueryString() { // Initialize $sQry = "export=html"; // Build QueryString for search // Build QueryString for pager $sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . urlencode($this->getRecordsPerPage()) . "&" . EW_TABLE_START_REC . "=" . urlencode($this->getStartRecordNumber()); return $sQry; } // Add search QueryString function AddSearchQueryString(&$Qry, &$Fld) { $FldSearchValue = $Fld->AdvancedSearch->getValue("x"); $FldParm = substr($Fld->FldVar,2); if (strval($FldSearchValue) <> "") { $Qry .= "&x_" . $FldParm . "=" . urlencode($FldSearchValue) . "&z_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("z")); } $FldSearchValue2 = $Fld->AdvancedSearch->getValue("y"); if (strval($FldSearchValue2) <> "") { $Qry .= "&v_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("v")) . "&y_" . $FldParm . "=" . urlencode($FldSearchValue2) . "&w_" . $FldParm . "=" . urlencode($Fld->AdvancedSearch->getValue("w")); } } // Set up master/detail based on QueryString function SetUpMasterParms() { $bValidMaster = FALSE; // Get the keys for master table if (isset($_GET[EW_TABLE_SHOW_MASTER])) { $sMasterTblVar = $_GET[EW_TABLE_SHOW_MASTER]; if ($sMasterTblVar == "") { $bValidMaster = TRUE; $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; } if ($sMasterTblVar == "tospiti") { $bValidMaster = TRUE; if (@$_GET["fk_idSeeker"] <> "") { $GLOBALS["tospiti"]->idSeeker->setQueryStringValue($_GET["fk_idSeeker"]); $this->idkSeeker->setQueryStringValue($GLOBALS["tospiti"]->idSeeker->QueryStringValue); $this->idkSeeker->setSessionValue($this->idkSeeker->QueryStringValue); if (!is_numeric($GLOBALS["tospiti"]->idSeeker->QueryStringValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } if ($sMasterTblVar == "taccomodations") { $bValidMaster = TRUE; if (@$_GET["fk_idAccomodation"] <> "") { $GLOBALS["taccomodations"]->idAccomodation->setQueryStringValue($_GET["fk_idAccomodation"]); $this->idkAccomodation->setQueryStringValue($GLOBALS["taccomodations"]->idAccomodation->QueryStringValue); $this->idkAccomodation->setSessionValue($this->idkAccomodation->QueryStringValue); if (!is_numeric($GLOBALS["taccomodations"]->idAccomodation->QueryStringValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } } elseif (isset($_POST[EW_TABLE_SHOW_MASTER])) { $sMasterTblVar = $_POST[EW_TABLE_SHOW_MASTER]; if ($sMasterTblVar == "") { $bValidMaster = TRUE; $this->DbMasterFilter = ""; $this->DbDetailFilter = ""; } if ($sMasterTblVar == "tospiti") { $bValidMaster = TRUE; if (@$_POST["fk_idSeeker"] <> "") { $GLOBALS["tospiti"]->idSeeker->setFormValue($_POST["fk_idSeeker"]); $this->idkSeeker->setFormValue($GLOBALS["tospiti"]->idSeeker->FormValue); $this->idkSeeker->setSessionValue($this->idkSeeker->FormValue); if (!is_numeric($GLOBALS["tospiti"]->idSeeker->FormValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } if ($sMasterTblVar == "taccomodations") { $bValidMaster = TRUE; if (@$_POST["fk_idAccomodation"] <> "") { $GLOBALS["taccomodations"]->idAccomodation->setFormValue($_POST["fk_idAccomodation"]); $this->idkAccomodation->setFormValue($GLOBALS["taccomodations"]->idAccomodation->FormValue); $this->idkAccomodation->setSessionValue($this->idkAccomodation->FormValue); if (!is_numeric($GLOBALS["taccomodations"]->idAccomodation->FormValue)) $bValidMaster = FALSE; } else { $bValidMaster = FALSE; } } } if ($bValidMaster) { // Update URL $this->AddUrl = $this->AddMasterUrl($this->AddUrl); $this->InlineAddUrl = $this->AddMasterUrl($this->InlineAddUrl); $this->GridAddUrl = $this->AddMasterUrl($this->GridAddUrl); $this->GridEditUrl = $this->AddMasterUrl($this->GridEditUrl); // Save current master table $this->setCurrentMasterTable($sMasterTblVar); // Reset start record counter (new master key) $this->StartRec = 1; $this->setStartRecordNumber($this->StartRec); // Clear previous master key from Session if ($sMasterTblVar <> "tospiti") { if ($this->idkSeeker->CurrentValue == "") $this->idkSeeker->setSessionValue(""); } if ($sMasterTblVar <> "taccomodations") { if ($this->idkAccomodation->CurrentValue == "") $this->idkAccomodation->setSessionValue(""); } } $this->DbMasterFilter = $this->GetMasterFilter(); // Get master filter $this->DbDetailFilter = $this->GetDetailFilter(); // Get detail filter } // Set up Breadcrumb function SetupBreadcrumb() { global $Breadcrumb, $Language; $Breadcrumb = new cBreadcrumb(); $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/")+1); $url = preg_replace('/\?cmd=reset(all){0,1}$/i', '', $url); // Remove cmd=reset / cmd=resetall $Breadcrumb->Add("list", $this->TableVar, $url, "", $this->TableVar, TRUE); } // Setup lookup filters of a field function SetupLookupFilters($fld, $pageId = null) { global $gsLanguage; $pageId = $pageId ?: $this->PageID; 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"; } // 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 $tassigment_list->Page_Main(); // Global Page Rendering event (in userfn*.php) Page_Rendering(); // Page Rendering event $tassigment_list->Page_Render(); ?> Export == "") { ?>
    Export == "") { ?>
    Export == "") { ?> Render(); ?> TotalRecs > 0 && $tassigment_list->ExportOptions->Visible()) { ?> ExportOptions->Render("body") ?> Export == "") { ?> SelectionForm(); ?>
    Export == "") || (EW_EXPORT_MASTER_RECORD && $tassigment->Export == "print")) { ?> DbMasterFilter <> "" && $tassigment->getCurrentMasterTable() == "tospiti") { if ($tassigment_list->MasterRecordExists) { ?> DbMasterFilter <> "" && $tassigment->getCurrentMasterTable() == "taccomodations") { if ($tassigment_list->MasterRecordExists) { ?> UseSelectLimit; if ($bSelectLimit) { if ($tassigment_list->TotalRecs <= 0) $tassigment_list->TotalRecs = $tassigment->SelectRecordCount(); } else { if (!$tassigment_list->Recordset && ($tassigment_list->Recordset = $tassigment_list->LoadRecordset())) $tassigment_list->TotalRecs = $tassigment_list->Recordset->RecordCount(); } $tassigment_list->StartRec = 1; if ($tassigment_list->DisplayRecs <= 0 || ($tassigment->Export <> "" && $tassigment->ExportAll)) // Display all records $tassigment_list->DisplayRecs = $tassigment_list->TotalRecs; if (!($tassigment->Export <> "" && $tassigment->ExportAll)) $tassigment_list->SetUpStartRec(); // Set up start record position if ($bSelectLimit) $tassigment_list->Recordset = $tassigment_list->LoadRecordset($tassigment_list->StartRec-1, $tassigment_list->DisplayRecs); // Set no record found message if ($tassigment->CurrentAction == "" && $tassigment_list->TotalRecs == 0) { if (!$Security->CanList()) $tassigment_list->setWarningMessage(ew_DeniedMsg()); if ($tassigment_list->SearchWhere == "0=101") $tassigment_list->setWarningMessage($Language->Phrase("EnterSearchCriteria")); else $tassigment_list->setWarningMessage($Language->Phrase("NoRecord")); } $tassigment_list->RenderOtherOptions(); ?> ShowPageHeader(); ?> ShowMessage(); ?> TotalRecs > 0 || $tassigment->CurrentAction <> "") { ?>
    Export == "") { ?>
    CurrentAction <> "gridadd" && $tassigment->CurrentAction <> "gridedit") { ?>
    Pager)) $tassigment_list->Pager = new cNumericPager($tassigment_list->StartRec, $tassigment_list->DisplayRecs, $tassigment_list->TotalRecs, $tassigment_list->RecRange) ?> Pager->RecordCount > 0 && $tassigment_list->Pager->Visible) { ?>
    Phrase("Record") ?> Pager->FromIndex ?> Phrase("To") ?> Pager->ToIndex ?> Phrase("Of") ?> Pager->RecordCount ?>
    TotalRecs > 0 && (!EW_AUTO_HIDE_PAGE_SIZE_SELECTOR || $tassigment_list->Pager->Visible)) { ?>
    OtherOptions as &$option) $option->Render("body"); ?>
    CheckToken) { ?> getCurrentMasterTable() == "tospiti" && $tassigment->CurrentAction <> "") { ?> getCurrentMasterTable() == "taccomodations" && $tassigment->CurrentAction <> "") { ?>
    ewGridMiddlePanel"> TotalRecs > 0 || $tassigment->CurrentAction == "gridedit") { ?> TableCustomInnerHtml ?> RowType = EW_ROWTYPE_HEADER; // Render list options $tassigment_list->RenderListOptions(); // Render list options (header, left) $tassigment_list->ListOptions->Render("header", "left"); ?> idkAccomodation->Visible) { // idkAccomodation ?> SortUrl($tassigment->idkAccomodation) == "") { ?> idkSeeker->Visible) { // idkSeeker ?> SortUrl($tassigment->idkSeeker) == "") { ?> Date_ass->Visible) { // Date_ass ?> SortUrl($tassigment->Date_ass) == "") { ?> Date_end->Visible) { // Date_end ?> SortUrl($tassigment->Date_end) == "") { ?> ListOptions->Render("header", "right"); ?> ExportAll && $tassigment->Export <> "") { $tassigment_list->StopRec = $tassigment_list->TotalRecs; } else { // Set the last record to display if ($tassigment_list->TotalRecs > $tassigment_list->StartRec + $tassigment_list->DisplayRecs - 1) $tassigment_list->StopRec = $tassigment_list->StartRec + $tassigment_list->DisplayRecs - 1; else $tassigment_list->StopRec = $tassigment_list->TotalRecs; } $tassigment_list->RecCnt = $tassigment_list->StartRec - 1; if ($tassigment_list->Recordset && !$tassigment_list->Recordset->EOF) { $tassigment_list->Recordset->MoveFirst(); $bSelectLimit = $tassigment_list->UseSelectLimit; if (!$bSelectLimit && $tassigment_list->StartRec > 1) $tassigment_list->Recordset->Move($tassigment_list->StartRec - 1); } elseif (!$tassigment->AllowAddDeleteRow && $tassigment_list->StopRec == 0) { $tassigment_list->StopRec = $tassigment->GridAddRowCount; } // Initialize aggregate $tassigment->RowType = EW_ROWTYPE_AGGREGATEINIT; $tassigment->ResetAttrs(); $tassigment_list->RenderRow(); while ($tassigment_list->RecCnt < $tassigment_list->StopRec) { $tassigment_list->RecCnt++; if (intval($tassigment_list->RecCnt) >= intval($tassigment_list->StartRec)) { $tassigment_list->RowCnt++; // Set up key count $tassigment_list->KeyCount = $tassigment_list->RowIndex; // Init row class and style $tassigment->ResetAttrs(); $tassigment->CssClass = ""; if ($tassigment->CurrentAction == "gridadd") { } else { $tassigment_list->LoadRowValues($tassigment_list->Recordset); // Load row values } $tassigment->RowType = EW_ROWTYPE_VIEW; // Render view // Set up row id / data-rowindex $tassigment->RowAttrs = array_merge($tassigment->RowAttrs, array('data-rowindex'=>$tassigment_list->RowCnt, 'id'=>'r' . $tassigment_list->RowCnt . '_tassigment', 'data-rowtype'=>$tassigment->RowType)); // Render row $tassigment_list->RenderRow(); // Render list options $tassigment_list->RenderListOptions(); ?> RowAttributes() ?>> ListOptions->Render("body", "left", $tassigment_list->RowCnt); ?> idkAccomodation->Visible) { // idkAccomodation ?> idkSeeker->Visible) { // idkSeeker ?> Date_ass->Visible) { // Date_ass ?> Date_end->Visible) { // Date_end ?> ListOptions->Render("body", "right", $tassigment_list->RowCnt); ?> CurrentAction <> "gridadd") $tassigment_list->Recordset->MoveNext(); } ?>
    idkAccomodation->FldCaption() ?>
    idkAccomodation->FldCaption() ?>idkAccomodation->getSort() == "ASC") { ?>idkAccomodation->getSort() == "DESC") { ?>
    idkSeeker->FldCaption() ?>
    idkSeeker->FldCaption() ?>idkSeeker->getSort() == "ASC") { ?>idkSeeker->getSort() == "DESC") { ?>
    Date_ass->FldCaption() ?>
    Date_ass->FldCaption() ?>Date_ass->getSort() == "ASC") { ?>Date_ass->getSort() == "DESC") { ?>
    Date_end->FldCaption() ?>
    Date_end->FldCaption() ?>Date_end->getSort() == "ASC") { ?>Date_end->getSort() == "DESC") { ?>
    idkAccomodation->CellAttributes() ?>> idkAccomodation->ViewAttributes() ?>> idkAccomodation->ListViewValue())) && $tassigment->idkAccomodation->LinkAttributes() <> "") { ?> idkAccomodation->LinkAttributes() ?>>idkAccomodation->ListViewValue() ?> idkAccomodation->ListViewValue() ?> RowCnt ?>"> idkSeeker->CellAttributes() ?>> idkSeeker->ViewAttributes() ?>> idkSeeker->ListViewValue())) && $tassigment->idkSeeker->LinkAttributes() <> "") { ?> idkSeeker->LinkAttributes() ?>>idkSeeker->ListViewValue() ?> idkSeeker->ListViewValue() ?> Date_ass->CellAttributes() ?>> Date_ass->ViewAttributes() ?>> Date_ass->ListViewValue() ?> Date_end->CellAttributes() ?>> Date_end->ViewAttributes() ?>> Date_end->ListViewValue() ?>
    CurrentAction == "") { ?>
    Recordset) $tassigment_list->Recordset->Close(); ?> Export == "") { ?>
    TotalRecs == 0 && $tassigment->CurrentAction == "") { // Show other options ?>
    OtherOptions as &$option) { $option->ButtonClass = ""; $option->Render("body", ""); } ?>
    Export == "") { ?> ShowPageFooter(); if (EW_DEBUG_ENABLED) echo ew_DebugMsg(); ?> Export == "") { ?> Page_Terminate(); ?>