本文整理汇总了PHP中getDateFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP getDateFormat函数的具体用法?PHP getDateFormat怎么用?PHP getDateFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDateFormat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: draw
/**
* Draws the edit downtime form using the object ID passed in $_REQUEST
* @param \User $user current user
* @return null
*/
function draw(\User $user = null)
{
if (is_null($user)) {
throw new Exception("Unregistered users can't edit a downtime.");
}
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
throw new Exception("A downtime id must be specified");
}
$serv = \Factory::getDowntimeService();
$dt = $serv->getDowntime($_GET['id']);
if ($dt == null) {
throw new Exception("No downtime with that id");
}
// check that this downtime is eligible for editing, throws exception if not.
$serv->editValidationDatePreConditions($dt);
$serv->authorization($dt->getServices(), $user);
$nowUtcDateTime = new \DateTime(null, new \DateTimeZone("UTC"));
$twoDaysAgoUtcDateTime = $nowUtcDateTime->sub(\DateInterval::createFromDateString('2 days'));
$twoDaysAgoUtc = $twoDaysAgoUtcDateTime->format('d/m/Y H:i');
//e.g. 02/10/2013 13:20
$params = array('dt' => $dt, 'format' => getDateFormat(), 'nowUtc' => $nowUtcDateTime->format('H:i T'), 'twoDaysAgoUtc' => $twoDaysAgoUtc);
show_view('downtime/edit_downtime.php', $params);
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:28,代码来源:edit_downtime.php
示例2: getDateFormat
<?php
} else {
?>
<tr valign="top">
<td width="200px" class="consult_det_title">
<?php
}
?>
<?php
echo $note->reporter->real_name;
?>
:
<br>
<?php
echo '(' . getDateFormat($note->date_submitted) . ')';
?>
</td>
<td width="540px" class="consult_det_info">
<?php
echo replaceRToBr($note->text);
?>
</td>
<?php
if ($issue->reporter->id != $note->reporter->id) {
?>
<td width="20px">
<img src="templates/medicnexus/images/dr_chat_icon.gif"/>
</td>
<?php
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:31,代码来源:issue_details_page.php
示例3: isMobileConnect
echo $g['img_core'];
?>
/_public/ico_mobile.gif" class="imgpos" alt="모바일" title="모바일(<?php
echo isMobileConnect($R['agent']);
?>
)접속" />
<?php
}
?>
<?php
echo strtoupper($_browse);
?>
</td>
<td><?php
echo getDateFormat($R['d_regis'], 'Y.m.d H:i');
?>
</td>
</tr>
<?php
}
?>
<?php
if (!$NUM) {
?>
<tr>
<td>1</td>
<td class="sbj1" colspan="5">접속기록이 없습니다.</td>
</tr>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:log.php
示例4: output_date
/**
* Date only Output using locale
*
* @since 1.0
* @param string $dt Date/Time string
* @return string
*/
function output_date($dt = null)
{
if (isset($dt)) {
$dt = strtotime($dt);
}
if (getDateFormat()) {
return formatDate(getDateFormat(), $dt);
}
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:16,代码来源:basic.php
示例5: while
while ($O = db_fetch_array($TCD)) {
?>
<?php
// echo $TPG . " = " . $p;// echo "<pre>"; print_r( $O ); echo "</pre>";
?>
<tr class="reply">
<td>┗ <div class="icon inline"><?php
echo $O['nic'];
?>
</div></td>
<td class="sbj"><?php
echo $O['content'];
?>
</td>
<td><?php
echo getDateFormat($O['d_regis'], 'Y-m-d');
?>
</td>
<td><a href="<?php
echo $g['cment_odelete'] . $O['uid'];
?>
" target="_action_frame_<?php
echo $m;
?>
" onclick="return oneDel('<?php
echo $O['id'];
?>
');"><img src="<?php
echo $g['img_module_skin'];
?>
/btn_delete_one.gif" alt="삭제" title="삭제" /></a></td>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:_list.php
示例6: lang
">
<span class="add-on"><span class="arrow"></span><i class="icon-th"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
<?php
echo lang('end_date', 'end_date');
?>
</div>
<div class="col-md-9">
<div class="input-with-icon right">
<div class="input-append success date no-padding">
<input type="text" class="form-control" id="end_date" name="end_date" value="<?php
echo getDateFormat($row->end_date);
?>
">
<span class="add-on"><span class="arrow"></span><i class="icon-th"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
<?php
echo lang('amount', 'amount');
?>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="amount" name="amount" value="<?php
echo $row->amount;
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:31,代码来源:table_ikatan_dinas.php
示例7: getDateFormat
?>
</a></td>
<td><?php
echo $R['nic'];
?>
</td>
<td><?php
echo $_R['id'];
?>
</td>
<td><?php
echo $R['tel2'] ? $R['tel2'] : $R['tel1'];
?>
</td>
<td data-tooltip="tooltip" title="<?php
echo getDateFormat($R['last_log'], $lang['admin']['aa022']);
?>
"><?php
echo sprintf(_LANG('aa023', 'admin'), -getRemainDate($R['last_log']));
?>
</td>
<td>
<?php
if ($my['uid'] == 1 && $R['admin']) {
?>
<a href="#." data-toggle="modal" data-target="#modal_window" class="btn btn-default btn-xs rb-modal-admininfo" onmousedown="admIdDrop('<?php
echo $R['memberuid'];
?>
','perm');"<?php
if ($R['memberuid'] == 1) {
?>
开发者ID:hanacody,项目名称:rb2,代码行数:31,代码来源:admin.php
示例8: foreach
</th>
<th width="10%">appr. spv</th>
<th width="10%">appr. ka. bag</th>
</tr>
</thead>
<tbody>
<?php
if ($num_rows_all > 0) {
foreach ($form_absen as $user) {
?>
<tr>
<td><a href="<?php
echo site_url('form_absen/detail/' . $user->id . '');
?>
"><?php
echo getDateFormat($user->date_tidak_hadir);
?>
</a></td>
<td><?php
echo $user->first_name . ' ' . $user->last_name;
?>
</td>
<td><?php
echo $user->keterangan_absen;
?>
</td>
<td style="text-align:center;">
<?php
if ($user->is_app_lv1 == 1) {
?>
<span>Ya</span>
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:31,代码来源:index_superior1.php
示例9: getCommentList
function getCommentList($theme, $parent, $_where, $recnum, $sort, $orderby1, $orderby2, $cp)
{
global $g, $table, $_HS, $m, $my;
include $theme . '_var.php';
// 설정파일 인클루드
$g['img_module_skin'] = $theme . 'image/';
$NCD = array();
$RCD = array();
$cp = $cp ? $cp : 1;
$sort = $sort ? $sort : 'uid';
$orderby1 = $orderby1 ? $orderby1 : $d['comment']['orderby1'];
$orderby2 = $orderby2 ? $orderby2 : $d['comment']['orderby2'];
$recnum = $recnum ? $recnum : $d['comment']['recnum'];
$cmentque = " and parent='" . str_replace('-', '', $parent) . "'";
if ($_where) {
$cmentque .= " and " . $_where;
}
$PCD = getDbArray($table['s_comment'], 'notice=1' . $cmentque, '*', $sort, $orderby1, 0, 0);
$TCD = getDbArray($table['s_comment'], 'notice=0' . $cmentque, '*', $sort, $orderby2, $recnum, $cp);
$NUM = getDbRows($table['s_comment'], 'notice=0' . $cmentque);
$TPG = getTotalPage($NUM, $recnum);
while ($_R = db_fetch_array($PCD)) {
$NCD[] = $_R;
}
while ($_R = db_fetch_array($TCD)) {
$RCD[] = $_R;
}
//echo $cmentque;
$RCD = $NCD + $RCD;
$i = 1;
$namegi = $NUM - $cp * $recnum;
if ($namegi > 0) {
$namegi_ment = '총 <span class="text-danger namegi">' . $namegi . '</span> 개의 댓글이 더 있습니다.';
$btn_more = 'btn-more';
$is_namegi = 1;
} else {
$namegi_ment = '더이상 댓글이 없습니다.';
$btn_more = 'disabled';
$is_namegi = 0;
}
// 한줄의견 쓰는(현재 로그인한) 사용자 아바타 사진 url 세팅
if ($my['photo']) {
$avatar_img = $g['url_root'] . '/_var/avatar/' . $my['photo'];
} else {
$avatar_img = $g['url_root'] . '/_var/avatar/0.gif';
}
foreach ($RCD as $C) {
$C['mobile'] = isMobileConnect($C['agent']);
if ($C['mbruid']) {
$M = getDbData($table['s_mbrdata'], 'memberuid=' . $C['mbruid'], '*');
} else {
$M = array();
}
$isSECRETCHECK = true;
$JN_time = getJNTime($C['d_regis']);
// 지난시간 얻기 함수 호출
// 댓글 작성자 아바타 사진 url 세팅
if ($M['photo']) {
$avatar_img = $g['url_root'] . '/_var/avatar/' . $M['photo'];
} else {
$avatar_img = $g['url_root'] . '/_var/avatar/0.gif';
}
echo '
<section id="pinBoot" class="rb-pinterest-grid">
<article class="panel panel-default panel-google-plus comment-list" id="' . $C['uid'] . '-' . $C['score1'] . '-' . $C['oneline'] . '">
<div id="cuid-' . $C['uid'] . '">
<input type="hidden" name="is_namegi" value="' . $is_namegi . '"/>
<input type="hidden" name="TPG" value="' . $TPG . '"/>
<input type="hidden" name="theme" class="theme" value="' . $theme . '" />
<input type="hidden" name="parent" class="parent" value="' . $parent . '" />
<input type="hidden" name="c_content" class="c_content" value="' . htmlspecialchars(getContents($C['content'], $C['html'], $keyword)) . '" />
<div class="dropdown">
<span class="dropdown-toggle" type="button" data-toggle="dropdown">
<span class="[ glyphicon glyphicon-chevron-down ]"></span>
</span>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
</ul>
</div>
<div class="panel-google-plus-tags">
<ul>
<li>#자동차</li>
<li>#귀성길</li>
</ul>
</div>
<div class="panel-heading">
<img class="img-circle pull-left" src="/_core/opensrc/thumb/image.php?width=46&height:46&cropratio=1:1&image=' . $avatar_img . '" alt="' . $M[$_HS['nametype']] . ' 아바타 " />
<h3>소비자와 함께</h3>
<h5><span>제한적으로 공유함</span> - <span>' . getDateFormat($C['d_regis'], 'Y. m. d') . '</span> </h5>
</div>
<div class="panel-body">
<p>' . getContents($C['content'], $C['html'], $keyword) . '</p>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-default">+1</button>
<button type="button" class="btn btn-default">
//.........这里部分代码省略.........
开发者ID:kieregh,项目名称:test_comment,代码行数:101,代码来源:function.php
示例10: lang
echo lang('start_cuti_date');
?>
</label>
</div>
<div class="col-md-3">
<input name="registration_date" id="registration_date" type="text" class="form-control" placeholder="Registration Date" value="<?php
echo getDateFormat($user->date_mulai_cuti);
?>
" disabled="disabled">
</div>
<div class="col-md-2">
<label class="form-label text-center">s/d</label>
</div>
<div class="col-md-3">
<input name="status" id="status" type="text" class="form-control" placeholder="Status" value="<?php
echo getDateFormat($user->date_selesai_cuti);
?>
" disabled="disabled">
</div>
</div>
<div class="row form-row">
<div class="col-md-3">
<label class="form-label text-right"><?php
echo lang('count_day');
?>
</label>
</div>
<div class="col-md-2">
<input name="courseid" id="courseid" type="text" class="form-control" placeholder="courseid" value="<?php
echo $user->jumlah_hari;
?>
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:31,代码来源:index.php
示例11: ShowError
return;
}
if (!CModule::IncludeModule("iblock")) {
$this->AbortResultCache();
ShowError(GetMessage("EC_IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
CModule::IncludeModule("socialnetwork");
// Limits
if (strlen($arParams["INIT_DATE"]) > 0 && strpos($arParams["INIT_DATE"], '.') !== false) {
$ts = MakeTimeStamp($arParams["INIT_DATE"], getTSFormat());
} else {
$ts = MakeTimeStamp(date(getDateFormat(false)), getTSFormat());
}
$fromLimit = date(getDateFormat(false), $ts);
$toLimit = date(getDateFormat(false), mktime(0, 0, 0, date("m", $ts) + $arParams["FUTURE_MONTH_COUNT"], date("d", $ts), date("Y", $ts)));
$arResult['ITEMS'] = array();
$arEvents = CEventCalendar::GetNearestEventsList(array('bCurUserList' => $arParams['B_CUR_USER_LIST'], 'fromLimit' => $fromLimit, 'toLimit' => $toLimit, 'iblockId' => $arParams["IBLOCK_ID"], 'iblockSectionId' => $arParams["IBLOCK_SECTION_ID"]));
if ($arEvents == 'access_denied') {
$arResult['ACCESS_DENIED'] = true;
} elseif ($arEvents == 'inactive_feature') {
$arResult['INACTIVE_FEATURE'] = true;
} elseif (is_array($arEvents)) {
$limitTromTS = MakeTimeStamp($fromLimit, getTSFormat());
if (strpos($arParams['DETAIL_URL'], '?') !== FALSE) {
$arParams['DETAIL_URL'] = substr($arParams['DETAIL_URL'], 0, strpos($arParams['DETAIL_URL'], '?'));
}
$arParams['DETAIL_URL'] = str_replace('#user_id#', $curUserId, strtolower($arParams['DETAIL_URL']));
for ($i = 0, $l = count($arEvents); $i < $l; $i++) {
$arEvents[$i]['_FROM_TS'] = MakeTimeStamp($arEvents[$i]['DATE_FROM'], getTSFormat());
if ($arEvents[$i]['_FROM_TS'] < $limitTromTS) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php
示例12: date
<!--------------------------------------------------------------------------------------------->
<script>getMenuTable(2,"")</script>
<!--------------------------------------------------------------------------------------------->
<table cellspacing=0 cellpadding=5 width=100% bgcolor=#EDF0F1>
<tr>
<td width=70><img src='./image/ico_stitle.gif'></td>
<td>
<font color='#2194C0'>
<b>회원의 기념일을 관리합니다.</b><br>
오늘은 <b>양력</b> <?php
echo date("Y년 m월 d일");
?>
, <b>음력</b> <?php
echo getDateFormat($today1);
?>
입니다.
</font>
</td>
</tr>
</table>
<?php
if (!$query) {
?>
<table width=100% height=30 cellspacing=0 cellpadding=0>
<tr>
开发者ID:jin255ff,项目名称:company_website,代码行数:30,代码来源:mbr_special.php
示例13: getAdvancedReportByDate
//.........这里部分代码省略.........
"{invitation}" i
INNER JOIN
"{thread}" t
ON
i."threadid" = t."threadid"
WHERE
t."operatorid" = ot."operatorid"
AND
TRUNC(t."created") = TRUNC(ot."date")
) "invited_users"
FROM
"{operatorlastaccess}" o
LEFT JOIN
"{operatoronline}" ot
ON
o."operatorid" = ot."operatorid"
' . $afrom . '
WHERE
WM_UNIX_TIMESTAMP(ot."date") >= :p_start
AND
WM_UNIX_TIMESTAMP(ot."date") < :p_end
' . $awhere . '
GROUP BY ot."operatorid", ot."date"
';
try {
$this->db->Query($sql, array_merge($params, $aparams));
$result = array();
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$row['online_sum_chatting_time_seconds'] = $row['online_sum_chat_time_seconds'];
//Cause indetifiers more than 30 chars not suppoted by Oracle
unset($row['online_sum_chat_time_seconds']);
$row['date'] = date(getDateFormat(), $row['date']);
if (!isset($result[$row['date']])) {
$result[$row['date']] = array();
}
$result[$row['date']][$row['opid']] = $row;
$result[$row['date']][$row['opid']]['threads'] = 0;
$result[$row['date']][$row['opid']]['msgs'] = 0;
$result[$row['date']][$row['opid']]['avglen'] = 0;
if (!$result[$row['date']][$row['opid']]['online_time']) {
$result[$row['date']][$row['opid']]['online_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_sum_chatting_time']) {
$result[$row['date']][$row['opid']]['online_sum_chatting_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_chatting_time']) {
$result[$row['date']][$row['opid']]['online_chatting_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds']) {
$result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds'] = 0;
}
$result[$row['date']][$row['opid']]['online_avg_chatting_time'] = 0;
}
} catch (Exception $e) {
}
$query = 'SELECT o."operatorid" FROM "{operatorlastaccess}" o ' . $afrom . ' WHERE 1=1 ' . $awhere;
try {
$this->db->Query($query, $aparams);
$operators = array();
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$operators[$row['operatorid']] = null;
}
} catch (Exception $e) {
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:67,代码来源:class.operatormapper.php
示例14: getDateFormat
?>
" />
<input type="hidden" name="m" value="<?php
echo $m;
?>
" />
<input type="hidden" name="front" value="<?php
echo $front;
?>
" />
<input type="hidden" name="a" value="pw_update" />
<div class="msg">
현재 비밀번호는 <span class="b"><?php
echo getDateFormat($my['last_pw'], 'Y.m.d');
?>
</span> 에 변경(등록)되었으며 <span class="b"><?php
echo -getRemainDate($my['last_pw']);
?>
일</span>이 경과되었습니다.<br />
비밀번호는 가급적 주기적으로 변경해 주세요.<br />
</div>
<table summary="비밀번호 변경데이터를 입력받는 표입니다.">
<caption>비밀번호 변경하기</caption>
<colgroup>
<col width="100">
<col>
</colgroup>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:pw.php
示例15: getDateFormat
<div id="bbsview" >
<div class="viewbox">
<div class="info">
<div class="xleft">
<span class="han"><?php
echo $R['name'];
?>
</span> <span class="split">|</span>
<?php
echo getDateFormat($R['d_regis'], $d['theme']['date_viewf']);
?>
<span class="split">|</span>
<span class="han">조회</span> <span class="num"><?php
echo $R['hit'];
?>
</span>
<?php
if ($d['theme']['show_score1']) {
?>
<span class="split">|</span> <span class="han">공감</span> <span class="num"><?php
echo $R['score1'];
?>
</span> <?php
}
?>
<?php
if ($d['theme']['show_score2']) {
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:30,代码来源:view.php
示例16: getAdvancedReportByDate
public function getAdvancedReportByDate($start, $end, $departmentid = null, $locale = null)
{
$awhere = "";
$params = array("start" => $start, "end" => $end);
if ($departmentid !== null || $locale !== null) {
if ($departmentid !== null) {
$awhere .= "\n\t \t\t\t\tAND o.operatorid IN (\n\t \t\t\t\t\tSELECT operatorid \n\t \t\t\t\t\tFROM {operatordepartment} \n\t \t\t\t\t\tWHERE departmentid = :departmentid\n\t \t\t\t\t)\n\t \t\t\t";
$params['departmentid'] = $departmentid;
}
if ($locale !== null) {
$awhere .= "AND (o.locales LIKE :locale OR o.locales IS NULL)";
$params['locale'] = '%' . $locale . '%';
}
}
$sql = "SELECT\n o.operatorid as opid,\n UNIX_TIMESTAMP(ot.date) as date,\n (\n \tSELECT \n \t\tSEC_TO_TIME(SUM(seconds)) as online_time\n\t\t\t\t\tFROM \n\t\t\t\t\t\t{operatoronline}\n\t\t\t\t\tWHERE \n\t\t\t\t\t\toperatorid = o.operatorid and threadid = -1\n\t\t\t\t\tAND \n\t\t\t\t\t\tdate = ot.date\n\t\t\t\t\tGROUP BY operatorid\n\t\t\t\t) as online_time,\n\t\t\t\t(\n \tSELECT \n \t\tSEC_TO_TIME(SUM(seconds)) as online_time\n\t\t\t\t\tFROM \n\t\t\t\t\t\t{operatoronline}\n\t\t\t\t\tWHERE \n\t\t\t\t\t\toperatorid = o.operatorid and threadid = -2\n\t\t\t\t\tAND \n\t\t\t\t\t\tdate = ot.date\n\t\t\t\t\tGROUP BY operatorid\n\t\t\t\t) as online_chatting_time,\n\t\t\t\t(\n \tSELECT \n \t\tSEC_TO_TIME(SUM(seconds)) as online_time\n\t\t\t\t\tFROM \n\t\t\t\t\t\t{operatoronline}\n\t\t\t\t\tWHERE \n\t\t\t\t\t\toperatorid = o.operatorid and threadid > 0\n\t\t\t\t\tAND \n\t\t\t\t\t\tdate = ot.date\n\t\t\t\t\tGROUP BY operatorid\n\t\t\t\t) as online_sum_chatting_time,\n\t\t\t\t(\n \tSELECT \n \t\tSUM(seconds) as online_time\n\t\t\t\t\tFROM \n\t\t\t\t\t\t{operatoronline}\n\t\t\t\t\tWHERE \n\t\t\t\t\t\toperatorid = o.operatorid and threadid > 0\n\t\t\t\t\tAND \n\t\t\t\t\t\tdate = ot.date \t\n\t\t\t\t\tGROUP BY operatorid\n\t\t\t\t) as online_sum_chatting_time_seconds,\n\t\t\t\t(\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tCOUNT(i.invitationid)\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{invitation} as i\n\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t{thread} as t\n\t\t\t\t\tON\n\t\t\t\t\t\ti.threadid = t.threadid\n\t\t\t\t\tWHERE \n\t\t\t\t\t\tt.operatorid = ot.operatorid\n\t\t\t\t\tAND \n\t\t\t\t\t\tDATE(t.created) = ot.date\n\t\t\t\t\t\t\n\t\t\t\t) as invited_users\n\t\t\t\tFROM \n\t\t\t\t\t{operatorlastaccess} as o\n\t\t\t\tLEFT JOIN \n\t\t\t\t\t{operatoronline} as ot\n\t\t\t\tON \n\t\t\t\t\to.operatorid = ot.operatorid\n\t\t\t\tWHERE \n\t\t\t\t\t\tunix_timestamp(ot.date) >= :start \t\n\t\t\t\t\tAND \n\t\t\t\t\t\tunix_timestamp(ot.date) < :end\n\t\t\t\t\t{$awhere}\n\t\t\t\tGROUP BY o.operatorid, ot.date\n \t ";
try {
$this->db->Query($sql, $params);
$result = array();
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$row['date'] = date(getDateFormat(), $row['date']);
if (!isset($result[$row['date']])) {
$result[$row['date']] = array();
}
$result[$row['date']][$row['opid']] = $row;
$result[$row['date']][$row['opid']]['threads'] = 0;
$result[$row['date']][$row['opid']]['msgs'] = 0;
$result[$row['date']][$row['opid']]['avglen'] = 0;
if (!$result[$row['date']][$row['opid']]['online_time']) {
$result[$row['date']][$row['opid']]['online_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_sum_chatting_time']) {
$result[$row['date']][$row['opid']]['online_sum_chatting_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_chatting_time']) {
$result[$row['date']][$row['opid']]['online_chatting_time'] = 0;
}
if (!$result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds']) {
$result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds'] = 0;
}
$result[$row['date']][$row['opid']]['online_avg_chatting_time'] = 0;
}
} catch (Exception $e) {
}
$query = "SELECT o.operatorid FROM {operatorlastaccess} as o WHERE 1 {$awhere}";
try {
$this->db->Query($query, $params);
$operators = array();
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$operators[$row['operatorid']] = null;
}
} catch (Exception $e) {
}
if (empty($operators)) {
return array();
}
$sql = "SELECT\n m.operatorid as opid,\n COUNT(DISTINCT(m.threadid)) as threads,\n SUM(m.kind = :kind) as msgs,\n AVG(CHAR_LENGTH(m.message)) as avglen,\n UNIX_TIMESTAMP(m.created) as date \n FROM\n \t{message} as m\n WHERE\n \tm.operatorid IS NOT NULL \n AND\n \t\tm.operatorid IN (" . implode(", ", array_keys($operators)) . ")\n AND\n unix_timestamp(m.created) >= :start\n AND\n unix_timestamp(m.created) < :end \n GROUP BY\n m.operatorid, DATE(m.created)";
try {
$this->db->Query($sql, array("kind" => KIND_AGENT, "start" => $start, "end" => $end));
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$row['date'] = date(getDateFormat(), $row['date']);
if (!isset($result[$row['date']][$row['opid']])) {
continue;
}
$result[$row['date']][$row['opid']] = array_merge($result[$row['date']][$row['opid']], $row);
if ($result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds'] > 0) {
$online_avg_chatting_time = $result[$row['date']][$row['opid']]['online_sum_chatting_time_seconds'] / $result[$row['date']][$row['opid']]['threads'];
$result[$row['date']][$row['opid']]['online_avg_chatting_time'] = sprintf("%02d", (int) ($online_avg_chatting_time / 60)) . ":" . sprintf("%02d", $online_avg_chatting_time % 60);
}
}
} catch (Exception $e) {
}
foreach ($operators as $id => $v) {
$operator = Operator::getInstance()->GetOperatorById($id);
$operators[$id] = $operator['fullname'];
}
foreach ($result as $date => $data) {
foreach ($operators as $id => $name) {
if (!isset($data[$id])) {
$result[$date][$id] = array('opid' => $id, 'date' => $date, 'online_time' => 0, 'online_chatting_time' => 0, 'online_sum_chatting_time' => 0, 'online_sum_chatting_time_seconds' => 0, 'threads' => 0, 'msgs' => 0, 'avglen' => 0, 'online_avg_chatting_time' => 0, 'invited_users' => 0);
}
$result[$date][$id]['name'] = $name;
}
}
$sql = "\n \t\tSELECT threadid AS tid, \n \t\t\tUNIX_TIMESTAMP(created) as date,\n \t\t\t(\n\t\t\t\t\tSELECT created\n\t\t\t\t\tFROM {thread}\n\t\t\t\t\tWHERE\n\t\t\t\t\tthreadid = tid\n\t\t\t\t\tLIMIT 1\n\t\t\t\t) AS started, \n\t\t\t\t(\n\t\t\t\t\tSELECT created\n\t\t\t\t\tFROM {message}\n\t\t\t\t\tWHERE kind = ?\n\t\t\t\t\tAND threadid = tid \n\t\t\t\t\tAND operatorid IS NOT NULL \n\t\t\t\t\tORDER BY created ASC \n\t\t\t\t\tLIMIT 1\n\t\t\t\t) AS replied, \n\t\t\t\t(\n\t\t\t\t\tSELECT operatorid\n\t\t\t\t\tFROM {message}\n\t\t\t\t\tWHERE kind = ?\n\t\t\t\t\tAND threadid = tid \n\t\t\t\t\tAND operatorid IS NOT NULL \n\t\t\t\t\tORDER BY created ASC \n\t\t\t\t\tLIMIT 1\n\t\t\t\t) AS operatorid, \n\t\t\t\t(\n\t\t\t\t\tSELECT UNIX_TIMESTAMP(replied) - UNIX_TIMESTAMP(started)\n\t\t\t\t) AS delta\n\t\t\t\tFROM {message} as m\n\t\t\t\tWHERE\n\t\t\t\t\t\tunix_timestamp(created) >= ? \t\n\t\t\t\tAND \n\t\t\t\t\t\tunix_timestamp(created) < ?\n\t\t\t\tAND\n \t\t\t\tm.operatorid IN (" . implode(", ", array_keys($operators)) . ")\n\t\t\t\tGROUP BY threadid, DATE(created)";
try {
$this->db->Query($sql, array(KIND_AGENT, KIND_AGENT, $start, $end));
$result_deltas = array();
while ($this->db->nextRecord()) {
$row = $this->db->getRow();
$row['date'] = date(getDateFormat(), $row['date']);
if ($row['operatorid'] == null) {
continue;
}
$date = $row['date'];
$opid = $row['operatorid'];
if (!isset($result_deltas[$date])) {
$result_deltas[$date] = array();
//.........这里部分代码省略.........
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:101,代码来源:class.operatormapper.php
示例17: lang
?>
</div>
</div>
</div>
<div class="row form-row">
<div class="col-md-3">
<?php
echo lang('seniority_date', 'seniority_date');
?>
</div>
<div class="col-md-9">
<div class="input-with-icon right">
<div class="input-append success date no-padding">
<input type="text" class="form-control" id="seniority_date" name="seniority_date" value="<?php
echo getDateFormat($row->seniority_date);
?>
">
<span class="add-on"><span class="arrow"></span><i class="icon-th"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
<?php
echo lang('position', 'position');
?>
</div>
<div class="col-md-9">
<select name="position_id" class="select2" id="position_id_detail" style="width:100%">
<?php
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:31,代码来源:detail.php
示例18: foreach
include 'partials/header.php';
$sql = 'SELECT * FROM article ORDER BY id DESC LIMIT 10';
$query = $db->query($sql);
$articles = $query->fetchAll();
?>
<h1>Les dernières Joies du code</h1>
<hr>
<?php
foreach ($articles as $article) {
?>
<div class="post">
<p><?php
echo getDateFormat($article['creation_date']);
?>
par <a href="#"><?php
echo getName($article['name']);
?>
</a></p>
<blockquote>
<p><?php
echo getContent($article['content'], 100, $article['id']);
?>
</p>
</blockquote>
</div>
<?php
}
开发者ID:budo60,项目名称:joieducode,代码行数:30,代码来源:index.php
示例19: getDateFormat
?>
<div class="existsnone">
현재 설치된 킴스큐는 최신버젼입니다.<br />
새로운 업데이트가 있을 경우 이곳에 알려드립니다.<br />
</div>
<?php
} else {
?>
<div class="existsnew">
새로 등록된 업데이트가 있습니다.<br />
지금 업데이트하시겠습니까?<br />
<span>(대기상태인 최신 업데이트 : <?php
echo $_lastupdate[0];
?>
- <?php
echo getDateFormat($_lastupdate[1], 'Y.m.d');
?>
)</span>
<div>
<a href="http://<?php
echo $_serverinfo[2];
?>
/r/update/<?php
echo $_lastupdate[2];
?>
" target="_blank"><i>관련정보 확인하기</i></a>
<a href="<?php
echo $g['s'];
?>
/?r=<?php
echo $r;
开发者ID:kieregh,项目名称:rb1.2,代码行数:31,代码来源:main.desk.php
|
请发表评论