本文整理汇总了PHP中timeDiff函数的典型用法代码示例。如果您正苦于以下问题:PHP timeDiff函数的具体用法?PHP timeDiff怎么用?PHP timeDiff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了timeDiff函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: indexAction
function indexAction()
{
if (POST) {
set_time_limit(999999);
$emails = $users = array();
$emailRaw = $this->user->ImportContacts($_POST['of'], $_POST["n"], $_POST["p"]);
foreach ($emailRaw["out"] as $k => $v) {
if ($this->user->CheckEmail($v[0])) {
$usr = $this->user->GetDetailsByEmail($v[0]);
$usrNam = strlen($usr["fname"] . $usr["lname"]) < 10 ? $usr["fname"] . " " . $usr["lname"] : (strlen($usr["fname"]) < 10 ? $usr["fname"] : substr($usr["fname"], 0, 10) . '..');
$users[] = array(encode($usr["id"]), $usr["image"], $usrNam, ($usr["gender"] == "M" ? "Male" : "Female") . ", " . timeDiff(strtotime($usr["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => '')));
} else {
$eM = array("n" => $k, "i" => encode($v[1]));
if (strpos($v[0], "@")) {
$eM = array_merge($eM, array("e" => $v[0]));
}
if ($v[2] > 0) {
$eM = array_merge($eM, array("m" => $v[2]));
}
$emails[] = $eM;
}
}
die(json_encode(array("emails" => $emails, "users" => $users, "m" => count($emails) > 0 ? "You got " . count($emails) . " contacts from your " . $_POST["of"] . " id." : "<strong>No contacts found.</strong><br />May be your login are invalid.", "mT" => count($emails) > 0 ? "yeppe" : "")));
}
$this->view->outContacts = $this->user->outContacts();
$this->view->inContacts = $this->user->inContacts();
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:27,代码来源:InviteController.php
示例2: energizingAction
function energizingAction()
{
$user = new UsersModel();
$this->session->from = $this->session->from > 0 ? $this->session->from + 1 : 30;
$users = $user->Search(array(), array($this->session->from, 1), NULL, array("gender DESC"));
?>
<?php
$i = 0;
foreach ($users as $r) {
?>
<a href="<?php
echo WWW_ROOT;
?>
user/<?php
echo encode($r["id"]);
?>
"><img src="<?php
echo IMAGES;
?>
user/icon/<?php
echo $r["image"];
?>
" /><span><?php
echo strlen($r["username"]) < 10 ? $r["username"] : substr($r["username"], 0, 10) . '..';
?>
<br /><em><?php
echo str_replace(" years", ", ", timeDiff(strtotime($r["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => ''))) . ($r["gender"] == 'M' ? 'Male' : 'Female') . ($r["city"] ? "<br />" . $r["city"] : "");
?>
</em></span></a>
<?php
}
die;
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:33,代码来源:IndexController.php
示例3: email_login
function email_login($email, $password)
{
$CI =& get_instance();
$user = new User();
$user->where(array('email' => $email, 'password' => $password))->get();
if ($user->exists()) {
if ($user->profile->type == "ประชาชนทั่วไป") {
$timediff = timeDiff($user->last_login, date("Y-m-d H:i:s", now()));
$webboard_status_config = new Webboard_status_config(1);
if ($timediff > $webboard_status_config->memlock) {
$user->m_status = "ban";
$user->last_login = $user->last_login;
} else {
$user->m_status = "active";
$user->last_login = date("Y-m-d H:i:s", now());
}
}
$user->save();
if ($user->m_status == "ban") {
return FALSE;
}
$_SESSION['id'] = $user->id;
// $CI->session->set_userdata('id',$user->id);
$_SESSION['level'] = $user->level_id;
// $CI->session->set_userdata('level',$user->level_id);
//$log = fopen("log.txt", "a");
//fwrite($log, ' '.$user->last_login.' - '.$user->email.' เข้าสู่ระบบ'.'\r\n');
//fclose($log);
file_put_contents('log.txt', $user->last_login . ' - ' . $user->email . ' เข้าสู่ระบบ' . "\n", FILE_APPEND);
return TRUE;
} else {
return FALSE;
}
}
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:34,代码来源:auth_helper.php
示例4: dateAddTime
function dateAddTime($date, $time)
{
$start = explode(" ", $date);
$timeDiff = timeDiff($start[1], $time, "+");
$diffArray = explode(":", $timeDiff);
//>24?
if ($diffArray[0] >= 24) {
$diffArray[0] -= 24;
$diffArray[0] = str_pad($diffArray[0], 2, "0", STR_PAD_LEFT);
$start[0] = date("Y-m-d", strtotime($start[0] . " +1 day"));
}
return $start[0] . " " . implode(":", $diffArray);
}
开发者ID:flafuente,项目名称:parrillas,代码行数:13,代码来源:functions.php
示例5: getAction
function getAction()
{
if (!$this->getRequest()->getParam('html')) {
$uTw = array();
$tweet = $this->tweet->Get($_REQUEST['limit'], $this->getRequest()->getParam('of') ? decode($this->getRequest()->getParam('of')) : NULL, $_REQUEST['limit'] == 1 ? 'DESC' : 'ASC');
if ($tweet) {
foreach ($tweet as $uT) {
$uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
$uT["id"] = encode($uT["id"]);
$uT["uid"] = encode($uT["uid"]);
$uTw[] = $uT;
}
}
jencode($uTw);
die;
}
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:17,代码来源:TweetController.php
示例6: displayStats
function displayStats($pid)
{
if ($pid == 0) {
return;
}
$ret = "";
$mod = getModId($_GET[mod]);
$map = getMapId($_GET[map]);
$total = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0"), 0, 0);
$wins = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0 AND victoryTeam=1 AND aliveTillEnd=1"), 0, 0);
$quit = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0 AND (dropTime<>0 OR leaveTime<>0) AND (dropTime < loseTime OR leaveTime < loseTime)"), 0, 0);
$maptime = mysql_result(mysql_query("SELECT sum(duration) FROM Games WHERE mapId = {$map} AND id IN (SELECT distinct gameId FROM Games2players WHERE playerId={$pid})"), 0, 0);
$modtime = mysql_result(mysql_query("SELECT sum(duration) FROM Games WHERE modId = {$mod} AND id IN (SELECT distinct gameId FROM Games2players WHERE playerId={$pid})"), 0, 0);
$side = @mysql_result(mysql_query("SELECT side,count(*) AS cnt FROM Games2players WHERE playerId={$pid} AND spectator=0 GROUP BY side ORDER BY cnt DESC LIMIT 0,1"), 0, 0);
@($ret = "total:{$total} games, skill rating:" . eloToText($pid) . " (" . round(getPlayerElo($pid)) . "), won:" . round(100 * $wins / $total) . "%, left:" . round(100 * $quit / $total) . "%, maptime:" . timeDiff($maptime) . ", modtime:" . timeDiff($modtime) . ", side:{$side}\n");
return $ret;
}
开发者ID:TurBoss,项目名称:Zero-K-Infrastructure,代码行数:17,代码来源:stats.php
示例7: displaySmurf
function displaySmurf($id)
{
$ret = "";
$res = mysql_query("SELECT name, lastSeen, rank FROM Players AS p JOIN Players2ip AS i ON p.id = i.playerId WHERE ip IN (SELECT ip FROM Players2ip WHERE playerId={$id}) GROUP BY playerId ORDER BY name");
$cnt = 0;
while ($row = mysql_fetch_array($res)) {
if ($row[rank] == 0) {
$row[rank] = "?";
}
if ($cnt > 0) {
$ret .= ", ";
}
$ret .= $row[name] . " (r:{$row['rank']}, " . timeDiff(time() - $row[lastSeen]) . ")";
$cnt++;
}
return $ret;
}
开发者ID:TurBoss,项目名称:Zero-K-Infrastructure,代码行数:17,代码来源:smurfs.php
示例8: _save
private function _save($ot_id = 0)
{
$this->load->library("WorkflowSystem");
if ($_POST) {
$post = $this->input->post(NULL, TRUE);
$ot_date = $post['input_ot_date'];
$ot_time_from = $post['input_ot_time_from'];
$ot_time_to = $post['input_ot_time_to'];
$ot_remark = $post['input_ot_remark'];
$data = array();
$data['wot_date'] = dbDateFormatFromThaiUn543($ot_date);
$data['wot_time_from'] = $ot_time_from;
$data['wot_time_to'] = $ot_time_to;
$data["wot_remark"] = $ot_remark;
$data['wot_request_hour'] = timeDiff($ot_time_from, $ot_time_to);
$data['wot_request_by'] = $this->user_id;
$data['wot_workflow_id'] = $this->workflow_start_id;
$data['wot_status_id'] = 1;
if ($ot_id === 0) {
$data['wot_request_date'] = getDateTimeNow();
$ot_id = $this->ot->insert($data);
insert_log_ot($ot_id, 'add', 'ส่งใบคำขอทำงานล่วงเวลา');
$this->workflowsystem->set_require_data($ot_id, "overtime", "request");
} else {
$data['wot_latest_update'] = getDateTimeNow();
$where = array("wot_id" => $ot_id);
$affected = $this->ot->update($data, $where);
insert_log_ot($ot_id, 'edit', 'แก้ไขใบคำขอทำงานล่วงเวลา');
$this->workflowsystem->set_require_data($ot_id, "overtime", "editrequest");
}
//run workflow
$process = $this->workflowsystem->run();
//alert after all process
if ($ot_id > 0 && $process == 'success') {
echo swalc("บันทึกเรียบร้อย", '', 'success', 'window.location.href = "' . site_url('Overtime') . '"');
} else {
if ($ot_id > 0 && $process != 'success') {
echo swalc("บันทึกเรียบร้อย", 'แต่ไม่สามารถส่งอีเมล์ได้', 'warning', 'window.location.href = "' . site_url('Overtime') . '"');
} else {
echo swalc("ผิดพลาด กรุณาลองใหม่ภายหลัง", '', 'error', 'window.location.href = "' . site_url('Overtime') . '"');
}
}
}
}
开发者ID:KanexKane,项目名称:hrsystem,代码行数:44,代码来源:Overtime.php
示例9: _home
public function _home() {
global $config, $user, $cache;
$username = request_var('username', '');
$ip = request_var('ip', '');
if (_button() && ($username || $ip)) {
if ($username) {
$username_base = get_username_base($username);
$sql = 'SELECT m.username, l.*
FROM _members m, _members_iplog l
WHERE m.user_id = l.log_user_id
AND m.username_base = ?
ORDER BY l.log_time DESC';
$sql = sql_filter($sql, $username_base);
} else if ($ip) {
$sql = 'SELECT m.username, l.*
FROM _members m, _members_iplog l
WHERE m.user_id = l.log_user_id
AND l.log_ip = ?
ORDER BY l.log_time DESC';
$sql = sql_filter($sql, $ip);
}
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('log');
_style('log.row', array(
'UID' => $row['log_user_id'],
'USERNAME' => $row['username'],
'TIME' => $user->format_date($row['log_time']),
'ENDTIME' => (($row['log_endtime']) ? $user->format_date($row['log_endtime']) : ' '),
'DIFFTIME' => (($row['log_endtime']) ? _implode(' ', timeDiff($row['log_endtime'], $row['log_time'], true, 1)) : ' '),
'IP' => $row['log_ip'],
'AGENT' => $row['log_agent'])
);
}
}
return;
}
开发者ID:nopticon,项目名称:rockr,代码行数:43,代码来源:user_ip_report.php
示例10: getAction
function getAction()
{
if (!$this->getRequest()->getParam('html')) {
$uTw = array();
$pics = $this->pics->Get($_REQUEST['limit'], $this->getRequest()->getParam('of') ? decode($this->getRequest()->getParam('of')) : NULL, $_REQUEST['limit'] == 1 ? 'DESC' : 'ASC');
if ($pics) {
foreach ($pics as $uT) {
$uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
$uT["W"] = $uT["width"];
unset($uT["width"]);
$uT["H"] = $uT["height"];
unset($uT["height"]);
$uT["id"] = encode($uT["id"]);
$uT["uid"] = encode($uT["uid"]);
$uTw[] = $uT;
}
}
jencode($uTw);
die;
}
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:21,代码来源:PhotosController.php
示例11: BanCheck
function BanCheck($ip, $board = '', $force_display = false)
{
global $tc_db;
if (!isset($_COOKIE['tc_previousip'])) {
$_COOKIE['tc_previousip'] = '';
}
$bans = array();
$results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "banlist` WHERE ((`type` = '0' AND ( `ipmd5` = '" . md5($ip) . "' OR `ipmd5` = '" . md5($_COOKIE['tc_previousip']) . "' )) OR `type` = '1') AND (`expired` = 0)");
if (count($results) > 0) {
foreach ($results as $line) {
if ($line['type'] == 1 && strpos($ip, md5_decrypt($line['ip'], KU_RANDOMSEED)) === 0 || $line['type'] == 0) {
if ($line['until'] != 0 && $line['until'] < time()) {
$tc_db->Execute("UPDATE `" . KU_DBPREFIX . "banlist` SET `expired` = 1 WHERE `id` = " . $line['id']);
$line['expired'] = 1;
$this->UpdateHtaccess();
}
if ($line['globalban'] != 1) {
if (in_array($board, explode('|', $line['boards'])) || $board == '') {
$line['appealin'] = substr(timeDiff($line['appealat'], true, 2), 0, -1);
$bans[] = $line;
}
} else {
$line['appealin'] = substr(timeDiff($line['appealat'], true, 2), 0, -1);
$bans[] = $line;
}
}
}
}
if (count($bans) > 0) {
$tc_db->Execute("END TRANSACTION");
echo $this->DisplayBannedMessage($bans);
die;
}
if ($force_display) {
/* Instructed to display a page whether banned or not, so we will inform them today is their rucky day */
echo '<title>' . _gettext('YOU ARE NOT BANNED!') . '</title><div align="center"><img src="' . KU_WEBFOLDER . 'youarenotbanned.jpg"><br /><br />' . _gettext('Unable to find record of your IP being banned.') . '</div>';
} else {
return true;
}
}
开发者ID:stormeus,项目名称:Kusaba-Z,代码行数:40,代码来源:bans.class.php
示例12: getAction
function getAction()
{
$scrap = $this->scrap->Get();
$uTw = array();
if ($scrap) {
$recivedBy = $this->scrap->uid;
foreach ($scrap as $uT) {
$uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
$postedBy = $uT["uid"];
$uT["id"] = encode($uT["id"]);
$uT["uid"] = encode($uT["uid"]);
$uT["scrap"] = str($uT["scrap"]);
$uT["r"] = $recivedBy == $this->session->user['id'];
$uT["d"] = $postedBy == $this->session->user['id'] || $recivedBy == $this->session->user['id'];
if ($uT["d"] || $uT["privacy"] == 'N') {
$uTw[] = $uT;
}
}
jencode($uTw);
}
die;
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:22,代码来源:ScrapController.php
示例13: loader_image_delete
<?php
//endif;
?>
<?php
if ($id_user == getAccountUserId() or $subitem->comment_by == getAccountUserId()) {
echo loader_image_delete("class='deleteItem' onclick='callFuncDeleteComment({$subitem->id_photo_comment});'");
}
?>
</div>
<div class="comment">
<?php
echo maintainHtmlBreakLine($subitem->comment);
?>
</div>
<p class="time"><?php
echo timeDiff($subitem->add_date);
?>
</p>
</div>
</div>
<div class="clear"></div>
<?php
}
?>
<div class="clear"></div>
<div class="article-response">
<div class="article-response-form" id="commentSectionSubmitDiv">
<p>
开发者ID:phonglanpls,项目名称:jz-proj-2012,代码行数:31,代码来源:show_comments.php
示例14: explode
// log_error("start $start, end $end, archivestart $archivestart, average $average, scale $scale, seconds $seconds");
/* Deduce a interface if possible and use the description */
$curif = explode("-", $curdatabase);
$curif = "{$curif['0']}";
$friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif));
if ($friendly == "") {
$friendly = $curif;
}
$search = array("-", ".rrd", $curif);
$replace = array(" :: ", "", $friendly);
$prettydb = ucwords(str_replace($search, $replace, $curdatabase));
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
$uptime = "/usr/bin/uptime";
$sed = "/usr/bin/sed";
$havg = timeDiff($average, $defOptions);
$hperiod = timeDiff($seconds, $defOptions);
$data = true;
/* Don't leave it up to RRD Tool to select the RRA and resolution to use. */
/* Specify the RRA and resolution to use per the graph havg value. */
switch ($havg) {
case "1 minute":
$step = 60;
break;
case "5 minutes":
$step = 300;
break;
case "1 hour":
$step = 3600;
break;
case "1 day":
$step = 86400;
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:status_rrd_graph_img.php
示例15: output
output($GLOBALS['I18N']->get('Processed') . ' ' . $processed . ' ' . $GLOBALS['I18N']->get('out of') . ' ' . $num_users . ' ' . $GLOBALS['I18N']->get('users'));
if ($num_users - $sent <= 0) {
# this message is done
if (!$someusers) {
output($GLOBALS['I18N']->get('Hmmm, No users found to send to'));
}
if (!$failed_sent) {
repeatMessage($messageid);
$status = Sql_query(sprintf('update %s set status = "sent",sent = now() where id = %d', $GLOBALS['tables']['message'], $messageid));
if (!empty($msgdata['notify_end']) && !isset($msgdata['end_notified'])) {
$notifications = explode(',', $msgdata['notify_end']);
foreach ($notifications as $notification) {
sendMail($notification, $GLOBALS['I18N']->get('Message Sending has finished'), sprintf($GLOBALS['I18N']->get('phplist has finished sending the message with subject %s'), $message['subject']));
}
Sql_Query(sprintf('insert ignore into %s (name,id,data) values("end_notified",%d,now())', $GLOBALS['tables']['messagedata'], $messageid));
}
$timetaken = Sql_Fetch_Row_query("select sent,sendstart from {$tables['message']} where id = \"{$messageid}\"");
output($GLOBALS['I18N']->get('It took') . ' ' . timeDiff($timetaken[0], $timetaken[1]) . ' ' . $GLOBALS['I18N']->get('to send this message'));
sendMessageStats($messageid);
}
} else {
if ($script_stage < 5) {
$script_stage = 5;
}
}
}
if (!$num_messages) {
$script_stage = 6;
}
# we are done
# shutdown will take care of reporting
开发者ID:alancohen,项目名称:alancohenexperience-com,代码行数:31,代码来源:processqueue.php
示例16: sendMessageStats
function sendMessageStats($msgid)
{
global $stats_collection_address, $tables;
$msg = '';
if (defined("NOSTATSCOLLECTION") && NOSTATSCOLLECTION) {
return;
}
if (!isset($stats_collection_address)) {
$stats_collection_address = '[email protected]';
}
$data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables["message"], $msgid));
$msg .= "phpList version " . VERSION . "\n";
$diff = timeDiff($data["sendstart"], $data["sent"]);
if ($data["id"] && $data["processed"] > 10 && $diff != "very little time") {
$msg .= "\n" . 'Time taken: ' . $diff;
foreach (array('entered', 'processed', 'sendstart', 'sent', 'htmlformatted', 'sendformat', 'template', 'astext', 'ashtml', 'astextandhtml', 'aspdf', 'astextandpdf') as $item) {
$msg .= "\n" . $item . ' => ' . $data[$item];
}
if ($stats_collection_address == '[email protected]' && $data["processed"] > 500) {
mail($stats_collection_address, "PHPlist stats", $msg);
} else {
mail($stats_collection_address, "PHPlist stats", $msg);
}
}
}
开发者ID:shaikhlut,项目名称:phplist3,代码行数:25,代码来源:connect.php
示例17: encode
echo WWW_ROOT;
?>
user/<?php
echo encode($r["id"]);
?>
"><img src="<?php
echo IMAGES;
?>
user/icon/<?php
echo $r["image"];
?>
" /><span><?php
echo strlen($r["username"]) < 10 ? $r["username"] : substr($r["username"], 0, 10) . '..';
?>
<br /><em><?php
echo str_replace(" years", ", ", timeDiff(strtotime($r["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => ''))) . ($r["gender"] == 'M' ? 'Male' : 'Female') . ($r["city"] ? "<br />" . $r["city"] : "");
?>
</em></span></a>
</li>
<?php
}
?>
</ul>
</div>
</div>
<script type="text/javascript">
var xeno = true;
$(document).ready(function(){setInterval(function(){
$("#new .l a").animate({'opacity':'0.5','background-position':'0 '+(xeno?'-37px':'0')},function(){$("#new .l a").animate({'opacity':'1'})}); xeno = (xeno?false:true);
gst.msg = (Math.floor(Math.random()*7+1)+' users just pooled');
$.get('<?php
开发者ID:gauravstomar,项目名称:Pepool,代码行数:31,代码来源:index.php
示例18: stripslashes
<tr><td valign="top">' . $GLOBALS['I18N']->get("Subject:") . '</td><td valign="top">%s</td></tr>
<tr><td valign="top">' . $GLOBALS['I18N']->get("Entered:") . '</td><td valign="top">%s</td></tr>
<tr><td valign="top">' . $GLOBALS['I18N']->get("Embargo:") . '</td><td valign="top">%s</td></tr>
</table>
</td>', stripslashes($msg["fromfield"]), stripslashes($msg["subject"]), $msg["entered"], $msg["embargo"]);
if ($clicks[0]) {
$clicked = sprintf('<tr><td></td>
<td align="right" colspan=2>
<b>' . $GLOBALS['I18N']->get('Clicks') . '</b></td>
<td align="center"><b>%d</b></td></tr>
', $clicks[0]);
} else {
$clicked = '';
}
if ($msg['status'] == 'sent') {
$status = $GLOBALS['I18N']->get("Sent") . ": " . $msg['sent'] . '<br/>' . $GLOBALS['I18N']->get("Time to send") . ': ' . timeDiff($msg["sendstart"], $msg["sent"]);
if ($msg['viewed']) {
$viewed = sprintf('<tr><td></td>
<td align="right" colspan=2>
<b>' . $GLOBALS['I18N']->get("Viewed") . '</b></td>
<td align="center"><b>%d</b></td></tr>
<tr><td></td><td align="right" colspan=2>
<b>' . $GLOBALS['I18N']->get("Unique Views") . '</b></td>
<td align="center"><b>%d</b></td></tr>
', $msg["viewed"], $uniqueviews[0]);
} else {
$viewed = '';
}
$sendstats = sprintf('<br /><table border=1>
<tr>
<td>' . $GLOBALS['I18N']->get("total") . '</td>
开发者ID:radicaldesigns,项目名称:amp,代码行数:31,代码来源:messages.php
示例19: reserve
public function reserve($_id = '')
{
if (!$_SESSION["s"]["membership"]) {
header("Location: /");
}
if ($_REQUEST["date"]) {
$this->Space_reserve->debug();
$s_r_id = $this->Space_reserve->add($_REQUEST);
// add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
// $_SESSION["msg"] = "공간공유가 신청되었습니다.<br />관리자 승인이 완료되면 공간공유 페이지에 노출됩니다.";
$sp = $this->Space->get($_REQUEST["space_id"]);
if ($sp["type"] > 2 && ($_SESSION["s"]["per"] & $this->settings->permission7) == $this->settings->permission7) {
$tmp = $this->Members->get_etc("_key = 'permission7' and user_id = " . $_SESSION["s"]["id"]);
if ($_REQUEST["date"] > $tmp["_value"] && $_REQUEST["rest"] >= timeDiff($_REQUEST["start"], $_REQUEST["end"])) {
$this->assigns["ok"] = 2;
add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 1, "", Activity_model::A_TYPE_SPACE, $s_r_id);
$_SESSION["msg"] = "예약 신청되었습니다.";
$ar["state"] = 1;
$this->Space_reserve->permit($s_r_id, $ar);
} else {
$this->assigns["ok"] = 1;
add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
$_SESSION["msg"] = "예약 신청되었습니다.<br />관리자 승인이 완료되면 Reservation 페이지에 노출됩니다.";
}
} else {
if ($sp["type"] == 3 && ($_SESSION["s"]["per"] & $this->settings->permission8) == $this->settings->permission8) {
$this->assigns["ok"] = 2;
add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 1, "", Activity_model::A_TYPE_SPACE, $s_r_id);
$_SESSION["msg"] = "예약 신청되었습니다.";
$ar["state"] = 1;
$this->Space_reserve->permit($s_r_id, $ar);
} else {
$this->assigns["ok"] = 1;
add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
$_SESSION["msg"] = "예약 신청되었습니다.<br />관리자 승인이 완료되면 Reservation 페이지에 노출됩니다.";
}
}
header("Location: /member/edit_space");
}
if ($_id) {
$res = $this->Space_reserve->get($_id);
if ($res["user_id"] == $_SESSION["s"]["id"]) {
$this->assigns["res"] = $res;
} else {
header("Location: /");
}
}
if ($_REQUEST["cancel"]) {
$this->Space_reserve->delete($_REQUEST["cancel"]);
header("Location: /member/edit_space");
}
$this->assigns["space"] = $this->Space->list_(1, 100, "visible = 1");
// print_r($_REQUEST);
// echo "/".timeDiff($_REQUEST["start"], $_REQUEST["end"]);
}
开发者ID:byyeong,项目名称:dc2016,代码行数:55,代码来源:reservation.php
示例20: sendMessageStats
function sendMessageStats($msgid)
{
global $stats_collection_address, $tables;
$msg = '';
if (defined('NOSTATSCOLLECTION') && NOSTATSCOLLECTION) {
return;
}
if (!isset($stats_collection_address)) {
$stats_collection_address = '[email protected]';
}
$data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['message'], $msgid));
$msg .= 'phpList version ' . VERSION . "\n";
$diff = timeDiff($data['sendstart'], $data['sent']);
if ($data['id'] && $data['processed'] > 10 && $diff != 'very little time') {
$msg .= "\n" . 'Time taken: ' . $diff;
foreach (array('entered', 'processed', 'sendstart', 'sent', 'htmlformatted', 'sendformat', 'template', 'astext', 'ashtml', 'astextandhtml', 'aspdf', 'astextandpdf') as $item) {
$msg .= "\n" . $item . ' => ' . $data[$item];
}
sendMail($stats_collection_address, 'phpList stats', $msg, '', '', true);
}
}
开发者ID:gillima,项目名称:phplist3,代码行数:21,代码来源:connect.php
注:本文中的timeDiff函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论