<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Query Builder Class
*
* This is the platform-independent base Query Builder implementation class.
*
* @package CodeIgniter
* @subpackage Drivers
* @category Database
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/
*/
abstract class CI_DB_query_builder extends CI_DB_driver {
/**
* Return DELETE SQL flag
*
* @var bool
*/
protected $return_delete_sql = FALSE;
/**
* Reset DELETE data flag
*
* @var bool
*/
protected $reset_delete_data = FALSE;
/**
* QB SELECT data
*
* @var array
*/
protected $qb_select = array();
/**
* QB DISTINCT flag
*
* @var bool
*/
protected $qb_distinct = FALSE;
/**
* QB FROM data
*
* @var array
*/
protected $qb_from = array();
/**
* QB JOIN data
*
* @var array
*/
protected $qb_join = array();
/**
* QB WHERE data
*
* @var array
*/
protected $qb_where = array();
/**
* QB GROUP BY data
*
* @var array
*/
protected $qb_groupby = array();
/**
* QB HAVING data
*
* @var array
*/
protected $qb_having = array();
/**
* QB keys
*
* @var array
*/
protected $qb_keys = array();
/**
* QB LIMIT data
*
* @var int
*/
protected $qb_limit = FALSE;
/**
* QB OFFSET data
*
* @var int
*/
protected $qb_offset = FALSE;
/**
* QB ORDER BY data
*
* @var array
*/
protected $qb_orderby = array();
/**
* QB data sets
*
* @var array
*/
protected $qb_set = array();
/**
* QB data set for update_batch()
*
* @var array
*/
protected $qb_set_ub = array();
/**
* QB aliased tables list
*
* @var array
*/
protected $qb_aliased_tables = array();
/**
* QB WHERE group started flag
*
* @var bool
*/
protected $qb_where_group_started = FALSE;
/**
* QB WHERE group count
*
* @var int
*/
protected $qb_where_group_count = 0;
// Query Builder Caching variables
/**
* QB Caching flag
*
* @var bool
*/
protected $qb_caching = FALSE;
/**
* QB Cache exists list
*
* @var array
*/
protected $qb_cache_exists = array();
/**
* QB Cache SELECT data
*
* @var array
*/
protected $qb_cache_select = array();
/**
* QB Cache FROM data
*
* @var array
*/
protected $qb_cache_from = array();
/**
* QB Cache JOIN data
*
* @var array
*/
protected $qb_cache_join = array();
/**
* QB Cache aliased tables list
*
* @var array
*/
protected $qb_cache_aliased_tables = array();
/**
* QB Cache WHERE data
*
* @var array
*/
protected $qb_cache_where = array();
/**
* QB Cache GROUP BY data
*
* @var array
*/
protected $qb_cache_groupby = array();
/**
* QB Cache HAVING data
*
* @var array
*/
protected $qb_cache_having = array();
/**
* QB Cache ORDER BY data
*
* @var array
*/
protected $qb_cache_orderby = array();
/**
* QB Cache data sets
*
* @var array
*/
protected $qb_cache_set = array();
/**
* QB No Escape data
*
* @var array
*/
protected $qb_no_escape = array();
/**
* QB Cache No Escape data
*
* @var array
*/
protected $qb_cache_no_escape = array();
// --------------------------------------------------------------------
/**
* Select
*
* Generates the SELECT portion of the query
*
* @param string
* @param mixed
* @return CI_DB_query_builder
*/
public function select($select = '*', $escape = NULL)
{
if (is_string($select))
{
$select = explode(',', $select);
}
// If the escape value was not set, we will base it on the global setting
is_bool($escape) OR $escape = $this->_protect_identifiers;
foreach ($select as $val)
{
$val = trim($val);
if ($val !== '')
{
$this->qb_select[] = $val;
$this->qb_no_escape[] = $escape;
if ($this->qb_caching === TRUE)
{
$this->qb_cache_select[] = $val;
$this->qb_cache_exists[] = 'select';
$this->qb_cache_no_escape[] = $escape;
}
}
}
return $this;
}
// --------------------------------------------------------------------
/**
* Select Max
*
* Generates a SELECT MAX(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_max($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'MAX');
}
// --------------------------------------------------------------------
/**
* Select Min
*
* Generates a SELECT MIN(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_min($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'MIN');
}
// --------------------------------------------------------------------
/**
* Select Average
*
* Generates a SELECT AVG(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_avg($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'AVG');
}
// --------------------------------------------------------------------
/**
* Select Sum
*
* Generates a SELECT SUM(field) portion of a query
*
* @param string the field
* @param string an alias
* @return CI_DB_query_builder
*/
public function select_sum($select = '', $alias = '')
{
return $this->_max_min_avg_sum($select, $alias, 'SUM');
}
// --------------------------------------------------------------------
/**
* SELECT [MAX|MIN|AVG|SUM]()
*
* @used-by select_max()
* @used-by select_min()
* @used-by select_avg()
* @used-by select_sum()
*
* @param string $select Field name
* @param string $alias
* @param string $type
* @return CI_DB_query_builder
*/
protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX')
{
if ( ! is_string($select) OR $select === '')
{
$this->display_error('db_invalid_query');
}
$type = strtoupper($type);
if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM')))
{
show_error('Invalid function type: '.$type);
}
if ($alias === '')
{
$alias = $this->_create_alias_from_table(trim($select));
}
$sql = $type.'(
没有合适的资源?快使用搜索试试~ 我知道了~
php基于CodeIgniter简易产品后台管理Demo+数据库
共667个文件
php:229个
html:215个
png:48个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 82 浏览量
2023-09-12
11:03:09
上传
评论
收藏 9.52MB ZIP 举报
温馨提示
php基于CodeIgniter简易产品后台管理Demo+数据库 环境要求 WAMPserver 注意事项 Apache httpd-vhosts.conf注册ServerName pro_product.loc 导入product_db.sql 更改CI的database文件'database' => 'product_db'及本机mysql的username和password 配置完成访问路径:http://pro_product.loc/index.php/admin
资源推荐
资源详情
资源评论
收起资源包目录
php基于CodeIgniter简易产品后台管理Demo+数据库 (667个子文件)
.buildinfo 230B
style.css 231KB
bootstrap.min.css 118KB
AdminLTE.min.css 89KB
theme.css 87KB
ionicons.min.css 50KB
font-awesome.min.css 30KB
umeditor.css 17KB
umeditor.min.css 14KB
simple-line-icons.css 13KB
adminStyle.css 10KB
mathquill.css 9KB
basic.css 8KB
pygments.css 4KB
badge_only.css 3KB
image.css 3KB
video.css 3KB
citheme.css 2KB
emotion.css 2KB
blue.css 2KB
renew.css 2KB
formula.css 838B
.editorconfig 302B
Symbola.eot 869KB
stixgeneral-webfont.eot 451KB
stixgeneralbol-webfont.eot 239KB
stixgeneralbolita-webfont.eot 210KB
stixgeneralitalic-webfont.eot 204KB
fontawesome-webfont.eot 37KB
glyphicons-halflings-regular.eot 20KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
appflowchart.gif 25KB
icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
videologo.gif 2KB
smile.gif 1KB
icon_trash.gif 1KB
ok.gif 866B
ajax-loader.gif 673B
icon_account.gif 603B
icon_edit.gif 581B
icon_drop.gif 579B
icon_view.gif 576B
icon_search.gif 396B
icon_title.gif 214B
arrow_right.gif 155B
arrow_left.gif 153B
no.gif 138B
yes.gif 131B
menu_plus.gif 67B
menu_minus.gif 64B
spacer.gif 43B
0.gif 43B
.gitattributes 90B
.gitignore 504B
.htaccess 123B
.htaccess 123B
.htaccess 117B
changelog.html 367KB
query_builder.html 190KB
form_validation.html 150KB
sessions.html 121KB
genindex.html 113KB
form_helper.html 113KB
upgrade_300.html 97KB
xmlrpc.html 83KB
results.html 81KB
styleguide.html 79KB
input.html 79KB
encryption.html 78KB
db_driver_reference.html 78KB
loader.html 78KB
html_helper.html 78KB
email.html 76KB
date_helper.html 74KB
image_lib.html 73KB
table.html 72KB
cart.html 71KB
forge.html 71KB
file_uploading.html 69KB
url_helper.html 66KB
trackback.html 66KB
ftp.html 65KB
parser.html 65KB
utilities.html 64KB
calendar.html 62KB
caching.html 61KB
output.html 58KB
javascript.html 58KB
user_agent.html 58KB
controllers.html 58KB
zip.html 57KB
uri.html 57KB
string_helper.html 56KB
compatibility_functions.html 55KB
共 667 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
云哲-吉吉2021
- 粉丝: 4053
- 资源: 1128
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AI爬虫项目全套技术资料100%好用.zip
- 扒网站数据软件项目全套技术资料100%好用.zip
- Oracle10gDBA学习手册中文PDF清晰版最新版本
- 超智能体写的人工智能深度学习pdf
- Oracle高级SQL培训与讲解WORD文档doc格式最新版本
- 网页数据采集软件项目全套技术资料100%好用.zip
- OraclePLSQL简单安装指南WORD文档doc格式最新版本
- 西门子840D HMI ADVANCED FOR PC 也可用于810D,840DSL中文版 1、软件可安装到台式机或笔记本上,可以连接到机床的NCU进行NC与PLC的数据备份与恢复,备份和恢复的数
- Oracle安装配置使用WORD文档doc格式最新版本
- MATLAB代码:基于分布式ADMM算法的考虑碳排放交易的电力系统优化调度研究 关键词:分布式调度 ADMM算法 交替方向乘子法 碳排放 最优潮流 仿真平台:MATLAB+CPLEX GUROBI
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功