本文整理汇总了PHP中generate_where_statement函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_where_statement函数的具体用法?PHP generate_where_statement怎么用?PHP generate_where_statement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_where_statement函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_where_clause
function _get_where_clause()
{
$where = '';
$whereClauses = array();
if (isset($_REQUEST['query'])) {
foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
if ($key == 'name' && !empty($_REQUEST['name'])) {
$whereClauses[count($whereClauses) - 1] = "(" . $whereClauses[count($whereClauses) - 1] . " or teams.name_2 like '" . $GLOBALS['db']->quote($_REQUEST['name']) . "%')";
}
}
$where = generate_where_statement($whereClauses);
}
if (!empty($this->_popupMeta['whereStatement'])) {
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $this->_popupMeta['whereStatement'];
}
if (!empty($_REQUEST['custom_method'])) {
if (!empty($_REQUEST['user_id'])) {
$where .= !empty($where) ? ' and' : '';
// deleted=0 added to fix CRYS-470.
$where .= " teams.id in (select team_id from team_memberships where user_id = '" . $_REQUEST['user_id'] . "' and deleted=0)";
} else {
$where .= !empty($where) ? ' and teams.private = 0' : ' teams.private = 0';
}
}
return $where;
}
示例2: _get_where_clause
function _get_where_clause()
{
$where = '';
if (isset($_REQUEST['query'])) {
$where_clauses = array();
append_where_clause($where_clauses, "name", "acl_roles.name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
示例3: _get_where_clause
function _get_where_clause()
{
$where = '';
if (isset($_REQUEST['query'])) {
$where_clauses = array();
append_where_clause($where_clauses, "name", "emails.name");
append_where_clause($where_clauses, "contact_name", "contacts.last_name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
示例4: _get_where_clause
function _get_where_clause()
{
$where = '';
if (isset($_REQUEST['query'])) {
$where_clauses = array();
append_where_clause($where_clauses, "first_name", "users.first_name");
append_where_clause($where_clauses, "last_name", "users.last_name");
append_where_clause($where_clauses, "user_name", "users.user_name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
示例5: _get_where_clause
function _get_where_clause()
{
$where = '';
if(isset($_REQUEST['query']))
{
$where_clauses = array();
append_where_clause($where_clauses, "first_name", "users.first_name");
append_where_clause($where_clauses, "last_name", "users.last_name");
append_where_clause($where_clauses, "user_name", "users.user_name");
$where = generate_where_statement($where_clauses);
}
$GLOBALS['log']->debug("module.employees.popup_picker, where: " . $where);
return $where;
}
示例6: _get_where_clause
function _get_where_clause()
{
$where = '';
$whereClauses = array();
if (isset($_REQUEST['query'])) {
foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
}
$where = generate_where_statement($whereClauses);
}
if (!empty($this->_popupMeta['whereStatement'])) {
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $this->_popupMeta['whereStatement'];
}
return $where;
}
示例7: Material
global $currentModule;
$seed_object = new Material();
/* require_once('modules/Prices/Price.php');
$price = new Price();*/
$where = "";
//$where2 = "";
if (isset($_REQUEST['query'])) {
$search_fields = array("num", "name", "category", "measure");
$where_clauses = array();
$where_clauses2 = array();
append_where_clause($where_clauses, "num", "materials.num");
append_where_clause($where_clauses, "name", "materials.name");
append_where_clause($where_clauses, "category", "materials.category");
append_where_clause($where_clauses, "measure", "materials.measure");
//append_where_clause($where_clauses2, "price", "prices.price");
$where = generate_where_statement($where_clauses);
//$where2 = generate_where_statement($where_clauses2);
$GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html'])) {
if ($_REQUEST['html'] == 'supplies' || $_REQUEST['html'] == 'purchaseorders') {
$form = new XTemplate('modules/Materials/Popup_cust.html');
$GLOBALS['log']->debug("using file modules/Materials/Popup_cust.html");
$form->assign("MOD", $mod_strings);
$form->assign("APP", $app_strings);
// the form key is required
if (!isset($_REQUEST['form'])) {
示例8: testGenerateWhereStatement
public function testGenerateWhereStatement()
{
$where = array("dog = '1'", "cat = '3'");
$this->assertEquals("dog = '1' and cat = '3'", generate_where_statement($where));
}
示例9: _get_where_clause
function _get_where_clause()
{
$where = '';
$whereClauses = array();
if (isset($_REQUEST['query'])) {
//Edit Peter Peshev
if (isset($_REQUEST['filter0']) && isset($_REQUEST['filtervalue0'])) {
$keys = array_keys($_GET);
for ($i = 0; $i < count($keys); $i++) {
if (substr_count($keys[$i], "filter") > 0) {
$index = substr($keys[$i], -1, 1);
if (isset($_GET["filter" . $index]) && isset($_GET["filtervalue" . $index])) {
if (empty($_GET["filtervalue" . $index])) {
return $where = '';
}
$filter = $_GET["filter" . $index];
$filtervalue = $_GET["filtervalue" . $index];
if (empty($where)) {
if ($filtervalue == 'NULL') {
$where = $where . " {$filter} IS NULL ";
} else {
$where = $where . " {$filter}='{$filtervalue}' ";
}
} else {
if ($filtervalue == 'NULL') {
$where = $where . " AND {$filter} IS NULL ";
} else {
$where = $where . " AND {$filter}='{$filtervalue}' ";
}
}
}
}
}
} else {
foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
}
$where = generate_where_statement($whereClauses);
}
}
return $where;
}