/** * Get a filter's SQL where clause condition * * @param String fName * @param Array intervalData * @param Object pSet * @param Object cipherer * @param String tableName * @return String */ static function getIntervalFilterWhere($fName, $intervalData, $pSet, $cipherer, $tableName, $connection) { $fullFieldName = RunnerPage::_getFieldSQL($fName, $connection, $pSet); if ($intervalData["remainder"]) { $index = $intervalData["index"]; $intervalsData = $pSet->getFilterIntervals($fName); $conditions = array(); foreach ($intervalsData as $intervalData) { if ($intervalData["noLimits"]) { return "1=0"; } if ($intervalData["index"] == $index) { continue; } $conditions[] = FilterIntervalList::getLimitsConditions($fName, $fullFieldName, $intervalData, $cipherer, $tableName, $connection, true); } return implode(" AND ", $conditions); } if ($intervalData["noLimits"]) { return $fullFieldName . " is not NULL AND " . $fullFieldName . " <> '' "; } return FilterIntervalList::getLimitsConditions($fName, $fullFieldName, $intervalData, $cipherer, $tableName, $connection); }
function LookupTextField($field, $pageObject, $id, $connection) { parent::EditControl($field, $pageObject, $id, $connection); $this->format = EDIT_FORMAT_LOOKUP_WIZARD; $this->lookupPageType = $this->pageObject->pSetEdit->getPageTypeByFieldEditFormat($this->field, EDIT_FORMAT_LOOKUP_WIZARD); $this->localPSet = new ProjectSettings($this->pageObject->tName, $this->lookupPageType); $this->lookupTable = $this->localPSet->getLookupTable($this->field); $this->lookupType = $this->localPSet->getLookupType($this->field); if ($this->lookupType == LT_QUERY) { $this->lookupPSet = new ProjectSettings($this->lookupTable); } $this->displayFieldName = $this->localPSet->getDisplayField($this->field); $this->linkFieldName = $this->localPSet->getLinkField($this->field); $this->linkAndDisplaySame = $this->displayFieldName == $this->linkFieldName; $this->ciphererLink = new RunnerCipherer($this->pageObject->tName); if ($this->lookupType == LT_QUERY) { $this->ciphererDisplay = new RunnerCipherer($this->lookupTable); } else { $this->ciphererDisplay = $this->ciphererLink; } $this->LCType = $this->localPSet->lookupControlType($this->field); $this->multiselect = $this->localPSet->multiSelect($this->field); $this->lwLinkField = $connection->addFieldWrappers($this->localPSet->getLinkField($this->field)); $this->lwDisplayFieldWrapped = RunnerPage::sqlFormattedDisplayField($this->field, $connection, $this->localPSet); $this->customDisplay = $this->localPSet->getCustomDisplay($this->field); }
function AddPage(&$params) { parent::RunnerPage($params); $this->formBricks["header"] = "addheader"; $this->formBricks["footer"] = "addbuttons"; }
/** * Get where clause for an active master-detail relationship * @return string */ public function getMasterTableSQLClause() { if ($this->mode == CHART_DASHBOARD) { return ""; } return parent::getMasterTableSQLClause(); }
/** * Clear session kyes * @intellisense */ public function clearSessionKeys() { parent::clearSessionKeys(); if (!count($_POST) && !count($_GET)) { unset($_SESSION[$this->sessionPrefix . "_tempImportFilePath"]); unset($_SESSION[$this->sessionPrefix . "_tempImportLogFilePath"]); unset($_SESSION[$this->sessionPrefix . "_tempDataFilePath"]); } }
function ViewPage(&$params) { parent::RunnerPage($params); $this->setKeysForJs(); $this->formBricks["header"] = "viewheader"; $this->formBricks["footer"] = "viewbuttons"; }
function RemindPasswordPage(&$params) { parent::RunnerPage($params); $this->pSet = new ProjectSettings("DashboardUsers", $this->pageType); $this->pSetEdit = $this->pSet; $this->formBricks["header"] = "remindheader"; $this->formBricks["footer"] = "remindbuttons"; $this->assignFormFooterAndHeaderBricks(true); }
function EditPage(&$params) { parent::RunnerPage($params); $this->editFields = $this->getFieldsByPageType(); $this->setKeys( $this->keys ); $this->formBricks["header"] = "editheader"; $this->formBricks["footer"] = "editbuttons"; }
function LoginPage(&$params) { // call parent constructor parent::RunnerPage($params); $this->auditObj = GetAuditObject(); $this->formBricks["header"] = "loginheader"; $this->formBricks["footer"] = "loginbuttons"; }
/** * @constructor */ function LoginPage(&$params) { // call parent constructor parent::RunnerPage($params); $this->pSet = new ProjectSettings("ConsolidatedStockEnquiry_users", $this->pageType); $this->pSetEdit = $this->pSet; $this->pSetSearch = new ProjectSettings($this->tName, PAGE_SEARCH); $this->auditObj = GetAuditObject(); $this->formBricks["header"] = "loginheader"; $this->formBricks["footer"] = "loginbuttons"; $this->assignFormFooterAndHeaderBricks(true); }
function RegisterPage(&$params = "") { parent::RunnerPage($params); // fill global password settings $this->pwdStrong = GetGlobalData("pwdStrong", false); if ($this->pwdStrong) { $this->settingsMap["globalSettings"]["pwdLen"] = GetGlobalData("pwdLen", 0); $this->settingsMap["globalSettings"]["pwdUnique"] = GetGlobalData("pwdUnique", 0); $this->settingsMap["globalSettings"]["pwdDigits"] = GetGlobalData("pwdDigits", 0); $this->settingsMap["globalSettings"]["pwdStrong"] = true; $this->settingsMap["globalSettings"]["pwdUpperLower"] = GetGlobalData("pwdUpperLower", false); } $this->formBricks["header"] = "regheader"; $this->formBricks["footer"] = "regbuttons"; $this->assignFormFooterAndHeaderBricks(true); }
function ChangePasswordPage(&$params = "") { parent::RunnerPage($params); $this->pSet = new ProjectSettings("DashboardUsers", $this->pageType); $this->pSetEdit = $this->pSet; // fill global password settings $this->pwdStrong = GetGlobalData("pwdStrong", false); if ($this->pwdStrong) { $this->settingsMap["globalSettings"]["pwdLen"] = GetGlobalData("pwdLen", 0); $this->settingsMap["globalSettings"]["pwdUnique"] = GetGlobalData("pwdUnique", 0); $this->settingsMap["globalSettings"]["pwdDigits"] = GetGlobalData("pwdDigits", 0); $this->settingsMap["globalSettings"]["pwdStrong"] = true; $this->settingsMap["globalSettings"]["pwdUpperLower"] = GetGlobalData("pwdUpperLower", false); } $this->formBricks["header"] = "changeheader"; $this->formBricks["footer"] = "changebuttons"; $this->assignFormFooterAndHeaderBricks(true); }
$params["id"] = $id; $params["mode"] = $mode; $params["calendar"] = $calendar; $params["timepicker"] = $timepicker; $params['xt'] =& $xt; $params['shortTableName'] = 'Electricity_Rates'; $params['origTName'] = $strOriginalTableName; $params['sessionPrefix'] = $sessionPrefix; $params['tName'] = $strTableName; $params['includes_js'] = $includes_js; $params['includes_jsreq'] = $includes_jsreq; $params['includes_css'] = $includes_css; $params['locale_info'] = $locale_info; $params['pageType'] = PAGE_SEARCH; //PAGE_SEARCH,$id,$calendar $pageObject = new RunnerPage($params); // create reusable searchControl builder instance $searchControllerId = postvalue('searchControllerId') ? postvalue('searchControllerId') : $pageObject->id; // Before Process event if ($eventObj->exists("BeforeProcessSearch")) { $eventObj->BeforeProcessSearch($conn); } // add constants and files for simple view if ($mode == SEARCH_SIMPLE) { $searchControlBuilder = new AdvancedSearchControl($searchControllerId, $strTableName, $pageObject->searchClauseObj, $pageObject); // add button events if exist $pageObject->addButtonHandlers(); $includes .= "<script language=\"JavaScript\" src=\"include/loadfirst.js\"></script>\r\n"; //$includes.="<script language=\"JavaScript\" src=\"include/customlabels.js\"></script>\r\n"; $includes .= "<script type=\"text/javascript\" src=\"include/lang/" . getLangFileName(mlang_getcurrentlang()) . ".js\"></script>"; // if not simple, this div already exist on page
$_SESSION[$strTableName . "_masterkey" . $i] = $masterKeys["masterkey" . $i]; $i++; } } if (isset($_SESSION[$strTableName . "_masterkey" . $i])) { unset($_SESSION[$strTableName . "_masterkey" . $i]); } } else { $mastertable = $_SESSION[$strTableName . "_mastertable"]; } $params = array(); $params['id'] = 1; $params['xt'] =& $xt; $params['tName'] = $strTableName; $params['pageType'] = "detailspreview"; $pageObject = new RunnerPage($params); if ($mastertable == "company") { $where = ""; $where .= $pageObject->getFieldSQLDecrypt("Coy_Id") . "=" . make_db_value("Coy_Id", $_SESSION[$strTableName . "_masterkey1"]); $where .= " and "; $where .= $pageObject->getFieldSQLDecrypt("Grp_id") . "=" . make_db_value("Grp_id", $_SESSION[$strTableName . "_masterkey2"]); } $str = SecuritySQL("Search", $strTableName); if (strlen($str)) { $where .= " and " . $str; } $strSQL = $gQuery->gSQLWhere($where); $strSQL .= " " . $gstrOrderBy; $rowcount = $gQuery->gSQLRowCount($where, $pageObject->connection); $xt->assign("row_count", $rowcount); if ($rowcount) {
$layout->containers["master"][] = array("name" => "masterinfoprint", "block" => "mastertable_block", "substyle" => 1); $layout->skins["master"] = "empty"; $layout->blocks["top"][] = "master"; $layout->skins["pdf"] = "empty"; $layout->blocks["top"][] = "pdf"; $page_layouts["System_Users_print"] = $layout; include 'include/xtempl.php'; include 'classes/runnerpage.php'; $xt = new Xtempl(); $id = postvalue("id") != "" ? postvalue("id") : 1; $all = postvalue("all"); $pageName = "print.php"; //array of params for classes $params = array("pageType" => PAGE_PRINT, "id" => $id, "tName" => $strTableName); $params["xt"] =& $xt; $pageObject = new RunnerPage($params); // add button events if exist $pageObject->addButtonHandlers(); // Modify query: remove blob fields from fieldlist. // Blob fields on a print page are shown using imager.php (for example). // They don't need to be selected from DB in print.php itself. if (!postvalue("pdf")) { $gQuery->ReplaceFieldsWithDummies(GetBinaryFieldsIndices()); } // Before Process event if ($eventObj->exists("BeforeProcessPrint")) { $eventObj->BeforeProcessPrint($conn); } $strWhereClause = ""; $strHavingClause = ""; $selected_recs = array();
$layout = new TLayout("import", "BoldOrange", "MobileOrange"); $layout->blocks["top"] = array(); $layout->containers["import"] = array(); $layout->containers["import"][] = array("name" => "importheader", "block" => "", "substyle" => 2); $layout->containers["import"][] = array("name" => "importheader_text", "block" => "", "substyle" => 3); $layout->containers["import"][] = array("name" => "errormessage", "block" => "", "substyle" => 1); $layout->containers["import"][] = array("name" => "importfields", "block" => "", "substyle" => 1); $layout->containers["import"][] = array("name" => "importbuttons", "block" => "", "substyle" => 2); $layout->skins["import"] = "fields"; $layout->blocks["top"][] = "import"; $page_layouts["Readings_import"] = $layout; //array of params for classes $params = array("pageType" => PAGE_IMPORT, "id" => $id, "tName" => $strTableName); $params["xt"] =& $xt; $params["needSearchClauseObj"] = false; $pageObject = new RunnerPage($params); // add button events if exist $pageObject->addButtonHandlers(); $pageObject->body["begin"] .= "<script type=\"text/javascript\" src=\"include/loadfirst.js\"></script>\r\n"; $pageObject->body["begin"] .= "<script>\r\n"; $pageObject->body["begin"] .= "function importMore(id)\r\n"; $pageObject->body["begin"] .= "{\r\n"; $pageObject->body["begin"] .= "\tif(\$('#importDebugInfoTable'+id).css('display')=='none')\r\n"; $pageObject->body["begin"] .= "\t\t\$('#importDebugInfoTable'+id).show();\r\n"; $pageObject->body["begin"] .= "\telse\r\n"; $pageObject->body["begin"] .= "\t\t\$('#importDebugInfoTable'+id).hide();\r\n"; $pageObject->body["begin"] .= "}\r\n"; $pageObject->body["begin"] .= "</script>\r\n"; $pageObject->body["begin"] .= "<script type=\"text/javascript\" src=\"include/lang/" . getLangFileName(mlang_getcurrentlang()) . ".js\"></script>"; $pageObject->fillSetCntrlMaps(); $pageObject->body['end'] .= '<script>';
/** * Add common assign */ function commonAssign() { parent::commonAssign(); if (isMobile()) { $this->xt->displayBrickHidden("search_dashboard_m"); } $this->xt->assign("languages_block", true); }
function DisplayMasterTableInfo_GE_ESTADO_CIVIL($params) { global $cman; $detailtable = $params["detailtable"]; $keys = $params["keys"]; $xt = new Xtempl(); $tName = "GE.ESTADO_CIVIL"; $settings = new ProjectSettings($tName, PAGE_LIST); $cipherer = new RunnerCipherer($tName); $connection = $cman->byTable($tName); $masterQuery = $settings->getSQLQuery(); $viewControls = new ViewControlsContainer($settings, PAGE_LIST); $where = ""; $keysAssoc = array(); $showKeys = ""; if ($detailtable == "GE.PERSONA_DISPONIBLE") { $keysAssoc["ESTADO_CIVIL_ID"] = $keys[1 - 1]; $where .= RunnerPage::_getFieldSQLDecrypt("ESTADO_CIVIL_ID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("ESTADO_CIVIL_ID", $keys[1 - 1], "", true); $keyValue = $viewControls->showDBValue("ESTADO_CIVIL_ID", $keysAssoc); $showKeys .= " " . GetFieldLabel("GE_ESTADO_CIVIL", "ESTADO_CIVIL_ID") . ": " . $keyValue; $xt->assign('showKeys', $showKeys); } if (!$where) { return; } $str = SecuritySQL("Search"); if (strlen($str)) { $where .= " and " . $str; } $strWhere = whereAdd($masterQuery->WhereToSql(), $where); if (strlen($strWhere)) { $strWhere = " where " . $strWhere . " "; } $strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql(); LogInfo($strSQL); $data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc()); if (!$data) { return; } // reassign pagetitlelabel function adding extra params $xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings)); $keylink = ""; $keylink .= "&key1=" . runner_htmlspecialchars(rawurlencode(@$data["ESTADO_CIVIL_ID"])); $xt->assign("ESTADO_CIVIL_ID_mastervalue", $viewControls->showDBValue("ESTADO_CIVIL_ID", $data, $keylink)); $format = $settings->getViewFormat("ESTADO_CIVIL_ID"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("ESTADO_CIVIL_ID"))) { $class = ' rnr-field-number'; } $xt->assign("ESTADO_CIVIL_ID_class", $class); // add class for field header as field value $xt->assign("NOMBRE_mastervalue", $viewControls->showDBValue("NOMBRE", $data, $keylink)); $format = $settings->getViewFormat("NOMBRE"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("NOMBRE"))) { $class = ' rnr-field-number'; } $xt->assign("NOMBRE_class", $class); // add class for field header as field value $xt->assign("FEC_CREACION_mastervalue", $viewControls->showDBValue("FEC_CREACION", $data, $keylink)); $format = $settings->getViewFormat("FEC_CREACION"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("FEC_CREACION"))) { $class = ' rnr-field-number'; } $xt->assign("FEC_CREACION_class", $class); // add class for field header as field value $xt->assign("USUARIO_CREACION_mastervalue", $viewControls->showDBValue("USUARIO_CREACION", $data, $keylink)); $format = $settings->getViewFormat("USUARIO_CREACION"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("USUARIO_CREACION"))) { $class = ' rnr-field-number'; } $xt->assign("USUARIO_CREACION_class", $class); // add class for field header as field value $xt->assign("FEC_ULTIMA_MOD_mastervalue", $viewControls->showDBValue("FEC_ULTIMA_MOD", $data, $keylink)); $format = $settings->getViewFormat("FEC_ULTIMA_MOD"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("FEC_ULTIMA_MOD"))) { $class = ' rnr-field-number'; } $xt->assign("FEC_ULTIMA_MOD_class", $class); // add class for field header as field value $xt->assign("USUARIO_ULTIMA_MOD_mastervalue", $viewControls->showDBValue("USUARIO_ULTIMA_MOD", $data, $keylink)); $format = $settings->getViewFormat("USUARIO_ULTIMA_MOD"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("USUARIO_ULTIMA_MOD"))) { $class = ' rnr-field-number'; } $xt->assign("USUARIO_ULTIMA_MOD_class", $class); // add class for field header as field value $layout = GetPageLayout("GE_ESTADO_CIVIL", 'masterlist'); if ($layout) { $xt->assign("pageattrs", 'class="' . $layout->style . " page-" . $layout->name . '"'); } $xt->displayPartial(GetTemplateName("GE_ESTADO_CIVIL", "masterlist")); }
} } if (!$linkAndDisplaySame) { $LookupSQLTable .= "," . ($lwDisplayField == $lwLinkField ? $cipherer->GetFieldName($lwDisplayField, $f, true) : $lwDisplayField); } $LookupSQLTable .= " FROM " . $lookupConnection->addTableWrappers($lookupTable) . " "; } $strLookupWhere = GetLWWhere($f, $pageType, $strTableName); if ($strLookupWhere) { $strLookupWhere = " (" . $strLookupWhere . ") AND "; } if ($LookupType == LT_QUERY) { if ($gSettings->getCustomDisplay($f)) { $likeField = $searchByLinkField ? $linkFieldName : $displayFieldName; } else { $likeField = RunnerPage::_getFieldSQLDecrypt($searchByLinkField ? $linkFieldName : $displayFieldName, $lookupConnection, $lookupPSet, $cipherer); } } else { $likeField = $cipherer->GetFieldName($lwDisplayField, $f); } if ($searchByLinkField) { $likeConditionField = $LookupType == LT_QUERY ? $linkFieldName : $f; } else { $likeConditionField = $LookupType == LT_QUERY ? $displayFieldName : $f; } $likeWheres = array(); foreach ($values as $fieldValue) { if ($LookupType == LT_QUERY) { $likeWheres[] = $likeField . $lookupCipherer->GetLikeClause($likeConditionField, $fieldValue); } else { $likeWheres[] = $likeField . $cipherer->GetLikeClause($likeConditionField, $fieldValue);
$id = postvalue("id"); } else { $id = 1; } //$isNeedSettings = true;//($inlineview && postvalue("isNeedSettings") == 'true') || (!$inlineview); // assign an id $xt->assign("id", $id); //array of params for classes $params = array("pageType" => PAGE_VIEW, "id" => $id, "tName" => $strTableName); $params["xt"] =& $xt; //Get array of tabs for edit page $params['useTabsOnView'] = useTabsOnView($strTableName); if ($params['useTabsOnView']) { $params['arrViewTabs'] = GetViewTabs($strTableName); } $pageObject = new RunnerPage($params); // SearchClause class stuff $pageObject->searchClauseObj->parseRequest(); $_SESSION[$strTableName . '_advsearch'] = serialize($pageObject->searchClauseObj); // proccess big google maps // add button events if exist $pageObject->addButtonHandlers(); //For show detail tables on master page view $dpParams = array(); if ($pageObject->isShowDetailTables && !isMobile()) { $ids = $id; $pageObject->jsSettings['tableSettings'][$strTableName]['dpParams'] = array(); } // Before Process event if ($eventObj->exists("BeforeProcessView")) { $eventObj->BeforeProcessView($conn);
/** * Add js files and scripts * */ function addCommonJs() { // call parent if need RunnerJS API RunnerPage::addCommonJs(); $this->addJsGroupsAndRights(); }
$pageObject->AddCSSFile($layout->getCSSFiles(isRTL(), isMobile())); } $options['id'] = $dpParams['ids'][$d]; $options['flyId'] = $pageObject->genId()+1; $options['tName'] = $strTableName; $options['pageType'] = PAGE_CHART; $options['shortTableName'] = GetTableURL($strTableName); $_params["chartname"] = GetTableURL($strTableName); $_params["table"] = $strTableName; $_params["ctype"] = $dpParams['params'][$d]; $_params["singlePage"] = true; $_params["id"] = $options['flyId']; $options["xt"]->assign_function($options['shortTableName']."_chart","xt_showchart", $_params); $chartPageObject = new RunnerPage($options); $chartPageObject->init(); $options["xt"]->assign("chart_block",true); $options["xt"]->assign("asearch_link",true); $options["xt"]->assign("search_records_block",true); $options["xt"]->assign("exportpdflink_attrs","onclick='chart.saveAsPDF();'"); $options["xt"]->assign("searchform_showall",true); $options["xt"]->assign("showallbutton_attrs","onclick=\"window.location.href='".GetTableLink($options['shortTableName'], "chart", "a=showall")."';\""); $options["xt"]->assign("advsearchlink_attrs", "id=\"advButton".$id."\""); $options["xt"]->assign("style_block",true); $options["xt"]->assign("shiftstyle_block", true); $chartPageObject->addControlsJSAndCSS(); $chartPageObject->fillSetCntrlMaps(); $chartPageObject->body["begin"] = ''; $chartPageObject->body["end"] = ''; $options["xt"]->assign("body",$chartPageObject->body);
/** * Common assign for diferent mode on list page * Branch classes add to this method its individualy code */ function commonAssign() { parent::commonAssign(); $this->xt->assign("id", $this->id); $this->xt->assignbyref("body", $this->body); $this->xt->enable_section("style_block"); $this->xt->enable_section("iestyle_block"); $this->xt->assign("newrecord_controls_block", $this->permis[$this->tName]['add']); $this->xt->assign("record_controls_block", $this->permis[$this->tName]['add'] || $this->isDispGrid()); //$this->xt->assign("grid_controls", $this->isDispGrid()); $this->importLinksAttrs(); $this->xt->assign("changepwd_link", $_SESSION["AccessLevel"] != ACCESS_LEVEL_GUEST); $this->xt->assign("changepwdlink_attrs", "href=\"changepwd.php\" onclick=\"window.location.href='changepwd.php';return false;\""); if ($this->isShowMenu() || $this->isAdminTable()) { $this->xt->assign("quickjump_attrs", 'class="runner-quickjump"'); } if ($this->createLoginPage) { $this->xt->assign("security_block", true); $this->xt->assign("username", htmlspecialchars($_SESSION["UserName"])); $this->xt->assign("logoutlink_attrs", "onclick=\"window.location.href='login.php?a=logout';return false;\""); $this->xt->assign("guestloginlink_attrs", "onclick=\"window.location.href='login.php';return false;\""); $this->xt->assign("loggedas_message", !isLoggedAsGuest()); $this->xt->assign("guestloginbutton", isLoggedAsGuest()); $this->xt->assign("logoutbutton", isSingleSign() && !isLoggedAsGuest()); } foreach ($this->googleMapCfg['mainMapIds'] as $mapId) { $this->xt->assign_event($mapId, $this, 'createMapDiv', array('mapId' => $mapId, 'width' => $this->googleMapCfg['mapsData'][$mapId]['width'], 'height' => $this->googleMapCfg['mapsData'][$mapId]['height'])); } //add assign for grid block $this->addAssignForGrid(); }
$layout->skins["master"] = "empty"; $layout->blocks["top"][] = "master"; $layout->skins["pdf"] = "empty"; $layout->blocks["top"][] = "pdf"; $page_layouts["pad_pad_daftar_hist_print"] = $layout; include 'include/xtempl.php'; include 'classes/runnerpage.php'; $cipherer = new RunnerCipherer($strTableName); $xt = new Xtempl(); $id = postvalue("id") != "" ? postvalue("id") : 1; $all = postvalue("all"); $pageName = "print.php"; //array of params for classes $params = array("id" => $id, "tName" => $strTableName, "pageType" => PAGE_PRINT); $params["xt"] =& $xt; $pageObject = new RunnerPage($params); // add button events if exist $pageObject->addButtonHandlers(); // Modify query: remove blob fields from fieldlist. // Blob fields on a print page are shown using imager.php (for example). // They don't need to be selected from DB in print.php itself. $noBlobReplace = false; if (!postvalue("pdf") && !$noBlobReplace) { $gQuery->ReplaceFieldsWithDummies($pageObject->pSet->getBinaryFieldsIndices()); } // Before Process event if ($eventObj->exists("BeforeProcessPrint")) { $eventObj->BeforeProcessPrint($conn, $pageObject); } $strWhereClause = ""; $strHavingClause = "";
/** * Set template file */ public function setTemplateFile() { if ($this->mode == ADD_INLINE) { $this->templatefile = GetTemplateName($this->shortTableName, "inline_add"); } parent::setTemplateFile(); }
function DisplayMasterTableInfo_BranchMaster($params) { global $cman; $detailtable = $params["detailtable"]; $keys = $params["keys"]; $xt = new Xtempl(); $tName = "BranchMaster"; $xt->eventsObject = getEventObject($tName); $settings = new ProjectSettings($tName, PAGE_LIST); $cipherer = new RunnerCipherer($tName); $connection = $cman->byTable($tName); $masterQuery = $settings->getSQLQuery(); $viewControls = new ViewControlsContainer($settings, PAGE_LIST); $where = ""; $keysAssoc = array(); $showKeys = ""; if ($detailtable == "Fact_SalesTransaction") { $keysAssoc["GroupID"] = $keys[1 - 1]; $keysAssoc["CompanyID"] = $keys[2 - 1]; $where .= RunnerPage::_getFieldSQLDecrypt("GroupID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("GroupID", $keys[1 - 1], "", true); $keyValue = $viewControls->showDBValue("GroupID", $keysAssoc); $showKeys .= " " . GetFieldLabel("BranchMaster", "GroupID") . ": " . $keyValue; $where .= " and "; $showKeys .= " , "; $where .= RunnerPage::_getFieldSQLDecrypt("CompanyID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("CompanyID", $keys[2 - 1], "", true); $keyValue = $viewControls->showDBValue("CompanyID", $keysAssoc); $showKeys .= " " . GetFieldLabel("BranchMaster", "CompanyID") . ": " . $keyValue; $xt->assign('showKeys', $showKeys); } if (!$where) { return; } $str = SecuritySQL("Search", $tName); if (strlen($str)) { $where .= " and " . $str; } $strWhere = whereAdd($masterQuery->WhereToSql(), $where); if (strlen($strWhere)) { $strWhere = " where " . $strWhere . " "; } $strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql(); LogInfo($strSQL); $data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc()); if (!$data) { return; } // reassign pagetitlelabel function adding extra params $xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings)); $keylink = ""; $xt->assign("BranchCloudFolder_mastervalue", $viewControls->showDBValue("BranchCloudFolder", $data, $keylink)); $format = $settings->getViewFormat("BranchCloudFolder"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchCloudFolder"))) { $class = ' rnr-field-number'; } $xt->assign("BranchCloudFolder_class", $class); // add class for field header as field value $xt->assign("BranchLastSyncDate_mastervalue", $viewControls->showDBValue("BranchLastSyncDate", $data, $keylink)); $format = $settings->getViewFormat("BranchLastSyncDate"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchLastSyncDate"))) { $class = ' rnr-field-number'; } $xt->assign("BranchLastSyncDate_class", $class); // add class for field header as field value $xt->assign("l_mastervalue", $viewControls->showDBValue("l", $data, $keylink)); $format = $settings->getViewFormat("l"); $class = " rnr-field-text"; if ($format == FORMAT_FILE) { $class = ' rnr-field-file'; } if ($format == FORMAT_AUDIO) { $class = ' rnr-field-audio'; } if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("l"))) { $class = ' rnr-field-number'; } $xt->assign("l_class", $class); // add class for field header as field value $layout = GetPageLayout("BranchMaster", 'masterlist'); if ($layout) { $xt->assign("pageattrs", 'class="' . $layout->style . " page-" . $layout->name . '"'); } $xt->displayPartial(GetTemplateName("BranchMaster", "masterlist")); }
$pSet = new ProjectSettings($strTableName, $pageType); $denyChecking = $pSet->allowDuplicateValues($fieldName); $denyChecking = $denyChecking && ($strTableName != "DashboardUsers" || $fieldName != $cUserNameField && $fieldName != $cEmailField); if ($denyChecking) { $returnJSON = array("success" => false, "error" => "Duplicated values are allowed"); echo printJSON($returnJSON); return; } $cipherer = new RunnerCipherer($strTableName, $pSet); if ($cipherer->isFieldEncrypted($fieldName)) { $value = $cipherer->MakeDBValue($fieldName, $value, $fieldControlType, true); } else { $value = make_db_value($fieldName, $value, $fieldControlType, "", $strTableName); } if ($value == "null") { $fieldSQL = RunnerPage::_getFieldSQL($fieldName, $_connection, $pSet); } else { $fieldSQL = RunnerPage::_getFieldSQLDecrypt($fieldName, $_connection, $pSet, $cipherer); } $where = $fieldSQL . ($value == "null" ? ' is ' : '=') . $value; $sql = "SELECT count(*) from " . $_connection->addTableWrappers($pSet->getOriginalTableName()) . " where " . $where; $qResult = $_connection->query($sql); if (!$qResult || !($data = $qResult->fetchNumeric())) { $returnJSON = array("success" => false, "error" => "Error: Wrong SQL query"); echo printJSON($returnJSON); return; } $hasDuplicates = $data[0] ? true : false; $returnJSON = array("success" => true, "hasDuplicates" => $hasDuplicates, "error" => ""); echo printJSON($returnJSON); return;
function ViewPage(&$params) { parent::RunnerPage($params); }
public function getFieldSQLDecrypt() { return RunnerPage::_getFieldSQLDecrypt($this->field, $this->connection, $this->pageObject->pSetEdit, $this->pageObject->cipherer); }