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


PHP Time::formatTime方法代码示例

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


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

示例1: get_time_array

 /**
  * Get associative array of available times and rowspans
  * This function computes and returns an associative array
  * containing a timezone adjusted time value and it's rowspan value as
  * $array[time] => rowspan
  * @param none
  * @return array of time value and it's associated rowspan value
  * @global $conf
  */
 function get_time_array()
 {
     global $conf;
     $startDay = $startingTime = $this->startDay;
     $endDay = $endingTime = $this->endDay;
     $interval = $this->timespan;
     $timeHash = array();
     // Compute the available times
     $prevTime = $startDay;
     if ($startDay % 60 != 0 && $interval < 60) {
         $time = Time::formatTime($startDay);
         $timeHash[$time] = intval((60 - $startDay % 60) / $interval);
         $prevTime += $interval * $timeHash[$time];
     }
     while ($prevTime < $endingTime) {
         if ($interval < 60) {
             $time = Time::formatTime($prevTime);
             $timeHash[$time] = intval(60 / $interval);
             $prevTime += 60;
             // Always increment by 1 hour
         } else {
             $colspan = 1;
             // Colspan is always 1
             $time = Time::formatTime($prevTime);
             $timeHash[$time] = $colspan;
             $prevTime += $interval;
         }
     }
     return $timeHash;
 }
开发者ID:razagilani,项目名称:srrs,代码行数:39,代码来源:Schedule.class.php

示例2: _buildBody

 function _buildBody($reminder)
 {
     return translate_email('Reminder Body', $reminder->resource_name, Time::formatDate($reminder->start_date), Time::formatTime($reminder->start_time), Time::formatDate($reminder->end_date), Time::formatTime($reminder->end_time));
 }
开发者ID:razagilani,项目名称:srrs,代码行数:4,代码来源:ReminderEmail.class.php

示例3: remove_users_email

 /**
  * Send an email informing the users they have been dropped from the reservation
  * @param array $emails array of email addresses
  * @param array $dates that have been dropped
  */
 function remove_users_email($emails, $dates)
 {
     global $conf;
     $mailer = new PHPMailer();
     $mailer->From = $this->user->get_email();
     $mailer->FromName = $this->user->get_name();
     $mailer->Subject = $conf['app']['title'] . ' ' . translate('Reservation Participation Change');
     $mailer->IsHTML(false);
     $url = CmnFns::getScriptURL();
     // Format dates
     $start_date = Time::formatDate($this->start_date);
     $end_date = Time::formatDate($this->end_date);
     $start = Time::formatTime($this->get_start());
     $end = Time::formatTime($this->get_end());
     $dates_text = '';
     for ($d = 1; $d < count($dates); $d++) {
         $dates_text .= Time::formatDate($dates) . ",";
     }
     foreach ($emails as $email) {
         $mailer->ClearAllRecipients();
         $mailer->AddAddress($email);
         $mailer->Body = translate_email('reservation_removal', $this->resource->properties['name'], $start_date, $start, $end_date, $end, $this->summary, $dates_text);
         $mailer->Send();
     }
 }
开发者ID:razagilani,项目名称:srrs,代码行数:30,代码来源:Reservation.class.php

示例4: print_manage_reservations

/**
* Interface for managing reservations
* Provide a table to allow admin to modify or delete reservations
* @param Object $pager pager object
* @param mixed $res reservation data
* @param string $err last database error
*/
function print_manage_reservations(&$pager, $res, $err)
{
    global $link;
    $util = new Utility();
    ?>
<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="9" class="tableTitle">&#8250; <?php 
    echo translate('User Reservations');
    ?>
</td>
        </tr>
		<?php 
    echo "\r\n        <tr class=\"rowHeaders\">\r\n          <td width=\"10%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'start_date'), translate('Start Date')) . "</td>\r\n\t\t  <td width=\"10%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'end_date'), translate('End Date')) . "</td>\r\n          <td width=\"20%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'lname'), translate('User')) . "</td>\r\n          <td width=\"19%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'name'), translate('Resource Name')) . "</td>\r\n          <td width=\"10%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'starttime'), translate('Start Time')) . "</td>\r\n          <td width=\"10%\">" . $link->getLink($_SERVER['PHP_SELF'] . $util->getSortingUrl($_SERVER['QUERY_STRING'], 'endtime'), translate('End Time')) . "</td>\r\n          <td width=\"7%\">" . translate('View') . "</td>\r\n          <td width=\"7%\">" . translate('Modify') . "</td>\r\n          <td width=\"7%\">" . translate('Delete') . "</td>\r\n        </tr>";
    // Write message if they have no reservations
    if (!$res) {
        echo '<tr class="cellColor"><td colspan="9" 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++) {
        $cur = $res[$i];
        $fname = $cur['fname'];
        $lname = $cur['lname'];
        echo "<tr class=\"cellColor" . $i % 2 . "\" align=\"center\">\n" . '<td>' . Time::formatDate($cur['start_date']) . '</td>' . '<td>' . Time::formatDate($cur['end_date']) . '</td>' . '<td style="text-align:left">' . $link->getLink("javascript: viewUser('" . $cur['memberid'] . "');", $fname . ' ' . $lname, '', '', translate('View information about', array($fname, $lname))) . "</td>" . '<td style="text-align:left">' . $cur['name'] . "</td>" . '<td>' . Time::formatTime($cur['starttime']) . '</td>' . '<td>' . Time::formatTime($cur['endtime']) . '</td>' . '<td>' . $link->getLink("javascript: reserve('v','','','" . $cur['resid'] . "');", translate('View')) . '</td>' . '<td>' . $link->getlink("javascript: reserve('m','','','" . $cur['resid'] . "');", translate('Modify')) . '</td>' . '<td>' . $link->getLink("javascript: reserve('d','','','" . $cur['resid'] . "');", translate('Delete')) . '</td>' . "</tr>\n";
    }
    ?>
      </table>
    </td>
  </tr>
</table>
<br />
<?php 
}
开发者ID:razagilani,项目名称:srrs,代码行数:43,代码来源:admin.template.php

示例5: build_reservation_detail_div

/**
* Builds the reservation details div and makes sure it is clean data
* @param array $res array of resrevation data
* @return formatted HTML string for the content of the div
*/
function build_reservation_detail_div($res)
{
    $html = '';
    $html .= translate_date('general_date', $res['start_date']) . ' ' . Time::formatTime($res['starttime']) . ' -<br/>';
    $html .= translate_date('general_date', $res['end_date']) . ' ' . Time::formatTime($res['endtime']) . '<br/><br/>';
    $html .= $res['name'] . ' @ ' . $res['location'] . '<br/>';
    $html .= $res['fname'] . ' ' . $res['lname'] . '<br/>';
    if (!empty($res['summary'])) {
        $html .= '<br/><br/><i>' . preg_replace("/[\n\r]+/", '<br/>', addslashes($res['summary'])) . '</i>';
    }
    return $html;
}
开发者ID:razagilani,项目名称:srrs,代码行数:17,代码来源:mycalendar.template.php

示例6: search


//.........这里部分代码省略.........
    $recs = count($res);
    // Print number of results found and a link to the text version
    echo '<h3 align="center">' . translate('Search Results found', array($recs)) . "</h3>\n" . '<h5 align="center">' . $link->getLink($_SERVER['PHP_SELF'], translate('Try a different search')) . "</h5>\n";
    print_change_output($_POST);
    echo "<hr noshade size=\"1\">\n";
    // If there were no results found, exit
    if ($recs <= 0) {
        return;
    }
    // Set up initial booleans
    $newUser = false;
    $newMach = false;
    $totalHours = 0;
    $resNo = 1;
    // Get first row
    $rs = $res[0];
    // Set up initial previous user/machine variables
    $prevUser = $rs['memberid'];
    $prevMach = $rs['machid'];
    /* Text file variables */
    // Create text output
    // Make global to share with other functions
    if ($type == 'text') {
        $GLOBALS['dblStr'] = str_repeat('=', 50) . "\n";
        $GLOBALS['sglStr'] = str_repeat('-', 50) . "\n";
    }
    if ($type != 'html') {
        // Plain-text view
        echo '<pre>';
        echo translate('Search Run On') . ' ' . date('M jS, Y - h:i:s a') . "\r\n\r\n";
    }
    // Print out first table with this information
    printUserInfo($rs['fname'], $rs['lname'], $rs['memberid'], $type);
    printTableHeader($rs['fname'], $rs['lname'], $rs['name'], $type, $rs['scheduletitle']);
    if ($type == 'csv') {
        // Print record id line for csv output
        print_csv_header();
    }
    // Repeat for each record
    for ($i = 0; $i < count($res); $i++) {
        $rs = $res[$i];
        // Current reservation
        // If we are at a new user, set them to prevUser
        if ($prevUser != $rs['memberid']) {
            $prevUser = $rs['memberid'];
            $newUser = true;
        }
        // If we are at a new resource, set it to prevMach
        if ($prevMach != $rs['machid']) {
            $prevMach = $rs['machid'];
            $newMach = true;
        }
        // If we are making a new table (by advancing to new user or resource)
        if ($newUser || $newMach) {
            // Write total hours row and close table
            // Write out total hours for this machine
            printTableFooter($totalHours, $type, $percent);
            $totalHours = 0;
            // Reset total hours
            $resNo = 1;
            // Reset total reservations
            // If it is a new user, write a comment, a extra break, and the user info
            if ($newUser) {
                // Write extra break to text output
                if ($type == 'text') {
                    echo "\r\n\r\n";
                }
                if ($html) {
                    echo '<p>&nbsp</p>';
                }
                printUserInfo($rs['fname'], $rs['lname'], $rs['memberid'], $type);
            }
            // Set both newUser and newResource to false
            $newUser = false;
            $newMach = false;
            // Write next table header
            printTableHeader($rs['fname'], $rs['lname'], $rs['name'], $type, $rs['scheduletitle']);
        }
        // Keep running total of hours on this machine
        $totalHours = $totalHours + ($rs['end_date'] / 60 + $rs['endtime'] - ($rs['start_date'] / 60 + $rs['starttime']));
        // Calculate what percentage that is of total machine time
        $percent = sprintf('%.02f', $totalHours / $rs_hours[$rs['machid']] * 100);
        // Store variables
        $start_date = Time::formatDate($rs['start_date'], null, false);
        $end_date = Time::formatDate($rs['end_date'], null, false);
        $created = Time::formatDateTime($rs['created'], null, false);
        $modified = !empty($rs['modified']) ? Time::formatDateTime($rs['modified'], null, false) : translate('N/A');
        $starttime = Time::formatTime($rs['starttime'], false);
        $endtime = Time::formatTime($rs['endtime'], false);
        $totTime = $rs['end_date'] / 60 + $rs['endtime'] - ($rs['start_date'] / 60 + $rs['starttime']);
        print_reservation_data($type, $link, $resNo++, $start_date, $end_date, $created, $modified, $starttime, $endtime, $totTime, $rs['resid'], $rs['fname'], $rs['lname'], $rs['name'], $rs['memberid'], $rs['scheduletitle']);
    }
    unset($rs);
    // On last record, print out total hours
    // Write out total hours for this machine
    printTableFooter($totalHours, $type, $percent);
    if (!$html) {
        echo '</pre>';
    }
}
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:usage.php

示例7: print_signup_sheet

/**
* Prints all reservations for a given day
* @param array $reservations array of all reservation data for this day
* @param int $datestamp the unix datestamp for the first day shown
* @param int $days number of days to print out
* @param int $start_time starting time of the day for this reservation's schedule
* @param int $end_time ending time of the day for this reservation's schedule
* @param int $time_span the time span interval for this reservation's schedule
* @param string $resource_name the name of this resource
* @param bool $is_private if we are in privacy mode and should hide user details
*/
function print_signup_sheet($reservations, $datestamp, $days, $start_time, $end_time, $time_span, $resource_name, $is_private = false)
{
    echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background-color:#ffffff;\">\n<table border=\"1\" bordercolor=\"#000000\" width=\"100%\" cellspacing=\"1\" cellpadding=\"3\">\n";
    $date_vars = getdate($datestamp);
    $col_width = intval(100 / $days);
    $hour_line = array();
    $date_cells_taken = array();
    $datestamps = array();
    // This will store the datestamp for each date on the calendar
    // Print out a date header for each date in the calendar view
    echo '<tr><td>&nbsp;</td>';
    for ($day_count = 0; $day_count < $days; $day_count++) {
        $datestamps[$day_count] = mktime(0, 0, 0, $date_vars['mon'], $date_vars['mday'] + $day_count, $date_vars['year']);
        echo '<td width="' . $col_width . '%" align="center"><b>' . $resource_name . '</b><br/>' . translate_date('schedule_daily', $datestamps[$day_count]) . '</td>';
    }
    echo "</tr>\n";
    for ($i = 0; $i < count($reservations); $i++) {
        $reservations[$i]['starttime'] = Time::getAdjustedMinutes($reservations[$i]['starttime']);
        $reservations[$i]['endtime'] = Time::getAdjustedMinutes($reservations[$i]['endtime']);
        // If the reservation starts on a day other than the first day shown then just show it at the start time of the first day
        $day = $reservations[$i]['start_date'] >= $datestamp ? ($reservations[$i]['start_date'] - $datestamp) / SECONDS_IN_DAY : 0;
        // This will tell how many days ahead of the first day this reservation occurs
        // If the reseravtion ends on a day further from the last day shown, then make the endday equal to the last day
        $endday = $reservations[$i]['end_date'] <= $datestamps[$days - 1] ? ($reservations[$i]['end_date'] - $datestamp) / SECONDS_IN_DAY : $days - 1;
        // This will tell how many days ahead of the first day this reservation occurs
        // Get temporary start and end times for dates that are off the viewable days
        $starttime = $reservations[$i]['start_date'] >= $datestamp ? $reservations[$i]['starttime'] : $start_time;
        $endtime = $reservations[$i]['end_date'] <= $datestamps[$days - 1] ? $reservations[$i]['endtime'] : $end_time;
        $hour_line[$starttime][$day] =& $reservations[$i];
        // If this is a multi day reservation, make sure we populate the $hour_line of the last day/time for this reservation
        if ($day != $endday) {
            for ($d = $day + 1; $d <= $endday; $d++) {
                $hour_line[$start_time][$d] =& $reservations[$i];
            }
        }
        // Keep an array of the cells that are taken by the rowspan of another reservation
        if ($day != $endday) {
            // MULTIDAY
            for ($d = $day; $d <= $endday; $d++) {
                if ($d == $day) {
                    for ($time = $starttime; $time < $end_time; $time += $time_span) {
                        $date_cells_taken[$d][$time] = 1;
                    }
                } else {
                    if ($d == $endday) {
                        for ($time = $start_time; $time < $endtime; $time += $time_span) {
                            $date_cells_taken[$d][$time] = 1;
                        }
                    } else {
                        for ($time = $start_time; $time < $end_time; $time += $time_span) {
                            $date_cells_taken[$d][$time] = 1;
                        }
                    }
                }
            }
        } else {
            // SINGLE DAY
            for ($time = $starttime; $time < $endtime; $time += $time_span) {
                $date_cells_taken[$day][$time] = 1;
            }
        }
    }
    // The reservation data is stored in a 2D array of time (x axis) and date (y axis)
    // This simply loops through all time/date possibilities and prints out the reservation data for each cell
    for ($time = $start_time; $time < $end_time; $time += $time_span) {
        echo '<tr><td valign="top">' . Time::formatTime($time, false) . '</td>';
        for ($date = 0; $date < $days; $date++) {
            if (isset($hour_line[$time][$date])) {
                $res = $hour_line[$time][$date];
                if ($is_private) {
                    $res['fname'] = 'Private';
                    $res['lname'] = '';
                }
                $starttime = $res['starttime'];
                $endtime = $res['endtime'];
                // Set temporary start/end times for multiday reservations so that the rowspan is correct
                if ($res['start_date'] != $res['end_date']) {
                    if ($res['start_date'] == $datestamps[$date]) {
                        $endtime = $end_time;
                    } else {
                        $starttime = $start_time;
                    }
                }
                $rowspan = intval(($endtime - $starttime) / $time_span);
                echo "<td valign=\"top\" rowspan=\"{$rowspan}\" class=\"\">&#8226; ";
                echo "{$res['fname']} {$res['lname']}";
                if (!empty($res['parentid'])) {
                    echo ' <img src="img/recurring.gif" width="15" height="15" alt="' . translate('Recurring') . '" title="' . translate('Recurring') . '"/>';
                }
//.........这里部分代码省略.........
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:rescalendar.template.php

示例8: set_stats

 /**
  * Sets the stat mode
  * This will load specific labels and values
  *  to print out and will set any necessary
  *  values for this stat type
  * @param string $stat_type stat type to print
  * 			can be: MONTH, DAY_0F_WEEK, DAY_OF_MONTH, USER, RESOURCE, STARTTIME, ENDTIME
  */
 function set_stats($stat_type)
 {
     global $conf;
     $start = $this->sched['daystart'];
     $end = $this->sched['dayend'];
     $interval = $this->sched['timespan'];
     unset($this->labels);
     // Reinitialize variables
     $this->dynlabel = false;
     $this->type = $stat_type;
     switch ($stat_type) {
         case MONTH:
             $this->labels =& $this->month_names;
             $this->values =& $this->month;
             $this->total = $this->numRes;
             $this->graph_title = translate('Reservations by month');
             break;
         case DAY_OF_WEEK:
             $this->labels =& $this->day_names;
             $this->values =& $this->dayofweek;
             $this->total = $this->numRes;
             $this->graph_title = translate('Reservations by day of the week');
             break;
         case DAY_OF_MONTH:
             $this->set_label_handler('day_of_month_lbl');
             $this->values =& $this->dayofmonth;
             $this->index =& $this->month_names;
             $this->dyntot =& $this->month;
             $this->dyn_title = translate('Reservations per month');
             break;
         case USER:
             $this->labels =& $this->userids;
             $this->values =& $this->user;
             $this->total = $this->numRes;
             $this->index =& $this->machids;
             $this->dyntot =& $this->resource;
             $this->dyn_title = translate('Reservations per user');
             break;
         case RESOURCE:
             $this->labels =& $this->machids;
             $this->values =& $this->resource;
             $this->total = $this->numRes;
             $this->graph_title = translate('Reservations per resource');
             break;
         case STARTTIME:
             for ($i = $start; $i < $end; $i += $interval) {
                 $this->labels[$i] = Time::formatTime($i, false);
             }
             $this->values =& $this->starttime;
             $this->total = $this->numRes;
             $this->graph_title = translate('Reservations per start time');
             break;
         case ENDTIME:
             for ($i = $start + $interval; $i <= $end; $i += $interval) {
                 $this->labels[$i] = Time::formatTime($i, false);
             }
             $this->values =& $this->endtime;
             $this->total = $this->numRes;
             $this->graph_title = translate('Reservations per end time');
             break;
     }
 }
开发者ID:razagilani,项目名称:srrs,代码行数:70,代码来源:Stats.class.php

示例9: 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

示例10: DBEngine

* @package phpScheduleIt
*
* Copyright (C) 2003 - 2007 phpScheduleIt
* License: GPL, see LICENSE
*/
include_once 'lib/DBEngine.class.php';
if (!(bool) $conf['app']['allowRss'] || (bool) $conf['app']['allowRss'] && !isset($_GET['id'])) {
    die;
}
$db = new DBEngine();
$res = $db->get_user_reservations($_GET['id'], 'res.start_date', 'DESC', true);
global $charset;
header('Content-Type: text/xml');
echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?" . ">\n<rss version=\"2.0\">\n";
echo "<channel>\n<title>{$conf['app']['title']} Reservations</title>\n";
if (!$res) {
    echo "<item>\n";
    echo '<title>' . $db->err_msg . "</title>\n";
    echo '<link>' . CmnFns::getScriptURL() . "</link>\n";
    echo '<description>' . $db->err_msg . "</description>\n";
    echo "</item>\n";
}
for ($i = 0; $i < count($res) && $res != false; $i++) {
    $cur = $res[$i];
    echo "<item>\n";
    echo '<title>' . $cur['name'] . ' [' . Time::formatDate($cur['start_date']) . ' @ ' . Time::formatTime($cur['starttime']) . "]</title>\n";
    echo '<link>' . CmnFns::getScriptURL() . "/reserve.php?type=m&amp;resid={$cur['resid']}&amp;scheduleid={$cur['scheduleid']}" . "</link>\n";
    echo '<description>' . "</description>\n";
    echo "</item>\n";
}
echo "</channel>\n</rss>";
开发者ID:razagilani,项目名称:srrs,代码行数:31,代码来源:rss.php

示例11: print_time_info

/**
* Print out available times or current reservation's time
* This function will print out all available times to make
*  a reservation or will print out the selected reservation's time
*  (if this is a view).
* @param array $res resource data array
* @param object $rs reservation object
* @param bool $print_min_max bool whether to print the min_max cells
* @param bool $allow_multi bool if multiple day reseravtions are allowed
* @global $conf
*/
function print_time_info($res, $rs, $print_min_max = true, $allow_multi = false)
{
    global $conf;
    $type = $res->get_type();
    $interval = $res->sched['timespan'];
    $startDay = $res->sched['daystart'];
    $endDay = $res->sched['dayend'];
    ?>
    <table width="100%" border="0" cellspacing="0" cellpadding="1">
     <tr class="tableBorder">
      <td>
       <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
         <td colspan="2" class="cellColor">
         <h5 align='left'>
<?php 
    // Print message depending on viewing type
    switch ($type) {
        case RES_TYPE_ADD:
            $msg = translate('Please select the starting and ending times');
            break;
        case RES_TYPE_MODIFY:
            $msg = translate('Please change the starting and ending times');
            break;
        default:
            $msg = translate('Reserved time');
            break;
    }
    if ((bool) $res->get_pending()) {
        $msg .= ' (' . translate('Pending Approval') . ')';
    }
    echo $msg;
    ?>
        </h5>
        </td>
       </tr>
	   <tr>
	   <td class="formNames"><?php 
    echo translate('Start');
    ?>
</td>
	   <td class="formNames"><?php 
    echo translate('End');
    ?>
</td>
	   </tr>
      <tr>
<?php 
    $start_date = $res->get_start_date();
    $end_date = $res->get_end_date();
    $display_start_date = Time::getAdjustedDate($res->get_start_date(), $res->get_start());
    $display_end_date = Time::getAdjustedDate($res->get_end_date(), $res->get_end());
    // Show reserved time or select boxes depending on type
    if ($type == RES_TYPE_ADD || $type == RES_TYPE_MODIFY || $type == RES_TYPE_APPROVE) {
        // Start time select box
        echo '<td class="formNames" width="50%"><div id="div_start_date" style="float:left;width:86px;">' . Time::formatDate($display_start_date, '', false) . '</div><input type="hidden" id="hdn_start_date" name="start_date" value="' . date('m' . INTERNAL_DATE_SEPERATOR . 'd' . INTERNAL_DATE_SEPERATOR . 'Y', $start_date) . '" onchange="checkCalendarDates();"/>';
        if ($allow_multi) {
            echo '<a href="javascript:void(0);"><img src="img/calendar.gif" border="0" id="img_start_date" alt="' . translate('Start') . '"/></a>' . '<br/><br/>';
        }
        echo "<select name=\"starttime\" class=\"textbox\">\n";
        // Start at startDay time, end 30 min before endDay
        for ($i = $startDay; $i < $endDay + $interval; $i += $interval) {
            echo '<option value="' . $i . '"';
            // If this is a modification, select corrent time
            if ($res->get_start() == $i) {
                echo ' selected="selected" ';
            }
            echo '>' . Time::formatTime($i) . '</option>';
        }
        echo "</select>\n</td>\n";
        // End time select box
        echo '<td class="formNames"><div id="div_end_date" style="float:left;width:86px;">' . Time::formatDate($display_end_date, '', false) . '</div><input type="hidden" id="hdn_end_date" name="end_date" value="' . date('m' . INTERNAL_DATE_SEPERATOR . 'd' . INTERNAL_DATE_SEPERATOR . 'Y', $end_date) . '" onchange="checkCalendarDates();"/>';
        if ($allow_multi) {
            echo '<a href="javascript:void(0);"><img src="img/calendar.gif" border="0" id="img_end_date" alt="' . translate('End') . '"/></a>' . '<br/><br/>';
        }
        echo "<select name=\"endtime\" class=\"textbox\">\n";
        // Start at 30 after startDay time, end 30 at endDay time
        for ($i = $startDay; $i < $endDay + $interval; $i += $interval) {
            echo "<option value=\"{$i}\"";
            // If this is a modification, select corrent time
            if ($res->get_end() == $i) {
                echo ' selected="selected" ';
            }
            echo '>' . Time::formatTime($i) . "</option>\n";
        }
        echo "</select>\n</td>\n";
        if ($print_min_max & !$allow_multi) {
            echo '</tr><tr class="noshow">' . '<td colspan="2">' . translate('Minimum Reservation Length') . ' ' . Time::minutes_to_hours($rs['minres']) . '</td></tr>' . '<tr class="noshow">' . '<td colspan="2">' . translate('Maximum Reservation Length') . ' ' . Time::minutes_to_hours($rs['maxres']) . '</td>';
        }
//.........这里部分代码省略.........
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:reserve.template.php

示例12: showForm


//.........这里部分代码省略.........
        if ($i == $min_max['endmax']['day']) {
            echo ' selected="selected"';
        }
        echo ">{$i}</option>\n";
    }
    ?>
              </select>
              ,
              <select name="endYearMax" class="textbox">
              <?php 
    for ($i = $min_max['endmin']['year']; $i < $min_max['endmax']['year'] + 1; $i++) {
        echo "<option value=\"{$i}\"";
        if ($i == $min_max['endmax']['year']) {
            echo ' selected="selected"';
        }
        echo ">{$i}</option>\n";
    }
    ?>
              </select>
            </td>
          </tr>
          <tr class="cellColor">
            <td class="formNames"><?php 
    echo translate('Starting Time');
    ?>
</td>
            <td>
			  <?php 
    echo translate('Minimum');
    ?>
              <select name="starttimeMin" class="textbox">
              <?php 
    // Print out first time and select it
    echo "<option value=\"{$startDay}\" selected=\"selected\">" . Time::formatTime($startDay, false) . "</option>\n";
    // Print out rest of times
    for ($i = $startDay + $interval; $i < $endDay; $i += $interval) {
        echo "<option value=\"{$i}\">" . Time::formatTime($i, false) . "</option>\n";
    }
    ?>
              </select>
			  <span style="width:30px;">&nbsp;</span>
			  <?php 
    echo translate('Maximum');
    ?>
              <select name="starttimeMax" class="textbox">
              <?php 
    // Print out all times except last
    for ($i = $startDay + $interval; $i < $endDay; $i += $interval) {
        echo "<option value=\"{$i}\">" . Time::formatTime($i, false) . "</option>\n";
    }
    // Print out last time and select it
    echo "<option value=\"{$endDay}\" selected=\"selected\">" . Time::formatTime($endDay, false) . "</option>\n";
    ?>
              </select>
            </td>
          </tr>
          <tr class="cellColor">
            <td class="formNames"><?php 
    echo translate('Ending Time');
    ?>
</td>
             <td>
			  <?php 
    echo translate('Minimum');
    ?>
              <select name="endtimeMin" class="textbox">
开发者ID:razagilani,项目名称:srrs,代码行数:67,代码来源:usage.template.php

示例13: print_system_stats


//.........这里部分代码省略.........
    <td><?php 
    echo $conf['app']['use_log'] ? translate('Yes') : translate('No');
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Log file');
    ?>
</td>
    <td><?php 
    echo $conf['app']['logfile'];
    ?>
    </td>
  </tr>
  <tr><td height="1" bgcolor="#666666" colspan="2"></td></tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Admin email address');
    ?>
</td>
    <td><?php 
    echo $conf['app']['adminEmail'];
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Tech email address');
    ?>
</td>
    <td><?php 
    echo $conf['app']['techEmail'];
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('CC email addresses');
    ?>
</td>
    <td><?php 
    echo $conf['app']['ccEmail'];
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Reservation start time');
    ?>
</td>
    <td><?php 
    echo Time::formatTime($stats->startDay);
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Reservation end time');
    ?>
</td>
    <td><?php 
    echo Time::formatTime($stats->endDay);
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Days shown at a time');
    ?>
</td>
    <td><?php 
    echo $stats->sched['viewdays'];
    ?>
    </td>
  </tr>
</table>
<?php 
}
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:stats.template.php


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