本文整理汇总了PHP中table函数的典型用法代码示例。如果您正苦于以下问题:PHP table函数的具体用法?PHP table怎么用?PHP table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了table函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: tpl_function_qishi_train_news_show
function tpl_function_qishi_train_news_show($params, &$smarty)
{
global $db;
$arr = explode(',', $params['set']);
foreach ($arr as $str) {
$a = explode(':', $str);
switch ($a[0]) {
case "新闻ID":
$aset['id'] = $a[1];
break;
case "列表名":
$aset['listname'] = $a[1];
break;
}
}
$aset = array_map("get_smarty_request", $aset);
$aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
$aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
unset($arr, $str, $a, $params);
$sql = "select id,title,content,addtime,train_id from " . table('train_news') . " WHERE id=" . intval($aset['id']) . " LIMIT 1";
$val = $db->getone($sql);
if (empty($val)) {
header("HTTP/1.1 404 Not Found");
$smarty->display("404.htm");
exit;
}
$val['keywords'] = $val['title'];
$val['description'] = cut_str(strip_tags($val['content']), 60, 0, "");
$smarty->assign($aset['listname'], $val);
}
开发者ID:winiceo,项目名称:job,代码行数:30,代码来源:function.qishi_train_news_show.php
示例2: faq__load_answer
function faq__load_answer($faq_id = "")
{
$pars = array(':faq_id' => $faq_id);
$query = "SELECT * from " . table('lang') . "\n WHERE content_type='faq_answer'\n AND content_name= :faq_id";
$line = orsee_query($query, $pars);
return $line;
}
开发者ID:danorama,项目名称:orsee,代码行数:7,代码来源:faqs.php
示例3: show
/**
*/
function show()
{
$filter_name = $_GET['object'] . '__' . $_GET['action'];
$default_filter = ['order_by' => 'date', 'order_direction' => 'desc'];
$sql = 'SELECT * FROM ' . db('log_auth');
return table($sql, ['filter' => (array) $_SESSION[$filter_name] + $default_filter, 'filter_params' => ['name' => 'like']])->user('user_id')->text('login')->link('group', './?object=user_groups&action=edit&id=%d', main()->get_data('user_groups'))->link('ip', './?object=' . $_GET['object'] . '&action=show_for_ip&id=%d')->date('date', ['format' => 'full', 'nowrap' => 1])->text('user_agent')->text('referer');
}
开发者ID:yfix,项目名称:yf,代码行数:9,代码来源:yf_log_user_auth.class.php
示例4: tpl_function_qishi_news_property
function tpl_function_qishi_news_property($params, &$smarty)
{
global $db;
$arr = explode(',', $params['set']);
foreach ($arr as $str) {
$a = explode(':', $str);
switch ($a[0]) {
case "列表名":
$aset['listname'] = $a[1];
break;
case "名称长度":
$aset['titlelen'] = $a[1];
break;
case "填补字符":
$aset['dot'] = $a[1];
break;
case "分类ID":
$aset['ID'] = $a[1];
break;
}
}
if (is_array($aset)) {
$aset = array_map("get_smarty_request", $aset);
}
$aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
$aset['titlelen'] = $aset['titlelen'] ? intval($aset['titlelen']) : 8;
if ($aset['ID']) {
$wheresql = " WHERE id=" . intval($aset['ID']);
}
$List = $db->getall("SELECT id,categoryname,category_order FROM " . table('article_property') . " " . $wheresql);
$smarty->assign($aset['listname'], $List);
}
开发者ID:source-hunter,项目名称:74cms,代码行数:32,代码来源:function.qishi_news_property.php
示例5: tpl_function_qishi_simple_show
function tpl_function_qishi_simple_show($params, &$smarty)
{
global $db;
$arr = explode(',', $params['set']);
foreach ($arr as $str) {
$a = explode(':', $str);
switch ($a[0]) {
case "ID":
$aset['id'] = $a[1];
break;
case "ÁбíÃû":
$aset['listname'] = $a[1];
break;
}
}
$aset = array_map("get_smarty_request", $aset);
$aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
$aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
unset($arr, $str, $a, $params);
$sql = "select * from " . table('simple') . " WHERE id='{$aset['id']}' AND audit=1 LIMIT 1";
$val = $db->getone($sql);
if (empty($val)) {
header("HTTP/1.1 404 Not Found");
$smarty->display("404.htm");
exit;
}
$val['keywords'] = "{$val['jobname']} {$val['comname']} ";
$val['description'] = cut_str(strip_tags($val['detailed']), 60, 0, "");
$smarty->assign($aset['listname'], $val);
}
开发者ID:dalinhuang,项目名称:yy,代码行数:30,代码来源:function.qishi_simple_show.php
示例6: generateConfirm
function generateConfirm($edit)
{
$dataInvalid = $this->isDataInvalid($edit);
if ($this->formbuilder) {
$this->formbuilder->bulk_set_answers($_POST[$this->event->formkey()]);
$dataInvalid .= $this->formbuilder->answers_invalid();
}
if ($dataInvalid) {
error_exit($dataInvalid . '<br>Please use your back button to return to the form, fix these errors, and try again.');
}
$output = para('Please confirm that this data is correct and click the submit button to proceed to the payment information page.');
$output .= form_hidden('edit[step]', 'submit');
$fields = array('Registration Status' => 'payment', 'Notes' => 'notes');
$rows = array();
foreach ($fields as $display => $column) {
array_push($rows, array($display, form_hidden("edit[{$column}]", $edit[$column]) . check_form($edit[$column])));
}
$output .= form_group('Registration details', "<div class='pairtable'>" . table(null, $rows) . '</div>');
if ($this->formbuilder) {
$form = $this->formbuilder->render_viewable();
$form .= $this->formbuilder->render_hidden();
$output .= form_group('Registration answers', $form);
}
$output .= para(form_submit('submit'));
return form($output);
}
开发者ID:roboshed,项目名称:leaguerunner,代码行数:26,代码来源:edit.php
示例7: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB:
table('authors')->where('name', '=', 'Ramish Fatima')->delete();
DB:
table('authors')->where('name', '=', 'Mahnoor Fatima')->delete();
}
开发者ID:RamishFatima,项目名称:Assignmnet_4,代码行数:12,代码来源:2015_08_16_081654_add_authors.php
示例8: region
function region()
{
$session_key = $_GET['object'] . '__' . $_GET['action'];
$filter = ['filter' => $_SESSION[$session_key], 'filter_params' => ['id' => 'in', 'value' => 'like']];
$table = table('SELECT * FROM ' . db('shop_regions'), $filter)->text('id', 'Номер')->text('value', 'Название')->btn_edit('', $this->_uri['edit'], ['no_ajax' => 1])->btn_delete('', $this->_uri['delete'])->btn_active('', $this->_uri['active'])->footer_add('', $this->_uri['add'], ['no_ajax' => 1]);
return $table;
}
开发者ID:yfix,项目名称:yf,代码行数:7,代码来源:yf_manage_shop_region.class.php
示例9: index
public function index()
{
$id = intval($_REQUEST['id']);
$post_key = $this->_get('post_key', 'trim');
if (empty($id)) {
$where = array('post_key' => $post_key);
} else {
$where = array('id' => $id);
}
$where['post_time'] = array('elt', time());
$where['status'] = 1;
$res = $this->post_mod->relation(true)->where($where)->find();
if ($res) {
$res['cate_list'] = $this->post_cate_re_mod->relation(true)->where(array('post_id' => $res['id']))->select();
$this->assign('info', $res);
$tag_list = $this->post_tag_mod->relation(true)->where("post_id={$res['id']}")->select();
$this->assign('tag_list', $tag_list);
$this->assign('prev_post', $this->post_mod->where("id>{$res['id']} and status=1 and post_time<=" . time())->order("id asc")->find());
$this->assign('next_post', $this->post_mod->where("id<{$res['id']} and status=1 and post_time<=" . time())->order("id desc")->find());
$where = "id in(select post_id from " . table('post_tag') . " where \n tag_id in(select tag_id from " . table('post_tag') . " where post_id={$res['id']}) \n and post_id!={$res['id']})";
$this->assign('like_list', $this->post_mod->where($where)->limit(4)->select());
$post_tag = '';
foreach ($tag_list as $val) {
$post_tag .= $val['tag']['name'];
}
$this->_config_seo(C('pin_seo_config.post'), array('post_title' => $res['title'], 'post_tag' => $post_tag, 'user_name' => $res['uname'], 'seo_title' => $res['seo_title'], 'seo_keywords' => $res['seo_keys'], 'seo_description' => $res['seo_desc']));
$this->comment_list($res['id']);
} else {
$this->error("作品不存在");
}
$this->display();
}
开发者ID:kid2682,项目名称:SMZDM,代码行数:32,代码来源:postAction.class.php
示例10: score_entry_display
function score_entry_display()
{
global $dbh;
$sth = $dbh->prepare('SELECT * FROM score_entry WHERE team_id = ? AND game_id = ?');
$sth->execute(array($this->game->home_team, $this->game->game_id));
$home = $sth->fetch();
if (!$home) {
$home = array('score_for' => 'not entered', 'score_against' => 'not entered', 'defaulted' => 'no');
} else {
$entry_person = Person::load(array('user_id' => $home['entered_by']));
$home['entered_by'] = l($entry_person->fullname, "person/view/{$entry_person->user_id}");
}
$sth->execute(array($this->game->away_team, $this->game->game_id));
$away = $sth->fetch();
if (!$away) {
$away = array('score_for' => 'not entered', 'score_against' => 'not entered', 'defaulted' => 'no');
} else {
$entry_person = Person::load(array('user_id' => $away['entered_by']));
$away['entered_by'] = l($entry_person->fullname, "person/view/{$entry_person->user_id}");
}
$header = array(" ", $this->game->home_name . ' (home)', $this->game->away_name . ' (away)');
$rows = array();
$rows[] = array("Home Score:", $home['score_for'], $away['score_against']);
$rows[] = array("Away Score:", $home['score_against'], $away['score_for']);
$rows[] = array("Defaulted?", $home['defaulted'], $away['defaulted']);
$rows[] = array("Entered By:", $home['entered_by'], $away['entered_by']);
$rows[] = array("Entry time:", $home['entry_time'], $away['entry_time']);
return '<div class="listtable">' . table($header, $rows) . "</div>";
}
开发者ID:roboshed,项目名称:leaguerunner,代码行数:29,代码来源:GameHandler.php
示例11: express
/**
*/
function express()
{
$date = date("Y-m-d");
$orders_info = db()->query_fetch_all("SELECT * FROM " . db('shop_orders') . " WHERE delivery_time LIKE '" . $date . "%' AND status = 1");
if (!empty($orders_info)) {
$orders = array_keys($orders_info);
$products = db()->query_fetch_all("SELECT o.*, p.name, p.price, p.cat_id\n\t\t\t\t\t\t\t\t\t\t\tFROM " . db('shop_order_items') . " as o\n\t\t\t\t\t\t\t\t\t\t\tRIGHT JOIN " . db('shop_products') . " as p ON o.product_id = p.id\n\t\t\t\t\t\t\t\t\t\t\tWHERE o.order_id IN(" . implode(",", $orders) . ") AND o.status = 1\n\t\t\t\t\t\t\t\t\t\t\tORDER BY o.order_id DESC");
}
$_category = _class("_shop_categories", "modules/shop/");
//always add one empty row in table for ajax
if (empty($products)) {
$products[] = ['product_id' => '-', 'name' => '-', 'quantity' => '-', 'price' => '-', 'order_id' => '-'];
$orders_info['-']['delivery_time'] = '-';
}
foreach ((array) $products as $k => $v) {
$replace[] = ["product_id" => $v['product_id'], "name" => $v['name'], "quantity" => $v['quantity'], "price" => module('shop')->_format_price(floatval($v['price'])), "order_id" => $v['order_id'], "id" => $v['order_id'] . '_' . $v['product_id'], "time" => str_replace($date, "", $orders_info[$v['order_id']]['delivery_time'])];
$table_tr[] = 'data-id="' . $v['order_id'] . '_' . $v['product_id'] . '" ';
}
if (!empty($_GET['ajax_mode'])) {
return json_encode($replace);
}
$table = table($replace)->text('order_id')->text('time')->text('name')->text('quantity')->text('product_id')->footer_link("PDF " . $date . " 10-12", './?object=' . $_GET['object'] . '&action=express_pdf&hours=10-12')->footer_link("PDF " . $date . " 13-15", './?object=' . $_GET['object'] . '&action=express_pdf&hours=13-15')->footer_link("PDF " . $date . " 17-20", './?object=' . $_GET['object'] . '&action=express_pdf&hours=17-20')->render(['table_attr' => 'id="express_catalog"', 'tr' => $table_tr]);
$replace = ['table' => $table];
return tpl()->parse("manage_shop/express", $replace);
}
开发者ID:yfix,项目名称:yf,代码行数:27,代码来源:yf_manage_shop_express.class.php
示例12: textile
function textile($text, $lite = '')
{
if (get_magic_quotes_gpc() == 1) {
$text = stripslashes($text);
}
$text = incomingEntities($text);
$text = encodeEntities($text);
$text = fixEntities($text);
$text = cleanWhiteSpace($text);
$text = getRefs($text);
$text = noTextile($text);
$text = image($text);
$text = links($text);
$text = span($text);
$text = superscript($text);
$text = footnoteRef($text);
$text = code($text);
$text = glyphs($text);
$text = retrieve($text);
if ($lite == '') {
$text = lists($text);
$text = table($text);
$text = block($text);
}
/* clean up <notextile> */
$text = preg_replace('/<\\/?notextile>/', "", $text);
/* turn the temp char back to an ampersand entity */
$text = str_replace("x%x%", "&", $text);
$text = str_replace("<br />", "<br />\n", $text);
return trim($text);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:textile2.php
示例13: batchInsert
function batchInsert($table, $data)
{
$sql = "INSERT INTO" . table($table) . "(";
$array = $data;
$keys = array_keys(array_shift($array));
//print_r($keys);
$fields = $values = array();
foreach ($keys as $v) {
$fields[] = '`' . $v . '`';
}
$sql .= implode(',', $fields);
$sql .= ") VALUES ";
foreach ($data as $k1 => $v1) {
$val = array();
foreach ($v1 as $v2) {
//print_r($v2);exit;
$val[] = $v2;
//print_r($val);exit;
}
$values[] = '(' . implode(',', $val) . ')';
}
$sql .= implode(',', $values);
$sql .= ";";
mysql_query($sql);
}
开发者ID:biaoche77,项目名称:chat,代码行数:25,代码来源:function_db.php
示例14: show
/**
*/
function show()
{
$filter_name = $_GET['object'] . '__' . $_GET['action'];
$default_filter = ['order_by' => 'date', 'order_direction' => 'desc'];
$sql = 'SELECT * FROM ' . db('log_redirects') . ' WHERE is_admin="' . strval(!$this->FOR_USER ? 1 : 0) . '"';
return table($sql, ['filter' => (array) $_SESSION[$filter_name] + $default_filter, 'filter_params' => ['url_from' => 'like', 'url_to' => 'like', 'ip' => 'like', 'user_agent' => 'like', 'referer' => 'like']])->admin('user_id')->link('ip', './?object=' . $_GET['object'] . '&action=show_for_ip&id=%d')->date('date', ['format' => 'full', 'nowrap' => 1])->text('user_agent')->text('referer')->text('url_from')->text('url_to')->text('exec_time');
}
开发者ID:yfix,项目名称:yf,代码行数:9,代码来源:yf_log_admin_redirects.class.php
示例15: insertUpdate
function insertUpdate($table, $rows, $primary)
{
$columns = array_keys(reset($rows));
$prefix = "INSERT INTO " . table($table) . " (" . implode(", ", $columns) . ") VALUES\n";
$values = array();
foreach ($columns as $key) {
$values[$key] = "{$key} = VALUES({$key})";
}
$suffix = "\nON DUPLICATE KEY UPDATE " . implode(", ", $values);
$values = array();
$length = 0;
foreach ($rows as $set) {
$value = "(" . implode(", ", $set) . ")";
if ($values && strlen($prefix) + $length + strlen($value) + strlen($suffix) > 1000000.0) {
// 1e6 - default max_allowed_packet
if (!queries($prefix . implode(",\n", $values) . $suffix)) {
return false;
}
$values = array();
$length = 0;
}
$values[] = $value;
$length += strlen($value) + 2;
// 2 - strlen(",\n")
}
return queries($prefix . implode(",\n", $values) . $suffix);
}
开发者ID:tomec-martin,项目名称:adminer,代码行数:27,代码来源:mysqlssl.inc.php
示例16: get_list
public function get_list($status = 0, $user_id = MEMBER_ID)
{
$timestamp = time();
if ($status == 0 ) {
$sql_limit_status = 'p.overtime > '.$timestamp.' AND p.begintime < '.$timestamp;
}
if($status == 1){
$sql_limit_status = 'p.overtime < '.$timestamp;
}
if($status == 2){
$sql_limit_status = 'p.begintime > '.$timestamp;
}
if ($status == -1) {
$sql_limit_status = '1';
}
$sql = 'SELECT p.*, f.uid, f.pid
FROM
' . table('favorite') .' f
,
' . table('product') . ' p
WHERE
'."f.uid = ".$user_id.'
AND
f.pid = p.id
AND
'. $sql_limit_status;
$sql = page_moyo($sql);
$results = dbc(DBCMax)->query($sql)->done();
return $results;
}
开发者ID:pf5512,项目名称:phpstudy,代码行数:31,代码来源:favorite.logic.php
示例17: show
/**
*/
function show()
{
$filter_name = $_GET['object'] . '__' . $_GET['action'];
$default_filter = ['order_by' => 'add_date', 'order_direction' => 'desc'];
$sql = 'SELECT * FROM ' . db('comments');
return table($sql, ['filter' => (array) $_SESSION[$filter_name] + $default_filter, 'filter_params' => ['text' => 'like']])->date('add_date', ['format' => 'full', 'nowrap' => 1])->text('object_name', ['link' => './?object=' . $_GET['object'] . '&action=redirect_view&id=%d', 'link_field_name' => 'id'])->text('object_id', 'oid')->text('text', ['max_length' => $this->TEXT_PREVIEW_LENGTH])->user('user_id')->text('ip', ['link' => './?object=' . $_GET['object'] . '&action=filter_save&page=clear&filter=ip:%d'])->btn_active()->btn_edit()->btn_delete();
}
开发者ID:yfix,项目名称:yf,代码行数:9,代码来源:yf_manage_comments.class.php
示例18: getSignPackage
public function getSignPackage($listid)
{
$configs = globaSetting(array("weixin_appId", "shop_logo"));
$appid = $configs['weixin_appId'];
$scene_list = mysqld_select('SELECT * FROM' . table('addon10_scene_list') . ' WHERE `id`=:id ', array(':id' => $listid));
$protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$url = "{$protocol}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$jsapiTicket = $this->addon_get_js_ticket();
$timestamp = time();
$nonceStr = $this->createNonceStr();
$string = "jsapi_ticket={$jsapiTicket}&noncestr={$nonceStr}×tamp={$timestamp}&url={$url}";
$signature = sha1($string);
$title = $scene_list['share_title'];
$imgUrl = WEBSITE_ROOT . "attachment/" . $scene_list['share_thumb'];
$description = $scene_list['share_content'];
if (empty($imgUrl)) {
$imgUrl = WEBSITE_ROOT . "attachment/" . $configs['shop_logo'];
}
if (empty($description)) {
$description = $configs['shop_title'];
}
if (empty($title)) {
$title = $configs['shop_title'];
}
$signPackage = array("appId" => $appid, "nonceStr" => $nonceStr, "timestamp" => $timestamp, "url" => $url, "title" => $title, "imgUrl" => $imgUrl, "link" => WEBSITE_ROOT . mobile_url('show', array('id' => $listid)), "signature" => $signature, "description" => $description, "rawString" => $string);
return $signPackage;
}
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:27,代码来源:mobile.php
示例19: updateOrderStock
function updateOrderStock($id, $minus = true)
{
$ordergoods = mysqld_selectall("SELECT * FROM " . table('shop_order_goods') . " WHERE orderid='{$id}'");
foreach ($ordergoods as $item) {
$goods = mysqld_select("SELECT * FROM " . table('shop_goods') . " WHERE id='" . $item['goodsid'] . "'");
if ($minus) {
//属性
if (!empty($item['optionid'])) {
mysqld_query("update " . table('shop_goods_option') . " set stock=stock-:stock where id=:id", array(":stock" => $item['total'], ":id" => $item['optionid']));
}
$data = array();
if ($goods['totalcnf'] != 1) {
$data['total'] = $goods['total'] - $item['total'];
}
$data['sales'] = $goods['sales'] + $item['total'];
mysqld_update('shop_goods', $data, array('id' => $item['goodsid']));
} else {
//属性
if (!empty($item['optionid'])) {
mysqld_query("update " . table('shop_goods_option') . " set stock=stock+:stock where id=:id", array(":stock" => $item['total'], ":id" => $item['optionid']));
}
$data = array();
if ($goods['totalcnf'] != 1) {
$data['total'] = $goods['total'] + $item['total'];
}
$data['sales'] = $goods['sales'] - $item['total'];
mysqld_update('shop_goods', $data, array('id' => $item['goodsid']));
}
}
}
开发者ID:jaydom,项目名称:weishang,代码行数:30,代码来源:lib_core.php
示例20: show
/**
*/
function show()
{
$filter_name = $_GET['object'] . '__' . $_GET['action'];
$default_filter = ['order_by' => 'time', 'order_direction' => 'desc'];
$sql = 'SELECT * FROM ' . db('log_auth_fails');
return table($sql, ['filter' => (array) $_SESSION[$filter_name] + $default_filter, 'filter_params' => ['name' => 'like']])->text('reason', ['data' => $this->_reasons])->date('time', ['format' => 'full', 'nowrap' => 1])->link('ip', './?object=' . $_GET['object'] . '&action=show_for_ip&id=%d')->text('login')->text('pswd')->text('user_agent')->text('referer');
}
开发者ID:yfix,项目名称:yf,代码行数:9,代码来源:yf_log_user_auth_fails.class.php
注:本文中的table函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论