本文整理汇总了PHP中SecuritySQL函数的典型用法代码示例。如果您正苦于以下问题:PHP SecuritySQL函数的具体用法?PHP SecuritySQL怎么用?PHP SecuritySQL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SecuritySQL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLookupWhere
/**
* Get a Lookup Wizard Where expression
* @return String
*/
protected function getLookupWhere()
{
$lookupWhere = GetLWWhere($this->field, $this->lookupPageType, $this->tName);
if ($this->lookupType == LT_QUERY) {
if ($this->lookupPSet->getAdvancedSecurityType() == ADVSECURITY_VIEW_OWN) {
$lookupWhere = whereAdd($lookupWhere, SecuritySQL("Search", $this->lookupTable));
}
}
return $lookupWhere;
}
示例2: DisplayMasterTableInfo_pad_pad_sspd
function DisplayMasterTableInfo_pad_pad_sspd($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "pad.pad_sspd";
//$strSQL = "SELECT id, tahun, sspdno, sspdtgl, sspdjam, invoice_id, keterangan, bulan_telat, hitung_bunga, denda, bunga, jml_bayar, sisa, jenis_bayar, printed, tp_id, is_validated, is_valid, enabled, created, create_uid, updated, update_uid, petugas_id, pejabat_id FROM \"pad\".pad_sspd ";
$cipherer = new RunnerCipherer($strTableName);
$settings = new ProjectSettings($strTableName, PAGE_PRINT);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_PRINT);
$where = "";
global $pageObject, $page_styles, $page_layouts, $page_layout_names, $container_styles;
$layout = new TLayout("masterprint", "RoundedGreen", "MobileGreen");
$layout->blocks["bare"] = array();
$layout->containers["0"] = array();
$layout->containers["0"][] = array("name" => "masterprintheader", "block" => "", "substyle" => 1);
$layout->skins["0"] = "empty";
$layout->blocks["bare"][] = "0";
$layout->containers["mastergrid"] = array();
$layout->containers["mastergrid"][] = array("name" => "masterprintfields", "block" => "", "substyle" => 1);
$layout->skins["mastergrid"] = "grid";
$layout->blocks["bare"][] = "mastergrid";
$page_layouts["pad_pad_sspd_masterprint"] = $layout;
$showKeys = "";
if ($detailtable == "public.pad_payment") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
$strTableName = $oldTableName;
return;
}
$str = SecuritySQL("Export");
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
// $strSQL=AddWhere($strSQL,$where);
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
$data = $cipherer->DecryptFetchedArray($rs);
if (!$data) {
$strTableName = $oldTableName;
return;
}
$keylink = "";
$keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["id"]));
// id -
$xt->assign("id_mastervalue", $viewControls->showDBValue("id", $data, $keylink));
// tahun -
$xt->assign("tahun_mastervalue", $viewControls->showDBValue("tahun", $data, $keylink));
// sspdno -
$xt->assign("sspdno_mastervalue", $viewControls->showDBValue("sspdno", $data, $keylink));
// sspdtgl - Short Date
$xt->assign("sspdtgl_mastervalue", $viewControls->showDBValue("sspdtgl", $data, $keylink));
// sspdjam - Time
$xt->assign("sspdjam_mastervalue", $viewControls->showDBValue("sspdjam", $data, $keylink));
// invoice_id -
$xt->assign("invoice_id_mastervalue", $viewControls->showDBValue("invoice_id", $data, $keylink));
// keterangan -
$xt->assign("keterangan_mastervalue", $viewControls->showDBValue("keterangan", $data, $keylink));
// bulan_telat -
$xt->assign("bulan_telat_mastervalue", $viewControls->showDBValue("bulan_telat", $data, $keylink));
// hitung_bunga -
$xt->assign("hitung_bunga_mastervalue", $viewControls->showDBValue("hitung_bunga", $data, $keylink));
// denda - Number
$xt->assign("denda_mastervalue", $viewControls->showDBValue("denda", $data, $keylink));
// bunga - Number
$xt->assign("bunga_mastervalue", $viewControls->showDBValue("bunga", $data, $keylink));
// jml_bayar -
$xt->assign("jml_bayar_mastervalue", $viewControls->showDBValue("jml_bayar", $data, $keylink));
// sisa - Number
$xt->assign("sisa_mastervalue", $viewControls->showDBValue("sisa", $data, $keylink));
// jenis_bayar -
$xt->assign("jenis_bayar_mastervalue", $viewControls->showDBValue("jenis_bayar", $data, $keylink));
// printed -
$xt->assign("printed_mastervalue", $viewControls->showDBValue("printed", $data, $keylink));
// tp_id -
$xt->assign("tp_id_mastervalue", $viewControls->showDBValue("tp_id", $data, $keylink));
// is_validated -
$xt->assign("is_validated_mastervalue", $viewControls->showDBValue("is_validated", $data, $keylink));
// is_valid -
$xt->assign("is_valid_mastervalue", $viewControls->showDBValue("is_valid", $data, $keylink));
// enabled -
$xt->assign("enabled_mastervalue", $viewControls->showDBValue("enabled", $data, $keylink));
// created - Short Date
$xt->assign("created_mastervalue", $viewControls->showDBValue("created", $data, $keylink));
// create_uid -
$xt->assign("create_uid_mastervalue", $viewControls->showDBValue("create_uid", $data, $keylink));
// updated - Short Date
$xt->assign("updated_mastervalue", $viewControls->showDBValue("updated", $data, $keylink));
// update_uid -
//.........这里部分代码省略.........
示例3: DisplayMasterTableInfo_BranchMaster
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
//.........这里部分代码省略.........
示例4: DisplayMasterTableInfo_app_users
function DisplayMasterTableInfo_app_users($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "app.users";
//$strSQL = "SELECT userid, nama, created, disabled, passwd, id, kd_kantor, kd_kanwil, kd_tp, kd_kanwil_bank, kd_kppbb_bank, kd_bank_tunggal, kd_bank_persepsi, nip, jabatan, handphone, create_uid, update_uid, updated, last_login, is_login, is_logout, last_ip FROM app.users ";
$cipherer = new RunnerCipherer($strTableName);
$settings = new ProjectSettings($strTableName, PAGE_PRINT);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_PRINT);
$where = "";
global $pageObject, $page_styles, $page_layouts, $page_layout_names, $container_styles;
$layout = new TLayout("masterprint", "RoundedGreen", "MobileGreen");
$layout->blocks["bare"] = array();
$layout->containers["0"] = array();
$layout->containers["0"][] = array("name" => "masterprintheader", "block" => "", "substyle" => 1);
$layout->skins["0"] = "empty";
$layout->blocks["bare"][] = "0";
$layout->containers["mastergrid"] = array();
$layout->containers["mastergrid"][] = array("name" => "masterprintfields", "block" => "", "substyle" => 1);
$layout->skins["mastergrid"] = "grid";
$layout->blocks["bare"][] = "mastergrid";
$page_layouts["app_users_masterprint"] = $layout;
$showKeys = "";
if ($detailtable == "app.user_groups") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
$strTableName = $oldTableName;
return;
}
$str = SecuritySQL("Export");
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
// $strSQL=AddWhere($strSQL,$where);
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
$data = $cipherer->DecryptFetchedArray($rs);
if (!$data) {
$strTableName = $oldTableName;
return;
}
$keylink = "";
$keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["id"]));
// userid -
$xt->assign("userid_mastervalue", $viewControls->showDBValue("userid", $data, $keylink));
// nama -
$xt->assign("nama_mastervalue", $viewControls->showDBValue("nama", $data, $keylink));
// created - Short Date
$xt->assign("created_mastervalue", $viewControls->showDBValue("created", $data, $keylink));
// disabled -
$xt->assign("disabled_mastervalue", $viewControls->showDBValue("disabled", $data, $keylink));
// passwd -
$xt->assign("passwd_mastervalue", $viewControls->showDBValue("passwd", $data, $keylink));
// id -
$xt->assign("id_mastervalue", $viewControls->showDBValue("id", $data, $keylink));
// kd_kantor -
$xt->assign("kd_kantor_mastervalue", $viewControls->showDBValue("kd_kantor", $data, $keylink));
// kd_kanwil -
$xt->assign("kd_kanwil_mastervalue", $viewControls->showDBValue("kd_kanwil", $data, $keylink));
// kd_tp -
$xt->assign("kd_tp_mastervalue", $viewControls->showDBValue("kd_tp", $data, $keylink));
// kd_kanwil_bank -
$xt->assign("kd_kanwil_bank_mastervalue", $viewControls->showDBValue("kd_kanwil_bank", $data, $keylink));
// kd_kppbb_bank -
$xt->assign("kd_kppbb_bank_mastervalue", $viewControls->showDBValue("kd_kppbb_bank", $data, $keylink));
// kd_bank_tunggal -
$xt->assign("kd_bank_tunggal_mastervalue", $viewControls->showDBValue("kd_bank_tunggal", $data, $keylink));
// kd_bank_persepsi -
$xt->assign("kd_bank_persepsi_mastervalue", $viewControls->showDBValue("kd_bank_persepsi", $data, $keylink));
// nip -
$xt->assign("nip_mastervalue", $viewControls->showDBValue("nip", $data, $keylink));
// jabatan -
$xt->assign("jabatan_mastervalue", $viewControls->showDBValue("jabatan", $data, $keylink));
// handphone -
$xt->assign("handphone_mastervalue", $viewControls->showDBValue("handphone", $data, $keylink));
// create_uid -
$xt->assign("create_uid_mastervalue", $viewControls->showDBValue("create_uid", $data, $keylink));
// update_uid -
$xt->assign("update_uid_mastervalue", $viewControls->showDBValue("update_uid", $data, $keylink));
// updated - Short Date
$xt->assign("updated_mastervalue", $viewControls->showDBValue("updated", $data, $keylink));
// last_login - Short Date
$xt->assign("last_login_mastervalue", $viewControls->showDBValue("last_login", $data, $keylink));
// is_login -
$xt->assign("is_login_mastervalue", $viewControls->showDBValue("is_login", $data, $keylink));
// is_logout -
$xt->assign("is_logout_mastervalue", $viewControls->showDBValue("is_logout", $data, $keylink));
// last_ip -
//.........这里部分代码省略.........
示例5: exit
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"] != "") {
$masterTablesInfoArr = $pSet->getMasterTablesArr($strTableName);
示例6: getCurrentRecordInternal
/**
* Read current values from the database
*
* @return {array} array of current record data
*/
function getCurrentRecordInternal()
{
if (!is_null($this->data))
return $this->data;
global $gstrOrderBy, $conn;
$strWhereClause = '';
$strHavingClause = '';
if(!$this->all)
{
$strWhereClause = KeyWhere($this->keys);
if($this->pSet->getAdvancedSecurityType()!=ADVSECURITY_ALL)
$strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search"));
$strSQL = $this->gQuery->gSQLWhere($strWhereClause);
}
else
{
if ($_SESSION[$this->tName."_SelectedSQL"]!="" && @$_REQUEST["records"]=="")
{
$strSQL = $_SESSION[$this->tName."_SelectedSQL"];
$strWhereClause=@$_SESSION[$this->tName."_SelectedWhere"];
}
else
{
$strWhereClause = @$_SESSION[$this->tName."_where"];
$strHavingClause = @$_SESSION[$this->tName."_having"];
$strSearchCriteria = @$_SESSION[$this->tName."_criteria"];
$joinFromPart = @$_SESSION[$this->tName."_joinFromPart"];
if($this->pSet->getAdvancedSecurityType()==ADVSECURITY_VIEW_OWN && $strWhereClause=="")
$strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search"));
//$strSQL = $this->gQuery->gSQLWhere($strWhereClause, $strHavingClause, $strSearchCriteria);
$strSQL = SQLQuery::gSQLWhere_having($this->gQuery->HeadToSql(), $this->gQuery->FromToSql().$joinFromPart, $this->gQuery->WhereToSql(),
$this->gQuery->GroupByToSql(), $this->gQuery->Having()->toSql($this->gQuery), $strWhereClause, $strHavingClause, $strSearchCriteria);
}
// order by
$strOrderBy = $_SESSION[$this->tName."_order"];
if(!$strOrderBy)
$strOrderBy = $gstrOrderBy;
$strSQL.=" ".trim($strOrderBy);
}
$strSQLbak = $strSQL;
if($this->eventsObject->exists("BeforeQueryView"))
$this->eventsObject->BeforeQueryView($strSQL, $strWhereClause, $this);
if($strSQLbak == $strSQL)
{
//$strSQL = $this->gQuery->gSQLWhere($strWhereClause, $strHavingClause);
$strSQL = SQLQuery::gSQLWhere_having($this->gQuery->HeadToSql(), $this->gQuery->FromToSql().$joinFromPart, $this->gQuery->WhereToSql(),
$this->gQuery->GroupByToSql(), $this->gQuery->Having()->toSql($this->gQuery), $strWhereClause, $strHavingClause, $strSearchCriteria);
if($this->all)
{
$numrows = $this->gQuery->gSQLRowCount($strWhereClause, $strHavingClause, $strSearchCriteria);
$strSQL.=" ".trim($strOrderBy);
}
}
else
{ // changed $strSQL - old style
if($this->all)
$numrows = GetRowCount($strSQL);
}
if(!$this->all)
{
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
}
else
{
// Pagination:
$nPageSize = 0;
if(@$_REQUEST["records"]=="page" && $numrows)
{
$mypage = (integer)@$_SESSION[$this->tName."_pagenumber"];
$nPageSize = (integer)@$_SESSION[$this->tName."_pagesize"];
if($numrows <= ($mypage-1)*$nPageSize)
$mypage = ceil($numrows/$nPageSize);
if(!$nPageSize)
$nPageSize = $gPageSize;
if(!$mypage)
$mypage = 1;
$strSQL.=" limit ".(($mypage-1)*$nPageSize).",".$nPageSize;
}
$rs = db_query($strSQL,$conn);
}
$this->data = $this->cipherer->DecryptFetchedArray($rs);
if(sizeof($this->data) && $this->eventsObject->exists("ProcessValuesView"))
$this->eventsObject->ProcessValuesView($this->data, $this);
return $this->data;
}
示例7: SecuritySQL
function SecuritySQL($strAction, $table = "")
{
global $strTableName;
if (!strlen($table)) {
$table = $strTableName;
}
$strPerm = GetUserPermissions($table);
$strPerm = !strlen($strPerm) ? "S" : $strPerm;
return SecuritySQL($strAction, $table, $strPerm);
}
示例8: DisplayMasterTableInfo_pad_pad_daftar_status
function DisplayMasterTableInfo_pad_pad_daftar_status($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "pad.pad_daftar_status";
//$strSQL = "SELECT id, kode, uraian FROM \"pad\".pad_daftar_status ";
$cipherer = new RunnerCipherer($strTableName);
$settings = new ProjectSettings($strTableName, PAGE_PRINT);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_PRINT);
$where = "";
global $pageObject, $page_styles, $page_layouts, $page_layout_names, $container_styles;
$layout = new TLayout("masterprint", "RoundedGreen", "MobileGreen");
$layout->blocks["bare"] = array();
$layout->containers["0"] = array();
$layout->containers["0"][] = array("name" => "masterprintheader", "block" => "", "substyle" => 1);
$layout->skins["0"] = "empty";
$layout->blocks["bare"][] = "0";
$layout->containers["mastergrid"] = array();
$layout->containers["mastergrid"][] = array("name" => "masterprintfields", "block" => "", "substyle" => 1);
$layout->skins["mastergrid"] = "grid";
$layout->blocks["bare"][] = "mastergrid";
$page_layouts["pad_pad_daftar_status_masterprint"] = $layout;
$showKeys = "";
if ($detailtable == "pad.pad_daftar_hist") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
$strTableName = $oldTableName;
return;
}
$str = SecuritySQL("Export");
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
// $strSQL=AddWhere($strSQL,$where);
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
$data = $cipherer->DecryptFetchedArray($rs);
if (!$data) {
$strTableName = $oldTableName;
return;
}
$keylink = "";
$keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["id"]));
// id -
$xt->assign("id_mastervalue", $viewControls->showDBValue("id", $data, $keylink));
// kode -
$xt->assign("kode_mastervalue", $viewControls->showDBValue("kode", $data, $keylink));
// uraian -
$xt->assign("uraian_mastervalue", $viewControls->showDBValue("uraian", $data, $keylink));
$xt->display("pad_pad_daftar_status_masterprint.htm");
$strTableName = $oldTableName;
}
示例9: DisplayMasterTableInfo_pad_pad_customer
function DisplayMasterTableInfo_pad_pad_customer($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
$detailPageObj = $params["detailPageObj"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "pad.pad_customer";
$settings = new ProjectSettings($strTableName, PAGE_LIST);
$cipherer = new RunnerCipherer($strTableName);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_LIST);
$where = "";
$mKeys = array();
$showKeys = "";
global $page_styles, $page_layouts, $page_layout_names, $container_styles;
$layout = new TLayout("masterlist", "RoundedGreen", "MobileGreen");
$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["pad_pad_customer_masterlist"] = $layout;
if ($detailtable == "pad.pad_spt") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "pad.pad_customer_usaha") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "pad.pad_customer_detail") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "pad.pad_terima") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
$strTableName = $oldTableName;
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();
// $strSQL = AddWhere($strSQL,$where);
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
$data = $cipherer->DecryptFetchedArray($rs);
if (!$data) {
$strTableName = $oldTableName;
return;
}
$keylink = "";
$keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["id"]));
// id -
$value = "";
$xt->assign("id_mastervalue", $viewControls->showDBValue("id", $data, $keylink));
// parent -
$value = "";
$xt->assign("parent_mastervalue", $viewControls->showDBValue("parent", $data, $keylink));
// npwpd -
$value = "";
$xt->assign("npwpd_mastervalue", $viewControls->showDBValue("npwpd", $data, $keylink));
// rp -
$value = "";
$xt->assign("rp_mastervalue", $viewControls->showDBValue("rp", $data, $keylink));
// pb -
$value = "";
$xt->assign("pb_mastervalue", $viewControls->showDBValue("pb", $data, $keylink));
// formno -
$value = "";
$xt->assign("formno_mastervalue", $viewControls->showDBValue("formno", $data, $keylink));
// reg_date - Short Date
$value = "";
$xt->assign("reg_date_mastervalue", $viewControls->showDBValue("reg_date", $data, $keylink));
// nama -
$value = "";
$xt->assign("nama_mastervalue", $viewControls->showDBValue("nama", $data, $keylink));
// kecamatan_id -
$value = "";
$xt->assign("kecamatan_id_mastervalue", $viewControls->showDBValue("kecamatan_id", $data, $keylink));
// kelurahan_id -
$value = "";
//.........这里部分代码省略.........
示例10: DoUpdateRecordSQL
/**
* update record on Edit page
* @intellisense
*/
function DoUpdateRecordSQL($pageObject)
{
$table = $pageObject->pSet->getOriginalTableName();
$strWhereClause = $pageObject->getWhereClause(true);
$evalues = $pageObject->getNewRecordData();
$blobfields = $pageObject->getBlobFields();
if (!count($evalues)) {
return true;
}
$strSQL = "update " . $pageObject->connection->addTableWrappers($table) . " set ";
$blobs = PrepareBlobs($evalues, $blobfields, $pageObject);
// construct SQL string
foreach ($evalues as $ekey => $value) {
if (in_array($ekey, $blobfields)) {
$strValue = $value;
} else {
if (is_null($pageObject->cipherer)) {
$strValue = add_db_quotes($ekey, $value);
} else {
$strValue = $pageObject->cipherer->AddDBQuotes($ekey, $value);
}
}
$strSQL .= $pageObject->getTableField($ekey) . "=" . $strValue . ", ";
}
$strSQL = substr($strSQL, 0, strlen($strSQL) - 2);
if ($strWhereClause === "") {
$strWhereClause = " (1=1) ";
}
$strSQL .= " where " . $strWhereClause;
if (SecuritySQL("Edit", $pageObject->tName)) {
$strSQL .= " and (" . SecuritySQL("Edit", $pageObject->tName) . ")";
}
if (!ExecuteUpdate($pageObject, $strSQL, $blobs)) {
return false;
}
return true;
}
示例11: SecuritySQL
/**
* A wrapper for the SecuritySQL function
* @param String strAction
* @paran String table
* @return String
*/
function SecuritySQL($strAction, $table = "")
{
return SecuritySQL($strAction, $table);
}
示例12: DisplayMasterTableInfo_LU_Module_Status
function DisplayMasterTableInfo_LU_Module_Status($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "dbo.LU_Module Status";
//$strSQL = "SELECT Code, Status FROM dbo.[LU_Module Status]";
$sqlHead = "SELECT Code, Status";
$sqlFrom = "FROM dbo.[LU_Module Status]";
$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["LU_Module_Status_masterlist"] = $layout;
if ($detailtable == "dbo.Module") {
$where .= GetFullFieldName("Code") . "=" . make_db_value("Code", $keys[1 - 1]);
$showKeys .= " " . GetFieldLabel("dbo_LU_Module_Status", "Code") . ": " . $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["Code"]));
// Code -
$value = "";
$value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink);
$xt->assign("Code_mastervalue", $value);
// Status -
$value = "";
$value = ProcessLargeText(GetData($data, "Status", ""), "field=Status" . $keylink);
$xt->assign("Status_mastervalue", $value);
$xt->display("LU_Module_Status_masterlist.htm");
$strTableName = $oldTableName;
}
示例13: array
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);
if ($pSet->getAdvancedSecurityType() == ADVSECURITY_VIEW_OWN) {
$where = whereAdd($where, SecuritySQL("Search", $strTableName));
}
$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();
}
if ($lookup) {
示例14: countDetailsRecsNoSubQ
/**
* Use for count details recs number, if subQueryes not supported, or keys have different types
*
* @param integer $i
* @param array $detailid
* @intellisense
*/
function countDetailsRecsNoSubQ($dInd, &$detailid)
{
global $tables_data;
global $masterTablesData;
global $detailsTablesData;
global $allDetailsTablesArr;
$dDataSourceTable = $this->allDetailsTablesArr[$dInd]['dDataSourceTable'];
$masterPSet = $this->pSet->getTable($dDataSourceTable);
$detailsQuery = $masterPSet->getSQLQuery();
$dSqlWhere = $detailsQuery->WhereToSql();
$detailKeys = $masterPSet->getDetailKeysByMasterTable($this->tName);
$securityClause = SecuritySQL("Search", $dDataSourceTable);
// add where
if (strlen($securityClause)) {
$dSqlWhere = whereAdd($dSqlWhere, $securityClause);
}
$masterwhere = "";
foreach ($this->masterKeysByD[$dInd] as $idx => $val) {
if ($masterwhere) {
$masterwhere .= " and ";
}
$mastervalue = $this->cipherer->MakeDBValue($detailKeys[$idx], $detailid[$idx], "", $dDataSourceTable, true);
if ($mastervalue == "null") {
$masterwhere .= GetFullFieldNameForInsert($masterPSet, $detailKeys[$idx]) . " is NULL ";
} else {
$masterwhere .= GetFullFieldName($detailKeys[$idx], $dDataSourceTable, false) . "=" . $mastervalue;
}
}
return SQLQuery::gSQLRowCount_int($detailsQuery->HeadToSql(), $detailsQuery->FromToSql(), $dSqlWhere, $detailsQuery->GroupByToSql(), $detailsQuery->Having()->toSql($detailsQuery), $masterwhere, "");
}
示例15: prepareDefvalues
/**
* Set the defvalues property
*/
protected function prepareDefvalues()
{
if ((array_key_exists("copyid1", $_REQUEST) || array_key_exists("editid1", $_REQUEST)) && $this->mode != ADD_DASHBOARD) {
// copy record
$copykeys = array();
$keyFields = $this->pSet->getTableKeys();
$prefix = array_key_exists("copyid1", $_REQUEST) ? "copyid" : "editid";
foreach ($keyFields as $idx => $k) {
$copykeys[$k] = postvalue($prefix . ($idx + 1));
}
$strWhere = KeyWhere($copykeys);
if ($this->pSet->getAdvancedSecurityType() != ADVSECURITY_ALL) {
$strWhere = whereAdd($strWhere, SecuritySQL("Search", $this->tName));
}
$strSQL = $this->gQuery->gSQLWhere($strWhere);
$this->defvalues = $this->cipherer->DecryptFetchedArray($this->connection->query($strSQL)->fetchAssoc());
if (!$this->defvalues) {
$this->defvalues = array();
}
// clear key fields
foreach ($keyFields as $idx => $k) {
$this->defvalues[$k] = "";
}
foreach ($this->addFields as $f) {
if ($this->pSet->getEditFormat($f) == EDIT_FORMAT_FILE) {
//#10023
$this->defvalues[$f] = $this->getControl($f, $this->id)->getFieldValueCopy($this->defvalues[$f]);
}
}
// call CopyOnLoad event
if ($this->eventsObject->exists("CopyOnLoad")) {
$this->eventsObject->CopyOnLoad($this->defvalues, $strWhere, $this);
}
} else {
foreach ($this->addFields as $f) {
$defaultValue = GetDefaultValue($f, PAGE_ADD);
if (strlen($defaultValue)) {
$this->defvalues[$f] = $defaultValue;
}
}
}
$securityType = $this->pSet->getAdvancedSecurityType();
if (!$this->isAdminTable() && ($securityType == ADVSECURITY_EDIT_OWN || $securityType == ADVSECURITY_VIEW_OWN)) {
$tableOwnerIdField = $this->pSet->getTableOwnerIdField();
// insert default owner id value if exists
if ($this->checkIfToAddOwnerIdValue($tableOwnerIdField, '')) {
$this->defvalues[$tableOwnerIdField] = prepare_for_db($tableOwnerIdField, $_SESSION["_" . $this->tName . "_OwnerID"]);
}
}
$masterTables = $this->pSet->getMasterTablesArr($this->tName);
// set default values for the foreign keys
foreach ($masterTables as $mTableData) {
if (@$_SESSION[$this->sessionPrefix . "_mastertable"] == $mTableData["mDataSourceTable"]) {
foreach ($mTableData["detailKeys"] as $idx => $dk) {
$masterkeyIdx = "masterkey" . ($idx + 1);
if (postvalue($masterkeyIdx)) {
$_SESSION[$this->sessionPrefix . "_" . $masterkeyIdx] = postvalue($masterkeyIdx);
}
if ($this->masterPageType != PAGE_ADD) {
$this->defvalues[$dk] = @$_SESSION[$this->sessionPrefix . "_" . $masterkeyIdx];
}
}
}
}
$lookupMainSettings = getLookupMainTableSettings($this->tName, $this->mainTable, $this->mainField);
if ($lookupMainSettings) {
if ($lookupMainSettings->useCategory($this->mainField) && !isset($this->newRecordData[$lookupMainSettings->getCategoryFilter($this->mainField)])) {
$this->defvalues[$lookupMainSettings->getCategoryFilter($this->mainField)] = $this->category;
}
}
if ($this->readAddValues) {
foreach ($this->addFields as $fName) {
$editFormat = $this->pSet->getEditFormat($fName);
if ($editFormat != EDIT_FORMAT_DATABASE_FILE && $editFormat != EDIT_FORMAT_DATABASE_IMAGE && $editFormat != EDIT_FORMAT_FILE) {
$this->defvalues[$fName] = @$this->newRecordData[$fName];
}
}
}
}