当前位置: 首页>>代码示例>>PHP>>正文


PHP Time::formatReservationDate方法代码示例

本文整理汇总了PHP中Time::formatReservationDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::formatReservationDate方法的具体用法?PHP Time::formatReservationDate怎么用?PHP Time::formatReservationDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Time的用法示例。


在下文中一共展示了Time::formatReservationDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send_email

    /**
     * Sends an email notification to the user
     * This function sends an email notifiying the user
     * of creation/modification/deletion of a reservation
     * @param string $type type of modification made to the reservation
     * @param array $repeat_dates array of dates reserved on
     * @param array $users_to_inform array of emails to CC about the reservation mod
     * @global $conf
     */
    function send_email($type, $repeat_dates = null, $users_to_inform = null)
    {
        global $conf;
        // Dont bother if nobody wants email
        if (!$this->user->wants_email($type) && !$conf['app']['emailAdmin']) {
            return;
        }
        // Email addresses
        $adminemail = $this->sched['adminemail'];
        $techEmail = $conf['app']['techEmail'];
        $url = CmnFns::getScriptURL();
        // Format date
        $start_date = Time::formatReservationDate($this->start_date, $this->start);
        $end_date = Time::formatReservationDate($this->end_date, $this->end);
        $start = Time::formatTime($this->get_start());
        $end = Time::formatTime($this->get_end());
        $defs = array(translate('Reservation #'), translate('Start Date'), translate('End Date'), translate('Resource'), translate('Start Time'), translate('End Time'), translate('Location'), translate('Contact'));
        switch ($type) {
            case 'e_add':
                $mod = 'created';
                break;
            case 'e_mod':
                $mod = 'modified';
                break;
            case 'e_del':
                $mod = 'deleted';
                break;
            case 'e_app':
                $mod = 'approved';
                break;
        }
        $to = $this->user->get_email();
        // Who to mail to
        $subject = translate("Reservation {$mod} for", array($start_date));
        $uname = $this->user->get_fname();
        $location = $this->resource->properties['location'];
        $phone = $this->resource->properties['rphone'];
        $name = $this->resource->properties['name'];
        $location = !empty($location) ? $location : translate('N/A');
        $phone = !empty($phone) ? $phone : translate('N/A');
        if ($mod == 'approved') {
            $text = translate_email('reservation_activity_7', $uname, $this->id, $start_date, $start, $end_date, $end, $name, $location, translate($mod));
        } else {
            $text = translate_email('reservation_activity_1', $uname, translate($mod), $this->id, $start_date, $start, $end_date, $end, $name, $location, translate($mod));
        }
        if ($this->is_repeat && count($repeat_dates) > 1) {
            // Start at index = 1 because at index 0 is the parent date
            $text .= translate_email('reservation_activity_2');
            for ($d = 1; $d < count($repeat_dates); $d++) {
                $text .= Time::formatDate($repeat_dates[$d]) . "\r\n<br/>";
            }
            $text .= "\r\n<br/>";
        }
        if ($type != 'e_add' && $this->is_repeat) {
            $text .= translate_email('reservation_activity_3', translate($mod));
        }
        if (!empty($this->summary)) {
            $text .= stripslashes(translate_email('reservation_activity_4', $this->summary));
        }
        $phone = "202-994-9870";
        $text .= translate_email('reservation_activity_5', $adminemail, $phone, $conf['app']['title'], $url, $url);
        if (!empty($techEmail)) {
            $text .= translate_email('reservation_activity_6', $techEmail, $techEmail);
        }
        if ($this->user->wants_html()) {
            $msg = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
\t\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
\t<!--
\tbody {
\t\tfont-size: 11px;
    \tfont-family: Verdana, Arial, Helvetica, sans-serif;
\t\tbackground-color: #F0F0F0;
\t}
\ta {
\t\tcolor: #104E8B;
\t\ttext-decoration: none;
\t}
\ta:hover {
\t\tcolor: #474747;
\t\ttext-decoration: underline;
\t}
\ttable tr.header td {
\t\tpadding-top: 2px;
\t\tpadding-botton: 2px;
\t\tbackground-color: #CCCCCC;
\t\tcolor: #000000;
//.........这里部分代码省略.........
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:Reservation.class.php

示例2: get_display_date

 /**
  * Return the formatted and timezone adjusted date
  * @param int $ts time stamp for date to format
  * @return formatted date
  */
 function get_display_date()
 {
     return Time::formatReservationDate($this->_date['todayTs'], $this->startDay, null, 'schedule_daily');
 }
开发者ID:razagilani,项目名称:srrs,代码行数:9,代码来源:Schedule.class.php

示例3: showParticipatingTable

/**
* This function prints a table of all upcoming
* reservations that the current user has been invited to but not yet responded to.
* It also provides a way for them to accept/decline invitations
* @param mixed $res array of reservation data
* @param string $err last error message from database
*/
function showParticipatingTable($res, $err)
{
    global $link;
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td class="tableBorder">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td colspan="7" class="tableTitle">
		    <a href="javascript: void(0);" onclick="showHideCpanelTable('accepted');">&#8250; <?php 
    echo translate('My Reservation Participation');
    ?>
</a>
		  </td>
          <td class="tableTitle">
            <div align="right">
              <?php 
    $link->doLink('javascript: help(\'my_participation\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Reservation Participation'));
    ?>
            </div>
          </td>
        </tr>
      </table>
      <div id="accepted" style="display: <?php 
    echo getShowHide('accepted');
    ?>
">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr class="rowHeaders">
          <td width="10%"><?php 
    echo translate('Start Date');
    ?>
</td>
		  <td width="10%"><?php 
    echo translate('End Date');
    ?>
</td>
          <td width="23%"><?php 
    echo translate('Resource');
    ?>
</td>
          <td width="10%"><?php 
    echo translate('Start Time');
    ?>
</td>
          <td width="10%"><?php 
    echo translate('End Time');
    ?>
</td>
          <td width="20%"><?php 
    echo translate('Owner');
    ?>
</td>
          <td width="16%"><?php 
    echo translate('End Participation');
    ?>
</td>
		</tr>
     <?php 
    // Write message if they have no reservations
    if (!$res) {
        echo '        <tr class="cellColor"><td colspan="7" align="center">' . $err . '</td></tr>';
    }
    // For each reservation, clean up the date/time and print it
    for ($i = 0; is_array($res) && $i < count($res); $i++) {
        $rs = $res[$i];
        $class = 'cellColor' . $i % 2;
        echo "        <tr class=\"{$class}\" align=\"center\">" . '          <td>' . $link->getLink("javascript: reserve('v','','','" . $rs['resid'] . "');", Time::formatReservationDate($rs['start_date'], $rs['starttime']), '', '', translate('View this reservation')) . '</td>' . '          <td>' . $link->getLink("javascript: reserve('v','','','" . $rs['resid'] . "');", Time::formatReservationDate($rs['end_date'], $rs['endtime']), '', '', translate('View this reservation')) . '</td>' . '          <td style="text-align:left;">' . $rs['name'] . '</td>' . '          <td>' . Time::formatTime($rs['starttime']) . '</td>' . '          <td>' . Time::formatTime($rs['endtime']) . '</td>' . '          <td style="text-align:left;">' . $rs['fname'] . ' ' . $rs['lname'] . '</td>' . '          <td>' . $link->getLink("manage_invites.php?id={$rs['resid']}&amp;memberid={$rs['memberid']}&amp;accept_code={$rs['accept_code']}&amp;action=" . INVITE_DECLINE, translate('End Participation'), '', '', translate('End Participation')) . '</td>' . "        </tr>\n";
    }
    unset($res);
    ?>
      </table>
	  </div>
    </td>
  </tr>
</table>
<?php 
}
开发者ID:razagilani,项目名称:srrs,代码行数:86,代码来源:cpanel.template.php


注:本文中的Time::formatReservationDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。