// update_uid - $viewContainer->recId = $recordsCounter; $value = $viewContainer->showDBValue("update_uid", $data, $keylink); $row["update_uid_value"] = $value; // npwpd_old - $viewContainer->recId = $recordsCounter; $value = $viewContainer->showDBValue("npwpd_old", $data, $keylink); $row["npwpd_old_value"] = $value; // id_old - $viewContainer->recId = $recordsCounter; $value = $viewContainer->showDBValue("id_old", $data, $keylink); $row["id_old_value"] = $value; $rowinfo[] = $row; $data = $cipherer->DecryptFetchedArray($rs); } $xt->assign_loopsection("details_row", $rowinfo); } $returnJSON = array("success" => true); $xt->load_template("pad_pad_customer_detailspreview.htm"); $returnJSON["body"] = $xt->fetch_loaded(); if ($mode != "inline") { $returnJSON["counter"] = postvalue("counter"); $layout = GetPageLayout(GoodFieldName($strTableName), 'detailspreview'); if ($layout) { $rtl = $xt->getReadingOrder() == 'RTL' ? 'RTL' : ''; $returnJSON["style"] = "styles/" . $layout->style . "/style" . $rtl . ".css"; $returnJSON["pageStyle"] = "pagestyles/" . $layout->name . $rtl . ".css"; $returnJSON["layout"] = $layout->style . " page-" . $layout->name . ".css"; } } echo "<textarea>" . htmlspecialchars(my_json_encode($returnJSON)) . "</textarea>";
function runner_error_handler($errno, $errstr, $errfile, $errline) { global $strLastSQL; if ($errno == 2048) { return 0; } if ($errno == 8192) { if ($errstr == "Assigning the return value of new by reference is deprecated") { return 0; } if (strpos($errstr, "set_magic_quotes_runtime")) { return 0; } } if ($errno == 2 && strpos($errstr, "has been disabled for security reasons")) { return 0; } if ($errno == 2 && strpos($errstr, "Data is not in a recognized format")) { return 0; } if ($errno == 8 && !strncmp($errstr, "Undefined index", 15)) { return 0; } if (strpos($errstr, "It is not safe to rely on the system's timezone settings.")) { return 0; } if (strpos($errstr, "fopen(") === 0) { return 0; } // show error htm if (!class_exists("Xtempl")) { require_once getabspath("include/xtempl.php"); } $xt = new Xtempl(); $xt->assign('errno', $errno); $xt->assign('errstr', $errstr); $url = $_SERVER["SERVER_NAME"] . $_SERVER["SCRIPT_NAME"]; if (array_key_exists("QUERY_STRING", $_SERVER)) { $url .= "?" . htmlspecialchars($_SERVER["QUERY_STRING"]); } $xt->assign('url', $url); $xt->assign('errfile', $errfile); $xt->assign('errline', $errline); $sqlStr = isset($strLastSQL) ? htmlspecialchars(substr($strLastSQL, 0, 1024)) : ''; $xt->assign('sqlStr', $sqlStr); $debugInfoArr = parse_backtrace($errfile, $errline); $xt->assign_loopsection('debugRow', $debugInfoArr); $xt->display('error.htm'); exit(0); }
/** * Search panel on list template handler * * @param array $params */ function DisplaySearchPanel(&$params) { global $gLoadSearchControls; $dispNoneStyle = 'style="display: none;"'; $xt = new Xtempl(); $xt->assign('searchPanel', $this->isDisplaySearchPanel); $xt->assign('id', $this->id); // search panel radio button assign $searchRadio = $this->searchControlBuilder->getSearchRadio(); $xt->assign_section("all_checkbox_label", $searchRadio['all_checkbox_label'][0], $searchRadio['all_checkbox_label'][1]); $xt->assign_section("any_checkbox_label", $searchRadio['any_checkbox_label'][0], $searchRadio['any_checkbox_label'][1]); $xt->assignbyref("all_checkbox", $searchRadio['all_checkbox']); $xt->assignbyref("any_checkbox", $searchRadio['any_checkbox']); $xt->assign("searchbutton_attrs", "id=\"searchButton" . $this->id . "\" "); $showHideOpt_mess = $this->srchPanelAttrs['ctrlTypeComboStatus'] ? mlang_message("SEARCH_HIDE_OPTIONS_BUTTON") : mlang_message("SEARCH_SHOW_OPTIONS_BUTTON"); // show hide search type opt message $xt->assign("showHideOpt_mess", $showHideOpt_mess); $xt->assign("srchOpt_attrs", 'style="display: none;"'); if ($this->searchClauseObj->getUsedCtrlsCount() > 0) { $xt->assign("srchCritTopCont_attrs", ''); } else { $xt->assign("srchCritTopCont_attrs", 'style="display: none;"'); } if ($this->searchClauseObj->getUsedCtrlsCount() > 1) { $xt->assign("srchCritBottomCont_attrs", ''); } else { $xt->assign("srchCritBottomCont_attrs", 'style="display: none;"'); } if ($this->searchClauseObj->getUsedCtrlsCount() > 0) { $xt->assign("bottomSearchButt_attrs", ''); } else { $xt->assign("bottomSearchButt_attrs", 'style="display: none;"'); } // array for assign $srchCtrlBlocksArr = array(); $recId = $this->pageObj->genId(); // build search controls for each field, first we need to build used controls, because cached must have last index for ($j = 0; $j < count($this->allSearchFields); $j++) { $this->pageObj->fillFieldToolTips($this->allSearchFields[$j]); $xt->assign("addSearch_" . GoodFieldName($this->allSearchFields[$j]), true); $srchFields = $this->searchClauseObj->getSearchCtrlParams($this->allSearchFields[$j]); $ctrlInd = 0; $isFieldNeedSecCtrl = $this->searchControlBuilder->isNeedSecondCtrl($this->allSearchFields[$j]); // add field that should be always shown on panel if (!count($srchFields) && in_array($this->allSearchFields[$j], $this->panelSearchFields)) { $srchFields[] = array('opt' => '', 'not' => '', 'value1' => '', 'value2' => ''); } // build used ctrls for ($i = 0; $i < count($srchFields); $i++) { // build used ctrl $srchCtrlBlocksArr[] = $this->searchControlBuilder->buildSearchCtrlBlockArr($recId, $this->allSearchFields[$j], $ctrlInd, $srchFields[$i]['opt'], $srchFields[$i]['not'], false, $srchFields[$i]['value1'], $srchFields[$i]['value2']); if ($isFieldNeedSecCtrl) { $this->pageObj->controlsMap["search"]["searchBlocks"][] = array('fName' => $this->allSearchFields[$j], 'recId' => $recId, 'ctrlsMap' => array(0 => $ctrlInd, 1 => $ctrlInd + 1)); $ctrlInd += 2; } else { $this->pageObj->controlsMap["search"]["searchBlocks"][] = array('fName' => $this->allSearchFields[$j], 'recId' => $recId, 'ctrlsMap' => array(0 => $ctrlInd)); $ctrlInd++; } // increment ID $recId = $this->pageObj->genId(); // make 0 for cached ctrls and build cache ctrls $ctrlInd = 0; } // use this criteria, for create cached ctrls. Because, it can slow page with big amout of ctrls if (count($this->allSearchFields) < $gLoadSearchControls) { // add cached ctrl $srchCtrlBlocksArr[] = $this->searchControlBuilder->buildSearchCtrlBlockArr($recId, $this->allSearchFields[$j], $ctrlInd, '', false, true, '', ''); if ($isFieldNeedSecCtrl) { $this->pageObj->controlsMap["search"]["searchBlocks"][] = array('fName' => $this->allSearchFields[$j], 'recId' => $recId, 'ctrlsMap' => array(0 => $ctrlInd, 1 => $ctrlInd + 1)); $ctrlInd += 2; } else { $this->pageObj->controlsMap["search"]["searchBlocks"][] = array('fName' => $this->allSearchFields[$j], 'recId' => $recId, 'ctrlsMap' => array(0 => $ctrlInd)); $ctrlInd++; } $recId = $this->pageObj->genId(); } } // assign blocks with ctrls $xt->assign_loopsection('searchCtrlBlock', $srchCtrlBlocksArr); // display templ $xt->display($this->pageObj->shortTableName . "_search_panel.htm"); }
} if ($format == FORMAT_CHECKBOX) { $class = ' rnr-field-checkbox'; } if ($format == FORMAT_NUMBER || IsNumberType($pSet->getFieldType("LastUpdate"))) { $class = ' rnr-field-number'; } $row["LastUpdate_class"] = $class; $rowinfo[] = $row; if ($b) { $rowinfo2[] = $row; $b = false; } $data = $cipherer->DecryptFetchedArray($qResult->fetchAssoc()); } $xt->assign_loopsection("details_row", $rowinfo); $xt->assign_loopsection("details_row_header", $rowinfo2); // assign class for header } $returnJSON = array("success" => true); $xt->load_template(GetTemplateName("StockMaster", "detailspreview")); $returnJSON["body"] = $xt->fetch_loaded(); if ($mode != "inline") { $returnJSON["counter"] = postvalue("counter"); $layout = GetPageLayout(GoodFieldName($strTableName), 'detailspreview'); if ($layout) { foreach ($layout->getCSSFiles(isRTL(), isMobile()) as $css) { $returnJSON['CSSFiles'][] = $css; } } }
/** * Search panel on list template handler * * @param array $params */ function DisplaySearchPanel(&$params) { global $gLoadSearchControls; $dispNoneStyle = 'style="display: none;"'; $xt = new Xtempl(); $xt->assign('searchPanel', $this->isDisplaySearchPanel); $xt->assign('id', $this->id); // search panel radio button assign $searchRadio = $this->searchControlBuilder->getSearchRadio(); $xt->assign_section("all_checkbox_label", $searchRadio['all_checkbox_label'][0], $searchRadio['all_checkbox_label'][1]); $xt->assign_section("any_checkbox_label", $searchRadio['any_checkbox_label'][0], $searchRadio['any_checkbox_label'][1]); $xt->assignbyref("all_checkbox", $searchRadio['all_checkbox']); $xt->assignbyref("any_checkbox", $searchRadio['any_checkbox']); $xt->assign("searchbutton_attrs", "id=\"searchButton" . $this->id . "\" "); $showHideOpt_mess = $this->srchPanelAttrs['ctrlTypeComboStatus'] ? "Hide options" : "Show options"; // show hide search type opt message $xt->assign("showHideOpt_mess", $showHideOpt_mess); $xt->assign("srchOpt_attrs", 'style="display: none;"'); if ($this->searchClauseObj->getUsedCtrlsCount() > 0) { $xt->assign("srchCritTopCont_attrs", ''); } else { $xt->assign("srchCritTopCont_attrs", 'style="display: none;"'); } if ($this->searchClauseObj->getUsedCtrlsCount() > 1) { $xt->assign("srchCritBottomCont_attrs", ''); } else { $xt->assign("srchCritBottomCont_attrs", 'style="display: none;"'); } if ($this->searchClauseObj->getUsedCtrlsCount() > 0) { $xt->assign("bottomSearchButt_attrs", ''); } else { $xt->assign("bottomSearchButt_attrs", 'style="display: none;"'); } // array for assign $srchCtrlBlocksArr = array(); $recId = $this->pageObj->genId(); $addedSearchFields = array(); $haveCashedSearchFields = false; // build search controls for each field, first we need to build used controls, because cached must have last index for ($j = 0; $j < count($this->allSearchFields); $j++) { $this->pageObj->fillFieldToolTips($this->allSearchFields[$j]); $xt->assign("addSearch_" . GoodFieldName($this->allSearchFields[$j]), true); $srchFields = $this->searchClauseObj->getSearchCtrlParams($this->allSearchFields[$j]); $isFieldNeedSecCtrl = $this->searchControlBuilder->isNeedSecondCtrl($this->allSearchFields[$j]); // add field that should be always shown on panel if (!count($srchFields) && in_array($this->allSearchFields[$j], $this->panelSearchFields)) { $srchFields[] = array('opt' => '', 'not' => '', 'value1' => '', 'value2' => ''); } if (count($srchFields)) { $addedSearchFields[] = $this->allSearchFields[$j]; // build used ctrls for ($i = 0; $i < count($srchFields); $i++) { $ctrlInd = 0; // build used ctrl $srchCtrlBlocksArr[] = $this->searchControlBuilder->buildSearchCtrlBlockArr($recId, $this->allSearchFields[$j], $ctrlInd, $srchFields[$i]['opt'], $srchFields[$i]['not'], false, $srchFields[$i]['value1'], $srchFields[$i]['value2']); $this->addSearchFieldToControlsMap($isFieldNeedSecCtrl, $this->allSearchFields[$j], $recId); // make 0 for cached ctrls and build cache ctrls //$ctrlInd = 0; } } else { $haveCashedSearchFields = true; } } if ($haveCashedSearchFields && count($srchCtrlBlocksArr) < $gLoadSearchControls) { $ctrlInd = 0; for ($j = 0; $j < count($this->allSearchFields); $j++) { if (in_array($this->allSearchFields[$j], $addedSearchFields)) { continue; } $isFieldNeedSecCtrl = $this->searchControlBuilder->isNeedSecondCtrl($this->allSearchFields[$j]); // add cached ctrl $srchCtrlBlocksArr[] = $this->searchControlBuilder->buildSearchCtrlBlockArr($recId, $this->allSearchFields[$j], $ctrlInd, '', false, true, '', ''); $this->addSearchFieldToControlsMap($isFieldNeedSecCtrl, $this->allSearchFields[$j], $recId); if (count($srchCtrlBlocksArr) >= $gLoadSearchControls) { break; } } } // assign blocks with ctrls $xt->assign_loopsection('searchCtrlBlock', $srchCtrlBlocksArr); // display templ if (isMobile()) { $xt->display($this->pageObj->shortTableName . "_search_panel_m.htm"); } else { $xt->display($this->pageObj->shortTableName . "_search_panel.htm"); } }