本文整理汇总了PHP中whereAdd函数的典型用法代码示例。如果您正苦于以下问题:PHP whereAdd函数的具体用法?PHP whereAdd怎么用?PHP whereAdd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了whereAdd函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: GetAddedDataLookupQuery
/**
* @param Array keys
* @param Boolean forLookup
* @param String _table
* @param String _field
* @param String pageType
* @return Array
*/
public function GetAddedDataLookupQuery($keys, $forLookup, $_table, $_field, $pageType)
{
$lookupMainSettings = getLookupMainTableSettings($this->tName, $_table, $_field, $pageType);
if(!$lookupMainSettings)
return array();
global $conn;
$LookupSQL = "";
$mainField = $_field;
$mainTable = $lookupMainSettings->getTableName();
$linkFieldName = $lookupMainSettings->getLinkField($mainField);
$dispfield = $lookupMainSettings->getDisplayField($mainField);
$nLookupType = $lookupMainSettings->getLookupType($mainField);
if($nLookupType == LT_QUERY)
{
if($lookupMainSettings->getCustomDisplay($mainField))
$this->pSet->getSQLQuery()->AddCustomExpression($dispfield, $this->pSet, $mainTable, $mainField);
$lookupQueryObj = $this->pSet->getSQLQuery()->CloneObject();
}
else
{
$LookupSQL = "select ";
$LookupSQL .= GetFullFieldName($linkFieldName, $this->tName, true);
if($linkFieldName != $dispfield)
$LookupSQL .= "," . $this->pSet->getLWDisplayField($mainField, true);
$LookupSQL.=" from ".AddTableWrappers($this->strOriginalTableName);
}
$data = 0;
$lookupIndexes = array("linkFieldIndex" => 0, "displayFieldIndex" => 0);
if(count($keys))
{
$where = KeyWhere($keys);
if($nLookupType == LT_QUERY)
$LookupSQL = $lookupQueryObj->toSql(whereAdd($lookupQueryObj->m_where->toSql($lookupQueryObj), $where));
else
$LookupSQL.=" where ".$where;
$lookupIndexes = GetLookupFieldsIndexes($lookupMainSettings, $mainField);
LogInfo($LookupSQL);
if($forLookup)
{
$rs=db_query($LookupSQL,$conn);
$data = $this->cipherer->DecryptFetchedArray($rs);
}
else if($LookupSQL)
{
$rs = db_query($LookupSQL,$conn);
$data = db_fetch_numarray($rs);
$data[$lookupIndexes["linkFieldIndex"]] = $this->cipherer->DecryptField($linkFieldName, $data[$lookupIndexes["linkFieldIndex"]]);
if($nLookupType == LT_QUERY)
$data[$lookupIndexes["displayFieldIndex"]] = $this->cipherer->DecryptField($dispfield, $data[$lookupIndexes["displayFieldIndex"]]);
}
}
return array($data, array("linkField" => $linkFieldName, "displayField" => $dispfield
, "linkFieldIndex" => $lookupIndexes["linkFieldIndex"], "displayFieldIndex" => $lookupIndexes["displayFieldIndex"]));
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:66,代码来源:addpage.php
示例2: buildSQL
/**
* Form the SQL query string to get then the filter's data
*/
protected function buildSQL()
{
$dbfName = $this->getDbFieldName($this->fName);
$sqlHead = "SELECT MIN(" . $dbfName . ") as " . $this->connection->addFieldWrappers("sliderMin") . ", MAX(" . $dbfName . ") as " . $this->connection->addFieldWrappers("sliderMax");
$whereComponents = $this->whereComponents;
$gQuery = $this->pSet->getSQLQuery();
$sqlFrom = $gQuery->FromToSql() . $whereComponents["joinFromPart"];
$sqlWhere = $this->getCombinedFilterWhere();
$sqlGroupBy = "GROUP BY " . $dbfName;
$sqlHaving = $this->getCombinedFilterHaving();
$notNullWhere = $dbfName . " is not NULL";
if ($this->connection->dbType != nDATABASE_Oracle) {
if (IsCharType($this->fieldType)) {
$notNullWhere = $dbfName . "<>'' and " . $notNullWhere;
}
}
$sqlWhere = whereAdd($sqlWhere, $notNullWhere);
$searchCombineType = $whereComponents["searchUnionRequired"] ? "or" : "and";
$this->strSQL = SQLQuery::gSQLWhere_having($sqlHead, $sqlFrom, $sqlWhere, "", "", $whereComponents["searchWhere"], $whereComponents["searchHaving"], $strSearchCriteria);
}
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:23,代码来源:FilterIntervalSlider.php
示例3: array
if ($pageObject->isShowDetailTables && !isMobile()) {
$ids = $id;
$pageObject->jsSettings['tableSettings'][$strTableName]['dpParams'] = array('tableNames' => $dpParams['strTableNames'], 'ids' => $dpParams['ids']);
}
}
/////////////////////////////////////////////////////////////
// process entered data, read and save
/////////////////////////////////////////////////////////////
// proccess captcha
if ($inlineedit != EDIT_INLINE) {
if ($pageObject->captchaExists()) {
$pageObject->doCaptchaCode();
}
}
if (@$_POST["a"] == "edited") {
$strWhereClause = whereAdd($strWhereClause, KeyWhere($keys));
$oldValuesRead = false;
if ($eventObj->exists("AfterEdit") || $eventObj->exists("BeforeEdit") || $auditObj || isTableGeoUpdatable($pageObject->cipherer->pSet) || $globalEvents->exists("IsRecordEditable", $strTableName)) {
// read old values
$rsold = db_query($gQuery->gSQLWhere($strWhereClause), $conn);
$dataold = $pageObject->cipherer->DecryptFetchedArray($rsold);
$oldValuesRead = true;
}
if ($globalEvents->exists("IsRecordEditable", $strTableName)) {
if (!$globalEvents->IsRecordEditable($dataold, true, $strTableName)) {
return SecurityRedirect($inlineedit);
}
}
$evalues = $efilename_values = $blobfields = array();
// processing nama - begin
$condition = 1;
开发者ID:aagusti,项目名称:padl-tng,代码行数:31,代码来源:app_modules_edit.php
示例4: DisplayMasterTableInfo_GE_ESTADO_CIVIL
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';
}
//.........这里部分代码省略.........
开发者ID:kcallow,项目名称:MatchMe,代码行数:101,代码来源:GE_ESTADO_CIVIL_masterlist.php
示例5: DisplayMasterTableInfo_Module
function DisplayMasterTableInfo_Module($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "dbo.Module";
//$strSQL = "SELECT ID, [Module Type], [Module Status], [Module Condition], [Serial Num], [Entry Date] FROM dbo.[Module]";
$sqlHead = "SELECT ID, [Module Type], [Module Status], [Module Condition], [Serial Num], [Entry Date]";
$sqlFrom = "FROM dbo.[Module]";
$sqlWhere = "";
$sqlTail = "";
$where = "";
global $page_styles, $page_layouts, $page_layout_names, $container_styles;
$layout = new TLayout("masterprint", "BoldOrange", "MobileOrange");
$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["Module_masterprint"] = $layout;
if ($detailtable == "dbo.Anomalies") {
$where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
}
if ($detailtable == "dbo.Customer Module Assignment") {
$where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
}
if ($detailtable == "dbo.Readings") {
$where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
}
if (!$where) {
$strTableName = $oldTableName;
return;
}
$str = SecuritySQL("Export");
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, "", MODE_PRINT);
$xt->assign("ID_mastervalue", $value);
// Module Type -
$value = "";
$value = DisplayLookupWizard("Module Type", $data["Module Type"], $data, $keylink, MODE_PRINT);
$xt->assign("Module_Type_mastervalue", $value);
// Module Status -
$value = "";
$value = DisplayLookupWizard("Module Status", $data["Module Status"], $data, $keylink, MODE_PRINT);
$xt->assign("Module_Status_mastervalue", $value);
// Module Condition -
$value = "";
$value = DisplayLookupWizard("Module Condition", $data["Module Condition"], $data, $keylink, MODE_PRINT);
$xt->assign("Module_Condition_mastervalue", $value);
// Serial Num -
$value = "";
$value = ProcessLargeText(GetData($data, "Serial Num", ""), "field=Serial+Num" . $keylink, "", MODE_PRINT);
$xt->assign("Serial_Num_mastervalue", $value);
// Entry Date - Short Date
$value = "";
$value = ProcessLargeText(GetData($data, "Entry Date", "Short Date"), "field=Entry+Date" . $keylink, "", MODE_PRINT);
$xt->assign("Entry_Date_mastervalue", $value);
$xt->display("Module_masterprint.htm");
$strTableName = $oldTableName;
}
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:85,代码来源:Module_masterprint.php
示例6: DisplayMasterTableInfo_pad_pad_kelurahan
function DisplayMasterTableInfo_pad_pad_kelurahan($params)
{
$detailtable = $params["detailtable"];
$keys = $params["keys"];
$detailPageObj = $params["detailPageObj"];
global $conn, $strTableName;
$xt = new Xtempl();
$oldTableName = $strTableName;
$strTableName = "pad.pad_kelurahan";
$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_kelurahan_masterlist"] = $layout;
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") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "pad.pad_daftar") {
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[1 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[1 - 1];
$where .= " and ";
$showKeys .= " , ";
$where .= GetFullFieldName("id", "", false) . "=" . $cipherer->MakeDBValue("id", $keys[2 - 1], "", "", true);
$showKeys .= " " . "Id" . ": " . $keys[2 - 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));
// kecamatan_id -
$value = "";
$xt->assign("kecamatan_id_mastervalue", $viewControls->showDBValue("kecamatan_id", $data, $keylink));
// kode -
$value = "";
$xt->assign("kode_mastervalue", $viewControls->showDBValue("kode", $data, $keylink));
// nama -
$value = "";
$xt->assign("nama_mastervalue", $viewControls->showDBValue("nama", $data, $keylink));
// tmt - Short Date
$value = "";
$xt->assign("tmt_mastervalue", $viewControls->showDBValue("tmt", $data, $keylink));
// enabled -
$value = "";
$xt->assign("enabled_mastervalue", $viewControls->showDBValue("enabled", $data, $keylink));
// created - Short Date
$value = "";
$xt->assign("created_mastervalue", $viewControls->showDBValue("created", $data, $keylink));
// create_uid -
$value = "";
$xt->assign("create_uid_mastervalue", $viewControls->showDBValue("create_uid", $data, $keylink));
// updated - Short Date
$value = "";
$xt->assign("updated_mastervalue", $viewControls->showDBValue("updated", $data, $keylink));
// update_uid -
$value = "";
$xt->assign("update_uid_mastervalue", $viewControls->showDBValue("update_uid", $data, $keylink));
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:pad_pad_kelurahan_masterlist.php
示例7: make_db_value
$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';
}
}
if ($LookupType == LT_QUERY) {
$LookupSQL = $lookupQueryObj->toSql(whereAdd($lookupQueryObj->m_where->toSql($lookupQueryObj), $strLookupWhere), strlen($lookupOrderBy) ? ' ORDER BY ' . $lookupOrderBy : null);
} else {
$LookupSQL = $LookupSQLTable . " where " . $strLookupWhere;
if (!$gSettings->isLookupUnique($f) || nDATABASE_Access != $lookupConnection->dbType) {
if ($lookupOrderBy) {
$LookupSQL .= " ORDER BY " . $lookupOrderBy;
}
}
}
}
if (strlen(GetLWWhere($f, $pageType, $strTableName))) {
$hasWhere = true;
}
break;
}
$lookupIndexes = GetLookupFieldsIndexes($gSettings, $lookupField);
开发者ID:kcallow,项目名称:MatchMe,代码行数:31,代码来源:lookupsuggest.php
示例8: trim
} else {
$strSQL = $gQuery->gSQLWhere($strWhereClause);
// order by
$strSQL.=" " . trim($strOrderBy);
}
$xt->assign("userid", runner_htmlspecialchars($_SESSION["UserID"]));
$xt->assign("guest", $_SESSION["AccessLevel"] == ACCESS_LEVEL_GUEST);
// save SQL for use in "Export" and "Printer-friendly" pages
if (!is_wr_project()) {
$_SESSION[$sessPrefix . "_sql"] = $rpt_array['sql'];
$_SESSION[$sessPrefix . "_where"] = $rpt_array['where'];
$_SESSION[$sessPrefix . "_order"] = $rpt_array['order_by'];
} else {
$strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search"));
$_SESSION[$sessPrefix . "_sql"] = $strSQL;
$_SESSION[$sessPrefix . "_where"] = $strWhereClause;
$_SESSION[$sessPrefix . "_order"] = $strOrderBy;
}
// select all records
$strSQLbak = $strSQL;
if (is_wr_db()) {
$strSQL = $rpt_array['sql'] . $rpt_array['where'] . $rpt_array['order_by'];
} elseif (is_wr_project()) {
$strSQL = $gQuery->gSQLWhere($strWhereClause);
$strSQL .= " " . trim($strOrderBy);
} elseif (is_wr_custom()) {
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:31,代码来源:dreport.php
示例9: Chart
//.........这里部分代码省略.........
$gQuery = $this->pSet->getSQLQuery();
$masterWhere = "";
if (!$this->dashChart) {
$masterTable = $_SESSION[$this->sessionPrefix . "_mastertable"];
$detailKeysByM = $this->pSet->getDetailKeysByMasterTable($masterTable);
if (count($detailKeysByM)) {
for ($i = 0; $i < count($detailKeysByM); $i++) {
if ($i != 0) {
$masterWhere .= " and ";
}
if ($this->cipherer && isEncryptionByPHPEnabled()) {
$mValue = $this->cipherer->MakeDBValue($detailKeysByM[$i], $_SESSION[$this->sessionPrefix . "_masterkey" . ($i + 1)]);
} else {
$mValue = make_db_value($detailKeysByM[$i], $_SESSION[$this->sessionPrefix . "_masterkey" . ($i + 1)]);
}
if (strlen($mValue) != 0) {
$masterWhere .= RunnerPage::_getFieldSQLDecrypt($detailKeysByM[$i], $this->connection, $this->pSet, $this->cipherer) . "=" . $mValue;
} else {
$masterWhere .= "1=0";
}
}
}
}
$strWhereClause = "";
$searchHavingClause = "";
$strSearchCriteria = "and";
global $strTableName;
// search where for basic charts
if (!$this->webchart) {
if (!$this->chartPreview && isset($_SESSION[$this->sessionPrefix . '_advsearch'])) {
$searchClauseObj = SearchClause::UnserializeObject($_SESSION[$this->sessionPrefix . '_advsearch']);
include_once getabspath('classes/controls/EditControlsContainer.php');
$editControls = new EditControlsContainer(null, $this->pSet, PAGE_SEARCH, $this->cipherer);
$whereComponents = RunnerPage::sGetWhereComponents($gQuery, $this->pSet, $searchClauseObj, $editControls, $this->connection);
$strWhereClause = $whereComponents["searchWhere"];
foreach ($whereComponents["filterWhere"] as $fWhere) {
$strWhereClause = whereAdd($strWhereClause, $fWhere);
}
$searchHavingClause = $whereComponents["searchHaving"];
foreach ($whereComponents["filterHaving"] as $fHaving) {
$searchHavingClause = whereAdd($searchHavingClause, $fHaving);
}
$strSearchCriteria = $whereComponents["searchUnionRequired"] ? "or" : "and";
}
} else {
if ($this->table_type != "project") {
$strTableName = "webchart" . $this->cname;
}
$strWhereClause = CalcSearchParam($this->table_type != "project");
}
if ($strWhereClause) {
$this->chrt_array['where'] .= $this->chrt_array['where'] ? " AND (" . $strWhereClause . ")" : " WHERE (" . $strWhereClause . ")";
}
if ($this->table_type == "project") {
if (SecuritySQL("Search", $this->chrt_array['tables'][0])) {
$strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search", $strTableName));
}
$this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
$strOrderBy = $this->gstrOrderBy;
$this->strSQL .= " " . $strOrderBy;
if ($masterWhere) {
$strWhereClause = whereAdd($strWhereClause, $masterWhere);
}
$strSQLbak = $this->strSQL;
if (tableEventExists("BeforeQueryChart", $strTableName)) {
$tstrSQL = $this->strSQL;
$eventObj = getEventObject($strTableName);
$eventObj->BeforeQueryChart($tstrSQL, $strWhereClause, $strOrderBy);
$this->strSQL = $tstrSQL;
}
if ($strSQLbak == $this->strSQL) {
$this->strSQL = $gQuery->gSQLWhere($strWhereClause, $searchHavingClause, $strSearchCriteria);
$this->strSQL .= " " . $strOrderBy;
}
}
if ($this->cname && $this->table_type == "db") {
$this->strSQL = $this->chrt_array['sql'] . $this->chrt_array['where'] . $this->chrt_array['group_by'] . $this->chrt_array['order_by'];
} elseif ($this->cname && $this->table_type == "custom") {
if (!IsStoredProcedure($this->chrt_array['sql'])) {
$sql_query = $this->chrt_array['sql'];
if ($this->connection->dbType == nDATABASE_MSSQLServer) {
$pos = strrpos(strtoupper($sql_query), "ORDER BY");
if ($pos) {
$sql_query = substr($sql_query, 0, $pos);
}
}
if ($this->connection->dbType != nDATABASE_Oracle) {
$this->strSQL = "select * from (" . $sql_query . ") as " . $this->connection->addFieldWrappers("custom_query") . $this->chrt_array['where'];
} else {
$this->strSQL = "select * from (" . $sql_query . ")" . $this->chrt_array['where'];
}
} else {
$this->strSQL = $this->chrt_array['sql'];
}
}
if (tableEventExists("UpdateChartSettings", $strTableName)) {
$eventObj = getEventObject($strTableName);
$eventObj->UpdateChartSettings($this);
}
}
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:101,代码来源:charts.php
示例10: gSQLRowCount_int
static function gSQLRowCount_int($sqlHead, $sqlFrom, $sqlWhere, $sqlGroupBy, $sqlHaving, $where, $having, $criteria="or")
{
global $conn;
global $bSubqueriesSupported;
$strWhere=whereAdd($sqlWhere,$where);
if(strlen($strWhere))
$strWhere=" where ".$strWhere." ";
if(strlen($sqlGroupBy))
{
if($bSubqueriesSupported)
{
$countstr = "select count(*) from (".SQLQuery::gSQLWhere_having($sqlHead,$sqlFrom,$sqlWhere,$sqlGroupBy, $sqlHaving,$where,$having,$criteria).") a";
}
else
{
$countstr = SQLQuery::gSQLWhere_having($sqlHead,$sqlFrom,$sqlWhere,$sqlGroupBy, $sqlHaving,$where,$having,$criteria);
return GetMySQL4RowCount($countstr);
}
}
else
{
$countstr = "select count(*) ".$sqlFrom.$strWhere;
}
$countrs = db_query($countstr, $conn);
$countdata = db_fetch_numarray($countrs);
return $countdata[0];
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:29,代码来源:sql.php
示例11: buildItegratedWhere
/**
* Build where for united search
* Params are common for advanced search and search panel on list
* Use in new projects
*
* @protected
* @return string
*
*/
function buildItegratedWhere($fieldsArr)
{
if (!count($fieldsArr)) {
return '';
}
// get global options
$simpleSrch = $this->_where[$this->sessionPrefix . "_simpleSrch"];
if (trim($simpleSrch) === '%') {
$simpleSrch = '[' . $simpleSrch . ']';
}
$srchType = $this->_where[$this->sessionPrefix . "_srchType"];
$srchFields =& $this->_where[$this->sessionPrefix . "_srchFields"];
$sWhere = '';
// build where for any field contains search
if (strlen($simpleSrch) || $this->_where[$this->sessionPrefix . "simpleSrchTypeComboOpt"] == "Empty") {
if (strlen($this->_where[$this->sessionPrefix . "simpleSrchFieldsComboOpt"])) {
$where = StrWhereExpression($this->_where[$this->sessionPrefix . "simpleSrchFieldsComboOpt"], $simpleSrch, $this->_where[$this->sessionPrefix . "simpleSrchTypeComboOpt"], "");
if ($where && $this->_where[$this->sessionPrefix . "simpleSrchTypeComboNot"]) {
$where = "not (" . $where . ")";
}
$sWhere = $where;
} else {
for ($i = 0; $i < count($this->searchFieldsArr); $i++) {
if (in_array($this->searchFieldsArr[$i], $fieldsArr) && in_array($this->searchFieldsArr[$i], $this->googleLikeFields)) {
$where = StrWhereExpression($this->searchFieldsArr[$i], $simpleSrch, $this->_where[$this->sessionPrefix . "simpleSrchTypeComboOpt"], "");
// add not
if ($where && $this->_where[$this->sessionPrefix . "simpleSrchTypeComboNot"]) {
$where = "not (" . $where . ")";
}
if ($where) {
if ($sWhere) {
$sWhere .= " or ";
}
$sWhere .= $where;
}
}
}
}
}
$resWhere = whereAdd('', $sWhere);
// if there are fields for build advanced where
$sWhere = '';
if (count($srchFields)) {
// prepare vars
$sWhere = $srchType == "and" ? "(1=1" : "(1=0";
$prevSrchFieldName = '';
// build where
foreach ($srchFields as $srchF) {
if (in_array($srchF['fName'], $fieldsArr)) {
$where = StrWhereAdv($srchF['fName'], $srchF['value1'], $srchF['opt'], $srchF['value2'], $srchF['eType']);
if ($where) {
// add not
if ($srchF['not']) {
$where = "not (" . $where . ")";
}
// and|or depends on search type
if ($srchType == "and") {
// add ( if we add new clause block for same field name
$sWhere .= ($prevSrchFieldName != $srchF['fName'] ? ") and (" : " and ") . $where;
} else {
$sWhere .= " or " . $where;
}
}
$prevSrchFieldName = $srchF['fName'];
}
}
// add ) to final field block clause
$sWhere .= ')';
}
$resWhere = whereAdd($resWhere, $sWhere);
return $resWhere;
}
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:81,代码来源:searchclause.php
示例12: 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 = "";
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:pad_pad_customer_masterlist.php
示例13: 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;
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:64,代码来源:pad_pad_daftar_status_masterprint.php
示例14: getFiltersHaving
/**
* Get the filters HAVING condition
* @return String
*/
function getFiltersHaving()
{
$havingClause = "";
$whereComponents = $this->getWhereComponents();
foreach ($whereComponents["filterHaving"] as $fHaving) {
$whereClause = whereAdd($havingClause, $fHaving);
}
return $whereClause;
}
开发者ID:sdev1,项目名称:CloudStockEnquiry,代码行数:13,代码来源:runnerpage.php
示例15: DisplayMasterTableInfo_LU_Module_Status
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1218|2022-08-30
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1133|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:942|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1339|2022-08-18
-
循环读取图片第一种方法①List =dir(amp;#39;*.jpgamp;#39;); %如需其它图片格式支持
阅读:966|2022-07-18
-
http://www.borland.com/namespaces/Types-IAppServerSOAP 服务器未能识别HTTP头SO
阅读:542|2022-07-18
-
Improper input validation vulnerability in Link of Cybozu Garoon 4.0.0 to 5.5.1
阅读:955|2022-07-08
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:485|2022-08-16
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:641|2022-11-06
-
shem8/MaterialLogin: Login view with material design
阅读:725|2022-08-17
|
请发表评论