本文整理汇总了PHP中get_time函数的典型用法代码示例。如果您正苦于以下问题:PHP get_time函数的具体用法?PHP get_time怎么用?PHP get_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pagination
/**
*
* @param string $where
* @return array 返回数据库查询后的数组:
*/
function pagination($where, $conn, $tbl_name)
{
require_once 'class/Config_commodity.php';
require_once 'class/DBpagination.php';
require_once 'class/DBcount.php';
require_once 'class/Info_user.php';
require_once 'class/Config_user.php';
require_once 'Include_picture.php';
//2.向数据库查询符合条件数,以计算显示分页数目
$dbcount = new DBcount($tbl_name, $where);
$retval = $dbcount->excute($conn);
$row = mysqli_fetch_array($retval, MYSQLI_NUM);
$count = 1 + (int) (($row ? $row[0] : 0) / SIZE_EACH_PAGE);
//3.计算当前页码;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$page = $page > $count ? $count : $page;
//4. 查询当前页的数据
$choosed_fields = array(Config_commodity::table_name . '.' . Config_commodity::description, Config_commodity::table_name . '.' . Config_commodity::id, Config_commodity::table_name . '.' . Config_commodity::publisher, Config_commodity::table_name . '.' . Config_commodity::title, Config_commodity::table_name . '.' . Config_commodity::price, Config_commodity::table_name . '.' . Config_commodity::release_date, Config_commodity::table_name . '.' . Config_commodity::praise, Config_commodity::table_name . '.' . Config_commodity::leave_message_time, Config_commodity::table_name . '.' . Config_commodity::id);
$DBpagination = new DBpagination($tbl_name, $where, $page, SIZE_EACH_PAGE, $choosed_fields);
$reval = $DBpagination->excute($conn);
//逐个配置 array 三级关联数组 供界面使用
$array = array();
while (($temp_database_row_array = mysqli_fetch_array($reval, MYSQLI_ASSOC)) != null) {
$userinfo = Info_user::get_user_info_by_id($conn, $temp_database_row_array[Config_commodity::publisher]);
$array[] = array('imgs' => get_commodity_pic($conn, $temp_database_row_array[Config_commodity::id]), 'description' => $temp_database_row_array[Config_commodity::description], 'title' => $temp_database_row_array[Config_commodity::title], 'price' => $temp_database_row_array[Config_commodity::price], 'url' => 'upload/default.jpg', 'name' => $userinfo[Config_user::log_name], 'time' => get_time($temp_database_row_array[Config_commodity::release_date]), 'star_numbers' => $temp_database_row_array[Config_commodity::praise], 'message_numbers' => $temp_database_row_array[Config_commodity::leave_message_time], 'id' => $temp_database_row_array[Config_commodity::id]);
}
//5.释放资源
mysqli_free_result($reval);
return array('page' => $page, 'array' => $array);
}
示例2: check_access_ip
public static function check_access_ip()
{
$blocked_time = db::scalar(self::Q_GET_IP, array('%ip' => ip2long(get_ip())));
if ($blocked_time > get_time()) {
throw new Exception_wx(4030003, get_ip());
}
}
示例3: record
function record($start_date, $end_date)
{
global $useradmin;
$start = new DateTime($start_date);
$end = new DateTime($end_date);
$end = $end->modify('+1 day');
$interval = new DateInterval('P1D');
$period = new DatePeriod($start, $interval, $end);
//var_dump($period);
foreach ($period as $date) {
$index_date = $date->format('Y-m-d');
//echo $index_date;
$unique_visitors = get_unique_visits($index_date);
$visits = get_visits($index_date);
$time = get_time($index_date);
echo "<br/><br/>" . $index_date . "<br/><br/>";
echo "unique visitors:" . $unique_visitors . "<br/>";
echo "visits:" . $visits . "<br/>";
echo "total time:" . $time . "<br/>";
$selectSQL = "SELECT * FROM visitor_daily_report WHERE report_date='" . $index_date . "'";
if ($row_record = mysql_fetch_assoc(mysql_query_or_die($selectSQL, $useradmin))) {
echo "<br/>record already in database!<br/>";
} else {
echo "<br/>inserting new record into database!<br/>";
$insertSQL = sprintf("INSERT INTO visitor_daily_report (report_date, visits, unique_visitors, total_time) VALUES(%s, %s, %s, %s)", GetSQLValueString($index_date, "date"), GetSQLValueString($visits, "int"), GetSQLValueString($unique_visitors, "int"), GetSQLValueString($time, "int"));
$result = mysql_query_or_die($insertSQL, $useradmin);
}
}
}
示例4: JKY_generate_purchase
/**
* generate Purchase
*
* @param int purchase_id
* @return int count of Incomings generated
*/
function JKY_generate_purchase($the_id)
{
$db = Zend_Registry::get('db');
$sql = 'SELECT *' . ' FROM Purchases' . ' WHERE id = ' . $the_id;
$my_purchase = $db->fetchRow($sql);
$sql = 'SELECT *' . ' FROM PurchaseLines' . ' WHERE parent_id = ' . $the_id;
$my_rows = $db->fetchAll($sql);
$my_count = 0;
foreach ($my_rows as $my_row) {
$my_incoming_id = get_next_id('Incomings');
$sql = 'INSERT Incomings' . ' SET id = ' . $my_incoming_id . ', updated_by = ' . get_session('user_id') . ', updated_at ="' . get_time() . '"' . ', incoming_number = ' . $my_incoming_id . ', supplier_id = ' . $my_purchase['supplier_id'] . ', invoice_date ="' . $my_row['expected_date'] . '"' . ', invoice_weight = ' . $my_row['expected_weight'];
log_sql('Incomings', 'INSERT', $sql);
$db->query($sql);
insert_changes($db, 'Incomings', $my_incoming_id);
$my_batchin_id = get_next_id('Batches');
$sql = 'INSERT Batches' . ' SET id = ' . $my_batchin_id . ', updated_by = ' . get_session('user_id') . ', updated_at ="' . get_time() . '"' . ', incoming_id = ' . $my_incoming_id . ', thread_id = ' . $my_row['thread_id'] . ', purchase_line_id = ' . $my_row['id'];
log_sql('Batches', 'INSERT', $sql);
$db->query($sql);
insert_changes($db, 'Batches', $my_batchin_id);
$sql = 'UPDATE PurchaseLines' . ' SET batch_id = ' . $my_batchin_id . ' WHERE id = ' . $my_row['id'];
log_sql('PurchaseLines', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'PurchaseLines', $my_row['id']);
$my_count++;
}
$sql = 'UPDATE Purchases' . ' SET status = "Active"' . ' WHERE id = ' . $the_id;
log_sql('Purchases', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'Purchases', $the_id);
return $my_count;
}
示例5: JKY_return_piece
/**
* return Piece from Pieces Return
*
* $.ajax({ method:'return', table:'Pieces', barcode:9...9, ...};
*
* @return string ''
*/
function JKY_return_piece($the_data)
{
$db = Zend_Registry::get('db');
$my_barcode = get_data($the_data, 'barcode');
$my_inspected_by = get_data($the_data, 'inspected_by');
$my_weighed_by = get_data($the_data, 'weighed_by');
$my_remarks = get_data($the_data, 'remarks');
$my_checkin_weight = get_data($the_data, 'checkin_weight');
$my_checkin_location = get_data($the_data, 'checkin_location');
$sql = 'UPDATE Pieces' . ' SET ' . get_updated() . ', status="Check In"' . ', inspected_by= ' . $my_inspected_by . ', weighed_by= ' . $my_weighed_by . ', remarks=\'' . $my_remarks . '\'' . ', checkin_weight= ' . $my_checkin_weight . ', checkin_location=\'' . $my_checkin_location . '\'' . ', checkin_at=\'' . get_time() . '\'' . ' WHERE id =' . $my_barcode;
log_sql('Pieces', 'update', $sql);
$db->query($sql);
insert_changes($db, 'Pieces', $my_barcode);
$my_order_id = get_table_value('Pieces', 'order_id', $my_barcode);
$my_set = ', produced_at=\'' . get_time() . '\'' . ', produced_pieces = produced_pieces + 1';
if ($my_remarks != 'boa') {
$my_set = ', rejected_pieces = rejected_pieces + 1';
}
$my_field_name = $my_remarks == 'boa' ? 'produced_pieces' : 'rejected_pieces';
$sql = 'UPDATE Orders' . ' SET ' . get_updated() . $my_set . ' WHERE id = ' . $my_order_id;
log_sql('Orders', 'update', $sql);
$db->query($sql);
insert_changes($db, 'Orders', $my_order_id);
return '';
}
示例6: addRecord
public function addRecord()
{
$M = M('backup');
$M->backup_time = get_time();
$M->path = $this->config['path'];
$M->desc = session('username');
$M->add();
$this->success('备份成功', U('Database/index'));
}
示例7: JKY_generate_order
/**
* generate Order from OSAs
*
* @param int quotation_id
* @return int count of Orders generated
*/
function JKY_generate_order($the_id)
{
$db = Zend_Registry::get('db');
$sql = 'SELECT *' . ' FROM OSAs' . ' WHERE id = ' . $the_id;
$my_osa = $db->fetchRow($sql);
$sql = 'SELECT *' . ' FROM OSA_Lines' . ' WHERE parent_id = ' . $the_id;
$my_rows = $db->fetchAll($sql);
$my_count = 0;
foreach ($my_rows as $my_row) {
$my_osa_line_id = $my_row['id'];
$sql = 'SELECT *' . ' FROM OSA_Colors' . ' WHERE parent_id = ' . $my_osa_line_id;
$my_colors = $db->fetchAll($sql);
foreach ($my_colors as $my_color) {
$my_order_id = get_next_id('Orders');
$sql = 'INSERT Orders' . ' SET id =' . $my_order_id . ', updated_by =' . get_session('user_id') . ', updated_at ="' . get_time() . '"' . ', order_number =' . $my_order_id . ', osa_line_id =' . $my_osa_line_id . ', osa_number =' . $my_osa['osa_number'] . ', ordered_at ="' . $my_osa['ordered_at'] . '"' . ', needed_at ="' . $my_osa['needed_at'] . '"' . ', quoted_units =' . $my_row['units'] . ', quoted_pieces =' . $my_color['quoted_pieces'] . ', quoted_weight =' . $my_color['quoted_weight'] . ', ordered_pieces =' . $my_color['ordered_pieces'] . ', ordered_weight =' . $my_color['ordered_weight'];
if ($my_osa['customer_id']) {
$sql .= ', customer_id=' . $my_osa['customer_id'];
}
if ($my_row['product_id']) {
$sql .= ', product_id=' . $my_row['product_id'];
}
if ($my_color['color_id']) {
$sql .= ', color_id=' . $my_color['color_id'];
}
if ($my_color['ftp_id']) {
$sql .= ', ftp_id=' . $my_color['ftp_id'];
}
if ($my_color['machine_id']) {
$sql .= ', machine_id=' . $my_color['machine_id'];
}
if ($my_color['partner_id']) {
$sql .= ', partner_id=' . $my_color['partner_id'];
}
log_sql('Orders', 'INSERT', $sql);
$db->query($sql);
insert_changes($db, 'Orders', $my_order_id);
/*
$sql= 'UPDATE OSA_lines'
. ' SET status = "Active"'
. ' WHERE id = ' . $my_row['id']
;
log_sql('OSA_Lines', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'OSA_Lines', $my_row['id']);
*/
$my_count++;
}
}
$sql = 'UPDATE OSAs' . ' SET status = "Active"' . ' WHERE id = ' . $the_id;
log_sql('OSAs', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'OSAs', $the_id);
return $my_count;
}
示例8: index
public function index()
{
if (session('?username') && session('userid')) {
redirect(U('Index/index'));
exit;
}
if ($this->isGet()) {
if (session('errors') > 2) {
$this->show_recaptcha();
}
//如果为get请求并且错误尝试次数大于3,显示验证码
$this->display();
exit;
} else {
if ($this->isPost()) {
session('errors', 0);
if (session('errors') < 3 || $this->recaptcha_valiaute()) {
//如果为post请求并且错误尝试次数小于4,则无需验证;否则需要对验证码进行验证
$username = htmlentities($this->_post('usernameoremail'));
$password = htmlentities($this->_post('password'));
$User = M('user');
$User->where("username='%s' or email='%s' ", $username, $username)->find();
if (isset($User->password) && $User->password === md5Encrypt($password)) {
session('username', $username);
session('userid', $User->id);
$M = M('log');
$M->update_user = session('userid');
$M->update_time = get_time();
$M->operate = 'login';
$M->ip = get_client_ip();
$M->status = '0';
$M->add();
$this->msg = 'success!';
redirect(U('Index/index'));
exit;
} else {
if (session('errors') > 2) {
$this->recaptcha = recaptcha_get_html($this->publickey, $error);
}
$this->msg = "Wrong username or email and password combine.";
}
}
session('errors', session('errors') + 1);
$this->errors = session('errors');
$this->username = $username;
$this->display();
} else {
if ($this->isAjax()) {
exit;
//Ajax cross domain attack
}
}
}
}
示例9: update
public function update($id, array $data, $log = true)
{
$data['updated_at'] = get_time();
if (is_session('user_id')) {
$data['updated_by'] = get_session('user_id');
}
$where = $this->getAdapter()->quoteInto('id = ?', $id);
parent::update($data, $where);
if ($log) {
log_sql($this->_name, $id, 'updated', $data);
set_session('notice', 'current record saved');
}
}
示例10: __construct
/**
* 导入记录信息
*
* @param string $pid
* @param string $location
* @param string $toplocation
* @param string $cookies
* @param unknown $data
*/
public function __construct($pid = "", $location = "", $toplocation = "", $cookies = "", $data = array())
{
$this->pid = $pid;
$this->location = $location;
$this->toplocation = $toplocation;
$this->cookies = $cookies;
$this->data = is_array($data) ? $data : array();
$this->dbh = $GLOBALS['pmx_dbh'];
$this->ip = get_ip();
$this->time = get_time();
$this->HTTP_ACCEPT = isset($_SERVER["HTTP_ACCEPT"]) ? $_SERVER["HTTP_ACCEPT"] : "";
$this->HTTP_REFERER = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "";
$this->HTTP_USER_AGENT = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
}
示例11: JKY_generate_checkout
/**
* generate CheckOut from Planning Orders
*
* @param int order_id
* @return int count of CheckOuts generated
*/
function JKY_generate_checkout($the_id)
{
$db = Zend_Registry::get('db');
$sql = 'SELECT *' . ' FROM Orders' . ' WHERE id = ' . $the_id;
$my_order = $db->fetchRow($sql);
$sql = 'SELECT *' . ' FROM OrdThreads' . ' WHERE parent_id = ' . $the_id;
$my_rows = $db->fetchAll($sql);
/*
$my_needed_at = $my_order['needed_at'];
if ($my_needed_at == null) {
$my_needed_at = get_time();
}
*/
$my_checkout_id = get_next_id('CheckOuts');
$sql = 'INSERT CheckOuts' . ' SET id =' . $my_checkout_id . ', updated_by =' . get_session('user_id') . ', updated_at ="' . get_time() . '"' . ', number =' . $my_checkout_id . ', requested_at ="' . get_time() . '"' . ', requested_weight =' . $my_order['ordered_weight'];
if ($my_order['machine_id']) {
$sql .= ', machine_id=' . $my_order['machine_id'];
}
if ($my_order['partner_id']) {
$sql .= ', partner_id=' . $my_order['partner_id'];
}
log_sql('CheckOuts', 'INSERT', $sql);
$db->query($sql);
insert_changes($db, 'CheckOuts', $my_checkout_id);
$my_count = 0;
foreach ($my_rows as $my_row) {
$my_ord_thread_id = $my_row['id'];
$my_batch = db_get_row('Batches', 'id=' . $my_row['batchin_id']);
$my_ordered_weight = $my_row['ordered_weight'];
$my_ordered_boxes = ceil((double) $my_ordered_weight / (double) $my_batch['average_weight']);
$my_batchout_id = get_next_id('BatchOuts');
$sql = 'INSERT BatchOuts' . ' SET id =' . $my_batchout_id . ', updated_by =' . get_session('user_id') . ', updated_at ="' . get_time() . '"' . ', checkout_id =' . $my_checkout_id . ', thread_id =' . $my_row['thread_id'] . ', batchin_id =' . $my_row['batchin_id'] . ', order_thread_id =' . $my_ord_thread_id . ', batch ="' . $my_batch['batch'] . '"' . ', unit_price =' . $my_batch['unit_price'] . ', average_weight =' . $my_batch['average_weight'] . ', requested_weight =' . $my_ordered_weight . ', requested_boxes =' . $my_ordered_boxes;
log_sql('BatchOuts', 'INSERT', $sql);
$db->query($sql);
insert_changes($db, 'BatchOuts', $my_batchout_id);
$sql = 'UPDATE OrdThreads' . ' SET batchout_id = ' . $my_batchout_id . ' WHERE id = ' . $my_ord_thread_id;
log_sql('OrdThreads', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'OrdThreads', $my_ord_thread_id);
$my_count++;
}
$sql = 'UPDATE Orders' . ' SET status = "Active"' . ' WHERE id = ' . $the_id;
log_sql('Orders', 'UPDATE', $sql);
$db->query($sql);
insert_changes($db, 'Orders', $the_id);
return $my_count;
}
示例12: show_recette
function show_recette($r)
{
global $PANIER;
?>
<a id="recette-<?php
echo $r['id'];
?>
" class="recette-el" href="recette-<?php
echo $r['id'] . '-' . txt2url($r['titre']);
?>
.html" style="background: url(images/<?php
echo $r['id'];
?>
.jpg) no-repeat center center; background-size: 100%;">
<div class="infos">
<div class="details fltr"><?php
echo '<img src="style/time11.png" alt="" /> ' . get_time($r['duree']) . ' <img src="style/pers11.png" alt="Pour " /> ' . $r['personnes'];
?>
</div>
<div class="stars"><div class="stars_full" style="width: <?php
echo $r['note'] / 2 * 12;
?>
px"></div></div>
<div class="titre"><?php
echo $r['titre'];
?>
</div>
</div>
<div class="cart"><?php
if (isset($PANIER[$r['id']])) {
for ($i = 1; $i <= $PANIER[$r['id']]; $i++) {
?>
<img src="style/ok25.png" alt="ok" onclick="return rem(<?php
echo $r['id'];
?>
,this)" /><?php
}
}
?>
<img class="cart-add" src="style/add25.png" alt="+" onclick="return add(<?php
echo $r['id'];
?>
)" />
</div>
<img src="style/transp.png" class="transp" />
</a><?php
}
示例13: get_leave_message
function get_leave_message($commodity_id, $conn)
{
require_once 'class/Config_leave_message.php';
require_once 'class/DBpagination.php';
require_once 'class/Info_user.php';
require_once 'class/Config_user.php';
$page = isset($_REQUEST['page']) ? (int) $_GET['id'] : 1;
$dbtraerser = new DBpagination(Config_leave_message::tbl_name, ' where ' . Config_leave_message::commodity_id . ' = ' . "'" . $commodity_id . "'", $page, MESSAGE_EACH_PAGE, array(Config_leave_message::content, Config_leave_message::time, Config_leave_message::talker));
$retval = $dbtraerser->excute($conn);
$array_message = array();
while (($temp_database_row_array = mysqli_fetch_array($retval, MYSQLI_ASSOC)) != null) {
$temp_user = Info_user::get_user_avatar_and_logname($conn, $temp_database_row_array[Config_leave_message::talker]);
$array_message[] = array('description' => $temp_database_row_array[Config_leave_message::content], 'time' => get_time($temp_database_row_array[Config_leave_message::time]), 'nickname' => $temp_user[Config_user::log_name], 'img' => 'upload/avatar.png');
}
mysqli_free_result($retval);
return $array_message;
}
示例14: show_buy_html
function show_buy_html($commodity_id, $conn)
{
require_once 'class/Config_commodity.php';
require_once 'class/DBtraverser.php';
$where = ' where ' . Config_commodity::id . ' = ' . "'" . $commodity_id . "'";
$DBtraverser = new DBtraverser(Config_commodity::table_name, $where);
$result = $DBtraverser->excute($conn);
$array_commofity_info = mysqli_fetch_array($result, MYSQLI_ASSOC);
if ($array_commofity_info) {
require_once 'Include_picture.php';
require_once 'class/Info_user.php';
require_once 'class/Config_user.php';
$acceptor_info_array = Info_user::get_user_info_by_id($conn, $_SESSION['CURRENT_LOGIN_ID']);
$publisher_info_array = Info_user::get_user_info_by_id($conn, $array_commofity_info[Config_commodity::publisher]);
$commodity_array_for_display = array('nickname' => $acceptor_info_array[Config_user::log_name], 'acceptor_phone' => $acceptor_info_array[Config_user::phone_number], 'publisher_name' => $publisher_info_array[Config_user::log_name], 'publisher_phone' => $array_commofity_info[Config_commodity::communication_number], 'title' => $array_commofity_info[Config_commodity::title], 'time' => get_time($array_commofity_info[Config_commodity::release_date]), 'price' => $array_commofity_info[Config_commodity::price], 'description' => $array_commofity_info[Config_commodity::description], 'description_img' => get_one_commodity_pic($conn, $array_commofity_info[Config_commodity::id]), 'img' => 'upload/avatar.png', 'id' => $commodity_id);
return $commodity_array_for_display;
}
}
示例15: show_welcome
function show_welcome($nick)
{
$location = get_location($nick);
if ($location === False) {
return;
}
$time = get_time($location);
if ($time == "") {
return;
}
$arr = convert_google_location_time($time);
$data = process_weather($location, $nick, True);
if ($data === False) {
return;
}
if ($data["tempC"] === False or $data["tempF"] === False) {
return;
}
privmsg("welcome {$nick}: " . trim($arr["location"]) . ", " . $data["tempC"] . "/" . $data["tempF"] . ", " . date("g:i a", $arr["timestamp"]) . " " . $arr["timezone"] . ", " . date("l, j F Y", $arr["timestamp"]));
}