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


PHP DBQuery::quote_sanitised方法代码示例

本文整理汇总了PHP中DBQuery::quote_sanitised方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::quote_sanitised方法的具体用法?PHP DBQuery::quote_sanitised怎么用?PHP DBQuery::quote_sanitised使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBQuery的用法示例。


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

示例1: die

if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$AppUI->savePlace();
if (!$canAccess) {
    $AppUI->redirect('m=public&a=access_denied');
}
$perms =& $AppUI->acl();
$q = new DBQuery();
$search_string = dPgetCleanParam($_GET, 'search_string', null);
// To configure an aditional filter to use in the search string
$additional_filter = '';
// retrieve any state parameters
if ($search_string) {
    $AppUI->setState('ContIdxWhere', $search_string);
    $get_search = $q->quote_sanitised('%' . $search_string . '%');
    $additional_filter = "contact_first_name LIKE " . $get_search . " OR contact_last_name LIKE " . $get_search . " OR company_name LIKE " . $get_search . " OR contact_notes LIKE " . $get_search . " OR contact_email LIKE " . $get_search;
} else {
    if (isset($_GET['where'])) {
        $AppUI->setState('ContIdxWhere', $_GET['where']);
    }
}
$where = $q->quote_sanitised($AppUI->getState('ContIdxWhere') ? $AppUI->getState('ContIdxWhere') . '%' : '%');
// Pull First Letters
$let = ":";
$search_map = array('contact_order_by', 'contact_first_name', 'contact_last_name');
foreach ($search_map as $search_name) {
    $q->addTable('contacts', 'c');
    $q->leftJoin('users', 'u', 'u.user_contact=c.contact_id');
    $q->addQuery('DISTINCT UPPER(SUBSTRING(' . $search_name . ',1,1)) as L, user_id');
    $q->addWhere('contact_private = 0 OR (contact_private = 1 AND contact_owner = ' . $AppUI->user_id . ') OR contact_owner IS NULL OR contact_owner = 0');
开发者ID:srinivasulurao,项目名称:jonel,代码行数:31,代码来源:index.php

示例2: DBQuery

// retrieve list of records
$q = new DBQuery();
$q->addTable('companies', 'c');
$q->addQuery('c.company_id, c.company_name, c.company_type, c.company_description' . ', count(distinct p.project_id) as countp' . ', count(distinct p2.project_id) as inactive' . ', con.contact_first_name, con.contact_last_name');
$q->addJoin('projects', 'p', 'c.company_id = p.project_company AND p.project_status <> 7');
$q->addJoin('users', 'u', 'c.company_owner = u.user_id');
$q->addJoin('contacts', 'con', 'u.user_contact = con.contact_id');
$q->addJoin('projects', 'p2', 'c.company_id = p2.project_company AND p2.project_status = 7');
if (count($allowedCompanies) > 0) {
    $q->addWhere('c.company_id IN (' . implode(',', array_keys($allowedCompanies)) . ')');
}
if ($companiesType) {
    $q->addWhere('c.company_type = ' . $company_type_filter);
}
if ($search_string != '') {
    $q->addWhere("c.company_name LIKE " . $q->quote_sanitised('%' . $search_string . '%'));
}
if ($owner_filter_id > 0) {
    $q->addWhere('c.company_owner = ' . $owner_filter_id);
}
$q->addGroup('c.company_id');
$q->addOrder($orderby . ' ' . $orderdir);
$rows = $q->loadList();
?>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl" summary="company list">
<tr>
	<td nowrap="nowrap" width="60" align="right">&nbsp;<?php 
echo $AppUI->_('sort by');
?>
:&nbsp;</td>
	<th nowrap="nowrap">
开发者ID:srinivasulurao,项目名称:jonel,代码行数:31,代码来源:vw_companies.php


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