function simpleSearchFieldCombo($fNamesArr, $selOpt) { $options = ""; if (sizeof($this->pSet->getGoogleLikeFields()) != 0) { $options = '<option value="" >' . "Any field" . '</option>'; } foreach ($fNamesArr as $fName) { $fLabel = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($fName)); $options .= '<option value="' . $fName . '" ' . ($selOpt == $fName ? 'selected' : '') . '>' . $fLabel . '</option>'; } return $options; }
function simpleSearchFieldCombo($fNamesArr, $selOpt) { $options = ""; if (sizeof(GetTableData($this->tName, ".googleLikeFields", array())) != 0) { $options = '<option value="" >' . mlang_message("ANY_FIELD") . '</option>'; } foreach ($fNamesArr as $fName) { $fLabel = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($fName)); $options .= '<option value="' . $fName . '" ' . ($selOpt == $fName ? 'selected' : '') . '>' . $fLabel . '</option>'; } return $options; }
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; }
$fdata["EditFormats"]["search"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataFact_StockTransaction_Report["LastSoldDays"] = $fdata; // DESCRIP // Custom field settings $fdata = array(); $fdata["Index"] = 15; $fdata["strName"] = "DESCRIP"; $fdata["GoodName"] = "DESCRIP"; $fdata["ownerTable"] = "SMAST"; $fdata["Label"] = GetFieldLabel("Fact_StockTransaction_Report", "DESCRIP"); $fdata["FieldType"] = 200; // report field settings // end of report field settings $fdata["bListPage"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "DESCRIP"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "SMAST.DESCRIP"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
$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; } }
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")); }
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")); }
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_COLOR_PELO["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 6; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.COLOR_PELO"; $fdata["Label"] = GetFieldLabel("GE_COLOR_PELO", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
function WriteTableData() { global $rs, $nPageSize, $strTableName, $conn, $eventObj; if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs); } else { $row = db_fetch_array($rs); } // if(!$row) // return; // write header echo "<tr>"; if ($_REQUEST["type"] == "excel") { echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_User_Roles", "Code")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_User_Roles", "Role")) . '</td>'; } else { echo "<td>" . GetFieldLabel("dbo_User_Roles", "Code") . "</td>"; echo "<td>" . GetFieldLabel("dbo_User_Roles", "Role") . "</td>"; } echo "</tr>"; $totals["Code"] = 0; $totalsFields[] = array('fName' => "Code", 'totalsType' => '', 'viewFormat' => ""); $totals["Role"] = 0; $totalsFields[] = array('fName' => "Role", 'totalsType' => '', 'viewFormat' => ""); $totals = array(); // write data rows $iNumberOfRows = 0; while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) { countTotals($totals, $totalsFields, $row); $values = array(); $format = ""; $values["Code"] = GetData($row, "Code", $format); $format = ""; $values["Role"] = GetData($row, "Role", $format); $eventRes = true; if ($eventObj->exists('BeforeOut')) { $eventRes = $eventObj->BeforeOut($row, $values); } if ($eventRes) { $iNumberOfRows++; echo "<tr>"; echo '<td>'; $format = ""; echo htmlspecialchars($values["Code"]); echo '</td>'; if ($_REQUEST["type"] == "excel") { echo '<td x:str>'; } else { echo '<td>'; } $format = ""; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Role"]); } else { echo htmlspecialchars($values["Role"]); } echo '</td>'; echo "</tr>"; } if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs); } else { $row = db_fetch_array($rs); } } }
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Contains", "Equals", "Empty"); // the end of search options settings $tdataGE_PERSONA_DISPONIBLE["USUARIO_ULTIMA_MOD"] = $fdata; // TIPO_RELACION_ID // Custom field settings $fdata = array(); $fdata["Index"] = 20; $fdata["strName"] = "TIPO_RELACION_ID"; $fdata["GoodName"] = "TIPO_RELACION_ID"; $fdata["ownerTable"] = "GE.PERSONA_DISPONIBLE"; $fdata["Label"] = GetFieldLabel("GE_PERSONA_DISPONIBLE", "TIPO_RELACION_ID"); $fdata["FieldType"] = 14; $fdata["bListPage"] = true; $fdata["bAddPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bEditPage"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "TIPO_RELACION_ID"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "TIPO_RELACION_ID"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files";
// the default search options list $fdata["searchOptionsList"] = array("Contains", "Equals", "Empty"); // the end of search options settings $tdatawebreport_users["password"] = $fdata; // email // Custom field settings $fdata = array(); $fdata["Index"] = 4; $fdata["strName"] = "email"; $fdata["GoodName"] = "email"; $fdata["ownerTable"] = "webreport_users"; $fdata["Label"] = GetFieldLabel("webreport_users","email"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bAddPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bEditPage"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true;
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_SALARIO["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 6; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.SALARIO"; $fdata["Label"] = GetFieldLabel("GE_SALARIO", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_CIUDAD["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 7; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.CIUDAD"; $fdata["Label"] = GetFieldLabel("GE_CIUDAD", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
function DisplayMasterTableInfo_Customers($params) { $detailtable = $params["detailtable"]; $keys = $params["keys"]; global $conn, $strTableName; $xt = new Xtempl(); $oldTableName = $strTableName; $strTableName = "dbo.Customers"; //$strSQL = "SELECT ID, Name, [Father Name], Address, Contact, Location, [Customer Type] FROM dbo.Customers"; $sqlHead = "SELECT ID, Name, [Father Name], Address, Contact, Location, [Customer Type]"; $sqlFrom = "FROM dbo.Customers"; $sqlWhere = ""; $sqlTail = ""; $where = ""; $mKeys = array(); $showKeys = ""; global $page_styles, $page_layouts, $page_layout_names, $container_styles; $layout = new TLayout("masterlist", "BoldOrange", "MobileOrange"); $layout->blocks["bare"] = array(); $layout->containers["0"] = array(); $layout->containers["0"][] = array("name" => "masterlistheader", "block" => "", "substyle" => 1); $layout->skins["0"] = "empty"; $layout->blocks["bare"][] = "0"; $layout->containers["mastergrid"] = array(); $layout->containers["mastergrid"][] = array("name" => "masterlistfields", "block" => "", "substyle" => 1); $layout->skins["mastergrid"] = "grid"; $layout->blocks["bare"][] = "mastergrid"; $page_layouts["Customers_masterlist"] = $layout; if ($detailtable == "dbo.Customer Module Assignment") { $where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]); $showKeys .= " " . GetFieldLabel("dbo_Customers", "ID") . ": " . $keys[1 - 1]; $xt->assign('showKeys', $showKeys); } if (!$where) { $strTableName = $oldTableName; return; } $str = SecuritySQL("Search"); if (strlen($str)) { $where .= " and " . $str; } $strWhere = whereAdd($sqlWhere, $where); if (strlen($strWhere)) { $strWhere = " where " . $strWhere . " "; } $strSQL = $sqlHead . ' ' . $sqlFrom . $strWhere . $sqlTail; // $strSQL=AddWhere($strSQL,$where); LogInfo($strSQL); $rs = db_query($strSQL, $conn); $data = db_fetch_array($rs); if (!$data) { $strTableName = $oldTableName; return; } $keylink = ""; $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["ID"])); // ID - $value = ""; $value = ProcessLargeText(GetData($data, "ID", ""), "field=ID" . $keylink); $xt->assign("ID_mastervalue", $value); // Name - $value = ""; $value = ProcessLargeText(GetData($data, "Name", ""), "field=Name" . $keylink); $xt->assign("Name_mastervalue", $value); // Father Name - $value = ""; $value = ProcessLargeText(GetData($data, "Father Name", ""), "field=Father+Name" . $keylink); $xt->assign("Father_Name_mastervalue", $value); // Address - $value = ""; $value = ProcessLargeText(GetData($data, "Address", ""), "field=Address" . $keylink); $xt->assign("Address_mastervalue", $value); // Contact - $value = ""; $value = ProcessLargeText(GetData($data, "Contact", ""), "field=Contact" . $keylink); $xt->assign("Contact_mastervalue", $value); // Location - $value = ""; $value = DisplayLookupWizard("Location", $data["Location"], $data, $keylink, MODE_LIST); $xt->assign("Location_mastervalue", $value); // Customer Type - $value = ""; $value = DisplayLookupWizard("Customer Type", $data["Customer Type"], $data, $keylink, MODE_LIST); $xt->assign("Customer_Type_mastervalue", $value); $xt->display("Customers_masterlist.htm"); $strTableName = $oldTableName; }
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_PERSONA_DISPONIBLEXEJERCICIO["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 7; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.PERSONA_DISPONIBLEXEJERCICIO"; $fdata["Label"] = GetFieldLabel("GE_PERSONA_DISPONIBLEXEJERCICIO", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array(); $vdata = array("ViewFormat" => ""); $vdata["NeedEncode"] = true; $fdata["ViewFormats"]["view"] = $vdata;
<attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_DiscountValue_")) . '</attr> <attr value="search"></attr> </attr>'; $tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="10"> <attr value="name">SUM(Fact_GrossProfit)</attr> <attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_GrossProfit_")) . '</attr> <attr value="search"></attr> </attr>'; $tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="11"> <attr value="name">SUM(Fact_GP)</attr> <attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_GP_")) . '</attr> <attr value="search"></attr> </attr>'; $tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="12"> <attr value="name">AVG(QOH)</attr> <attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "AVG_QOH_")) . '</attr> <attr value="search"></attr> </attr>'; $tdataTop_Grossing_Products_YTD[".chartXml"] .= '</attr> <attr value="settings"> <attr value="name">Top Grossing Products YTD</attr> <attr value="short_table_name">Top_Grossing_Products_YTD</attr> </attr> </chart>'; $tables_data["Top Grossing Products YTD"] =& $tdataTop_Grossing_Products_YTD; $field_labels["Top_Grossing_Products_YTD"] =& $fieldLabelsTop_Grossing_Products_YTD; $fieldToolTips["Top Grossing Products YTD"] =& $fieldToolTipsTop_Grossing_Products_YTD; $page_titles["Top_Grossing_Products_YTD"] =& $pageTitlesTop_Grossing_Products_YTD;
<b><?php echo GetFieldLabel($itemField); ?> </b> <?php if (GetFieldLabel($itemField) == "Image") { ?> <input name="<?php echo GetFieldLabel($itemField); ?> " type="file"></input> <?php } else { ?> <input name="<?php echo GetFieldLabel($itemField); ?> " type="text" value="<?php echo $item[GetFieldName($itemField)]; ?> "></input> <?php } ?> <?php } ?> <br><br> <?php }
<attr value="linestyle">0</attr> <attr value="autoupdate">0</attr> <attr value="autoupmin">60</attr> <attr value="cscroll">true</attr> <attr value="maxbarscroll">10</attr>'; $tdataSales_By_Department[".chartXml"] .= '</attr> <attr value="fields">'; $tdataSales_By_Department[".chartXml"] .= '<attr value="0"> <attr value="name">DepartmentDesc</attr> <attr value="label">' . xmlencode(GetFieldLabel("Sales_By_Department", "DepartmentDesc")) . '</attr> <attr value="search"></attr> </attr>'; $tdataSales_By_Department[".chartXml"] .= '<attr value="1"> <attr value="name">MTD Sales</attr> <attr value="label">' . xmlencode(GetFieldLabel("Sales_By_Department", "MTD_Sales")) . '</attr> <attr value="search"></attr> </attr>'; $tdataSales_By_Department[".chartXml"] .= '</attr> <attr value="settings"> <attr value="name">Sales By Department</attr> <attr value="short_table_name">Sales_By_Department</attr> </attr> </chart>'; $tables_data["Sales By Department"] =& $tdataSales_By_Department; $field_labels["Sales_By_Department"] =& $fieldLabelsSales_By_Department; $fieldToolTips["Sales By Department"] =& $fieldToolTipsSales_By_Department; $page_titles["Sales_By_Department"] =& $pageTitlesSales_By_Department;
function WriteTableData() { global $rs, $nPageSize, $strTableName, $conn, $eventObj; if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs); } else { $row = db_fetch_array($rs); } // if(!$row) // return; // write header echo "<tr>"; if ($_REQUEST["type"] == "excel") { echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "ID")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Module_ID")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Anomaly_Description")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Anomaly_Type")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Date_Time")) . '</td>'; echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Action_Taken")) . '</td>'; } else { echo "<td>" . GetFieldLabel("dbo_Anomalies", "ID") . "</td>"; echo "<td>" . GetFieldLabel("dbo_Anomalies", "Module_ID") . "</td>"; echo "<td>" . GetFieldLabel("dbo_Anomalies", "Anomaly_Description") . "</td>"; echo "<td>" . GetFieldLabel("dbo_Anomalies", "Anomaly_Type") . "</td>"; echo "<td>" . GetFieldLabel("dbo_Anomalies", "Date_Time") . "</td>"; echo "<td>" . GetFieldLabel("dbo_Anomalies", "Action_Taken") . "</td>"; } echo "</tr>"; $totals["ID"] = 0; $totalsFields[] = array('fName' => "ID", 'totalsType' => '', 'viewFormat' => ""); $totals["Module ID"] = 0; $totalsFields[] = array('fName' => "Module ID", 'totalsType' => '', 'viewFormat' => ""); $totals["Anomaly Description"] = 0; $totalsFields[] = array('fName' => "Anomaly Description", 'totalsType' => '', 'viewFormat' => ""); $totals["Anomaly Type"] = 0; $totalsFields[] = array('fName' => "Anomaly Type", 'totalsType' => '', 'viewFormat' => ""); $totals["Date Time"] = 0; $totalsFields[] = array('fName' => "Date Time", 'totalsType' => '', 'viewFormat' => "Short Date"); $totals["Action Taken"] = 0; $totalsFields[] = array('fName' => "Action Taken", 'totalsType' => '', 'viewFormat' => ""); $totals = array(); // write data rows $iNumberOfRows = 0; while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) { countTotals($totals, $totalsFields, $row); $values = array(); $format = ""; $values["ID"] = GetData($row, "ID", $format); $values["Module ID"] = ""; if (strlen($row["Module ID"])) { $values["Module ID"] = DisplayLookupWizard("Module ID", $row["Module ID"], $row, "", MODE_EXPORT); } $format = ""; $values["Anomaly Description"] = GetData($row, "Anomaly Description", $format); $values["Anomaly Type"] = ""; if (strlen($row["Anomaly Type"])) { $values["Anomaly Type"] = DisplayLookupWizard("Anomaly Type", $row["Anomaly Type"], $row, "", MODE_EXPORT); } $format = "Short Date"; $values["Date Time"] = GetData($row, "Date Time", $format); $values["Action Taken"] = ""; if (strlen($row["Action Taken"])) { $values["Action Taken"] = DisplayLookupWizard("Action Taken", $row["Action Taken"], $row, "", MODE_EXPORT); } $eventRes = true; if ($eventObj->exists('BeforeOut')) { $eventRes = $eventObj->BeforeOut($row, $values); } if ($eventRes) { $iNumberOfRows++; echo "<tr>"; echo '<td>'; $format = ""; echo htmlspecialchars($values["ID"]); echo '</td>'; echo '<td>'; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Module ID"]); } else { echo htmlspecialchars($values["Module ID"]); } echo '</td>'; if ($_REQUEST["type"] == "excel") { echo '<td x:str>'; } else { echo '<td>'; } $format = ""; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Anomaly Description"]); } else { echo htmlspecialchars($values["Anomaly Description"]); } echo '</td>'; echo '<td>'; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Anomaly Type"]); } else { echo htmlspecialchars($values["Anomaly Type"]); } echo '</td>'; echo '<td>'; $format = "Short Date"; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Date Time"]); } else { echo htmlspecialchars($values["Date Time"]); } echo '</td>'; echo '<td>'; if ($_REQUEST["type"] == "excel") { echo PrepareForExcel($values["Action Taken"]); } else { echo htmlspecialchars($values["Action Taken"]); } echo '</td>'; echo "</tr>"; } if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs); } else { $row = db_fetch_array($rs); } } }
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_CATEGORIA_OCUPACION["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 6; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.CATEGORIA_OCUPACION"; $fdata["Label"] = GetFieldLabel("GE_CATEGORIA_OCUPACION", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataFact_SalesTransaction["Fact_GP"] = $fdata; // Fact_Salescol // Custom field settings $fdata = array(); $fdata["Index"] = 20; $fdata["strName"] = "Fact_Salescol"; $fdata["GoodName"] = "Fact_Salescol"; $fdata["ownerTable"] = "Fact_SalesTransaction"; $fdata["Label"] = GetFieldLabel("Fact_SalesTransaction", "Fact_Salescol"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bAddPage"] = true; $fdata["bInlineAdd"] = true; $fdata["bEditPage"] = true; $fdata["bInlineEdit"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "Fact_Salescol"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "Fact_Salescol"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files";
$message .= $strLabel . ": " . $values["groupid"] . "\r\n"; if (($pos = strpos($strEmail, "\r")) !== FALSE || ($pos = strpos($strEmail, "\n")) !== FALSE) { $strEmail = substr($strEmail, 0, $pos); } $sentMailResults = runner_mail(array('to' => $strEmail, 'subject' => "Notification on registering", 'body' => $message)); // send letter to admin $message = "User registered at" . " " . $url . "\r\n"; $strLabel = GetFieldLabel("DashboardUsers", "username"); $message .= $strLabel . ": " . $values["username"] . "\r\n"; $strLabel = GetFieldLabel("DashboardUsers", "email"); $message .= $strLabel . ": " . $values["email"] . "\r\n"; $strLabel = GetFieldLabel("DashboardUsers", "active"); $message .= $strLabel . ": " . $values["active"] . "\r\n"; $strLabel = GetFieldLabel("DashboardUsers", "fullname"); $message .= $strLabel . ": " . $values["fullname"] . "\r\n"; $strLabel = GetFieldLabel("DashboardUsers", "groupid"); $message .= $strLabel . ": " . $values["groupid"] . "\r\n"; $sentMailResults = runner_mail(array('to' => "*****@*****.**", 'subject' => "Notification on registering", 'body' => $message)); if (!count($sentMailResults) || $sentMailResults['mailed']) { // show Registartion successful message $pageObject->updatePageLayoutAndCSS('', 'success'); $pageObject->addCommonJs(); $pageObject->fillSetCntrlMaps(); $pageObject->addButtonHandlers(); $pageObject->body["begin"] .= $includes . "<form method=\"POST\" action=\"" . GetTableLink("login") . "\" name=\"loginform\">\n\t\t\t<input type=\"Hidden\" name=username value=\"" . runner_htmlspecialchars($strUsername) . "\">" . "<input type=\"Hidden\" name=password value=\"" . runner_htmlspecialchars($strPassword) . "\"></form>"; $pageObject->body["end"] .= "<script>"; $pageObject->body['end'] .= "window.controlsMap = " . my_json_encode($pageObject->controlsHTMLMap) . ";"; $pageObject->body['end'] .= "window.viewControlsMap = " . my_json_encode($pageObject->viewControlsHTMLMap) . ";"; $pageObject->body['end'] .= "window.settings = " . my_json_encode($pageObject->jsSettings) . ";</script>"; $pageObject->body['end'] .= "<script language=\"JavaScript\" src=\"" . GetRootPathForResources("include/runnerJS/RunnerAll.js") . "\"></script>\r\n"; $pageObject->body["end"] .= "<script>" . $pageObject->PrepareJS() . "</script>";
function ExportToExcel($rs, $nPageSize, $eventObj, $cipherer, $pageObj) { if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs, $pageObj); } else { $row = $cipherer->DecryptFetchedArray($pageObj->connection->fetch_array($rs)); } $tmpArr = array(); $totals = array(); $arrLabel = array(); $arrTotal = array(); $arrFields = array(); $arrTmpTotal = array(); $arrColumnWidth = array(); $arrTotalMessage = array(); $tmpArr = $pageObj->pSet->getExportFields(); foreach ($tmpArr as $value) { if ($pageObj->pSet->appearOnExportPage($value)) { $arrFields[] = $value; } } $arrTmpTotal = $pageObj->pSet->getTotalsFields(); $pageObj->viewControls->forExport = "excel"; foreach ($arrFields as $value) { $arrLabel[$value] = GetFieldLabel(GoodFieldName($pageObj->tName), GoodFieldName($value)); $arrColumnWidth[$value] = 10; $totals[$value] = array("value" => 0, "numRows" => 0); $totalsType = ""; foreach ($arrTmpTotal as $tvalue) { if ($tvalue["fName"] == $value) { $totalsType = $tvalue["totalsType"]; $totalsFields[] = array('fName' => $value, 'totalsType' => $totalsType, 'viewFormat' => $pageObj->pSet->getViewFormat($value)); } } } // write data rows $iNumberOfRows = 0; $objPHPExcel = ExportExcelInit($arrLabel, $arrColumnWidth); while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) { countTotals($totals, $totalsFields, $row); $values = array(); $arrData = array(); $arrDataType = array(); foreach ($arrFields as $field) { if (IsBinaryType($pageObj->pSet->getFieldType($field))) { $values[$field] = $row[$field]; } else { $values[$field] = $pageObj->getExportValue($field, $row); } } $eventRes = true; if ($eventObj->exists('BeforeOut')) { $eventRes = $eventObj->BeforeOut($row, $values, $pageObj); } if ($eventRes) { $iNumberOfRows++; $i = 0; foreach ($arrFields as $field) { if (IsBinaryType($pageObj->pSet->getFieldType($field))) { $arrDataType[$field] = "binary"; } elseif ($pageObj->pSet->getViewFormat($field) == FORMAT_DATE_SHORT || $pageObj->pSet->getViewFormat($field) == FORMAT_DATE_LONG || $pageObj->pSet->getViewFormat($field) == FORMAT_DATE_TIME) { $arrDataType[$field] = "date"; } elseif ($pageObj->pSet->getViewFormat($field) == FORMAT_FILE_IMAGE) { $arrDataType[$field] = "file"; } else { $arrDataType[$field] = ""; } $arrData[$field] = $values[$field]; } ExportExcelRecord($arrData, $arrDataType, $iNumberOfRows, $objPHPExcel, $pageObj); } if ($eventObj->exists("ListFetchArray")) { $row = $eventObj->ListFetchArray($rs, $pageObj); } else { $row = $cipherer->DecryptFetchedArray($pageObj->connection->fetch_array($rs)); } } if (count($arrTmpTotal)) { foreach ($arrFields as $fName) { $value = array(); foreach ($arrTmpTotal as $tvalue) { if ($tvalue["fName"] == $fName) { $value = $tvalue; } } $total = ""; $totalMess = ""; if ($value["totalsType"]) { if ($value["totalsType"] == "COUNT") { $totalMess = "Count" . ": "; } elseif ($value["totalsType"] == "TOTAL") { $totalMess = "Total" . ": "; } elseif ($value["totalsType"] == "AVERAGE") { $totalMess = "Average" . ": "; } $total = GetTotals($fName, $totals[$fName]["value"], $value["totalsType"], $totals[$fName]["numRows"], $value["viewFormat"], "export"); } $arrTotal[$fName] = $total; $arrTotalMessage[$fName] = $totalMess; } } ExportExcelTotals($arrTotal, $arrTotalMessage, ++$iNumberOfRows, $objPHPExcel); $extExcel = ".xlsx"; $formatExcel = "Excel2007"; if (@$_REQUEST["type"] == "excel5") { $formatExcel = "Excel5"; $extExcel = ".xls"; } ExportExcelSave(GoodFieldName($pageObj->tName) . $extExcel, $formatExcel, $objPHPExcel); }
$fdata["EditFormats"]["edit"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataGE_PERSONA_DISPONIBLEXRELIGION["FEC_ULTIMA_MOD"] = $fdata; // USUARIO_ULTIMA_MOD // Custom field settings $fdata = array(); $fdata["Index"] = 7; $fdata["strName"] = "USUARIO_ULTIMA_MOD"; $fdata["GoodName"] = "USUARIO_ULTIMA_MOD"; $fdata["ownerTable"] = "GE.PERSONA_DISPONIBLEXRELIGION"; $fdata["Label"] = GetFieldLabel("GE_PERSONA_DISPONIBLEXRELIGION", "USUARIO_ULTIMA_MOD"); $fdata["FieldType"] = 200; $fdata["bListPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "USUARIO_ULTIMA_MOD"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "USUARIO_ULTIMA_MOD"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array(); $vdata = array("ViewFormat" => ""); $vdata["NeedEncode"] = true; $fdata["ViewFormats"]["view"] = $vdata;
function getFieldNamesByHeaders($fields) { global $strTableName, $conn, $strOriginalTableName, $ext; // check fields in column headers // check that we have labes in column headers $fieldsNotFoundArr = array(); $fNamesArr = array(); $fNamesFromQuery = GetFieldsList($strTableName); $fieldLabelError = false; $labelFieldsNotFoundArr = array(); for ($j = 0; $j < count($fields); $j++) { $labelNotFound = true; for ($i = 0; $i < count($fNamesFromQuery); $i++) { if ($ext == ".CSV") { $label = GoodFieldName($fNamesFromQuery[$i]); } else { $label = GetFieldLabel(GoodFieldName($strTableName), GoodFieldName($fNamesFromQuery[$i])); } if ($fields[$j] == $label) { $fNamesArr[$j] = $fNamesFromQuery[$i]; $labelNotFound = false; break; } } if ($labelNotFound) { $fieldLabelError = true; $labelFieldsNotFoundArr[] = $fields[$j]; } } // if field names are not labels, than compare them with fields from query $fieldsListError = false; $queryFieldsNotFoundArr = array(); if ($fieldLabelError) { $fieldFromListNotFound = true; $fNamesArr = array(); for ($j = 0; $j < count($fields); $j++) { $fieldNotFound = true; for ($i = 0; $i < count($fNamesFromQuery); $i++) { if ($fields[$j] == $fNamesFromQuery[$i]) { $fNamesArr[$j] = $fNamesFromQuery[$i]; $fieldNotFound = false; $fieldFromListNotFound = false; break; } } if ($fieldNotFound) { $fieldsListError = true; $queryFieldsNotFoundArr[] = $fields[$j]; } } } // if field list not lables or fields from query, than compare fields from DB $fieldsDbError = false; $dbFieldsNotFoundArr = array(); if ($fieldLabelError && $fieldsListError) { $fNamesArr = array(); $strSQL = "select * from " . AddTableWrappers($strOriginalTableName); $rs = db_query($strSQL, $conn); $dbFieldNum = db_numfields($rs); for ($j = 0; $j < count($fields); $j++) { $fieldFromDBNotFound = true; for ($i = 0; $i < $dbFieldNum; $i++) { $fNameFromDB = db_fieldname($rs, $i); if ($fields[$j] == $fNameFromDB) { $fNamesArr[$j] = $fNameFromDB; $fieldFromDBNotFound = false; break; } } if ($fieldFromDBNotFound) { $fieldsDbError = true; $dbFieldsNotFoundArr[] = $fields[$j]; } } } // if fields are not labels, fields from list and fields from table if ($fieldLabelError && $fieldsListError && $fieldsDbError) { if (count($labelFieldsNotFoundArr) < count($dbFieldsNotFoundArr) && count($labelFieldsNotFoundArr) < count($queryFieldsNotFoundArr)) { $fieldsNotFoundArr = $labelFieldsNotFoundArr; } elseif (count($dbFieldsNotFoundArr) < count($labelFieldsNotFoundArr) && count($dbFieldsNotFoundArr) < count($queryFieldsNotFoundArr)) { $fieldsNotFoundArr = $dbFieldsNotFoundArr; } elseif (count($queryFieldsNotFoundArr) < count($labelFieldsNotFoundArr) && count($queryFieldsNotFoundArr) < count($dbFieldsNotFoundArr)) { $fieldsNotFoundArr = $queryFieldsNotFoundArr; } elseif (count($queryFieldsNotFoundArr) == count($labelFieldsNotFoundArr) && count($queryFieldsNotFoundArr) == count($dbFieldsNotFoundArr)) { $fieldsNotFoundArr = $dbFieldsNotFoundArr; } echo "Import didn't succeed, couldn't find followind fields: " . implode(", ", $fieldsNotFoundArr); exit; } else { return $fNamesArr; } }
function buildSearchCtrlBlockArr($recId, $fName, $ctrlInd, $opt, $not, $isChached, $val1, $val2) { $srchCtrlBlock = array(); $srchCtrlBlock['searchcontrol'] = $this->getCtrlParamsArr($fName, $recId, $ctrlInd, $val1, false, $isChached); // create second control, if need it $renderHidden = strtolower($opt) != 'between' && strtolower($opt) != 'not between'; $srchCtrlBlock['searchcontrol1'] = $this->getSecCtrlParamsArr($fName, $recId, $ctrlInd, $val2, $renderHidden, $isChached); // del button $srchCtrlBlock['delCtrlButt'] = $this->getDelButtonHtml($fName, $recId); // one control with options container attr $filterRowId = $this->getFilterRowId($recId, $fName); $srchCtrlBlock['filterRow_attrs'] = ($isChached ? $this->dispNoneStyle : '') . ' id="' . $filterRowId . '" '; $srchCtrlBlock['fName'] = $fName; // combo with attrs $srchCtrlBlock['searchtype'] = $this->getCtrlSearchType($fName, $recId, $ctrlInd, $opt, $not); // checkbox attrs $srchCtrlBlock['notbox'] = $this->getNotBox($fName, $recId, $not); $srchCtrlBlock['fLabel'] = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($fName)); return $srchCtrlBlock; }
function buildSearchCtrlBlockArr($recId, $fName, $ctrlInd, $opt, $not, $isChached, $val1, $val2, $panelField = false, $flexible = true, $immutable = false) { $srchCtrlBlock = array(); $postfix = ''; if($panelField) $postfix = '_'.GoodFieldName($fName); // if the search option isn't set by search params use the user's search option settings if($opt == "") $opt = $this->pSet->getDefaultSearchOption($fName); // create the first control $renderHidden = strtolower($opt) == 'empty' || strtolower($opt) == 'not empty'; $srchCtrlBlock['searchcontrol'.$postfix] = $this->getCtrlParamsArr($fName, $recId, $ctrlInd, $val1, $opt, $renderHidden, $isChached); $renderHidden = strtolower($opt) != 'between' && strtolower($opt) != 'not between'; if($flexible || !$renderHidden) { // create the second control $srchCtrlBlock['searchcontrol1'.$postfix] = $this->getSecCtrlParamsArr($fName, $recId, $ctrlInd, $val2, $opt, $renderHidden, $isChached); } // del button if( !$immutable ) $srchCtrlBlock['delCtrlButt'] = $this->getDelButtonHtml($fName, $recId); // one control with options container attr $filterRowId = $this->getFilterRowId($recId, $fName); $filterRowAttrs = 'id="'.$filterRowId.'" '; if($isChached) $filterRowAttrs.= $this->dispNoneStyle; $srchCtrlBlock['filterRow_attrs'.$postfix] = $filterRowAttrs; if($immutable) $srchCtrlBlock['filterRow_class'.$postfix] = 'rnr-basic-search-field'; $srchCtrlBlock['fName'] = $fName; // combo with attrs $srchCtrlBlock['searchtype'.$postfix] = $this->getCtrlSearchType($fName, $recId, $ctrlInd, $opt, $not, $flexible); // checkbox attrs $srchCtrlBlock['notbox'] = $this->getNotBox($fName, $recId, $not); $srchCtrlBlock['fLabel'.$postfix] = GetFieldLabel(GoodFieldName($this->tName),GoodFieldName($fName)); return $srchCtrlBlock; }
$fdata["EditFormats"]["search"] = $edata; // End Edit Formats $fdata["isSeparate"] = false; // the field's search options settings // the default search options list $fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between"); // the end of search options settings $tdataStock_on_Hand["DATELPURCH"] = $fdata; // DepartmentDesc // Custom field settings $fdata = array(); $fdata["Index"] = 7; $fdata["strName"] = "DepartmentDesc"; $fdata["GoodName"] = "DepartmentDesc"; $fdata["ownerTable"] = "DimDept"; $fdata["Label"] = GetFieldLabel("Stock_on_Hand", "DepartmentDesc"); $fdata["FieldType"] = 200; // report field settings // end of report field settings $fdata["bListPage"] = true; $fdata["bViewPage"] = true; $fdata["bAdvancedSearch"] = true; $fdata["bPrinterPage"] = true; $fdata["bExportPage"] = true; $fdata["strField"] = "DepartmentDesc"; $fdata["isSQLExpression"] = true; $fdata["FullName"] = "DimDept.DepartmentDesc"; $fdata["FieldPermissions"] = true; $fdata["UploadFolder"] = "files"; // Begin View Formats $fdata["ViewFormats"] = array();
function label($field) { $result = GetFieldLabel( GoodFieldName($this->_table), GoodFieldName($field) ); return $result != "" ? $result : $field; }
$message .= $url . "?a=activate&u=" . rawurlencode(base64_encode($values["username"])) . "&code="; $message .= rawurlencode(md5($values["username"] . md5($values["password"]))); $message .= "\r\n(" . "If you are unable to click on the link, copy and paste it into your browser window." . ")\r\n\r\n"; $strLabel = GetFieldLabel("ConsolidatedStockEnquiry_users", "username"); $message .= $strLabel . ": " . $values["username"] . "\r\n"; $strLabel = GetFieldLabel("ConsolidatedStockEnquiry_users", "email"); $message .= $strLabel . ": " . $values["email"] . "\r\n"; if (($pos = strpos($strEmail, "\r")) !== FALSE || ($pos = strpos($strEmail, "\n")) !== FALSE) { $strEmail = substr($strEmail, 0, $pos); } $sentMailResults = runner_mail(array('to' => $strEmail, 'subject' => "Notification on registering", 'body' => $message)); // send letter to admin $message = "User registered at" . " " . $url . "\r\n"; $strLabel = GetFieldLabel("ConsolidatedStockEnquiry_users", "username"); $message .= $strLabel . ": " . $values["username"] . "\r\n"; $strLabel = GetFieldLabel("ConsolidatedStockEnquiry_users", "email"); $message .= $strLabel . ": " . $values["email"] . "\r\n"; $sentMailResults = runner_mail(array('to' => "*****@*****.**", 'subject' => "Notification on registering", 'body' => $message)); if (!count($sentMailResults) || $sentMailResults['mailed']) { // show Registartion successful message $pageObject->updatePageLayoutAndCSS('', 'success'); $xt->assign("email", $strEmail); $xt->assign("activation_block", true); $xt->assign("registered_block", true); $xt->assign("body", $pageObject->body); $xt->assign("loginlink_attrs", "onclick=\"document.forms.loginform.submit();return false;\" id=\"ProceedToLogin\""); if (postvalue("onFly") == 1) { $pageObject->templatefile = GetTemplateName("", "register_success"); $xt->assign("id", $id); $xt->assign("footer", false); $xt->assign("header", false);