本文整理汇总了PHP中Format::db_datetime方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::db_datetime方法的具体用法?PHP Format::db_datetime怎么用?PHP Format::db_datetime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::db_datetime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onTicketCreated
function onTicketCreated($answer)
{
try {
global $ost;
if (!($ticket = Ticket::lookup($answer->object_id))) {
die('Unknown or invalid ticket ID.');
}
//Slack payload
$payload = array('attachments' => array(array('pretext' => "New Ticket <" . $ost->getConfig()->getUrl() . "scp/tickets.php?id=" . $ticket->getId() . "|#" . $ticket->getId() . "> in " . Format::htmlchars($ticket->getDept() instanceof Dept ? $ticket->getDept()->getName() : '') . " via " . $ticket->getSource() . " (" . Format::db_datetime($ticket->getCreateDate()) . ")", 'fallback' => "New Ticket <" . $ost->getConfig()->getUrl() . "scp/tickets.php?id=" . $ticket->getId() . "|#" . $ticket->getId() . "> in " . Format::htmlchars($ticket->getDept() instanceof Dept ? $ticket->getDept()->getName() : '') . " via " . $ticket->getSource() . " (" . Format::db_datetime($ticket->getCreateDate()) . ")", 'color' => "#D00000", 'fields' => array(array('title' => "From: " . mb_convert_case(Format::htmlchars($ticket->getName()), MB_CASE_TITLE) . " (" . $ticket->getEmail() . ")", 'value' => '', 'short' => false)))));
//Curl to webhook
$data_string = utf8_encode(json_encode($payload));
$url = $this->getConfig()->get('slack-webhook-url');
if (!function_exists('curl_init')) {
error_log('osticket slackplugin error: cURL is not installed!');
}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
if ($result === false) {
error_log($url . ' - ' . curl_error($ch));
} else {
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($statusCode != '200') {
error_log($url . ' Http code: ' . $statusCode);
}
}
curl_close($ch);
} catch (Exception $e) {
error_log('Error posting to Slack. ' . $e->getMessage());
}
}
示例2: __
<th><?php
echo __('Created');
?>
:</th>
<td><?php
echo Format::db_datetime($user->getCreateDate());
?>
</td>
</tr>
<tr>
<th><?php
echo __('Updated');
?>
:</th>
<td><?php
echo Format::db_datetime($user->getUpdateDate());
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<div class="clear"></div>
<ul class="tabs">
<li><a class="active" id="tickets_tab" href="#tickets"><i
class="icon-list-alt"></i> <?php
echo __('User Tickets');
?>
</a></li>
示例3:
<td><?php
echo $ticket->getStatus();
?>
</td>
</tr>
<tr>
<th>Department:</th>
<td><?php
echo Format::htmlchars($dept->getName());
?>
</td>
</tr>
<tr>
<th>Create Date:</th>
<td><?php
echo Format::db_datetime($ticket->getCreateDate());
?>
</td>
</tr>
</table>
</td>
<td width=50% valign="top">
<table align="center" class="infotable" cellspacing="1" cellpadding="3" width="100%" border=0>
<tr>
<th width="100">Name:</th>
<td><?php
echo Format::htmlchars($ticket->getName());
?>
</td>
</tr>
<tr>
示例4: if
if($ids && in_array($row['category_id'],$ids))
$sel=true;
$faqs=0;
if($row['faqs'])
$faqs=sprintf('<a href="faq.php?cid=%d">%d</a>',$row['category_id'],$row['faqs']);
?>
<tr id="<?php echo $row['category_id']; ?>">
<td width=7px>
<input type="checkbox" name="ids[]" value="<?php echo $row['category_id']; ?>" class="ckb"
<?php echo $sel?'checked="checked"':''; ?>>
</td>
<td><a href="categories.php?id=<?php echo $row['category_id']; ?>"><?php echo Format::truncate($row['name'],200); ?></a> </td>
<td><?php echo $row['ispublic']?'<b>'.__('Public').'</b>':__('Internal'); ?></td>
<td style="text-align:right;padding-right:25px;"><?php echo $faqs; ?></td>
<td> <?php echo Format::db_datetime($row['updated']); ?></td>
</tr>
<?php
} //end of while.
endif; ?>
<tfoot>
<tr>
<td colspan="5">
<?php if($res && $num){ ?>
<?php echo __('Select');?>:
<a id="selectAll" href="#ckb"><?php echo __('All');?></a>
<a id="selectNone" href="#ckb"><?php echo __('None');?></a>
<a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a>
<?php }else{
echo __('No FAQ categories found.');
} ?>
示例5:
?>
onClick="highLight(this.value,this.checked);">
<td> <?php
echo $row['apikey'];
?>
</td>
<td><?php
echo $row['isactive'] ? '<b>Yes</b>' : 'No';
?>
</td>
<td> <?php
echo $row['ipaddr'];
?>
</td>
<td> <?php
echo Format::db_datetime($row['created']);
?>
</td>
</tr>
<?php
$class = $class == 'row2' ? 'row1' : 'row2';
}
//end of while.
} else {
//nothin' found!!
?>
<tr class="<?php
echo $class;
?>
"><td colspan=5><b>Query returned 0 results</b> <a href="admin.php?t=templates">Index list</a></td></tr>
示例6: _print
function _print()
{
if (!($ticket = $this->getTicket())) {
return;
}
$w = $this->w / 2 - $this->lMargin;
$l = 35;
$c = $w - $l;
$this->SetFont('Arial', 'B', 11);
$this->cMargin = 0;
$this->SetFont('Arial', 'B', 11);
$this->SetTextColor(10, 86, 142);
$this->Cell($w, 7, 'Ticket #' . $ticket->getNumber(), 0, 0, 'L');
$this->Ln(7);
$this->cMargin = 3;
$this->SetTextColor(0);
$this->SetDrawColor(220, 220, 220);
$this->SetFillColor(244, 250, 255);
$this->SetX($this->lMargin);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Status', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getStatus(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Name', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getName(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Priority', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getPriority(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Email', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getEmail(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Department', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getDeptName(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Phone', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getPhoneNumber(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Create Date', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, Format::db_datetime($ticket->getCreateDate()), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Source', 1, 0, 'L', true);
$this->SetFont('');
$source = ucfirst($ticket->getSource());
if ($ticket->getIP()) {
$source .= ' (' . $ticket->getIP() . ')';
}
$this->Cell($c, 7, $source, 1, 0, 'L', true);
$this->Ln(15);
$this->SetFont('Arial', 'B', 11);
if ($ticket->isOpen()) {
$this->Cell($l, 7, 'Assigned To', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->isAssigned() ? $ticket->getAssigned() : ' -- ', 1, 0, 'L', true);
} else {
$closedby = 'unknown';
if ($staff = $ticket->getStaff()) {
$closedby = $staff->getName();
}
$this->Cell($l, 7, 'Closed By', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $closedby, 1, 0, 'L', true);
}
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Help Topic', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, $ticket->getHelpTopic(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'SLA Plan', 1, 0, 'L', true);
$this->SetFont('');
$sla = $ticket->getSLA();
$this->Cell($c, 7, $sla ? $sla->getName() : ' -- ', 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Last Response', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, Format::db_datetime($ticket->getLastRespDate()), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
if ($ticket->isOpen()) {
$this->Cell($l, 7, 'Due Date', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, Format::db_datetime($ticket->getEstDueDate()), 1, 0, 'L', true);
} else {
$this->Cell($l, 7, 'Close Date', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, Format::db_datetime($ticket->getCloseDate()), 1, 0, 'L', true);
}
$this->SetFont('Arial', 'B', 11);
$this->Cell($l, 7, 'Last Message', 1, 0, 'L', true);
$this->SetFont('');
$this->Cell($c, 7, Format::db_datetime($ticket->getLastMsgDate()), 1, 1, 'L', true);
$this->Ln(5);
$this->SetFont('Arial', 'B', 11);
$this->cMargin = 0;
//.........这里部分代码省略.........
示例7:
?>
></td>
<td><a href="plugins.php?id=<?php
echo $p->getId();
?>
"
><?php
echo $p->getName();
?>
</a></td>
<td><?php
echo $p->isActive() ? 'Enabled' : '<strong>Disabled</strong>';
?>
</td>
<td><?php
echo Format::db_datetime($p->getInstallDate());
?>
</td>
</tr>
<?php
} else {
}
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="4">
<?php
if ($count) {
?>
示例8: ticketsAction
protected function ticketsAction($type, $ticket_id)
{
$tickets = array();
foreach ($ticket_id as $id) {
$ticket = \Ticket::lookup($id['ticket_id']);
$equipment = new \model\Equipment($id['equipment_id']);
if (isset($ticket) && isset($equipment)) {
$ticket_data = array('id' => $ticket->getId(), 'number' => $ticket->getNumber(), 'equipment' => $equipment->getAsset_id(), 'create_date' => \Format::db_datetime($ticket->getCreateDate()), 'subject' => $ticket->getSubject(), 'name' => $ticket->getName()->getFull(), 'priority' => $ticket->getPriority());
if ($type == 'closed') {
$ts_open = strtotime($ticket->getCreateDate());
$ts_closed = strtotime($ticket->getCloseDate());
$ticket_data['close_date'] = \Format::db_datetime($ticket->getCloseDate());
$ticket_data['closed_by'] = $ticket->getStaff()->getUserName();
$ticket_data['elapsed'] = $this->elapsedTime($ts_closed - $ts_open);
}
$tickets[] = $ticket_data;
}
}
return $tickets;
}
示例9: is_array
$ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null;
while ($row = db_fetch_array($res)) {
$sel=false;
if($ids && in_array($row['staff_id'],$ids))
$sel=true;
?>
<tr id="<?php echo $row['staff_id']; ?>">
<td width=7px>
<input type="checkbox" class="ckb" name="ids[]" value="<?php echo $row['staff_id']; ?>" <?php echo $sel?'checked="checked"':''; ?> >
<td><a href="staff.php?id=<?php echo $row['staff_id']; ?>"><?php echo Format::htmlchars($row['name']); ?></a> </td>
<td><?php echo $row['username']; ?></td>
<td><?php echo $row['isactive']?__('Active'):'<b>'.__('Locked').'</b>'; ?> <?php echo $row['onvacation']?'<small>(<i>'.__('vacation').'</i>)</small>':''; ?></td>
<td><a href="groups.php?id=<?php echo $row['group_id']; ?>"><?php echo Format::htmlchars($row['group_name']); ?></a></td>
<td><a href="departments.php?id=<?php echo $row['dept_id']; ?>"><?php echo Format::htmlchars($row['dept']); ?></a></td>
<td><?php echo Format::db_date($row['created']); ?></td>
<td><?php echo Format::db_datetime($row['lastlogin']); ?> </td>
</tr>
<?php
} //end of while.
endif; ?>
<tfoot>
<tr>
<td colspan="8">
<?php if($res && $num){ ?>
<?php echo __('Select');?>:
<a id="selectAll" href="#ckb"><?php echo __('All');?></a>
<a id="selectNone" href="#ckb"><?php echo __('None');?></a>
<a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a>
<?php }else{
echo __('No agents found!');
} ?>
示例10: strtolower
echo $row['email'];
?>
" nowrap>
<a class="Icon <?php
echo strtolower($row['source']);
?>
Ticket ticketPreview" title="Preview Ticket"
href="tickets.php?id=<?php
echo $row['ticket_id'];
?>
"><?php
echo $tid;
?>
</a></td>
<td align="center" nowrap><?php
echo Format::db_datetime($row['effective_date']);
?>
</td>
<td><a <?php
if ($flag) {
?>
class="Icon <?php
echo $flag;
?>
Ticket" title="<?php
echo ucfirst($flag);
?>
Ticket" <?php
}
?>
href="tickets.php?id=<?php
示例11:
</td>
<td width=50% valign="top">
<table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
<tr><th>Help Topic:</th>
<td><?
$ht=$ticket->getHelpTopic();
echo Format::htmlchars($ht?$ht:'N/A');
?>
</td>
</tr>
<tr>
<th>IP Address:</th>
<td><?=$ticket->getIP()?></td>
</tr>
<tr><th nowrap>Last Message:</th>
<td><?=Format::db_datetime($ticket->getLastMessageDate())?></td>
</tr>
</table>
</td>
</tr>
</table>
<div>
<?if($errors['err'] && $_POST['a']=='process') {?>
<p align="center" id="errormessage"><?=$errors['err']?></p>
<?}elseif($msg && $_POST['a']=='process' || $_POST['a']=='update' ) {?>
<p align="center" id="infomessage"><?=$msg?></p>
<?}elseif($warn) {?>
<p id="warnmessage"><?=$warn?></p>
<?}?>
</div>
<?
示例12: sprintf
<tr>
<th>Create Date:</th>
<td>%s</td>
</tr>', $ticket_state, Format::db_datetime($ticket->getCreateDate()));
if ($ticket->isClosed()) {
echo sprintf('
<tr>
<th>Close Date:</th>
<td>%s <span class="faded">by %s</span></td>
</tr>', Format::db_datetime($ticket->getCloseDate()), $staff ? $staff->getName() : 'staff');
} elseif ($ticket->getEstDueDate()) {
echo sprintf('
<tr>
<th>Due Date:</th>
<td>%s</td>
</tr>', Format::db_datetime($ticket->getEstDueDate()));
}
echo '</table>';
echo '<hr>
<table border="0" cellspacing="" cellpadding="1" width="100%" class="ticket_info">';
if ($ticket->isOpen()) {
echo sprintf('
<tr>
<th width="100">Assigned To:</th>
<td>%s</td>
</tr>', $ticket->isAssigned() ? implode('/', $ticket->getAssignees()) : ' <span class="faded">— Unassigned —</span>');
}
echo sprintf('
<tr>
<th>From:</th>
<td><a href="users.php?id=%d" class="no-pjax">%s</a> <span class="faded">%s</span></td>
示例13:
</tr>
</table>
</td>
<td width="50%" style="vertical-align:top">
<table border="0" cellspacing="" cellpadding="4" width="100%">
<tr>
<th width="150">Created:</th>
<td><?php
echo Format::db_datetime($org->getCreateDate());
?>
</td>
</tr>
<tr>
<th>Updated:</th>
<td><?php
echo Format::db_datetime($org->getUpdateDate());
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<div class="clear"></div>
<ul class="tabs">
<li><a class="active" id="users_tab" href="#users"><i
class="icon-user"></i> Users</a></li>
<li><a id="tickets_tab" href="#tickets"><i
class="icon-list-alt"></i> Tickets</a></li>
<li><a id="notes_tab" href="#notes"><i
示例14: _print
function _print()
{
if (!($ticket = $this->getTicket())) {
return;
}
$w = $this->w / 2 - $this->lMargin;
$l = 35;
$c = $w - $l;
// Setup HTML writing and load default thread stylesheet
$this->WriteHtml('<style>' . file_get_contents(ROOT_DIR . 'css/thread.css') . '</style>', 1, true, false);
$this->SetFont('Arial', 'B', 11);
$this->cMargin = 0;
$this->SetFont('Arial', 'B', 11);
$this->SetTextColor(10, 86, 142);
$this->WriteCell($w, 7, sprintf(__('Ticket #%s'), $ticket->getNumber()), 0, 0, 'L');
$this->Ln(7);
$this->cMargin = 3;
$this->SetTextColor(0);
$this->SetDrawColor(220, 220, 220);
$this->SetFillColor(244, 250, 255);
$this->SetX($this->lMargin);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Status'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, (string) $ticket->getStatus(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Name'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, (string) $ticket->getName(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Priority'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->getPriority(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Email'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->getEmail(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Department'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->getDeptName(), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Phone'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->getPhoneNumber(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Create Date'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, Format::db_datetime($ticket->getCreateDate()), 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Source'), 1, 0, 'L', true);
$this->SetFont('');
$source = ucfirst($ticket->getSource());
if ($ticket->getIP()) {
$source .= ' (' . $ticket->getIP() . ')';
}
$this->WriteCell($c, 7, $source, 1, 0, 'L', true);
$this->Ln(12);
$this->SetFont('Arial', 'B', 11);
if ($ticket->isOpen()) {
$this->WriteCell($l, 7, __('Assigned To'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->isAssigned() ? $ticket->getAssigned() : ' -- ', 1, 0, 'L', true);
} else {
$closedby = __('unknown');
if ($staff = $ticket->getStaff()) {
$closedby = (string) $staff->getName();
}
$this->WriteCell($l, 7, __('Closed By'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $closedby, 1, 0, 'L', true);
}
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Help Topic'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, $ticket->getHelpTopic(), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('SLA Plan'), 1, 0, 'L', true);
$this->SetFont('');
$sla = $ticket->getSLA();
$this->WriteCell($c, 7, $sla ? $sla->getName() : ' -- ', 1, 0, 'L', true);
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Last Response'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, Format::db_datetime($ticket->getLastRespDate()), 1, 1, 'L', true);
$this->SetFont('Arial', 'B', 11);
if ($ticket->isOpen()) {
$this->WriteCell($l, 7, __('Due Date'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, Format::db_datetime($ticket->getEstDueDate()), 1, 0, 'L', true);
} else {
$this->WriteCell($l, 7, __('Close Date'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, Format::db_datetime($ticket->getCloseDate()), 1, 0, 'L', true);
}
$this->SetFont('Arial', 'B', 11);
$this->WriteCell($l, 7, __('Last Message'), 1, 0, 'L', true);
$this->SetFont('');
$this->WriteCell($c, 7, Format::db_datetime($ticket->getLastMsgDate()), 1, 1, 'L', true);
$this->SetFillColor(255, 255, 255);
//.........这里部分代码省略.........
示例15:
?>
" <?php
echo $sel ? 'checked' : '';
?>
onClick="highLight(this.value,this.checked);">
<td><?php
echo $row['email'];
?>
</td>
<td><?php
echo $row['submitter'];
?>
</td>
<td><?php
echo Format::db_datetime($row['added']);
?>
</td>
</tr>
<?php
$class = $class == 'row2' ? 'row1' : 'row2';
}
//end of while.
} else {
//nothin' found!!
?>
<tr class="<?php
echo $class;
?>
"><td colspan=4><b>Query returned 0 results</b> <a href="admin.php?t=banlist">Index list</a></td></tr>