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


PHP Time::minutes_to_hours方法代码示例

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


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

示例1: print_schedule_edit

/**
* Interface to add or edit schedule information
* @param mixed $rs array of schedule data
* @param boolean $edit whether this is an edit or not
* @param object $pager Pager object
*/
function print_schedule_edit($rs, $edit, &$pager)
{
    global $conf;
    ?>
<form name="addSchedule" method="post" action="admin_update.php" <?php 
    echo $edit ? "" : "onsubmit=\"return checkAddSchedule();\"";
    ?>
>
<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 width="200" class="formNames"><?php 
    echo translate('Schedule Title');
    ?>
</td>
          <td class="cellColor"><input type="text" name="scheduletitle" class="textbox" value="<?php 
    echo isset($rs['scheduletitle']) ? $rs['scheduletitle'] : '';
    ?>
" />
          </td>
        </tr>
		<tr>
		  <td class="formNames"><?php 
    echo translate('Start Time');
    ?>
</td>
		  <td class="cellColor"><select name="daystart" class="textbox">
		  <?php 
    for ($time = 0; $time <= 1410; $time += 30) {
        echo '<option value="' . $time . '"' . (isset($rs['daystart']) && $rs['daystart'] == $time ? ' selected="selected"' : '') . '>' . Time::formatTime($time, false) . '</option>' . "\n";
    }
    ?>
		  </select>
		  </td>
		</tr>
		<tr>
		  <td class="formNames"><?php 
    echo translate('End Time');
    ?>
</td>
		  <td class="cellColor"><select name="dayend" class="textbox">
		  <?php 
    for ($time = 30; $time <= 1440; $time += 30) {
        echo '<option value="' . $time . '"' . (isset($rs['dayend']) && $rs['dayend'] == $time ? ' selected="selected"' : ($time == 1440 && !isset($rs['dayend']) ? ' selected="selected"' : '')) . '>' . Time::formatTime($time, false) . '</option>' . "\n";
    }
    ?>
		  </select>
		  </td>
		</tr>
        <tr>
          <td class="formNames"><?php 
    echo translate('Time Span');
    ?>
</td>
          <td class="cellColor"><select name="timespan" class="textbox">
		  <?php 
    $spans = array(30, 10, 15, 60, 120, 180, 240);
    for ($i = 0; $i < count($spans); $i++) {
        echo '<option value="' . $spans[$i] . '"' . (isset($rs['timespan']) && $rs['timespan'] == $spans[$i] ? ' selected="selected"' : '') . '>' . Time::minutes_to_hours($spans[$i]) . '</option>' . "\n";
    }
    ?>
		  </select>
		  </td>
        </tr>
        <tr>
          <td class="formNames"><?php 
    echo translate('Weekday Start');
    ?>
</td>
          <td class="cellColor"><select name="weekdaystart" class="textbox">
		  <?php 
    for ($i = 0; $i < 7; $i++) {
        echo '<option value="' . $i . '"' . (isset($rs['weekdaystart']) && $rs['weekdaystart'] == $i ? ' selected="selected"' : '') . '>' . CmnFns::get_day_name($i) . '</option>' . "\n";
    }
    ?>
		  </select>
		  </td>
        </tr>
        <tr>
          <td class="formNames"><?php 
    echo translate('Days to Show');
    ?>
</td>
          <td class="cellColor"><input type="text" name="viewdays" class="textbox" size="2" maxlength="2" value="<?php 
    echo isset($rs['viewdays']) ? $rs['viewdays'] : '7';
    ?>
" />
          </td>
        </tr>
		<tr>
		  <td class="formNames"><?php 
    echo translate('Hidden');
//.........这里部分代码省略.........
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:admin.template.php

示例2: check_min_max

 /**
  * Check to make sure that the reservation falls within the specified reservation length
  * @param int $min minimum reservation length
  * @param int $max maximum reservation length
  * @return if the time is valid
  */
 function check_min_max()
 {
     $min = $this->resource->get_property('minres');
     $max = $this->resource->get_property('maxRes');
     if ($this->start_date < $this->end_date) {
         return true;
     }
     // Cannot have a min/max for multi-day reservations
     $this_length = $this->end - $this->start;
     $is_valid = $this_length >= $min && $this_length <= $max;
     if (!$is_valid) {
         $this->add_error(translate('Reservation length does not fall within this resource\'s allowed length.') . '<br /><br >' . translate('Your reservation is') . ' ' . Time::minutes_to_hours($this_length) . '<br />' . translate('Minimum reservation length') . ' ' . Time::minutes_to_hours($min) . '<br />' . translate('Maximum reservation length') . ' ' . Time::minutes_to_hours($max));
     }
     return $is_valid;
 }
开发者ID:razagilani,项目名称:srrs,代码行数:21,代码来源:Reservation.class.php

示例3: print_reservation_data

/**
* This function prints out the bulk of the reservation data for text and html output
*  and all of the data for xml and csv output types.
* This data is properly formatted for each output type
* @param string $type output type
* @param object $link Link object
* @param int $resNo reservation count number (not reservation id)
* @param string $start_date formatted reservation starting date string
* @param string $end_date formatted reservation ending date string
* @param string $created formatted reservation created datetime string
* @param string $modified formatted reservation modified datetime string
* @param string $starttime formatted reservation start time
* @param string $endtime formatted reservation end time
* @param float $totTime total reservation time
* @param string $resid reservation id
* @param string $fname user first name
* @param string $lname user last name
* @param string $name resource name
* @param string $memberid member id
* @param string $schedule schedule title
*/
function print_reservation_data($type, &$link, $resNo, $start_date, $end_date, $created, $modified, $starttime, $endtime, $totTime, $resid, $fname, $lname, $name, $memberid, $schedule)
{
    global $conf;
    $totTime = Time::minutes_to_hours($totTime);
    switch ($type) {
        case 'html':
            // Write out reservation info
            echo '<tr class="cellColor" align="center" style="font-weight: normal;">' . '<td>' . $resNo . "</td>\n" . '<td>' . $start_date . "</td>\n" . '<td>' . $end_date . "</td>\n" . '<td>' . $created . "</td>\n" . '<td>' . $modified . "</td>\n" . '<td>' . $starttime . "</td>\n" . '<td>' . $endtime . "</td>\n" . '<td>' . $link->getLink("javascript: reserve('m','','','" . $resid . "');", translate('Edit'), '', '', translate('Edit this reservation')) . "</td>\n" . '<td>' . $totTime . "</td>\n</tr>\n";
            break;
        case 'text':
            // Format modifed time so it tabs correctly
            if ($modified == translate('N/A')) {
                $modified = str_repeat('-', 23);
                if ($conf['app']['timeFormat'] != 24) {
                    $modified .= '-';
                }
            }
            $extraTab = $conf['app']['timeFormat'] == 24 ? "\t" : '';
            echo $resNo . "\t" . $start_date . "\t" . $end_date . "\t" . $created . "\t" . $extraTab . $modified . "\t" . $extraTab . $starttime . "\t\t" . $endtime . "\t\t" . $totTime . "\n";
            break;
        case 'xml':
            echo "&lt;reservation id=\"{$resid}\"&gt;\r\n" . "\t&lt;memberid&gt;{$memberid}&lt;/memberid&gt;\r\n" . "\t&lt;scheduletitle&gt;{$schedule}&lt;/scheduletitle&gt;\r\n" . "\t&lt;fname&gt;{$fname}&lt;/fname&gt;\r\n" . "\t&lt;lname&gt;{$lname}&lt;/lname&gt;\r\n" . "\t&lt;resourcename&gt;{$name}&lt;/resourcename&gt;\r\n" . "\t&lt;start_date&gt;{$start_date}&lt;/start_date&gt;\r\n" . "\t&lt;end_date&gt;{$end_date}&lt;/end_date&gt;\r\n" . "\t&lt;created&gt;{$created}&lt;/created&gt;\r\n" . "\t&lt;modified&gt;{$modified}&lt;/modified&gt;\r\n" . "\t&lt;starttime&gt;{$starttime}&lt;/starttime&gt;\r\n" . "\t&lt;endtime&gt;{$endtime}&lt;/endtime&gt;\r\n" . "\t&lt;totTime&gt;{$totTime}&lt;/totTime&gt;\r\n" . "&lt;/reservation&gt;\r\n";
            break;
        case 'csv':
            echo "\"{$resid}\"," . "\"{$memberid}\"," . '"' . addslashes($schedule) . '",' . '"' . addslashes($fname) . '",' . '"' . addslashes($lname) . '",' . '"' . addslashes($name) . '",' . "\"{$start_date}\"," . "\"{$end_date}\"," . "\"{$created}\"," . "\"{$modified}\"," . "\"{$starttime}\"," . "\"{$endtime}\"," . "\"{$totTime}\"\r\n";
            break;
    }
}
开发者ID:razagilani,项目名称:srrs,代码行数:49,代码来源:usage.template.php

示例4: print_reminder_box

/**
* Prints out the box where users can select when to get a reminder
* @param array $reminder_times the minutes that are shown in the selection box
* @param int $selected_minutes the currently selected minutes
* @param string $reminderid id of the reminder to modify
*/
function print_reminder_box($reminder_times, $selected_minutes, $reminderid)
{
    if (empty($reminder_times)) {
        return;
    }
    ?>
<table width="200" border="0" cellspacing="0" cellpadding="0" class="recur_box" id="repeat_table" style="margin-top:5px;">
  <tr>
    <td style="padding: 5px;">
	 <?php 
    echo '<input type="hidden" name="reminderid" id="reminderid" value="' . $reminderid . '"/>';
    echo translate('Reminder') . ' ';
    echo '<select name="reminder_minutes_prior" id="reminder_minutes_prior" class="textbox">';
    echo '<option value="0">' . translate('Never') . '</option>';
    for ($i = 0; $i < count($reminder_times); $i++) {
        echo "<option value=\"{$reminder_times[$i]} " . ($selected_minutes == $reminder_times[$i] ? 'selected="selected"' : '') . "\">" . Time::minutes_to_hours($reminder_times[$i]) . "</option>\n";
    }
    echo '</select><br/>';
    echo translate('before reservation');
    ?>
	</td>
  </tr>
</table>
<?php 
}
开发者ID:razagilani,项目名称:srrs,代码行数:31,代码来源:reserve.template.php

示例5: print_quick_stats

/**
* Prints out a quick summary of statistical information about the
*  application and system
* @param object $stats stats object with all properties set
*/
function print_quick_stats(&$stats)
{
    $color = 0;
    ?>
<a name="top"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td class="tableTitle" colspan="2"><?php 
    echo translate('At A Glance');
    ?>
</td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td width="175"><?php 
    echo translate('Total Users');
    ?>
</td>
    <td><?php 
    echo $stats->get_num_users();
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Total Resources');
    ?>
</td>
    <td><?php 
    echo $stats->get_num_rs();
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Total Reservations');
    ?>
</td>
    <td><?php 
    echo $stats->get_num_res();
    ?>
    </td>
  </tr>
  <tr><td height="1" bgcolor="#666666" colspan="2"></td></tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Max Reservation');
    ?>
</td>
    <td><?php 
    echo Time::minutes_to_hours($stats->longest);
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Min Reservation');
    ?>
</td>
    <td><?php 
    echo Time::minutes_to_hours($stats->shortest);
    ?>
    </td>
  </tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
">
    <td><?php 
    echo translate('Avg Reservation');
    ?>
</td>
    <td><?php 
    echo @Time::minutes_to_hours($stats->get_total_time() / $stats->get_num_res());
    ?>
    </td>
  </tr>
  <tr><td height="1" bgcolor="#666666" colspan="2"></td></tr>
  <tr class="cellColor<?php 
    echo $color++ % 2;
    ?>
//.........这里部分代码省略.........
开发者ID:razagilani,项目名称:srrs,代码行数:101,代码来源:stats.template.php


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