当前位置: 首页>>代码示例>>PHP>>正文


PHP gSQLWhere函数代码示例

本文整理汇总了PHP中gSQLWhere函数的典型用法代码示例。如果您正苦于以下问题:PHP gSQLWhere函数的具体用法?PHP gSQLWhere怎么用?PHP gSQLWhere使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了gSQLWhere函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

<?php

$strTableName = "dbo.Anomalies";
$_SESSION["OwnerID"] = $_SESSION["_" . $strTableName . "_OwnerID"];
$strOriginalTableName = "dbo.Anomalies";
$gstrOrderBy = "";
if (strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy, 0, 8)) != "order by") {
    $gstrOrderBy = "order by " . $gstrOrderBy;
}
$g_orderindexes = array();
$gsqlHead = "SELECT ID,   [Module ID],   [Anomaly Description],   [Anomaly Type],   [Date Time],   [Action Taken]";
$gsqlFrom = "FROM dbo.Anomalies";
$gsqlWhereExpr = "";
$gsqlTail = "";
include_once getabspath("include/Anomalies_settings.php");
// alias for 'SQLQuery' object
$gQuery =& $queryData_Anomalies;
$eventObj =& $tableEvents["dbo.Anomalies"];
$reportCaseSensitiveGroupFields = false;
$gstrSQL = gSQLWhere("");
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:20,代码来源:Anomalies_variables.php

示例2: trim

 //	order by
 $strOrderBy = $_SESSION[$strTableName . "_order"];
 if (!$strOrderBy) {
     $strOrderBy = $gstrOrderBy;
 }
 $strSQL .= " " . trim($strOrderBy);
 $strSQLbak = $strSQL;
 if ($eventObj->exists("BeforeQueryExport")) {
     $eventObj->BeforeQueryExport($strSQL, $strWhereClause, $strOrderBy);
 }
 //	Rebuild SQL if needed
 if ($strSQL != $strSQLbak) {
     //	changed $strSQL - old style
     $numrows = GetRowCount($strSQL);
 } else {
     $strSQL = gSQLWhere($strWhereClause, $strHavingClause);
     $strSQL .= " " . trim($strOrderBy);
     $rowcount = false;
     if ($eventObj->exists("ListGetRowCount")) {
         $masterKeysReq = array();
         for ($i = 0; $i < count($pageObject->detailKeysByM); $i++) {
             $masterKeysReq[] = $_SESSION[$strTableName . "_masterkey" . ($i + 1)];
         }
         $rowcount = $eventObj->ListGetRowCount($pageObject->searchClauseObj, $_SESSION[$strTableName . "_mastertable"], $masterKeysReq, $selected_recs);
     }
     if ($rowcount !== false) {
         $numrows = $rowcount;
     } else {
         $numrows = gSQLRowCount($strWhereClause, $strHavingClause);
     }
 }
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:Anomalies_export.php

示例3: unset

    $message = $_SESSION["message_edit"];
    unset($_SESSION["message_edit"]);
}
/////////////////////////////////////////////////////////////
//	read current values from the database
/////////////////////////////////////////////////////////////
$query = $queryData_Customers->Copy();
$strWhereClause = KeyWhere($keys);
$strSQL = gSQLWhere($strWhereClause);
$strSQLbak = $strSQL;
//	Before Query event
if ($eventObj->exists("BeforeQueryEdit")) {
    $eventObj->BeforeQueryEdit($strSQL, $strWhereClause);
}
if ($strSQLbak == $strSQL) {
    $strSQL = gSQLWhere($strWhereClause);
}
LogInfo($strSQL);
$rs = db_query($strSQL, $conn);
$data = db_fetch_array($rs);
if (!$data) {
    if ($inlineedit == EDIT_SIMPLE) {
        header("Location: Customers_list.php?a=return");
        exit;
    } else {
        $data = array();
    }
}
$readonlyfields = array();
if ($readevalues) {
    $data["Name"] = $evalues["Name"];
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:Customers_edit.php

示例4: array

     if ($HaveData) {
         $returnJSON['noKeys'] = false;
     } else {
         $returnJSON['noKeys'] = true;
     }
     $respJSON['keys'] = $keys;
     $respJSON['rawVals'] = $showRawValues;
     $respJSON['detKeys'] = $showDetailKeys;
     $respJSON['userMess'] = $usermessage;
 }
 $respJSON['mKeys'] = array();
 for ($i = 0; $i < count($dpParams['ids']); $i++) {
     $data = 0;
     if (count($keys)) {
         $where = KeyWhere($keys);
         $strSQL = gSQLWhere($where);
         LogInfo($strSQL);
         $rs = db_query($strSQL, $conn);
         $data = db_fetch_array($rs);
     }
     if (!$data) {
         $data = $avalues;
     }
     $mKeyId = 1;
     foreach ($mKeys[$dpParams['strTableNames'][$i]] as $mk) {
         if ($data[$mk]) {
             $respJSON['mKeys'][$dpParams['strTableNames'][$i]]['masterkey' . $mKeyId++] = $data[$mk];
         } else {
             $respJSON['mKeys'][$dpParams['strTableNames'][$i]]['masterkey' . $mKeyId++] = '';
         }
     }
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:Month_Billings_add.php

示例5: DeleteUploadedFiles

function DeleteUploadedFiles($where, $table = "")
{
    global $conn, $gstrSQL;
    $sql = gSQLWhere($where);
    $rs = db_query($sql, $conn);
    if (!($data = db_fetch_array($rs))) {
        return;
    }
    foreach ($data as $field => $value) {
        if (strlen($value) && GetEditFormat($field) == EDIT_FORMAT_FILE) {
            $isAbs = GetFieldData($table, $field, "Absolute", false);
            $filename = GetUploadFolder($field) . $value;
            if (!$isAbs) {
                $filename = getabspath($filename);
            }
            runner_delete_file($filename);
            if (GetCreateThumbnail($field)) {
                $filename = GetUploadFolder($field) . GetThumbnailPrefix($field) . $value;
                if (!$isAbs) {
                    $filename = getabspath($filename);
                }
                runner_delete_file($filename);
            }
        }
    }
}
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:26,代码来源:commonfunctions.php

示例6: array

    $returnJSON = array("success" => false, "error" => 'Error: You have not permission for read this text');
    echo my_json_encode($returnJSON);
    return;
}
if (!$gQuery->HasGroupBy()) {
    // Do not select any fields except current (full text) field.
    // If query has 'group by' clause then other fields are used in it and we may not simply cut 'em off.
    // Just don't do anything in that case.
    $gQuery->RemoveAllFieldsExcept(GetFieldIndex($field));
}
$keysArr = GetTableData($strTableName, '.Keys', array());
$keys = array();
foreach ($keysArr as $ind => $k) {
    $keys[$k] = postvalue("key" . ($ind + 1));
}
$where = KeyWhere($keys);
$secOpt = GetTableData($strTableName, '.nSecOptions', array());
if ($secOpt == ADVSECURITY_VIEW_OWN) {
    $where = whereAdd($where, SecuritySQL("Search"));
}
$sql = gSQLWhere($where);
$rs = db_query($sql, $conn);
if (!$rs || !($data = db_fetch_array($rs))) {
    $returnJSON = array("success" => false, "error" => 'Error: Wrong SQL query');
    echo my_json_encode($returnJSON);
    return;
}
$value = nl2br(htmlspecialchars($data[$field]));
$returnJSON = array("success" => true, "textCont" => $value);
echo my_json_encode($returnJSON);
return;
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:31,代码来源:fulltext.php

示例7: Chart


//.........这里部分代码省略.........
         }
     }
     if ($this->chrt_array["chart_type"]["type"] != "gauge") {
         $this->strLabel = $this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name'];
         for ($j = 0; $j < count($this->chrt_array['fields']); $j++) {
             if ($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name'] == $this->chrt_array['fields'][$j]['name']) {
                 if ($this->table_type == "project") {
                     $this->label2 = $this->chart_xmlencode(GetFieldLabel($TableName, GoodFieldName($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name'])));
                 } else {
                     $this->label2 = $this->chart_xmlencode($this->chrt_array['parameters'][count($this->chrt_array['parameters']) - 1]['name']);
                 }
             }
         }
     }
     if ($this->chrt_array["chart_type"]["type"] != "ohlc" && $this->chrt_array["chart_type"]["type"] != "candlestick") {
         foreach ($this->arrDataColor as $ind => $val) {
             if ($ind == 0) {
                 $this->arrAxesColor = "#000000";
             } else {
                 $this->arrAxesColor = "#" . $this->arrDataColor[$ind];
             }
         }
     } else {
         foreach ($this->arrOHLC_color as $ind => $val) {
             if ($ind == 0) {
                 $this->arrAxesColor = "#000000";
             } else {
                 $this->arrAxesColor = "#" . $this->arrOHLC_color[$ind];
             }
         }
     }
     // prepare search params
     global $gsqlFrom, $gsqlWhereExpr;
     $gQuery = GetTableData($this->sessionPrefix, ".sqlquery", null);
     $strWhereClause = "";
     $searchHavingClause = "";
     // search where for basic charts
     if (!$this->webchart) {
         global $strTableName;
         if (isset($_SESSION[$this->sessionPrefix . '_advsearch'])) {
             $searchClauseObj = unserialize($_SESSION[$this->sessionPrefix . '_advsearch']);
             $strWhereClause = $searchClauseObj->getWhere(GetListOfFieldsByExprType(false));
             $searchHavingClause = $searchClauseObj->getWhere(GetListOfFieldsByExprType(true));
         }
     } else {
         if ($this->table_type != "project") {
             $strTableName = "webchart" . $this->cname;
         } else {
             $strTableName = $TableName;
         }
         $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")) {
             $strWhereClause = whereAdd($strWhereClause, SecuritySQL("Search"));
         }
         $this->strSQL = gSQLWhere($strWhereClause, $searchHavingClause);
         $strOrderBy = $this->gstrOrderBy;
         $this->strSQL .= " " . $strOrderBy;
         $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 = gSQLWhere($strWhereClause, $searchHavingClause);
             $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 (GetDatabaseType() == 2) {
                 $pos = strrpos(strtoupper($sql_query), "ORDER BY");
                 if ($pos) {
                     $sql_query = substr($sql_query, 0, $pos);
                 }
             }
             if (GetDatabaseType() != 1) {
                 //Oracle
                 $this->strSQL = "select * from (" . $sql_query . ") as 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:samsulpendis,项目名称:Instant_Appointment,代码行数:101,代码来源:charts.php


注:本文中的gSQLWhere函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。