TableVar = 'tofferers'; $this->TableName = 'tofferers'; $this->TableType = 'TABLE'; // Update Table $this->UpdateTable = "`tofferers`"; $this->DBID = 'DB'; $this->ExportAll = TRUE; $this->ExportPageBreakCount = 0; // Page break per every n record (PDF only) $this->ExportPageOrientation = "portrait"; // Page orientation (PDF only) $this->ExportPageSize = "a4"; // Page size (PDF only) $this->ExportExcelPageOrientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT; // Page orientation (PHPExcel only) $this->ExportExcelPageSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4; // Page size (PHPExcel only) $this->DetailAdd = FALSE; // Allow detail add $this->DetailEdit = FALSE; // Allow detail edit $this->DetailView = FALSE; // Allow detail view $this->ShowMultipleDetails = FALSE; // Show multiple details $this->GridAddRowCount = 5; $this->AllowAddDeleteRow = ew_AllowAddDeleteRow(); // Allow add/delete row $this->UserIDAllowSecurity = 0; // User ID Allow $this->BasicSearch = new cBasicSearch($this->TableVar); // idOfferer $this->idOfferer = new cField('tofferers', 'tofferers', 'x_idOfferer', 'idOfferer', '`idOfferer`', '`idOfferer`', 3, -1, FALSE, '`idOfferer`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'NO'); $this->idOfferer->Sortable = TRUE; // Allow sort $this->idOfferer->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger"); $this->fields['idOfferer'] = &$this->idOfferer; // Name $this->Name = new cField('tofferers', 'tofferers', 'x_Name', 'Name', '`Name`', '`Name`', 200, -1, FALSE, '`Name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Name->Sortable = TRUE; // Allow sort $this->fields['Name'] = &$this->Name; // Surname $this->Surname = new cField('tofferers', 'tofferers', 'x_Surname', 'Surname', '`Surname`', '`Surname`', 200, -1, FALSE, '`Surname`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Surname->Sortable = TRUE; // Allow sort $this->fields['Surname'] = &$this->Surname; // Institution_Type $this->Institution_Type = new cField('tofferers', 'tofferers', 'x_Institution_Type', 'Institution_Type', '`Institution_Type`', '`Institution_Type`', 200, -1, FALSE, '`Institution_Type`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'SELECT'); $this->Institution_Type->Sortable = TRUE; // Allow sort $this->Institution_Type->UsePleaseSelect = TRUE; // Use PleaseSelect by default $this->Institution_Type->PleaseSelectText = $Language->Phrase("PleaseSelect"); // PleaseSelect text $this->fields['Institution_Type'] = &$this->Institution_Type; // Institution_Name $this->Institution_Name = new cField('tofferers', 'tofferers', 'x_Institution_Name', 'Institution_Name', '`Institution_Name`', '`Institution_Name`', 200, -1, FALSE, '`Institution_Name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Institution_Name->Sortable = TRUE; // Allow sort $this->fields['Institution_Name'] = &$this->Institution_Name; // Address $this->Address = new cField('tofferers', 'tofferers', 'x_Address', 'Address', '`Address`', '`Address`', 200, -1, FALSE, '`Address`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Address->Sortable = TRUE; // Allow sort $this->fields['Address'] = &$this->Address; // Phone $this->Phone = new cField('tofferers', 'tofferers', 'x_Phone', 'Phone', '`Phone`', '`Phone`', 200, -1, FALSE, '`Phone`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Phone->Sortable = TRUE; // Allow sort $this->fields['Phone'] = &$this->Phone; // Phone_Mobile $this->Phone_Mobile = new cField('tofferers', 'tofferers', 'x_Phone_Mobile', 'Phone_Mobile', '`Phone_Mobile`', '`Phone_Mobile`', 200, -1, FALSE, '`Phone_Mobile`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Phone_Mobile->Sortable = TRUE; // Allow sort $this->fields['Phone_Mobile'] = &$this->Phone_Mobile; // Email $this->_Email = new cField('tofferers', 'tofferers', 'x__Email', 'Email', '`Email`', '`Email`', 200, -1, FALSE, '`Email`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->_Email->Sortable = TRUE; // Allow sort $this->fields['Email'] = &$this->_Email; // Town $this->Town = new cField('tofferers', 'tofferers', 'x_Town', 'Town', '`Town`', '`Town`', 200, -1, FALSE, '`Town`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Town->Sortable = TRUE; // Allow sort $this->fields['Town'] = &$this->Town; // District $this->District = new cField('tofferers', 'tofferers', 'x_District', 'District', '`District`', '`District`', 200, -1, FALSE, '`District`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->District->Sortable = TRUE; // Allow sort $this->fields['District'] = &$this->District; // Region $this->Region = new cField('tofferers', 'tofferers', 'x_Region', 'Region', '`Region`', '`Region`', 200, -1, FALSE, '`Region`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Region->Sortable = TRUE; // Allow sort $this->fields['Region'] = &$this->Region; // Suggest_by $this->Suggest_by = new cField('tofferers', 'tofferers', 'x_Suggest_by', 'Suggest_by', '`Suggest_by`', '`Suggest_by`', 200, -1, FALSE, '`Suggest_by`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'SELECT'); $this->Suggest_by->Sortable = TRUE; // Allow sort $this->Suggest_by->UsePleaseSelect = TRUE; // Use PleaseSelect by default $this->Suggest_by->PleaseSelectText = $Language->Phrase("PleaseSelect"); // PleaseSelect text $this->fields['Suggest_by'] = &$this->Suggest_by; // Suggest_by_note $this->Suggest_by_note = new cField('tofferers', 'tofferers', 'x_Suggest_by_note', 'Suggest_by_note', '`Suggest_by_note`', '`Suggest_by_note`', 201, -1, FALSE, '`Suggest_by_note`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXTAREA'); $this->Suggest_by_note->Sortable = TRUE; // Allow sort $this->fields['Suggest_by_note'] = &$this->Suggest_by_note; // Referent $this->Referent = new cField('tofferers', 'tofferers', 'x_Referent', 'Referent', '`Referent`', '`Referent`', 200, -1, FALSE, '`Referent`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT'); $this->Referent->Sortable = TRUE; // Allow sort $this->fields['Referent'] = &$this->Referent; // add_network $this->add_network = new cField('tofferers', 'tofferers', 'x_add_network', 'add_network', '`add_network`', '`add_network`', 202, -1, FALSE, '`add_network`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_network->Sortable = FALSE; // Allow sort $this->add_network->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_network->TrueValue = 'Y'; $this->add_network->FalseValue = 'N'; $this->add_network->OptionCount = 2; $this->fields['add_network'] = &$this->add_network; // add_documents $this->add_documents = new cField('tofferers', 'tofferers', 'x_add_documents', 'add_documents', '`add_documents`', '`add_documents`', 202, -1, FALSE, '`add_documents`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_documents->Sortable = TRUE; // Allow sort $this->add_documents->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_documents->TrueValue = 'Y'; $this->add_documents->FalseValue = 'N'; $this->add_documents->OptionCount = 2; $this->fields['add_documents'] = &$this->add_documents; // add_care $this->add_care = new cField('tofferers', 'tofferers', 'x_add_care', 'add_care', '`add_care`', '`add_care`', 202, -1, FALSE, '`add_care`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_care->Sortable = TRUE; // Allow sort $this->add_care->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_care->TrueValue = 'Y'; $this->add_care->FalseValue = 'N'; $this->add_care->OptionCount = 2; $this->fields['add_care'] = &$this->add_care; // add_food $this->add_food = new cField('tofferers', 'tofferers', 'x_add_food', 'add_food', '`add_food`', '`add_food`', 202, -1, FALSE, '`add_food`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_food->Sortable = TRUE; // Allow sort $this->add_food->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_food->TrueValue = 'Y'; $this->add_food->FalseValue = 'N'; $this->add_food->OptionCount = 2; $this->fields['add_food'] = &$this->add_food; // add_clothes $this->add_clothes = new cField('tofferers', 'tofferers', 'x_add_clothes', 'add_clothes', '`add_clothes`', '`add_clothes`', 202, -1, FALSE, '`add_clothes`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_clothes->Sortable = TRUE; // Allow sort $this->add_clothes->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_clothes->TrueValue = 'Y'; $this->add_clothes->FalseValue = 'N'; $this->add_clothes->OptionCount = 2; $this->fields['add_clothes'] = &$this->add_clothes; // add_utilities $this->add_utilities = new cField('tofferers', 'tofferers', 'x_add_utilities', 'add_utilities', '`add_utilities`', '`add_utilities`', 202, -1, FALSE, '`add_utilities`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_utilities->Sortable = TRUE; // Allow sort $this->add_utilities->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_utilities->TrueValue = 'Y'; $this->add_utilities->FalseValue = 'N'; $this->add_utilities->OptionCount = 2; $this->fields['add_utilities'] = &$this->add_utilities; // add_job $this->add_job = new cField('tofferers', 'tofferers', 'x_add_job', 'add_job', '`add_job`', '`add_job`', 202, -1, FALSE, '`add_job`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO'); $this->add_job->Sortable = TRUE; // Allow sort $this->add_job->FldDataType = EW_DATATYPE_BOOLEAN; $this->add_job->TrueValue = 'Y'; $this->add_job->FalseValue = 'N'; $this->add_job->OptionCount = 2; $this->fields['add_job'] = &$this->add_job; } // Set Field Visibility function SetFieldVisibility($fldparm) { global $Security; return $this->$fldparm->Visible; // Returns original value } // Single column sort function UpdateSort(&$ofld) { if ($this->CurrentOrder == $ofld->FldName) { $sSortField = $ofld->FldExpression; $sLastSort = $ofld->getSort(); if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") { $sThisSort = $this->CurrentOrderType; } else { $sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC"; } $ofld->setSort($sThisSort); $this->setSessionOrderBy($sSortField . " " . $sThisSort); // Save to Session } else { $ofld->setSort(""); } } // Current detail table name function getCurrentDetailTable() { return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_DETAIL_TABLE]; } function setCurrentDetailTable($v) { $_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_DETAIL_TABLE] = $v; } // Get detail url function GetDetailUrl() { // Detail url $sDetailUrl = ""; if ($this->getCurrentDetailTable() == "taccomodations") { $sDetailUrl = $GLOBALS["taccomodations"]->GetListUrl() . "?" . EW_TABLE_SHOW_MASTER . "=" . $this->TableVar; $sDetailUrl .= "&fk_idOfferer=" . urlencode($this->idOfferer->CurrentValue); } if ($sDetailUrl == "") { $sDetailUrl = "toffererslist.php"; } return $sDetailUrl; } // Table level SQL var $_SqlFrom = ""; function getSqlFrom() { // From return ($this->_SqlFrom <> "") ? $this->_SqlFrom : "`tofferers`"; } function SqlFrom() { // For backward compatibility return $this->getSqlFrom(); } function setSqlFrom($v) { $this->_SqlFrom = $v; } var $_SqlSelect = ""; function getSqlSelect() { // Select return ($this->_SqlSelect <> "") ? $this->_SqlSelect : "SELECT * FROM " . $this->getSqlFrom(); } function SqlSelect() { // For backward compatibility return $this->getSqlSelect(); } function setSqlSelect($v) { $this->_SqlSelect = $v; } var $_SqlWhere = ""; function getSqlWhere() { // Where $sWhere = ($this->_SqlWhere <> "") ? $this->_SqlWhere : ""; $this->TableFilter = ""; ew_AddFilter($sWhere, $this->TableFilter); return $sWhere; } function SqlWhere() { // For backward compatibility return $this->getSqlWhere(); } function setSqlWhere($v) { $this->_SqlWhere = $v; } var $_SqlGroupBy = ""; function getSqlGroupBy() { // Group By return ($this->_SqlGroupBy <> "") ? $this->_SqlGroupBy : ""; } function SqlGroupBy() { // For backward compatibility return $this->getSqlGroupBy(); } function setSqlGroupBy($v) { $this->_SqlGroupBy = $v; } var $_SqlHaving = ""; function getSqlHaving() { // Having return ($this->_SqlHaving <> "") ? $this->_SqlHaving : ""; } function SqlHaving() { // For backward compatibility return $this->getSqlHaving(); } function setSqlHaving($v) { $this->_SqlHaving = $v; } var $_SqlOrderBy = ""; function getSqlOrderBy() { // Order By return ($this->_SqlOrderBy <> "") ? $this->_SqlOrderBy : ""; } function SqlOrderBy() { // For backward compatibility return $this->getSqlOrderBy(); } function setSqlOrderBy($v) { $this->_SqlOrderBy = $v; } // Apply User ID filters function ApplyUserIDFilters($sFilter) { return $sFilter; } // Check if User ID security allows view all function UserIDAllow($id = "") { $allow = EW_USER_ID_ALLOW; switch ($id) { case "add": case "copy": case "gridadd": case "register": case "addopt": return (($allow & 1) == 1); case "edit": case "gridedit": case "update": case "changepwd": case "forgotpwd": return (($allow & 4) == 4); case "delete": return (($allow & 2) == 2); case "view": return (($allow & 32) == 32); case "search": return (($allow & 64) == 64); default: return (($allow & 8) == 8); } } // Get SQL function GetSQL($where, $orderby) { return ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), $this->getSqlOrderBy(), $where, $orderby); } // Table SQL function SQL() { $sFilter = $this->CurrentFilter; $sFilter = $this->ApplyUserIDFilters($sFilter); $sSort = $this->getSessionOrderBy(); return ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort); } // Table SQL with List page filter function SelectSQL() { $sFilter = $this->getSessionWhere(); ew_AddFilter($sFilter, $this->CurrentFilter); $sFilter = $this->ApplyUserIDFilters($sFilter); $this->Recordset_Selecting($sFilter); $sSort = $this->getSessionOrderBy(); return ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort); } // Get ORDER BY clause function GetOrderBy() { $sSort = $this->getSessionOrderBy(); return ew_BuildSelectSql("", "", "", "", $this->getSqlOrderBy(), "", $sSort); } // Try to get record count function TryGetRecordCount($sSql) { $cnt = -1; if (($this->TableType == 'TABLE' || $this->TableType == 'VIEW' || $this->TableType == 'LINKTABLE') && preg_match("/^SELECT \* FROM/i", $sSql)) { $sSql = "SELECT COUNT(*) FROM" . preg_replace('/^SELECT\s([\s\S]+)?\*\sFROM/i', "", $sSql); $sOrderBy = $this->GetOrderBy(); if (substr($sSql, strlen($sOrderBy) * -1) == $sOrderBy) $sSql = substr($sSql, 0, strlen($sSql) - strlen($sOrderBy)); // Remove ORDER BY clause } else { $sSql = "SELECT COUNT(*) FROM (" . $sSql . ") EW_COUNT_TABLE"; } $conn = &$this->Connection(); if ($rs = $conn->Execute($sSql)) { if (!$rs->EOF && $rs->FieldCount() > 0) { $cnt = $rs->fields[0]; $rs->Close(); } } return intval($cnt); } // Get record count based on filter (for detail record count in master table pages) function LoadRecordCount($sFilter) { $origFilter = $this->CurrentFilter; $this->CurrentFilter = $sFilter; $this->Recordset_Selecting($this->CurrentFilter); //$sSql = $this->SQL(); $sSql = $this->GetSQL($this->CurrentFilter, ""); $cnt = $this->TryGetRecordCount($sSql); if ($cnt == -1) { if ($rs = $this->LoadRs($this->CurrentFilter)) { $cnt = $rs->RecordCount(); $rs->Close(); } } $this->CurrentFilter = $origFilter; return intval($cnt); } // Get record count (for current List page) function SelectRecordCount() { $sSql = $this->SelectSQL(); $cnt = $this->TryGetRecordCount($sSql); if ($cnt == -1) { $conn = &$this->Connection(); if ($rs = $conn->Execute($sSql)) { $cnt = $rs->RecordCount(); $rs->Close(); } } return intval($cnt); } // INSERT statement function InsertSQL(&$rs) { $names = ""; $values = ""; foreach ($rs as $name => $value) { if (!isset($this->fields[$name]) || $this->fields[$name]->FldIsCustom) continue; $names .= $this->fields[$name]->FldExpression . ","; $values .= ew_QuotedValue($value, $this->fields[$name]->FldDataType, $this->DBID) . ","; } while (substr($names, -1) == ",") $names = substr($names, 0, -1); while (substr($values, -1) == ",") $values = substr($values, 0, -1); return "INSERT INTO " . $this->UpdateTable . " ($names) VALUES ($values)"; } // Insert function Insert(&$rs) { $conn = &$this->Connection(); $bInsert = $conn->Execute($this->InsertSQL($rs)); if ($bInsert) { // Get insert id if necessary $this->idOfferer->setDbValue($conn->Insert_ID()); $rs['idOfferer'] = $this->idOfferer->DbValue; } return $bInsert; } // UPDATE statement function UpdateSQL(&$rs, $where = "", $curfilter = TRUE) { $sql = "UPDATE " . $this->UpdateTable . " SET "; foreach ($rs as $name => $value) { if (!isset($this->fields[$name]) || $this->fields[$name]->FldIsCustom) continue; $sql .= $this->fields[$name]->FldExpression . "="; $sql .= ew_QuotedValue($value, $this->fields[$name]->FldDataType, $this->DBID) . ","; } while (substr($sql, -1) == ",") $sql = substr($sql, 0, -1); $filter = ($curfilter) ? $this->CurrentFilter : ""; if (is_array($where)) $where = $this->ArrayToFilter($where); ew_AddFilter($filter, $where); if ($filter <> "") $sql .= " WHERE " . $filter; return $sql; } // Update function Update(&$rs, $where = "", $rsold = NULL, $curfilter = TRUE) { $conn = &$this->Connection(); // Cascade Update detail table 'taccomodations' $bCascadeUpdate = FALSE; $rscascade = array(); if (!is_null($rsold) && (isset($rs['idOfferer']) && $rsold['idOfferer'] <> $rs['idOfferer'])) { // Update detail field 'idOfferer' $bCascadeUpdate = TRUE; $rscascade['idOfferer'] = $rs['idOfferer']; } if ($bCascadeUpdate) { if (!isset($GLOBALS["taccomodations"])) $GLOBALS["taccomodations"] = new ctaccomodations(); $rswrk = $GLOBALS["taccomodations"]->LoadRs("`idOfferer` = " . ew_QuotedValue($rsold['idOfferer'], EW_DATATYPE_NUMBER, 'DB')); while ($rswrk && !$rswrk->EOF) { $rskey = array(); $fldname = 'idAccomodation'; $rskey[$fldname] = $rswrk->fields[$fldname]; $bUpdate = $GLOBALS["taccomodations"]->Update($rscascade, $rskey, $rswrk->fields); if (!$bUpdate) return FALSE; $rswrk->MoveNext(); } } $bUpdate = $conn->Execute($this->UpdateSQL($rs, $where, $curfilter)); return $bUpdate; } // DELETE statement function DeleteSQL(&$rs, $where = "", $curfilter = TRUE) { $sql = "DELETE FROM " . $this->UpdateTable . " WHERE "; if (is_array($where)) $where = $this->ArrayToFilter($where); if ($rs) { if (array_key_exists('idOfferer', $rs)) ew_AddFilter($where, ew_QuotedName('idOfferer', $this->DBID) . '=' . ew_QuotedValue($rs['idOfferer'], $this->idOfferer->FldDataType, $this->DBID)); } $filter = ($curfilter) ? $this->CurrentFilter : ""; ew_AddFilter($filter, $where); if ($filter <> "") $sql .= $filter; else $sql .= "0=1"; // Avoid delete return $sql; } // Delete function Delete(&$rs, $where = "", $curfilter = TRUE) { $conn = &$this->Connection(); // Cascade delete detail table 'taccomodations' if (!isset($GLOBALS["taccomodations"])) $GLOBALS["taccomodations"] = new ctaccomodations(); $rscascade = $GLOBALS["taccomodations"]->LoadRs("`idOfferer` = " . ew_QuotedValue($rs['idOfferer'], EW_DATATYPE_NUMBER, "DB")); while ($rscascade && !$rscascade->EOF) { $GLOBALS["taccomodations"]->Delete($rscascade->fields); $rscascade->MoveNext(); } $bDelete = $conn->Execute($this->DeleteSQL($rs, $where, $curfilter)); return $bDelete; } // Key filter WHERE clause function SqlKeyFilter() { return "`idOfferer` = @idOfferer@"; } // Key filter function KeyFilter() { $sKeyFilter = $this->SqlKeyFilter(); if (!is_numeric($this->idOfferer->CurrentValue)) $sKeyFilter = "0=1"; // Invalid key $sKeyFilter = str_replace("@idOfferer@", ew_AdjustSql($this->idOfferer->CurrentValue, $this->DBID), $sKeyFilter); // Replace key value return $sKeyFilter; } // Return page URL function getReturnUrl() { $name = EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL; // Get referer URL automatically if (ew_ServerVar("HTTP_REFERER") <> "" && ew_ReferPage() <> ew_CurrentPage() && ew_ReferPage() <> "login.php") // Referer not same page or login page $_SESSION[$name] = ew_ServerVar("HTTP_REFERER"); // Save to Session if (@$_SESSION[$name] <> "") { return $_SESSION[$name]; } else { return "toffererslist.php"; } } function setReturnUrl($v) { $_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] = $v; } // List URL function GetListUrl() { return "toffererslist.php"; } // View URL function GetViewUrl($parm = "") { if ($parm <> "") $url = $this->KeyUrl("tofferersview.php", $this->UrlParm($parm)); else $url = $this->KeyUrl("tofferersview.php", $this->UrlParm(EW_TABLE_SHOW_DETAIL . "=")); return $this->AddMasterUrl($url); } // Add URL function GetAddUrl($parm = "") { if ($parm <> "") $url = "tofferersadd.php?" . $this->UrlParm($parm); else $url = "tofferersadd.php"; return $this->AddMasterUrl($url); } // Edit URL function GetEditUrl($parm = "") { if ($parm <> "") $url = $this->KeyUrl("tofferersedit.php", $this->UrlParm($parm)); else $url = $this->KeyUrl("tofferersedit.php", $this->UrlParm(EW_TABLE_SHOW_DETAIL . "=")); return $this->AddMasterUrl($url); } // Inline edit URL function GetInlineEditUrl() { $url = $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=edit")); return $this->AddMasterUrl($url); } // Copy URL function GetCopyUrl($parm = "") { if ($parm <> "") $url = $this->KeyUrl("tofferersadd.php", $this->UrlParm($parm)); else $url = $this->KeyUrl("tofferersadd.php", $this->UrlParm(EW_TABLE_SHOW_DETAIL . "=")); return $this->AddMasterUrl($url); } // Inline copy URL function GetInlineCopyUrl() { $url = $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=copy")); return $this->AddMasterUrl($url); } // Delete URL function GetDeleteUrl() { return $this->KeyUrl("tofferersdelete.php", $this->UrlParm()); } // Add master url function AddMasterUrl($url) { return $url; } function KeyToJson() { $json = ""; $json .= "idOfferer:" . ew_VarToJson($this->idOfferer->CurrentValue, "number", "'"); return "{" . $json . "}"; } // Add key value to URL function KeyUrl($url, $parm = "") { $sUrl = $url . "?"; if ($parm <> "") $sUrl .= $parm . "&"; if (!is_null($this->idOfferer->CurrentValue)) { $sUrl .= "idOfferer=" . urlencode($this->idOfferer->CurrentValue); } else { return "javascript:ew_Alert(ewLanguage.Phrase('InvalidRecord'));"; } return $sUrl; } // Sort URL function SortUrl(&$fld) { if ($this->CurrentAction <> "" || $this->Export <> "" || in_array($fld->FldType, array(128, 204, 205))) { // Unsortable data type return ""; } elseif ($fld->Sortable) { $sUrlParm = $this->UrlParm("order=" . urlencode($fld->FldName) . "&ordertype=" . $fld->ReverseSort()); return $this->AddMasterUrl(ew_CurrentPage() . "?" . $sUrlParm); } else { return ""; } } // Get record keys from $_POST/$_GET/$_SESSION function GetRecordKeys() { global $EW_COMPOSITE_KEY_SEPARATOR; $arKeys = array(); $arKey = array(); if (isset($_POST["key_m"])) { $arKeys = ew_StripSlashes($_POST["key_m"]); $cnt = count($arKeys); } elseif (isset($_GET["key_m"])) { $arKeys = ew_StripSlashes($_GET["key_m"]); $cnt = count($arKeys); } elseif (!empty($_GET) || !empty($_POST)) { $isPost = ew_IsHttpPost(); if ($isPost && isset($_POST["idOfferer"])) $arKeys[] = ew_StripSlashes($_POST["idOfferer"]); elseif (isset($_GET["idOfferer"])) $arKeys[] = ew_StripSlashes($_GET["idOfferer"]); else $arKeys = NULL; // Do not setup //return $arKeys; // Do not return yet, so the values will also be checked by the following code } // Check keys $ar = array(); if (is_array($arKeys)) { foreach ($arKeys as $key) { if (!is_numeric($key)) continue; $ar[] = $key; } } return $ar; } // Get key filter function GetKeyFilter() { $arKeys = $this->GetRecordKeys(); $sKeyFilter = ""; foreach ($arKeys as $key) { if ($sKeyFilter <> "") $sKeyFilter .= " OR "; $this->idOfferer->CurrentValue = $key; $sKeyFilter .= "(" . $this->KeyFilter() . ")"; } return $sKeyFilter; } // Load rows based on filter function &LoadRs($sFilter) { // Set up filter (SQL WHERE clause) and get return SQL //$this->CurrentFilter = $sFilter; //$sSql = $this->SQL(); $sSql = $this->GetSQL($sFilter, ""); $conn = &$this->Connection(); $rs = $conn->Execute($sSql); return $rs; } // Load row values from recordset function LoadListRowValues(&$rs) { $this->idOfferer->setDbValue($rs->fields('idOfferer')); $this->Name->setDbValue($rs->fields('Name')); $this->Surname->setDbValue($rs->fields('Surname')); $this->Institution_Type->setDbValue($rs->fields('Institution_Type')); $this->Institution_Name->setDbValue($rs->fields('Institution_Name')); $this->Address->setDbValue($rs->fields('Address')); $this->Phone->setDbValue($rs->fields('Phone')); $this->Phone_Mobile->setDbValue($rs->fields('Phone_Mobile')); $this->_Email->setDbValue($rs->fields('Email')); $this->Town->setDbValue($rs->fields('Town')); $this->District->setDbValue($rs->fields('District')); $this->Region->setDbValue($rs->fields('Region')); $this->Suggest_by->setDbValue($rs->fields('Suggest_by')); $this->Suggest_by_note->setDbValue($rs->fields('Suggest_by_note')); $this->Referent->setDbValue($rs->fields('Referent')); $this->add_network->setDbValue($rs->fields('add_network')); $this->add_documents->setDbValue($rs->fields('add_documents')); $this->add_care->setDbValue($rs->fields('add_care')); $this->add_food->setDbValue($rs->fields('add_food')); $this->add_clothes->setDbValue($rs->fields('add_clothes')); $this->add_utilities->setDbValue($rs->fields('add_utilities')); $this->add_job->setDbValue($rs->fields('add_job')); } // Render list row values function RenderListRow() { global $Security, $gsLanguage, $Language; // Call Row Rendering event $this->Row_Rendering(); // Common render codes // idOfferer // Name // Surname // Institution_Type // Institution_Name // Address // Phone // Phone_Mobile // Email // Town // District // Region // Suggest_by // Suggest_by_note // Referent // add_network $this->add_network->CellCssStyle = "white-space: nowrap;"; // add_documents // add_care // add_food // add_clothes // add_utilities // add_job // idOfferer $this->idOfferer->ViewValue = $this->idOfferer->CurrentValue; $this->idOfferer->ViewCustomAttributes = ""; // Name $this->Name->ViewValue = $this->Name->CurrentValue; $this->Name->ViewCustomAttributes = ""; // Surname $this->Surname->ViewValue = $this->Surname->CurrentValue; $this->Surname->ViewCustomAttributes = ""; // Institution_Type if (strval($this->Institution_Type->CurrentValue) <> "") { $sFilterWrk = "`Institution_Type`" . ew_SearchString("=", $this->Institution_Type->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `Institution_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tinstitutions`"; $sWhereWrk = ""; $this->Institution_Type->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `Institution_Type`, `Description_it` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tinstitutions`"; $sWhereWrk = ""; $this->Institution_Type->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `Institution_Type`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tinstitutions`"; $sWhereWrk = ""; $this->Institution_Type->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Institution_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->Institution_Type->ViewValue = $this->Institution_Type->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Institution_Type->ViewValue = $this->Institution_Type->CurrentValue; } } else { $this->Institution_Type->ViewValue = NULL; } $this->Institution_Type->ViewCustomAttributes = ""; // Institution_Name $this->Institution_Name->ViewValue = $this->Institution_Name->CurrentValue; $this->Institution_Name->ViewCustomAttributes = ""; // Address $this->Address->ViewValue = $this->Address->CurrentValue; $this->Address->ViewCustomAttributes = ""; // Phone $this->Phone->ViewValue = $this->Phone->CurrentValue; $this->Phone->ViewCustomAttributes = ""; // Phone_Mobile $this->Phone_Mobile->ViewValue = $this->Phone_Mobile->CurrentValue; $this->Phone_Mobile->ViewCustomAttributes = ""; // Email $this->_Email->ViewValue = $this->_Email->CurrentValue; $this->_Email->ViewCustomAttributes = ""; // Town $this->Town->ViewValue = $this->Town->CurrentValue; $this->Town->ViewCustomAttributes = ""; // District $this->District->ViewValue = $this->District->CurrentValue; $this->District->ViewCustomAttributes = ""; // Region $this->Region->ViewValue = $this->Region->CurrentValue; $this->Region->ViewCustomAttributes = ""; // Suggest_by if (strval($this->Suggest_by->CurrentValue) <> "") { $sFilterWrk = "`suggesttype`" . ew_SearchString("=", $this->Suggest_by->CurrentValue, EW_DATATYPE_STRING, ""); switch (@$gsLanguage) { case "en": $sSqlWrk = "SELECT `suggesttype`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tsuggest_type`"; $sWhereWrk = ""; $this->Suggest_by->LookupFilters = array(); break; case "it": $sSqlWrk = "SELECT `suggesttype`, `Description_IT` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tsuggest_type`"; $sWhereWrk = ""; $this->Suggest_by->LookupFilters = array(); break; default: $sSqlWrk = "SELECT `suggesttype`, `Description` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tsuggest_type`"; $sWhereWrk = ""; $this->Suggest_by->LookupFilters = array(); break; } ew_AddFilter($sWhereWrk, $sFilterWrk); $this->Lookup_Selecting($this->Suggest_by, $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->Suggest_by->ViewValue = $this->Suggest_by->DisplayValue($arwrk); $rswrk->Close(); } else { $this->Suggest_by->ViewValue = $this->Suggest_by->CurrentValue; } } else { $this->Suggest_by->ViewValue = NULL; } $this->Suggest_by->ViewCustomAttributes = ""; // Suggest_by_note $this->Suggest_by_note->ViewValue = $this->Suggest_by_note->CurrentValue; $this->Suggest_by_note->ViewCustomAttributes = ""; // Referent $this->Referent->ViewValue = $this->Referent->CurrentValue; $this->Referent->ViewCustomAttributes = ""; // add_network if (ew_ConvertToBool($this->add_network->CurrentValue)) { $this->add_network->ViewValue = $this->add_network->FldTagCaption(1) <> "" ? $this->add_network->FldTagCaption(1) : "Y"; } else { $this->add_network->ViewValue = $this->add_network->FldTagCaption(2) <> "" ? $this->add_network->FldTagCaption(2) : "N"; } $this->add_network->ViewCustomAttributes = ""; // add_documents if (ew_ConvertToBool($this->add_documents->CurrentValue)) { $this->add_documents->ViewValue = $this->add_documents->FldTagCaption(1) <> "" ? $this->add_documents->FldTagCaption(1) : "Y"; } else { $this->add_documents->ViewValue = $this->add_documents->FldTagCaption(2) <> "" ? $this->add_documents->FldTagCaption(2) : "N"; } $this->add_documents->ViewCustomAttributes = ""; // add_care if (ew_ConvertToBool($this->add_care->CurrentValue)) { $this->add_care->ViewValue = $this->add_care->FldTagCaption(1) <> "" ? $this->add_care->FldTagCaption(1) : "Y"; } else { $this->add_care->ViewValue = $this->add_care->FldTagCaption(2) <> "" ? $this->add_care->FldTagCaption(2) : "N"; } $this->add_care->ViewCustomAttributes = ""; // add_food if (ew_ConvertToBool($this->add_food->CurrentValue)) { $this->add_food->ViewValue = $this->add_food->FldTagCaption(1) <> "" ? $this->add_food->FldTagCaption(1) : "Y"; } else { $this->add_food->ViewValue = $this->add_food->FldTagCaption(2) <> "" ? $this->add_food->FldTagCaption(2) : "N"; } $this->add_food->ViewCustomAttributes = ""; // add_clothes if (ew_ConvertToBool($this->add_clothes->CurrentValue)) { $this->add_clothes->ViewValue = $this->add_clothes->FldTagCaption(1) <> "" ? $this->add_clothes->FldTagCaption(1) : "Y"; } else { $this->add_clothes->ViewValue = $this->add_clothes->FldTagCaption(2) <> "" ? $this->add_clothes->FldTagCaption(2) : "N"; } $this->add_clothes->ViewCustomAttributes = ""; // add_utilities if (ew_ConvertToBool($this->add_utilities->CurrentValue)) { $this->add_utilities->ViewValue = $this->add_utilities->FldTagCaption(1) <> "" ? $this->add_utilities->FldTagCaption(1) : "Y"; } else { $this->add_utilities->ViewValue = $this->add_utilities->FldTagCaption(2) <> "" ? $this->add_utilities->FldTagCaption(2) : "N"; } $this->add_utilities->ViewCustomAttributes = ""; // add_job if (ew_ConvertToBool($this->add_job->CurrentValue)) { $this->add_job->ViewValue = $this->add_job->FldTagCaption(1) <> "" ? $this->add_job->FldTagCaption(1) : "Y"; } else { $this->add_job->ViewValue = $this->add_job->FldTagCaption(2) <> "" ? $this->add_job->FldTagCaption(2) : "N"; } $this->add_job->ViewCustomAttributes = ""; // idOfferer $this->idOfferer->LinkCustomAttributes = ""; $this->idOfferer->HrefValue = ""; $this->idOfferer->TooltipValue = ""; // Name $this->Name->LinkCustomAttributes = ""; $this->Name->HrefValue = ""; $this->Name->TooltipValue = ""; // Surname $this->Surname->LinkCustomAttributes = ""; $this->Surname->HrefValue = ""; $this->Surname->TooltipValue = ""; // Institution_Type $this->Institution_Type->LinkCustomAttributes = ""; $this->Institution_Type->HrefValue = ""; $this->Institution_Type->TooltipValue = ""; // Institution_Name $this->Institution_Name->LinkCustomAttributes = ""; $this->Institution_Name->HrefValue = ""; $this->Institution_Name->TooltipValue = ""; // Address $this->Address->LinkCustomAttributes = ""; $this->Address->HrefValue = ""; $this->Address->TooltipValue = ""; // Phone $this->Phone->LinkCustomAttributes = ""; $this->Phone->HrefValue = ""; $this->Phone->TooltipValue = ""; // Phone_Mobile $this->Phone_Mobile->LinkCustomAttributes = ""; $this->Phone_Mobile->HrefValue = ""; $this->Phone_Mobile->TooltipValue = ""; // Email $this->_Email->LinkCustomAttributes = ""; $this->_Email->HrefValue = ""; $this->_Email->TooltipValue = ""; // Town $this->Town->LinkCustomAttributes = ""; $this->Town->HrefValue = ""; $this->Town->TooltipValue = ""; // District $this->District->LinkCustomAttributes = ""; $this->District->HrefValue = ""; $this->District->TooltipValue = ""; // Region $this->Region->LinkCustomAttributes = ""; $this->Region->HrefValue = ""; $this->Region->TooltipValue = ""; // Suggest_by $this->Suggest_by->LinkCustomAttributes = ""; $this->Suggest_by->HrefValue = ""; $this->Suggest_by->TooltipValue = ""; // Suggest_by_note $this->Suggest_by_note->LinkCustomAttributes = ""; $this->Suggest_by_note->HrefValue = ""; $this->Suggest_by_note->TooltipValue = ""; // Referent $this->Referent->LinkCustomAttributes = ""; $this->Referent->HrefValue = ""; $this->Referent->TooltipValue = ""; // add_network $this->add_network->LinkCustomAttributes = ""; $this->add_network->HrefValue = ""; $this->add_network->TooltipValue = ""; // add_documents $this->add_documents->LinkCustomAttributes = ""; $this->add_documents->HrefValue = ""; $this->add_documents->TooltipValue = ""; // add_care $this->add_care->LinkCustomAttributes = ""; $this->add_care->HrefValue = ""; $this->add_care->TooltipValue = ""; // add_food $this->add_food->LinkCustomAttributes = ""; $this->add_food->HrefValue = ""; $this->add_food->TooltipValue = ""; // add_clothes $this->add_clothes->LinkCustomAttributes = ""; $this->add_clothes->HrefValue = ""; $this->add_clothes->TooltipValue = ""; // add_utilities $this->add_utilities->LinkCustomAttributes = ""; $this->add_utilities->HrefValue = ""; $this->add_utilities->TooltipValue = ""; // add_job $this->add_job->LinkCustomAttributes = ""; $this->add_job->HrefValue = ""; $this->add_job->TooltipValue = ""; // Call Row Rendered event $this->Row_Rendered(); } // Render edit row values function RenderEditRow() { global $Security, $gsLanguage, $Language; // Call Row Rendering event $this->Row_Rendering(); // idOfferer $this->idOfferer->EditAttrs["class"] = "form-control"; $this->idOfferer->EditCustomAttributes = ""; $this->idOfferer->EditValue = $this->idOfferer->CurrentValue; $this->idOfferer->ViewCustomAttributes = ""; // Name $this->Name->EditAttrs["class"] = "form-control"; $this->Name->EditCustomAttributes = ""; $this->Name->EditValue = $this->Name->CurrentValue; $this->Name->PlaceHolder = ew_RemoveHtml($this->Name->FldCaption()); // Surname $this->Surname->EditAttrs["class"] = "form-control"; $this->Surname->EditCustomAttributes = ""; $this->Surname->EditValue = $this->Surname->CurrentValue; $this->Surname->PlaceHolder = ew_RemoveHtml($this->Surname->FldCaption()); // Institution_Type $this->Institution_Type->EditAttrs["class"] = "form-control"; $this->Institution_Type->EditCustomAttributes = ""; // Institution_Name $this->Institution_Name->EditAttrs["class"] = "form-control"; $this->Institution_Name->EditCustomAttributes = ""; $this->Institution_Name->EditValue = $this->Institution_Name->CurrentValue; $this->Institution_Name->PlaceHolder = ew_RemoveHtml($this->Institution_Name->FldCaption()); // Address $this->Address->EditAttrs["class"] = "form-control"; $this->Address->EditCustomAttributes = ""; $this->Address->EditValue = $this->Address->CurrentValue; $this->Address->PlaceHolder = ew_RemoveHtml($this->Address->FldCaption()); // Phone $this->Phone->EditAttrs["class"] = "form-control"; $this->Phone->EditCustomAttributes = ""; $this->Phone->EditValue = $this->Phone->CurrentValue; $this->Phone->PlaceHolder = ew_RemoveHtml($this->Phone->FldCaption()); // Phone_Mobile $this->Phone_Mobile->EditAttrs["class"] = "form-control"; $this->Phone_Mobile->EditCustomAttributes = ""; $this->Phone_Mobile->EditValue = $this->Phone_Mobile->CurrentValue; $this->Phone_Mobile->PlaceHolder = ew_RemoveHtml($this->Phone_Mobile->FldCaption()); // Email $this->_Email->EditAttrs["class"] = "form-control"; $this->_Email->EditCustomAttributes = ""; $this->_Email->EditValue = $this->_Email->CurrentValue; $this->_Email->PlaceHolder = ew_RemoveHtml($this->_Email->FldCaption()); // Town $this->Town->EditAttrs["class"] = "form-control"; $this->Town->EditCustomAttributes = ""; $this->Town->EditValue = $this->Town->CurrentValue; $this->Town->PlaceHolder = ew_RemoveHtml($this->Town->FldCaption()); // District $this->District->EditAttrs["class"] = "form-control"; $this->District->EditCustomAttributes = ""; $this->District->EditValue = $this->District->CurrentValue; $this->District->PlaceHolder = ew_RemoveHtml($this->District->FldCaption()); // Region $this->Region->EditAttrs["class"] = "form-control"; $this->Region->EditCustomAttributes = ""; $this->Region->EditValue = $this->Region->CurrentValue; $this->Region->PlaceHolder = ew_RemoveHtml($this->Region->FldCaption()); // Suggest_by $this->Suggest_by->EditAttrs["class"] = "form-control"; $this->Suggest_by->EditCustomAttributes = ""; // Suggest_by_note $this->Suggest_by_note->EditAttrs["class"] = "form-control"; $this->Suggest_by_note->EditCustomAttributes = ""; $this->Suggest_by_note->EditValue = $this->Suggest_by_note->CurrentValue; $this->Suggest_by_note->PlaceHolder = ew_RemoveHtml($this->Suggest_by_note->FldCaption()); // Referent $this->Referent->EditAttrs["class"] = "form-control"; $this->Referent->EditCustomAttributes = ""; $this->Referent->EditValue = $this->Referent->CurrentValue; $this->Referent->PlaceHolder = ew_RemoveHtml($this->Referent->FldCaption()); // add_network $this->add_network->EditCustomAttributes = ""; $this->add_network->EditValue = $this->add_network->Options(FALSE); // add_documents $this->add_documents->EditCustomAttributes = ""; $this->add_documents->EditValue = $this->add_documents->Options(FALSE); // add_care $this->add_care->EditCustomAttributes = ""; $this->add_care->EditValue = $this->add_care->Options(FALSE); // add_food $this->add_food->EditCustomAttributes = ""; $this->add_food->EditValue = $this->add_food->Options(FALSE); // add_clothes $this->add_clothes->EditCustomAttributes = ""; $this->add_clothes->EditValue = $this->add_clothes->Options(FALSE); // add_utilities $this->add_utilities->EditCustomAttributes = ""; $this->add_utilities->EditValue = $this->add_utilities->Options(FALSE); // add_job $this->add_job->EditCustomAttributes = ""; $this->add_job->EditValue = $this->add_job->Options(FALSE); // Call Row Rendered event $this->Row_Rendered(); } // Aggregate list row values function AggregateListRowValues() { } // Aggregate list row (for rendering) function AggregateListRow() { // Call Row Rendered event $this->Row_Rendered(); } var $ExportDoc; // Export data in HTML/CSV/Word/Excel/Email/PDF format function ExportDocument(&$Doc, &$Recordset, $StartRec, $StopRec, $ExportPageType = "") { if (!$Recordset || !$Doc) return; if (!$Doc->ExportCustom) { // Write header $Doc->ExportTableHeader(); if ($Doc->Horizontal) { // Horizontal format, write header $Doc->BeginExportRow(); if ($ExportPageType == "view") { if ($this->idOfferer->Exportable) $Doc->ExportCaption($this->idOfferer); if ($this->Name->Exportable) $Doc->ExportCaption($this->Name); if ($this->Surname->Exportable) $Doc->ExportCaption($this->Surname); if ($this->Institution_Type->Exportable) $Doc->ExportCaption($this->Institution_Type); if ($this->Institution_Name->Exportable) $Doc->ExportCaption($this->Institution_Name); if ($this->Address->Exportable) $Doc->ExportCaption($this->Address); if ($this->Phone->Exportable) $Doc->ExportCaption($this->Phone); if ($this->Phone_Mobile->Exportable) $Doc->ExportCaption($this->Phone_Mobile); if ($this->_Email->Exportable) $Doc->ExportCaption($this->_Email); if ($this->Town->Exportable) $Doc->ExportCaption($this->Town); if ($this->District->Exportable) $Doc->ExportCaption($this->District); if ($this->Region->Exportable) $Doc->ExportCaption($this->Region); if ($this->Suggest_by->Exportable) $Doc->ExportCaption($this->Suggest_by); if ($this->Suggest_by_note->Exportable) $Doc->ExportCaption($this->Suggest_by_note); if ($this->Referent->Exportable) $Doc->ExportCaption($this->Referent); if ($this->add_documents->Exportable) $Doc->ExportCaption($this->add_documents); if ($this->add_care->Exportable) $Doc->ExportCaption($this->add_care); if ($this->add_food->Exportable) $Doc->ExportCaption($this->add_food); if ($this->add_clothes->Exportable) $Doc->ExportCaption($this->add_clothes); if ($this->add_utilities->Exportable) $Doc->ExportCaption($this->add_utilities); if ($this->add_job->Exportable) $Doc->ExportCaption($this->add_job); } else { if ($this->idOfferer->Exportable) $Doc->ExportCaption($this->idOfferer); if ($this->Name->Exportable) $Doc->ExportCaption($this->Name); if ($this->Surname->Exportable) $Doc->ExportCaption($this->Surname); if ($this->Institution_Type->Exportable) $Doc->ExportCaption($this->Institution_Type); if ($this->Institution_Name->Exportable) $Doc->ExportCaption($this->Institution_Name); if ($this->Address->Exportable) $Doc->ExportCaption($this->Address); if ($this->Phone->Exportable) $Doc->ExportCaption($this->Phone); if ($this->Phone_Mobile->Exportable) $Doc->ExportCaption($this->Phone_Mobile); if ($this->_Email->Exportable) $Doc->ExportCaption($this->_Email); if ($this->Town->Exportable) $Doc->ExportCaption($this->Town); if ($this->District->Exportable) $Doc->ExportCaption($this->District); if ($this->Region->Exportable) $Doc->ExportCaption($this->Region); if ($this->Suggest_by->Exportable) $Doc->ExportCaption($this->Suggest_by); if ($this->Referent->Exportable) $Doc->ExportCaption($this->Referent); if ($this->add_documents->Exportable) $Doc->ExportCaption($this->add_documents); if ($this->add_care->Exportable) $Doc->ExportCaption($this->add_care); if ($this->add_food->Exportable) $Doc->ExportCaption($this->add_food); if ($this->add_clothes->Exportable) $Doc->ExportCaption($this->add_clothes); if ($this->add_utilities->Exportable) $Doc->ExportCaption($this->add_utilities); if ($this->add_job->Exportable) $Doc->ExportCaption($this->add_job); } $Doc->EndExportRow(); } } // Move to first record $RecCnt = $StartRec - 1; if (!$Recordset->EOF) { $Recordset->MoveFirst(); if ($StartRec > 1) $Recordset->Move($StartRec - 1); } while (!$Recordset->EOF && $RecCnt < $StopRec) { $RecCnt++; if (intval($RecCnt) >= intval($StartRec)) { $RowCnt = intval($RecCnt) - intval($StartRec) + 1; // Page break if ($this->ExportPageBreakCount > 0) { if ($RowCnt > 1 && ($RowCnt - 1) % $this->ExportPageBreakCount == 0) $Doc->ExportPageBreak(); } $this->LoadListRowValues($Recordset); // Render row $this->RowType = EW_ROWTYPE_VIEW; // Render view $this->ResetAttrs(); $this->RenderListRow(); if (!$Doc->ExportCustom) { $Doc->BeginExportRow($RowCnt); // Allow CSS styles if enabled if ($ExportPageType == "view") { if ($this->idOfferer->Exportable) $Doc->ExportField($this->idOfferer); if ($this->Name->Exportable) $Doc->ExportField($this->Name); if ($this->Surname->Exportable) $Doc->ExportField($this->Surname); if ($this->Institution_Type->Exportable) $Doc->ExportField($this->Institution_Type); if ($this->Institution_Name->Exportable) $Doc->ExportField($this->Institution_Name); if ($this->Address->Exportable) $Doc->ExportField($this->Address); if ($this->Phone->Exportable) $Doc->ExportField($this->Phone); if ($this->Phone_Mobile->Exportable) $Doc->ExportField($this->Phone_Mobile); if ($this->_Email->Exportable) $Doc->ExportField($this->_Email); if ($this->Town->Exportable) $Doc->ExportField($this->Town); if ($this->District->Exportable) $Doc->ExportField($this->District); if ($this->Region->Exportable) $Doc->ExportField($this->Region); if ($this->Suggest_by->Exportable) $Doc->ExportField($this->Suggest_by); if ($this->Suggest_by_note->Exportable) $Doc->ExportField($this->Suggest_by_note); if ($this->Referent->Exportable) $Doc->ExportField($this->Referent); if ($this->add_documents->Exportable) $Doc->ExportField($this->add_documents); if ($this->add_care->Exportable) $Doc->ExportField($this->add_care); if ($this->add_food->Exportable) $Doc->ExportField($this->add_food); if ($this->add_clothes->Exportable) $Doc->ExportField($this->add_clothes); if ($this->add_utilities->Exportable) $Doc->ExportField($this->add_utilities); if ($this->add_job->Exportable) $Doc->ExportField($this->add_job); } else { if ($this->idOfferer->Exportable) $Doc->ExportField($this->idOfferer); if ($this->Name->Exportable) $Doc->ExportField($this->Name); if ($this->Surname->Exportable) $Doc->ExportField($this->Surname); if ($this->Institution_Type->Exportable) $Doc->ExportField($this->Institution_Type); if ($this->Institution_Name->Exportable) $Doc->ExportField($this->Institution_Name); if ($this->Address->Exportable) $Doc->ExportField($this->Address); if ($this->Phone->Exportable) $Doc->ExportField($this->Phone); if ($this->Phone_Mobile->Exportable) $Doc->ExportField($this->Phone_Mobile); if ($this->_Email->Exportable) $Doc->ExportField($this->_Email); if ($this->Town->Exportable) $Doc->ExportField($this->Town); if ($this->District->Exportable) $Doc->ExportField($this->District); if ($this->Region->Exportable) $Doc->ExportField($this->Region); if ($this->Suggest_by->Exportable) $Doc->ExportField($this->Suggest_by); if ($this->Referent->Exportable) $Doc->ExportField($this->Referent); if ($this->add_documents->Exportable) $Doc->ExportField($this->add_documents); if ($this->add_care->Exportable) $Doc->ExportField($this->add_care); if ($this->add_food->Exportable) $Doc->ExportField($this->add_food); if ($this->add_clothes->Exportable) $Doc->ExportField($this->add_clothes); if ($this->add_utilities->Exportable) $Doc->ExportField($this->add_utilities); if ($this->add_job->Exportable) $Doc->ExportField($this->add_job); } $Doc->EndExportRow(); } } // Call Row Export server event if ($Doc->ExportCustom) $this->Row_Export($Recordset->fields); $Recordset->MoveNext(); } if (!$Doc->ExportCustom) { $Doc->ExportTableFooter(); } } // Get auto fill value function GetAutoFill($id, $val) { $rsarr = array(); $rowcnt = 0; // Output if (is_array($rsarr) && $rowcnt > 0) { $fldcnt = count($rsarr[0]); for ($i = 0; $i < $rowcnt; $i++) { for ($j = 0; $j < $fldcnt; $j++) { $str = strval($rsarr[$i][$j]); $str = ew_ConvertToUtf8($str); if (isset($post["keepCRLF"])) { $str = str_replace(array("\r", "\n"), array("\\r", "\\n"), $str); } else { $str = str_replace(array("\r", "\n"), array(" ", " "), $str); } $rsarr[$i][$j] = $str; } } return ew_ArrayToJson($rsarr); } else { return FALSE; } } // Table level events // Recordset Selecting event function Recordset_Selecting(&$filter) { // Enter your code here } // Recordset Selected event function Recordset_Selected(&$rs) { //echo "Recordset Selected"; } // Recordset Search Validated event function Recordset_SearchValidated() { // Example: //$this->MyField1->AdvancedSearch->SearchValue = "your search criteria"; // Search value } // Recordset Searching event function Recordset_Searching(&$filter) { // Enter your code here } // Row_Selecting event function Row_Selecting(&$filter) { // Enter your code here } // Row Selected event function Row_Selected(&$rs) { //echo "Row Selected"; } // Row Inserting event function Row_Inserting($rsold, &$rsnew) { // Enter your code here // To cancel, set return value to FALSE return TRUE; } // Row Inserted event function Row_Inserted($rsold, &$rsnew) { //echo "Row Inserted" } // Row Updating event function Row_Updating($rsold, &$rsnew) { // Enter your code here // To cancel, set return value to FALSE return TRUE; } // Row Updated event function Row_Updated($rsold, &$rsnew) { //echo "Row Updated"; } // Row Update Conflict event function Row_UpdateConflict($rsold, &$rsnew) { // Enter your code here // To ignore conflict, set return value to FALSE return TRUE; } // Grid Inserting event function Grid_Inserting() { // Enter your code here // To reject grid insert, set return value to FALSE return TRUE; } // Grid Inserted event function Grid_Inserted($rsnew) { //echo "Grid Inserted"; } // Grid Updating event function Grid_Updating($rsold) { // Enter your code here // To reject grid update, set return value to FALSE return TRUE; } // Grid Updated event function Grid_Updated($rsold, $rsnew) { //echo "Grid Updated"; } // Row Deleting event function Row_Deleting(&$rs) { // Enter your code here // To cancel, set return value to False return TRUE; } // Row Deleted event function Row_Deleted(&$rs) { //echo "Row Deleted"; } // Email Sending event function Email_Sending(&$Email, &$Args) { //var_dump($Email); var_dump($Args); exit(); return TRUE; } // Lookup Selecting event function Lookup_Selecting($fld, &$filter) { //var_dump($fld->FldName, $fld->LookupFilters, $filter); // Uncomment to view the filter // Enter your code here } // Row Rendering event function Row_Rendering() { // Enter your code here } // Row Rendered event function Row_Rendered() { // To view properties of field class, use: //var_dump($this->); } // User ID Filtering event function UserID_Filtering(&$filter) { // Enter your code here } } ?>