public function showDBValue(&$data, $keylink) { if ($this->container->forExport) { return "LONG BINARY DATA - CANNOT BE DISPLAYED"; } $value = ""; if (@$data[$this->field] != NULL && $this->container->pageType != PAGE_PRINT) { $videoId = 'video_' . GoodFieldName(htmlspecialchars($this->field)) . '_'; $videoId .= $this->getContainer()->id . "_"; if ($this->getContainer()->pageType != PAGE_ADD) { $videoId .= $this->getContainer()->recId; } else { $videoId .= postvalue("id"); } $type = 'video/flv'; $fileName = 'file.flv'; $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field); if ($fileNameF) { $fileName = $data[$fileNameF]; if (!$fileName) { $fileName = 'file.flv'; } else { $type = getContentTypeByExtension(substr($fileName, strrpos($fileName, '.'))); } } $href = "mfhandler.php?filename=" . $fileName . "&table=" . rawurlencode($this->getContainer()->pSet->_table) . "&field=" . rawurlencode($this->field) . "&pageType=" . $this->getContainer()->pageType . $keylink; if (isMobileIOS()) { $value = '<video width="' . $this->getContainer()->pSet->getVideoWidth($this->field) . '" height="' . $this->getContainer()->pSet->getVideoHeight($this->field) . '" controls="controls"> <source src="' . $href . '" type="' . $type . '" /> Your browser does not support the video tag. </video>'; } else { $vWidth = $this->getContainer()->pSet->getVideoWidth($this->field); $vHeight = $this->getContainer()->pSet->getVideoHeight($this->field); if ($vWidth == 0) { $vWidth = 300; } if ($vHeight == 0) { $vHeight = 200; } $value .= ' <div style="width:' . $vWidth . 'px; height:' . $vHeight . 'px;"> <video class="projekktor" width="' . $vWidth . '" height="' . $vHeight . '" id="' . $videoId . '" type="' . $type . '" src="' . $href . '" > </video></div>'; } if ($this->pageObject != null) { $this->pageObject->controlsMap['video'][] = $videoId; } } else { $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field); if ($fileNameF) { $fileName = $data[$fileNameF]; if (!$fileName) { $value = $fileName; } } } return $value; }
/** * Set keys values * * @param {array} */ function setKeys($keys = array()) { if (count($keys)) { $this->keys = $keys; return; } $tKeys = $this->pSet->getTableKeys(); for ($i = 0; $i < count($tKeys); $i++) { $this->keys[$tKeys[$i]] = postvalue("editid" . ($i + 1)); } $this->setKeysForJs(); }
public function showDBValue(&$data, $keylink) { $value = ""; if (@$data[$this->field] != NULL && $this->container->pageType != PAGE_PRINT) { $videoId = 'video_' . GoodFieldName(runner_htmlspecialchars($this->field)) . '_'; $videoId .= $this->getContainer()->id . "_"; if ($this->getContainer()->pageType != PAGE_ADD) { $videoId .= $this->getContainer()->recId; } else { $videoId .= postvalue("id"); } $type = 'video/mp4'; $fileName = 'file.mp4'; $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field); if ($fileNameF) { $fileName = $data[$fileNameF]; if (!$fileName) { $fileName = 'file.mp4'; } else { $type = getContentTypeByExtension(substr($fileName, strrpos($fileName, '.'))); } } $href = GetTableLink("mfhandler", "", "filename=" . $fileName . "&table=" . rawurlencode($this->getContainer()->pSet->_table) . "&field=" . rawurlencode($this->field) . "&pageType=" . $this->getContainer()->pageType . $keylink); $vWidth = $this->getContainer()->pSet->getVideoWidth($this->field); $vHeight = $this->getContainer()->pSet->getVideoHeight($this->field); if ($vWidth == 0) { $vWidth = 300; } if ($vHeight == 0) { $vHeight = 200; } $value .= ' <div style="width:' . $vWidth . 'px; height:' . $vHeight . 'px;"> <video class="projekktor" width="' . $vWidth . '" height="' . $vHeight . '" id="' . $videoId . '" type="' . $type . '" src="' . $href . '" > </video></div>'; if ($this->pageObject != null) { $this->pageObject->controlsMap['video'][] = $videoId; } } else { $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field); if ($fileNameF) { $fileName = $data[$fileNameF]; if (!$fileName) { $value = $fileName; } } } return $value; }
public function displaySearchControl() { $this->searchControlBuilder = new PanelSearchControl($this->searchControllerId, $this->tName, $this->searchClauseObj, $this); $defaultValue = $this->pSet->getDefaultValue($this->ctrlField); $ctrlBlockArr = $this->searchControlBuilder->buildSearchCtrlBlockArr($this->id, $this->ctrlField, 0, '', false, true, $defaultValue, ''); // build array for encode $resArr = array(); $resArr['control1'] = trim($this->xt->call_func($ctrlBlockArr['searchcontrol'])); $resArr['control2'] = trim($this->xt->call_func($ctrlBlockArr['searchcontrol1'])); $resArr['comboHtml'] = trim($ctrlBlockArr['searchtype']); $resArr['delButt'] = trim($ctrlBlockArr['delCtrlButt']); $resArr['delButtId'] = trim($this->searchControlBuilder->getDelButtonId($this->ctrlField, $this->id)); $resArr['divInd'] = trim($this->id); $resArr['fLabel'] = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($this->ctrlField)); $resArr['ctrlMap'] = $this->controlsMap['controls']; if (postvalue('isNeedSettings') == 'true') { $this->fillSettings(); $resArr['settings'] = $this->jsSettings; } // return JSON echo printJSON($resArr); exit; }
* * Rules: * 1) All fields are required * 2) usernm must be unique * 3) usernm must match usernm2 * 4) passwd must be passwd2 * */ case "Register": $firstnm = postvalue("firstnm", ""); $lastnm = postvalue("lastnm", ""); $phonenbr = postvalue("phonenbr", ""); $usernm = postvalue("usernm", ""); $usernm2 = postvalue("usernm2", ""); $passwd = postvalue("passwd", ""); $passwd2 = postvalue("passwd2", ""); $errlist = "<ul style='background-color: red; padding: 8px 40px 8px 40px;'>"; $errors = 0; /* Required field checks */ if (!$firstnm) { $errlist .= "<li>First name is required.</li>"; $errors++; } if (!$lastnm) { $errlist .= "<li>Last name is required.</li>"; $errors++; } if (!$phonenbr) { $errlist .= "<li>Phone number is required.</li>"; $errors++; }
} $options["masterKeysReq"][$i] = $_REQUEST["masterkey" . $i]; $i++; } // Create $pageObject $pageObject = ListPage::createListPage($strTableName, $options); // Read Search parameters from the request if (postvalue("saveSearch") && postvalue("searchName") && !is_null($pageObject->searchLogger)) { $searchName = postvalue("searchName"); $searchParams = $pageObject->getSearchParamsForSaving(); $pageObject->searchLogger->saveSearch($searchName, $searchParams); $pageObject->searchClauseObj->savedSearchIsRun = true; $_SESSION[$pageObject->sessionPrefix . '_advsearch'] = serialize($pageObject->searchClauseObj); echo my_json_encode($searchParams); exit; } // Delete the saved search if (postvalue("deleteSearch") && postvalue("searchName") && !is_null($pageObject->searchLogger)) { $searchName = postvalue("searchName"); $pageObject->searchLogger->deleteSearch($searchName); exit; } $gQuery->ReplaceFieldsWithDummies($pageObject->getNotListBlobFieldsIndices()); if ($mode != LIST_DETAILS) { } unset($_SESSION["message_add"]); unset($_SESSION["message_edit"]); // prepare code for build page $pageObject->prepareForBuildPage(); // show page depends of mode $pageObject->showPage();
} else { $xt->assign("footer", false); $xt->assign("header", false); $xt->assign("flybody", $pageObject->body); $xt->assign("body", true); $xt->assign("pdflink_block", false); $pageObject->fillSetCntrlMaps(); $returnJSON['controlsMap'] = $pageObject->controlsHTMLMap; $returnJSON['viewControlsMap'] = $pageObject->viewControlsHTMLMap; $returnJSON['settings'] = $pageObject->jsSettings; } $xt->assign("style_block", true); $xt->assign("stylefiles_block", true); $editlink = ""; $editkeys = array(); $editkeys["editid1"] = postvalue("editid1"); foreach ($editkeys as $key => $val) { if ($editlink) { $editlink .= "&"; } $editlink .= $key . "=" . $val; } $xt->assign("editlink_attrs", "id=\"editLink" . $id . "\" name=\"editLink" . $id . "\" onclick=\"window.location.href='pad_pad_customer_edit.php?" . $editlink . "'\""); $strPerm = GetUserPermissions($strTableName); if (CheckSecurity($ownerIdValue, "Edit") && !$inlineview && strpos($strPerm, "E") !== false) { $xt->assign("edit_button", true); } else { $xt->assign("edit_button", false); } if (!$pdf && !$all && !$inlineview) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$pageObject->body['end'] .= "window.settings = " . my_json_encode($pageObject->jsSettings) . ";"; $pageObject->body['end'] .= '</script>'; $pageObject->body['end'] .= "<script language=\"JavaScript\" src=\"include/runnerJS/RunnerAll.js\"></script>\r\n"; $pageObject->body["end"] .= "<script>" . $pageObject->PrepareJs() . "</script>"; $xt->assignbyref("body", $pageObject->body); $xt->display($templatefile); exit; } else { if ($mode == SEARCH_LOAD_CONTROL) { $searchControlBuilder = new PanelSearchControl($searchControllerId, $strTableName, $pageObject->searchClauseObj, $pageObject); $ctrlField = postvalue('ctrlField'); $ctrlBlockArr = $searchControlBuilder->buildSearchCtrlBlockArr($id, $ctrlField, 0, '', false, true, '', ''); // build array for encode $resArr = array(); $resArr['control1'] = trim($xt->call_func($ctrlBlockArr['searchcontrol'])); $resArr['control2'] = trim($xt->call_func($ctrlBlockArr['searchcontrol1'])); $resArr['comboHtml'] = trim($ctrlBlockArr['searchtype']); $resArr['delButt'] = trim($ctrlBlockArr['delCtrlButt']); $resArr['delButtId'] = trim($searchControlBuilder->getDelButtonId($ctrlField, $id)); $resArr['divInd'] = trim($id); $resArr['fLabel'] = GetFieldLabel(GoodFieldName($strTableName), GoodFieldName($ctrlField)); $resArr['ctrlMap'] = $pageObject->controlsMap['controls']; if (postvalue('isNeedSettings') == 'true') { $pageObject->fillSettings(); $resArr['settings'] = $pageObject->jsSettings; } // return JSON echo my_json_encode($resArr); exit; } }
$params["tName"] = $strTableName; $params["action"] = postvalue("a"); $params["needSearchClauseObj"] = false; $params["baseTableName"] = postvalue("table"); $params["afterAdd_id"] = postvalue("afteradd"); $params["masterTable"] = postvalue("mastertable"); if ($pageMode == ADD_INLINE) { // Inline add in a 'List page with search' lookup $params["forListPageWithSearch"] = postvalue('forLookup'); $params["screenWidth"] = postvalue("screenWidth"); $params["screenHeight"] = postvalue("screenHeight"); $params["orientation"] = postvalue("orientation"); $params["masterPageType"] = postvalue("mainMPageType"); } if ($pageMode == ADD_ONTHEFLY || $pageMode == ADD_INLINE && (postvalue('forLookup') || postvalue("category"))) { //table where lookup is set $params["mainTable"] = postvalue("table"); //field with lookup is set $params["mainField"] = postvalue("field"); //the ptype od the page where lookup is set $params["mainPageType"] = postvalue("pageType"); //the parent control value $params["category"] = postvalue("category"); } if ($pageMode == ADD_DASHBOARD) { $params["dashElementName"] = postvalue("dashelement"); $params["dashTName"] = postvalue("table"); } $pageObject = new AddPage($params); $pageObject->init(); $pageObject->process();
// 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>";
} if (count($aKeys) == 0 && searchId) { $lastId = db_insertid($conn); if ($lastId > 0) { $aKeys[$keyfields[0]] = $lastId; } } } return $aKeys; } $id = postvalue("id") != "" ? postvalue("id") : 1; $error_message = ""; // if is postback (form sended) and import needed if (@$_POST["a"] == "added") { $value = postvalue("value_ImportFileName" . $id); $type = postvalue("type_ImportFileName" . $id); $importfile = getImportTableName("file_ImportFileName" . $id); //check the file extension $pos = strrpos($value, "."); $ext = strtoupper(substr($value, $pos)); if ($eventObj->exists('BeforeImport')) { if ($eventObj->BeforeImport() === false) { exit(0); } } if ($ext == ".XLS" || $ext == ".XLSX") { ImportFromExcel($importfile); } else { ImportFromCSV($importfile); } if ($eventObj->exists('AfterImport')) {
public function showPage() { if ($this->eventsObject->exists("BeforeShowChart")) { $this->eventsObject->BeforeShowChart($this->xt, $this->templatefile, $this); } if ($this->mode == CHART_DETAILS || $this->mode == CHART_DASHBOARD || $this->mode == CHART_DASHDETAILS) { $this->addControlsJSAndCSS(); $this->fillSetCntrlMaps(); $this->xt->unassign("header"); $this->xt->unassign("footer"); $this->body["begin"] = ""; $this->body["end"] = ""; $this->xt->assign("body", $this->body); $bricksExcept = array("chart"); $this->xt->hideAllBricksExcept($bricksExcept); if ($this->show_message_block) { $this->xt->assign("message_block", true); } $this->displayAJAX($this->templatefile, $this->id + 1); exit; } if ($this->mode == CHART_POPUPDETAILS) { $bricksExcept = array("grid", "pagination"); $this->xt->unassign('header'); $this->xt->unassign('footer'); $this->body["begin"] = ''; $this->body["end"] = ''; $this->xt->hideAllBricksExcept($bricksExcept); $this->xt->prepare_template($this->templatefile); $respArr = array(); $respArr['success'] = true; $respArr['body'] = $this->xt->fetch_loaded("body"); $respArr['counter'] = postvalue('counter'); $this->xt->assign("container_master", false); echo printJSON($respArr); exit; } $this->display($this->templatefile); }
$strTableName = GetTableByShort($table); if (!checkTableName($table)) { exit(0); } require_once "include/" . $table . "_variables.php"; $searchFor = postvalue('searchFor'); // if nothing to search if ($searchFor == '') { echo printJSON(array('success' => true, 'result' => '')); return; } $_connection = $cman->byTable($strTableName); // array of vals $response = array(); $searchOpt = postvalue("start") ? "Starts with" : "Contains"; $searchField = GoodFieldName(postvalue('searchField')); $strSecuritySql = SecuritySQL("Search", $strTableName); $numberOfSuggests = GetGlobalData("searchSuggestsNumber", 10); $pSet = new ProjectSettings($strTableName, PAGE_SEARCH); if ($searchField == "") { $allSearchFields = $pSet->getGoogleLikeFields(); } else { // array of fields which were added in wizard for search $allSearchFields = $pSet->getAllSearchFields(); } require_once getabspath('classes/controls/EditControlsContainer.php'); $detailKeys = array(); $masterWhere = ""; $cipherer = new RunnerCipherer($strTableName); $controls = new EditControlsContainer(null, $pSet, PAGE_LIST, $cipherer); if (@$_SESSION[$strTableName . "_mastertable"] != "") {
function readWebValue(&$avalues, &$blobfields, $legacy1, $legacy2, &$filename_values) { $this->getPostValueAndType(); $this->formStamp = postvalue("formStamp_" . $this->goodFieldName . "_" . $this->id); if (FieldSubmitted($this->goodFieldName . "_" . $this->id) && $this->formStamp != "") { $filesArray = my_json_decode($this->webValue); if (!is_array($filesArray) || count($filesArray) == 0) { $this->webValue = ""; } else { if (count($_SESSION["mupload_" . $this->formStamp]) > 0) { foreach ($_SESSION["mupload_" . $this->formStamp] as $fileArray) { $fileArray["deleted"] = true; } } $result = array(); $uploadDir = $this->pageObject->pSetEdit->getLinkPrefix($this->field); $searchStr = ""; foreach ($filesArray as $file) { if (isset($_SESSION["mupload_" . $this->formStamp][$file["name"]])) { $sessionFile = $_SESSION["mupload_" . $this->formStamp][$file["name"]]["file"]; $searchStr .= $file["name"] . ",!"; $result[] = array("name" => $sessionFile["name"], "usrName" => $file["name"], "size" => $sessionFile["size"], "type" => $sessionFile["type"]); if ($this->pageObject->pSetEdit->getCreateThumbnail($this->field) && $sessionFile["thumbnail"] != "") { $lastIndex = count($result) - 1; $result[$lastIndex]["thumbnail"] = $sessionFile["thumbnail"]; $result[$lastIndex]["thumbnail_type"] = $sessionFile["thumbnail_type"]; $result[$lastIndex]["thumbnail_size"] = $sessionFile["thumbnail_size"]; } $_SESSION["mupload_" . $this->formStamp][$file["name"]]["deleted"] = false; } } if (count($result) > 0) { $result[0]["searchStr"] = $searchStr . ":sStrEnd"; $this->webValue = my_json_encode_unescaped_unicode($result); } else { $this->webValue = ""; } } } else { $this->webValue = false; } if (!($this->webValue === false)) { if ($this->connection->dbType == nDATABASE_Informix) { if (IsTextType($this->pageObject->pSetEdit->getFieldType($this->field))) { $blobfields[] = $this->field; } } $avalues[$this->field] = $this->webValue; } }
public function delete() { $fileName = postvalue("fileName"); $success = false; if (isset($_SESSION["mupload_" . $this->formStamp][$fileName])) { if (!$_SESSION["mupload_" . $this->formStamp][$fileName]["fromDB"]) { $sessionFile = $_SESSION["mupload_" . $this->formStamp][$fileName]["file"]; $file_path = $sessionFile["name"]; if (is_file($file_path)) { $success = unlink($file_path); } if ($success && $sessionFile["thumbnail"] != "") { $file = $sessionFile["thumbnail"]; if (is_file($file)) { unlink($file); } } unset($_SESSION["mupload_" . $this->formStamp][$fileName]); } else { $_SESSION["mupload_" . $this->formStamp][$fileName]["deleted"] = true; $success = true; } } header('Content-type: application/json'); echo my_json_encode($success); }
else $b_includes .= '$("#add_new_query").hide();'; $b_includes .= ' NEXT_PAGE_URL = "'.GetTableLink("webreport3").'"; PREV_PAGE_URL = "'.GetTableLink("webreport").'";'; $b_includes .= '$("td[id=row1], td[id=row2]").hide();'."\r\n"; foreach ($arr_tables_custom as $tbl) { if(!$tbl["isStorProc"]) { $selected=""; if ( !empty( $_SESSION['webreports']['tables'] ) ) if ( in_array( $tbl["sqlname"], $_SESSION['webreports']['tables'] ) ) $selected = "selected"; if(postvalue("sqlname")==$tbl["sqlname"]) $selected = "selected"; $b_includes .= "$('<option ".$selected."></option>').attr('value', '".jsreplace($tbl["sqlname"])."').html('".jsreplace(getCaptionTable($tbl["sqlname"]))."').appendTo($('#tables'));"."\r\n"; } } $b_includes .= ' } $("li").css("list-style-type","none"); $(".selected").css("padding-bottom","0px"); if($("#tables").get(0).selectedIndex==-1) $("#tables").get(0).selectedIndex=0; //if(li_selected_start!=li_selected) // $("#row5,#row6").show(); //else if(table_name==$("#tables").val())
* styletype - stype of style change */ ini_set("display_errors", "1"); ini_set("display_startup_errors", "1"); include "include/dbcommon.php"; header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); include "include/reportfunctions.php"; // #9875 It's expected that webreport_style table belongs to the webreport db connection $_connection = $cman->getForWebReports(); $xml = new xml(); if (!postvalue('str_xml')) { echo "Error: No se han obtenido resultados. Inténtelo de nuevo."; exit(0); } $arr = $xml->xml_to_array(postvalue('str_xml')); $repname = postvalue('repname'); if ($_POST['str_xml'] == "del_all") { $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE " . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname); $_connection->exec($strSQL); die; } $arrayer = array(); foreach ($arr as $key => $style_record) { if ($style_record['type'] == "table") { $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE (" . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname) . " AND " . $_connection->addFieldWrappers("styletype") . "='" . $style_record['params']['styleType'] . "')"; $_connection->exec($strSQL); } if ($style_record['type'] == "group") { if ($style_record['params']['groupName'] != 0) { $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE (" . $_connection->addFieldWrappers("group") . " = " . (0 + $style_record["params"]["groupName"]) . " AND " . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname) . " AND " . $_connection->addFieldWrappers("styletype") . "='" . $style_record["params"]["styleType"] . "' AND (" . $_connection->addFieldWrappers("type") . "='cell' OR " . $_connection->addFieldWrappers("type") . "='group'))"; $_connection->exec($strSQL);
$_connection = $cman->byTable($strTableName); if (!$pSet->checkFieldPermissions($field)) { $returnJSON = array("success" => false, "error" => 'Error: You have not permission for read this text'); echo printJSON($returnJSON); return; } if (!$gQuery->HasGroupBy()) { // Do not select any fields except current (full text) field. // If query has 'group by' clause then other fields are used in it and we may not simply cut 'em off. // Just don't do anything in that case. $gQuery->RemoveAllFieldsExcept($pSet->getFieldIndex($field)); } $keysArr = $pSet->getTableKeys(); $keys = array(); foreach ($keysArr as $ind => $k) { $keys[$k] = postvalue("key" . ($ind + 1)); } $where = KeyWhere($keys); $sql = $gQuery->gSQLWhere($where); $qResult = $_connection->query($sql); if (!$qResult || !($data = $cipherer->DecryptFetchedArray($qResult->fetchAssoc()))) { $returnJSON = array("success" => false, "error" => 'Error: Wrong SQL query'); echo printJSON($returnJSON); return; } $fieldValue = $data[$field]; $sessionPrefix = $pSet->getOriginalTableName(); if ($mode == LIST_DASHBOARD) { //set the session prefix for the dashboard list page $sessionPrefix = "Dashboard_" . $pSet->getOriginalTableName(); }
$rfooter["endrecordheader_block"] = true; } $record_header["data"][] = $rheader; $record_footer["data"][] = $rfooter; } $xt->assignbyref("record_header", $record_header); $xt->assignbyref("record_footer", $record_footer); $xt->assign("grid_header", true); $xt->assign("grid_footer", true); if ($eventObj->exists("BeforeShowPrint")) { $eventObj->BeforeShowPrint($xt, $pageObject->templatefile, $pageObject); } if (!postvalue("pdf")) { $xt->display($pageObject->templatefile); } else { $xt->load_template($pageObject->templatefile); $page = $xt->fetch_loaded(); $pagewidth = postvalue("width") * 1.05; $pageheight = postvalue("height") * 1.05; $landscape = false; if ($pagewidth > $pageheight) { $landscape = true; if ($pagewidth / $pageheight < 297 / 210) { $pagewidth = 297 / 210 * $pageheight; } } else { if ($pagewidth / $pageheight < 210 / 297) { $pagewidth = 210 / 297 * $pageheight; } } }
} 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); } } $strLookupWhere .= implode(' OR ', $likeWheres); if ($gSettings->useCategory($f) && ($isExistParent || postvalue('editMode') != MODE_SEARCH)) { $arLookupWhere = array(); foreach ($lookupCategory as $arLookupCategory) { $cvalue = make_db_value($gSettings->getCategoryControl($f), $arLookupCategory); $arLookupWhere[] = $lookupConnection->addFieldWrappers($gSettings->getCategoryFilter($f)) . "=" . $cvalue; } $arLookupWhereToStr = count($arLookupWhere) == 1 ? $arLookupWhere[0] : "(" . implode(" OR ", $arLookupWhere) . ")"; if (count($arLookupWhere)) { $strLookupWhere = whereAdd($strLookupWhere, $arLookupWhereToStr); } } if (strlen($lookupOrderBy)) { $lookupOrderBy = $lookupConnection->addFieldWrappers($lookupOrderBy); if ($gSettings->isLookupDesc($f)) { $lookupOrderBy .= ' DESC'; }
/** * Returns true if logged out * @return Boolean */ static function processLogoutRequest() { // no need to logout if (postvalue("a") != "logout" || !isLogged() || isLoggedAsGuest()) { return false; } // logout and redirect (refresh current page) $loginPageObject = Security::createLoginPageObject(); $loginPageObject->Logout(); // login as guest Security::doGuestLogin(); global $logoutPerformed; $logoutPerformed = true; return true; }
$layout->blocks["bare"][] = "mastergrid"; $page_layouts["Fact_SalesTransaction_masterprint"] = $layout; $layout->skinsparams = array(); $layout->skinsparams["empty"] = array("button" => "button1"); $layout->skinsparams["menu"] = array("button" => "button1"); $layout->skinsparams["hmenu"] = array("button" => "button1"); $layout->skinsparams["undermenu"] = array("button" => "button1"); $layout->skinsparams["fields"] = array("button" => "button1"); $layout->skinsparams["form"] = array("button" => "button1"); $layout->skinsparams["1"] = array("button" => "button1"); $layout->skinsparams["2"] = array("button" => "button1"); $layout->skinsparams["3"] = array("button" => "button1"); $xt = new Xtempl(); $id = postvalue("id"); $id = $id != "" ? $id : 1; $all = postvalue("all"); //array of params for classes $params = array(); $params["id"] = $id; $params["xt"] =& $xt; $params["pageType"] = PAGE_PRINT; $params["tName"] = $strTableName; $params["selectedRecords"] = PrintPage::readSelectedRecordsFromRequest("GroupMaster"); $params["allPagesMode"] = postvalue("all"); $params["recsPerRowPrint"] = 1; $params["pdfMode"] = postvalue("pdf"); $params["pdfContent"] = postvalue("htmlPdfContent"); $params["pdfWidth"] = postvalue("width"); $pageObject = new PrintPage($params); $pageObject->init(); $pageObject->process();
$pageObject->body['end'] = array(); $pageObject->body['end']["method"] = "assignBodyEnd"; $pageObject->body['end']["object"] =& $pageObject; $xt->assign("body", $pageObject->body); $xt->assign("flybody", true); } if ($inlineedit == EDIT_POPUP) { $xt->assign("footer", false); $xt->assign("header", false); $xt->assign("body", $pageObject->body); } $xt->assign("style_block", true); $pageObject->xt->assign("legend", true); $viewlink = ""; $viewkeys = array(); $viewkeys["editid1"] = postvalue("editid1"); foreach ($viewkeys as $key => $val) { if ($viewlink) { $viewlink .= "&"; } $viewlink .= $key . "=" . $val; } $xt->assign("viewlink_attrs", "id=\"viewButton" . $id . "\" name=\"viewButton" . $id . "\" onclick=\"window.location.href='app_modules_view.php?" . $viewlink . "'\""); if (CheckSecurity(@$_SESSION["_" . $strTableName . "_OwnerID"], "Search") && $inlineedit == EDIT_SIMPLE) { $xt->assign("view_button", true); } else { $xt->assign("view_button", false); } ///////////////////////////////////////////////////////////// //display the page /////////////////////////////////////////////////////////////
} if ($reminded) { $pageObject->templatefile = GetTemplateName("", "remind_success"); $xt->assign("id",$id); $xt->assign("footer",false); $xt->assign("header",false); $xt->assign("body",true); $pageObject->displayAJAX($pageObject->templatefile, $id+1); exit(); } echo printJSON($returnJSON); exit(); } // load popup page if (postvalue("onFly") == 1) { $xt->assign("message_block",true); $xt->assign("message","<div id='remind_message' class='message rnr-error'></div>"); $xt->displayBrickHidden("message"); $xt->assign("id",$id); $xt->assign("footer",false); $xt->assign("header",false); $xt->assign("body",$pageObject->body); $xt->assign("style_block",true); $xt->assign("backlink_attrs", 'style="display:none"'); $xt->assign("submit_attrs","id='submitRemind'"); $pageObject->displayAJAX($pageObject->templatefile, $id+1); exit(); }
$layout->skins["toplinks"] = "empty"; $layout->blocks["top"][] = "toplinks"; $layout->containers["hmenu"] = array(); $layout->container_properties["hmenu"] = array(); $layout->containers["hmenu"][] = array("name" => "hmenu", "block" => "menu_block", "substyle" => 1); $layout->skins["hmenu"] = "hmenu"; $layout->blocks["top"][] = "hmenu"; $page_layouts["Stock_Dashboard_dashboard"] = $layout; $layout->skinsparams = array(); $layout->skinsparams["empty"] = array("button" => "button1"); $layout->skinsparams["menu"] = array("button" => "button1"); $layout->skinsparams["hmenu"] = array("button" => "button1"); $layout->skinsparams["undermenu"] = array("button" => "button1"); $layout->skinsparams["fields"] = array("button" => "button1"); $layout->skinsparams["form"] = array("button" => "button1"); $layout->skinsparams["1"] = array("button" => "button1"); $layout->skinsparams["2"] = array("button" => "button1"); $layout->skinsparams["3"] = array("button" => "button1"); $xt = new Xtempl(); $id = postvalue("id"); $id = $id != "" ? $id : 1; //array of params for classes $params = array(); $params["id"] = $id; $params["xt"] =& $xt; $params["tName"] = $strTableName; $params["pageType"] = PAGE_DASHBOARD; $params["templatefile"] = GetTemplateName("Stock_Dashboard", "dashboard"); $pageObject = new DashboardPage($params); $pageObject->init(); $pageObject->process();
$mode = SEARCH_LOAD_CONTROL; } } $params = array(); $params["id"] = $id; $params['xt'] =& $xt; $params["mode"] = $mode; $params['chartName'] = $cname; $params['reportName'] = $rname; $params['tName'] = $strTableName; $params['pageType'] = PAGE_SEARCH; $params['templatefile'] = $templatefile; $params['shortTableName'] = 'CompanyMaster'; $params['searchControllerId'] = postvalue('searchControllerId') ? postvalue('searchControllerId') : $id; $params['ctrlField'] = postvalue('ctrlField'); //crosstab report params $params['axis_x'] = postvalue('axis_x'); $params['axis_y'] = postvalue('axis_y'); $params['field'] = postvalue('field'); $params['group_func'] = postvalue('group_func'); if ($mode == SEARCH_DASHBOARD) { $params["dashTName"] = postvalue("table"); $params["dashElementName"] = postvalue("dashelement"); } $pageObject = new SearchPage($params); if ($mode == SEARCH_LOAD_CONTROL) { $pageObject->displaySearchControl(); return; } $pageObject->init(); $pageObject->process();
} $preload = $pageObject->fillPreload($fName, $vals); if ($preload !== false) { $controls["controls"]['preloadData'] = $preload; if (!@$defvalues[$fName] && count($preload["vals"]) > 0) { $defvalues[$fName] = $preload["vals"][0]; } } $pageObject->fillControlsMap($controls); //fill field tool tips $pageObject->fillFieldToolTips($fName); // fill special settings for timepicker if ($pageObject->pSet->getEditFormat($fName) == 'Time') { $pageObject->fillTimePickSettings($fName, @$defvalues[$fName]); } if (($detailKeys && in_array($fName, $detailKeys) || $fName == postvalue("category")) && array_key_exists($fName, $defvalues)) { $value = $pageObject->showDBValue($fName, $defvalues); $xt->assign($gfName . "_editcontrol", $value); } } //fill tab groups name and sections name to controls $pageObject->fillCntrlTabGroups(); ///////////////////////////////////////////////////////////// if ($pageObject->isShowDetailTables && ($inlineadd == ADD_SIMPLE || $inlineadd == ADD_POPUP) && !isMobile()) { if (count($dpParams['ids'])) { $xt->assign("detail_tables", true); include 'classes/listpage.php'; include 'classes/listpage_embed.php'; include 'classes/listpage_dpinline.php'; include "classes/searchclause.php"; }
$page_layouts["pad_pad_daftar_hist_export"] = $layout; // Modify query: remove blob fields from fieldlist. // Blob fields on an export page are shown using imager.php (for example). // They don't need to be selected from DB in export.php itself. //$gQuery->ReplaceFieldsWithDummies(GetBinaryFieldsIndices()); $cipherer = new RunnerCipherer($strTableName); $strWhereClause = ""; $strHavingClause = ""; $strSearchCriteria = "and"; $selected_recs = array(); $options = "1"; header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); include 'include/xtempl.php'; include 'classes/runnerpage.php'; $xt = new Xtempl(); $id = postvalue("id") != "" ? postvalue("id") : 1; $phpVersion = (int) substr(phpversion(), 0, 1); if ($phpVersion > 4) { include "include/export_functions.php"; $xt->assign("groupExcel", true); } else { $xt->assign("excel", true); } //array of params for classes $params = array("pageType" => PAGE_EXPORT, "id" => $id, "tName" => $strTableName); $params["xt"] =& $xt; if (!$eventObj->exists("ListGetRowCount") && !$eventObj->exists("ListQuery")) { $params["needSearchClauseObj"] = false; } $pageObject = new RunnerPage($params); // Before Process event
$xt = new Xtempl(); // Modify query: remove blob fields from fieldlist. // Blob fields on a list page are shown using imager.php (for example). // They don't need to be selected from DB in list.php itself. $noBlobReplace = false; $options = array(); //array of params for classes $options["pageType"] = PAGE_LIST; $options["id"] = postvalue("id") ? postvalue("id") : 1; $options["mode"] = $mode; $options['xt'] =& $xt; $options['mainMasterPageType'] = postvalue("mainmasterpagetype"); $options['masterPageType'] = postvalue("masterpagetype"); $options["masterTable"] = postvalue("mastertable"); $options["masterId"] = postvalue("masterid"); $options["firstTime"] = postvalue("firsttime"); $i = 1; while (isset($_REQUEST["masterkey" . $i])) { $options["masterKeysReq"][$i] = $_REQUEST["masterkey" . $i]; $i++; } $pageObject = ListPage::createListPage($strTableName, $options); if (!$noBlobReplace) { $gQuery->ReplaceFieldsWithDummies($pageObject->pSet->getBinaryFieldsIndices()); } if ($mode != LIST_DETAILS) { } unset($_SESSION["message_add"]); unset($_SESSION["message_edit"]); // prepare code for build page $pageObject->prepareForBuildPage();
// submit on popup login page if ($onFly == 2) { if ($message) { $returnJSON['message'] = $message; } elseif ($d) { $returnJSON['redirect'] = $ajaxmessage; } if ($pageObject->isCaptchaOk == 0 && $useCaptcha) { $returnJSON['message'] = "Invalid security code."; } echo printJSON($returnJSON); exit; } // load popup login page if ($onFly == 1) { if (postvalue("notRedirect")) { $pageObject->body["begin"] .= "<input type=hidden id='notRedirect' value=1>"; $xt->assign("continuebutton_attrs", 'href="#" style="display:none" id="continueButton"'); $xt->assign("continue_button", true); } $xt->assign("message_block", true); $xt->assign("message", "<div id='login_message' class='message rnr-error'>" . $message . "</div>"); if (!$message) { $xt->displayBrickHidden("message"); } $xt->assign("id", $id); $xt->assign("footer", false); $xt->assign("header", false); $xt->assign("body", $pageObject->body); $xt->assign("guestlink_block", false); $xt->assign("registerlink_attrs", 'name="RegisterPage" data-table="' . $cLoginTable . '"');