本文整理汇总了PHP中day_name函数的典型用法代码示例。如果您正苦于以下问题:PHP day_name函数的具体用法?PHP day_name怎么用?PHP day_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了day_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_week
function display_week()
{
global $vars;
$heading_html = tag('tr');
$heading_html->add(tag('th', __p('Week', 'W')));
for ($i = 0; $i < 7; $i++) {
$d = ($i + day_of_week_start()) % 7;
$heading_html->add(tag('th', day_name($d)));
}
if (!isset($vars['week']) || !isset($vars['year'])) {
soft_error(__('Invalid date.'));
}
$week_of_year = intval($vars['week']);
$year = intval($vars['year']);
$day_of_year = 1 + ($week_of_year - 1) * 7 - day_of_week(1, 1, $year);
$from_stamp = mktime(0, 0, 0, 1, $day_of_year, $year);
$start_month = date("n", $from_stamp);
$start_year = date("Y", $from_stamp);
$last_day = $day_of_year + 6;
$to_stamp = mktime(23, 59, 59, 1, $last_day, $year);
$end_month = date("n", $to_stamp);
$end_year = date("Y", $to_stamp);
$heading = month_name($start_month) . " {$start_year}";
if ($end_month != $start_month) {
$heading .= " - " . month_name($end_month) . " {$end_year}";
}
return tag('', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('table', attributes('class="phpc-main phpc-calendar"'), tag('caption', $heading), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), create_week($week_of_year, $from_stamp, $to_stamp, $year)));
}
示例2: display_month
function display_month($month, $year)
{
global $config;
$days = tag('tr');
for ($i = 0; $i < 7; $i++) {
if ($config['start_monday']) {
$d = $i + 1 % 7;
} else {
$d = $i;
}
$days->add(tag('th', day_name($d)));
}
return tag('div', month_navbar($month, $year), tag('table', attributes('class="phpc-main"', 'id="calendar"'), tag('caption', month_name($month) . " {$year}"), tag('colgroup', attributes('span="7"', 'width="1*"')), tag('thead', $days), create_month($month, $year)));
}
示例3: display_month
function display_month()
{
global $month, $year, $phpc_home_url, $phpcid;
$heading_html = tag('tr');
$heading_html->add(tag('th', __p('Week', 'W')));
for ($i = 0; $i < 7; $i++) {
$d = ($i + day_of_week_start()) % 7;
$heading_html->add(tag('th', day_name($d)));
}
$months = array();
for ($i = 1; $i <= 12; $i++) {
$m = month_name($i);
$months["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$i}&year={$year}"] = $m;
}
$years = array();
for ($i = $year - 5; $i <= $year + 5; $i++) {
$years["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$month}&year={$i}"] = $i;
}
return tag('', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('table', attributes('class="phpc-main phpc-calendar"'), tag('caption', create_dropdown_list(month_name($month), $months), create_dropdown_list($year, $years)), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), create_month($month, $year)));
}
示例4: get_vocab
$tplArrayEditEntry['pasPeriodique']['vocab'] = get_vocab('rep_type_' . $rep_type);
$affiche_period = get_vocab('rep_type_' . $rep_type);
}
//echo '<tr><td class="E"><b>'.get_vocab('rep_type').'</b> '.$affiche_period.'</td></tr>'."\n";
if ($rep_type != 0) {
//$tplArrayEditEntry['pasPeriodique']['repTypeNot0'] = true;
$opt = '';
if ($rep_type == 2) {
$nb = 0;
for ($i = 0; $i < 7; ++$i) {
$wday = ($i + $weekstarts) % 7;
if ($rep_opt[$wday]) {
if ($opt != '') {
$opt .= ', ';
}
$opt .= day_name($wday);
++$nb;
}
}
}
if ($rep_type == 6) {
$nb = 1;
$opt .= get_vocab('jour_cycle') . ' ' . $jours_c;
}
if ($opt) {
$tplArrayEditEntry['pasPeriode']['opt'] = $opt;
$tplArrayEditEntry['pasPeriode']['nb'] = $nb;
/*if ($nb == 1) {
echo '<tr><td class="E"><b>'.get_vocab('rep_rep_day').'</b> '.$opt.'</td></tr>'."\n";
} else {
示例5: array
echo "<legend></legend>\n";
$params = array('name' => 'month_type', 'options' => array(REP_MONTH_RELATIVE => get_vocab("month_relative")), 'value' => $month_type, 'disabled' => $disabled);
generate_radio($params);
// Note: the select box order does not internationalise very well and could
// do with revisiting. It assumes all languages have the same order as English
// eg "the second Wednesday" which is probably not true.
$options = array();
foreach (array('1', '2', '3', '4', '5', '-1', '-2', '-3', '-4', '-5') as $i) {
$options[$i] = get_vocab("ord_" . $i);
}
$params = array('name' => 'month_relative_ord', 'value' => $month_relative_ord, 'disabled' => $disabled, 'options' => $options, 'force_assoc' => TRUE);
generate_select($params);
$options = array();
for ($i = 0; $i < 7; $i++) {
$i_offset = ($i + $weekstarts) % 7;
$options[$RFC_5545_days[$i_offset]] = day_name($i_offset);
}
$params = array('name' => 'month_relative_day', 'value' => $month_relative_day, 'disabled' => $disabled, 'options' => $options);
generate_select($params);
echo "</fieldset>\n";
echo "</fieldset>\n";
}
// Repeat end date
echo "<div id=\"rep_end_date\">\n";
echo "<label>" . get_vocab("rep_end_date") . ":</label>\n";
genDateSelector("rep_end_", $rep_end_day, $rep_end_month, $rep_end_year, '', $disabled);
echo "</div>\n";
// Checkbox for skipping past conflicts
if (!$disabled) {
echo "<div>\n";
$params = array('label' => get_vocab("skip_conflicts") . ":", 'name' => 'skip', 'value' => !empty($skip_default));
示例6: listevents
function listevents()
{
global $list_prefix;
$EVENTS = "<select name='deletelist'>\r\n";
$count = 0;
//now we will list weekly events
$sql = "SELECT * FROM " . $list_prefix . "calendar WHERE `weekly` < '7';";
$result = db_query($sql);
if ($result) {
$rows = db_num_rows($result);
} else {
$rows = 0;
}
if ($rows > 0) {
$i = 0;
while ($i < $rows) {
$row = db_fetch_array($result);
//calculate the time
$time = $row['time'];
$hour = $time[0] . $time[1];
$min = $time[2] . $time[3];
if ($hour < 12) {
//we are in the am.
if ($hour == 0) {
$hour = "12";
}
$time = $hour . ":" . $min . "am";
} else {
//we are in the pm
$hour -= 12;
if ($hour == 0) {
$hour = "12";
}
$time = $hour . ":" . $min . "pm";
}
$EVENTS .= "<option value='" . $row['id'] . "'>" . day_name($row['weekly']) . " at " . $time . "</option>\r\n";
$count++;
$i++;
}
}
//we will do the monthly events
$sql = "SELECT * FROM " . $list_prefix . "calendar WHERE `monthly` NOT LIKE '';";
$result = db_query($sql);
if ($result) {
$rows = db_num_rows($result);
} else {
$rows = 0;
}
if ($rows > 0) {
$i = 0;
while ($i < $rows) {
$row = db_fetch_array($result);
//calculate the time
$time = $row['time'];
$hour = $time[0] . $time[1];
$min = $time[2] . $time[3];
if ($hour < 12) {
//we are in the am.
if ($hour == 0) {
$hour = "12";
}
$time = $hour . ":" . $min . "am";
} else {
//we are in the pm
$hour -= 12;
if ($hour == 0) {
$hour = "12";
}
$time = $hour . ":" . $min . "pm";
}
$EVENTS .= "<option value='" . $row['id'] . "'>Monthly on the " . $row['monthly'] . " at " . $time . "</option>\r\n";
$count++;
$i++;
}
}
//we will do yearly events
$sql = "SELECT * FROM " . $list_prefix . "calendar WHERE `yearly` NOT LIKE '';";
$result = db_query($sql);
if ($result) {
$rows = db_num_rows($result);
} else {
$rows = 0;
}
if ($rows > 0) {
$i = 0;
while ($i < $rows) {
$row = db_fetch_array($result);
//calculate the time
$time = $row['time'];
$hour = $time[0] . $time[1];
$min = $time[2] . $time[3];
if ($hour < 12) {
//we are in the am.
if ($hour == 0) {
$hour = "12";
}
$time = $hour . ":" . $min . "am";
} else {
//we are in the pm
$hour -= 12;
//.........这里部分代码省略.........
示例7: get_string
echo " ID: " . $d[$i]["id"][$j] . " Data: " . $d[$i]["data"][$j] . "\n";
}
}
}
echo "</pre>\n";
}
// Include the active cell content management routines.
// Must be included before the beginnning of the main table.
if ($javascript_cursor) {
echo "<SCRIPT language=\"JavaScript\" type=\"text/javascript\" src=\"xbLib.js\"></SCRIPT>\n";
echo "<SCRIPT language=\"JavaScript\">InitActiveCell(" . ($show_plus_link ? "true" : "false") . ", " . "false, " . "false, " . "\"{$highlight_method}\", " . "\"" . get_string('click_to_reserve', 'block_mrbs') . "\"" . ");</SCRIPT>\n";
}
echo "<table border=\"1\" cellspacing=\"0\" width=\"100%\">\n<tr>";
# Weekday name header row:
for ($weekcol = 0; $weekcol < 7; $weekcol++) {
echo "<th width=\"14%\">" . day_name(($weekcol + $weekstarts) % 7) . "</th>";
}
echo "</tr><tr>\n";
# Skip days in week before start of month:
for ($weekcol = 0; $weekcol < $weekday_start; $weekcol++) {
echo "<td bgcolor=\"#cccccc\" height=100> </td>\n";
}
# Draw the days of the month:
for ($cday = 1; $cday <= $days_in_month; $cday++) {
if ($weekcol == 0) {
echo "</tr><tr>\n";
}
echo "<td valign=top height=100 class=\"month\"><div class=\"monthday\"><a href=\"day.php?year={$year}&month={$month}&day={$cday}&area={$area}\">{$cday}</a> \n";
echo "</div>";
# Anything to display for this day?
if (isset($d[$cday]["id"][0])) {
示例8: day_name
$tplArray['jours'][$weekcol]['vacances'] = true;
$tplArray['jours'][$weekcol]['vacancesTitle'] = $sh[1];
$class .= 'vacance ';
$title = ' ' . $sh[1];
}
if ($ferie_true) {
$tplArray['jours'][$weekcol]['ferie'] = true;
$class .= 'ferie ';
}
}
//echo '<th class="jour_sem">'.PHP_EOL;
//echo '<a class="lienPlanning '.$class.'" href="day.php?year='.$temp_year.'&month='.$temp_month.'&day='.$num_day.'&area='.$area.'" title="'.$title.'">'.day_name(($weekcol + $weekstarts) % 7).' '.$num_day.' '.$temp_month2.'</a>'.PHP_EOL;
$tplArray['jours'][$weekcol]['numDay'] = $num_day;
$tplArray['jours'][$weekcol]['linkHref'] = 'day.php?year=' . $temp_year . '&month=' . $temp_month . '&day=' . $num_day . '&area=' . $area;
$tplArray['jours'][$weekcol]['linkTitle'] = $title;
$tplArray['jours'][$weekcol]['linkText'] = day_name(($weekcol + $weekstarts) % 7) . ' ' . $num_day . ' ' . $temp_month2;
/* is this day in the past ? */
if ($t < time()) {
$tplArray['jours'][$weekcol]['past'] = true;
} else {
$tplArray['jours'][$weekcol]['past'] = false;
}
if (Settings::get('jours_cycles_actif') == 'Oui' && intval($jour_cycle) > -1) {
if (intval($jour_cycle) > 0) {
$tplArray['jours'][$weekcol]['jourCycleActifFirst'] = true;
$tplArray['jours'][$weekcol]['jourCycle'] = $jour_cycle;
$tplArray['vocab']['rep_type_6'] = get_vocab('rep_type_6');
//echo '<br />'.get_vocab('rep_type_6').' '.$jour_cycle;
} else {
$tplArray['jours'][$weekcol]['jourCycleActifFirst'] = false;
$tplArray['jours'][$weekcol]['jourCycle'] = $jour_cycle;
示例9: getSchoolHolidays
if ($tt == $value) {
$ferie_true = 1;
break;
}
}
$sh = getSchoolHolidays($tt, $temp_year);
if ($sh[0] == true) {
$class .= "vacance ";
$title = " " . $sh[1];
}
if ($ferie_true) {
$class .= "ferie ";
}
}
echo '<th class="jour_sem">' . PHP_EOL;
echo '<a class="lienPlanning ' . $class . '" href="day.php?year=' . $temp_year . '&month=' . $temp_month . '&day=' . $num_day . '&area=' . $area . '" title="' . $title . '">' . day_name(($weekcol + $weekstarts) % 7) . ' ' . $num_day . ' ' . $temp_month2 . '</a>' . PHP_EOL;
if (Settings::get("jours_cycles_actif") == "Oui" && intval($jour_cycle) > -1) {
if (intval($jour_cycle) > 0) {
echo "<br />" . get_vocab("rep_type_6") . " " . $jour_cycle;
} else {
echo "<br />" . $jour_cycle;
}
}
echo '</th>' . PHP_EOL;
}
$num_week_day++;
$num_week_day = $num_week_day % 7;
}
echo '</tr>' . PHP_EOL;
echo '</thead>' . PHP_EOL;
$li = 0;
示例10: strftime
{
$num_day = strftime("%d", $t);
$temp_month = strftime("%m", $t);
$temp_month2 = strftime("%b", $t);
$temp_year = strftime("%Y", $t);
$jour_cycle = grr_sql_query1("SELECT Jours FROM ".TABLE_PREFIX."_calendrier_jours_cycle WHERE DAY='$t'");
$t += 86400;
if (!isset($correct_heure_ete_hiver) or ($correct_heure_ete_hiver == 1)) {
// Correction dans le cas d'un changement d'heure
if (heure_ete_hiver("hiver",$temp_year,0) == mktime(0,0,0,$temp_month,$num_day,$temp_year))
$t +=3600;
if (date("H",$t) == "01")
$t -=3600;
}
if ($display_day[$num_week_day] == 1) {// on n'affiche pas tous les jours de la semaine
echo "<th style=\"width:10%;\">" . day_name(($weekcol + $weekstarts)%7) . " ".$num_day. " ".$temp_month2;
if (getSettingValue("jours_cycles_actif") == "Oui" and intval($jour_cycle)>-1)
if (intval($jour_cycle)>0)
echo "<br />".get_vocab("rep_type_6")." ".$jour_cycle;
else
echo "<br />".$jour_cycle;
echo "</th>\n";
}
$num_week_day++;// Pour le calcul des jours à afficher
$num_week_day = $num_week_day % 7;// Pour le calcul des jours à afficher
}
echo "</tr>";
// Fin Affichage de la première ligne contenant les jours
// Affichage de la deuxième ligne contenant un lien "journée"
if ($_GET['pview'] != 1)
{
示例11: create_display_table
function create_display_table($heading, $contents)
{
$heading_html = tag('tr', attrs('class="ui-widget-header"'));
$heading_html->add(tag('th', __p('Week', 'W')));
for ($i = 0; $i < 7; $i++) {
$d = ($i + day_of_week_start()) % 7;
$heading_html->add(tag('th', day_name($d)));
}
return tag('div', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('div', attrs('class="phpc-sub-title phpc-month-title ui-widget-content"'), $heading), tag('table', attrs('class="phpc-month-view"'), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), tag('tbody', $contents)));
}
示例12: send_mail
//.........这里部分代码省略.........
// Infos sur la réservation
//
$reservation = '';
$reservation = $reservation.$vocab["start_of_the_booking"]." ".$start_date."\n";
$reservation = $reservation.$vocab["duration"]." ".$duration." ".$dur_units."\n";
if (trim($breve_description) != "")
$reservation = $reservation.$vocab["namebooker"].preg_replace("/ /", " ",$vocab["deux_points"])." ".$breve_description."\n";
else
$reservation = $reservation.$vocab["entryid"].$room_id."\n";
if ($description !='') {
$reservation = $reservation.$vocab["description"]." ".$description."\n";
}
// Champ additionnels
$reservation .= affichage_champ_add_mails($id_entry);
#Type de réservation
$temp = grr_sql_query1("select type_name from ".TABLE_PREFIX."_type_area where type_letter='".$row[5]."'");
if ($temp == -1) $temp = "?".$row[5]."?"; else $temp = removeMailUnicode($temp);
$reservation = $reservation.$vocab["type"].preg_replace("/ /", " ",$vocab["deux_points"])." ".$temp."\n";
if($rep_type != 0) {
$reservation = $reservation.$vocab["rep_type"]." ".$affiche_period."\n";
}
if($rep_type != 0)
{
// cas d'une periodicité "une semaine sur n", on affiche les jours de périodicité
if ($rep_type == 2)
{
$opt = "";
# Display day names according to language and preferred weekday start.
for ($i = 0; $i < 7; $i++)
{
$daynum = ($i + $weekstarts) % 7;
if ($rep_opt[$daynum]) $opt .= day_name($daynum) . " ";
}
if($opt)
$reservation = $reservation.$vocab["rep_rep_day"]." ".$opt."\n";
}
// cas d'une periodicité "Jour Cycle", on affiche le numéro du jour cycle
if ($rep_type == 6) {
if (getSettingValue("jours_cycles_actif") == "Oui")
$reservation = $reservation.$vocab["rep_type_6"].preg_replace("/ /", " ",$vocab["deux_points"]).ucfirst(substr($vocab["rep_type_6"],0,1)).$jours_cycle."\n";
}
$reservation = $reservation.$vocab["rep_end_date"]." ".$rep_end_date."\n";
}
if (($delais_option_reservation > 0) and ($option_reservation != -1))
$reservation = $reservation."*** ".$vocab["reservation_a_confirmer_au_plus_tard_le"]." ".time_date_string_jma($option_reservation,$dformat)." ***\n";
$reservation = $reservation."-----\n";
// message complet du message
$message = $message.$reservation;
// Si vous ne souhaitez plus recevoir ces messages automatiques, écrivez en ce sens au gestionnaire de Grr :
$message = $message.$vocab["msg_no_email"].getSettingValue("webmaster_email");;
$message = html_entity_decode_all_version($message);
// Fin de l'élaboration du message destiné aux utilisateurs devant recevoir les mails automatiques
//
// maintenant, on envoie le message
//
// Décommenter la ligne suivante (et une ligne un peu plus bas) si on veut, pour une ressource modérée, ne pas envoyer de mails tant que la résa n'est pas acceptée
//if ((($action != 5) and ($action!=6)) or (($action==6) and ($moderate_decision==2))) {
$sql = "SELECT u.email FROM ".TABLE_PREFIX."_utilisateurs u, ".TABLE_PREFIX."_j_mailuser_room j WHERE
(j.id_room='".protect_data_sql($room_id)."' and u.login=j.login and u.etat='actif') order by u.nom, u.prenom";
示例13: getPreviousEntryData
/**
* Gather all fields values for an entry. Used for emails to get previous
* entry state.
*
* @param int $id entry id to get data
* @param int $series 1 if this is a serie or 0
* @return bool TRUE or PEAR error object if fails
*/
function getPreviousEntryData($id, $series)
{
global $tbl_area, $tbl_entry, $tbl_repeat, $tbl_room, $enable_periods;
//
$sql = "\n SELECT e.name,\n e.description,\n e.create_by,\n r.room_name,\n a.area_name,\n e.type,\n e.room_id,\n e.repeat_id,\n e.timestamp,\n (e.end_time - e.start_time) AS tbl_e_duration,\n e.start_time AS tbl_e_start_time,\n e.end_time AS tbl_e_end_time,\n a.area_admin_email,\n r.room_admin_email";
// Here we could just use $tbl_repeat.start_time, and not use alias,
// as the last column will take precedence using mysql_fetch_array,
// but for portability purpose I will not use it.
if (1 == $series) {
$sql .= ", re.rep_type, re.rep_opt, re.rep_num_weeks,\n (re.end_time - re.start_time) AS tbl_r_duration,\n re.start_time AS tbl_r_start_time,\n re.end_time AS tbl_r_end_time,\n re.end_date AS tbl_r_end_date";
}
$sql .= "\n FROM {$tbl_entry} e, {$tbl_room} r, {$tbl_area} a ";
1 == $series ? $sql .= ', ' . $tbl_repeat . ' re ' : '';
$sql .= "\n WHERE e.room_id = r.id\n AND r.area_id = a.id\n AND e.id={$id}";
1 == $series ? $sql .= " AND e.repeat_id = re.id" : '';
//
$res = sql_query($sql);
!$res ? fatal_error(0, sql_error()) : '';
sql_count($res) < 1 ? fatal_error(0, get_string('invalid_entry_id', 'block_mrbs')) : '';
$row = sql_row_keyed($res, 0);
sql_free($res);
// Store all needed values in $mail_previous array to pass to
// notifyAdminOnDelete function (shorter than individual variables -:) )
$mail_previous['namebooker'] = $row['name'];
$mail_previous['description'] = $row['description'];
$mail_previous['createdby'] = $row['create_by'];
$mail_previous['room_name'] = $row['room_name'];
$mail_previous['area_name'] = $row['area_name'];
$mail_previous['type'] = $row['type'];
$mail_previous['room_id'] = $row['room_id'];
$mail_previous['repeat_id'] = $row['repeat_id'];
$mail_previous['updated'] = getMailTimeDateString($row[8]);
$mail_previous['area_admin_email'] = $row['area_admin_email'];
$mail_previous['room_admin_email'] = $row['room_admin_email'];
// If we use periods
if ($enable_periods) {
// If we delete a serie, start_time and end_time must
// come from $tbl_repeat, not $tbl_entry.
//
// This is not a serie
if (1 != $series) {
list($mail_previous['start_period'], $mail_previous['start_date']) = getMailPeriodDateString($row['tbl_e_start_time']);
list($mail_previous['end_period'], $mail_previous['end_date']) = getMailPeriodDateString($row['tbl_e_end_time'], -1);
// need to make DST correct in opposite direction to entry creation
// so that user see what he expects to see
$mail_previous['duration'] = $row['tbl_e_duration'] - cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
} else {
list($mail_previous['start_period'], $mail_previous['start_date']) = getMailPeriodDateString($row['tbl_r_start_time']);
list($mail_previous['end_period'], $mail_previous['end_date']) = getMailPeriodDateString($row['tbl_r_end_time'], 0);
// use getMailTimeDateString as all I want is the date
$mail_previous['rep_end_date'] = getMailTimeDateString($row['tbl_r_end_date'], FALSE);
// need to make DST correct in opposite direction to entry creation
// so that user see what he expects to see
$mail_previous['duration'] = $row['tbl_r_duration'] - cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
$mail_previous['rep_opt'] = "";
switch ($row['rep_type']) {
case 2:
case 6:
$rep_day[0] = $row['rep_opt'][0] != "0";
$rep_day[1] = $row['rep_opt'][1] != "0";
$rep_day[2] = $row['rep_opt'][2] != "0";
$rep_day[3] = $row['rep_opt'][3] != "0";
$rep_day[4] = $row['rep_opt'][4] != "0";
$rep_day[5] = $row['rep_opt'][5] != "0";
$rep_day[6] = $row['rep_opt'][6] != "0";
if ($row['rep_type'] == 6) {
$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
} else {
$mail_previous['rep_num_weeks'] = "";
}
break;
default:
$rep_day = array(0, 0, 0, 0, 0, 0, 0);
}
for ($i = 0; $i < 7; $i++) {
$wday = ($i + $weekstarts) % 7;
if ($rep_day[$wday]) {
$mail_previous['rep_opt'] .= day_name($wday) . " ";
}
}
$mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
}
toPeriodString($mail_previous['start_period'], $mail_previous['duration'], $mail_previous['dur_units']);
} else {
// This is not a serie
if (1 != $series) {
$mail_previous['start_date'] = getMailTimeDateString($row['tbl_e_start_time']);
$mail_previous['end_date'] = getMailTimeDateString($row['tbl_e_end_time']);
// need to make DST correct in opposite direction to entry creation
// so that user see what he expects to see
$mail_previous['duration'] = $row['tbl_e_duration'] - cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
} else {
//.........这里部分代码省略.........
示例14: get_vocab
echo "</pre>\n";
}
// Include the active cell content management routines.
// Must be included before the beginnning of the main table.
if ($javascript_cursor) {
echo "<script type=\"text/javascript\" src=\"xbLib.js\"></script>\n";
echo "<script type=\"text/javascript\">\n";
echo "//<![CDATA[\n";
echo "InitActiveCell(" . ($show_plus_link ? "true" : "false") . ", " . "false, " . "false, " . "\"{$highlight_method}\", " . "\"" . get_vocab("click_to_reserve") . "\"" . ");\n";
echo "//]]>\n";
echo "</script>\n";
}
echo "<table class=\"dwm_main\" id=\"month_main\">\n<tr>";
// Weekday name header row:
for ($weekcol = 0; $weekcol < 7; $weekcol++) {
echo "<th>" . day_name(($weekcol + $weekstarts) % 7) . "</th>";
}
echo "</tr><tr>\n";
// Skip days in week before start of month:
for ($weekcol = 0; $weekcol < $weekday_start; $weekcol++) {
echo "<td class=\"invalid\"><div class=\"cell_container\"> </div></td>\n";
}
// Draw the days of the month:
for ($cday = 1; $cday <= $days_in_month; $cday++) {
if ($weekcol == 0) {
echo "</tr><tr>\n";
}
echo "<td class=\"valid\">\n";
echo "<div class=\"cell_container\">\n";
echo "<div class=\"cell_header\">\n";
// first put in the day of the month
示例15: day_name
" Data: " . $d[$i]["data"][$j] . "\n";
}
}
echo "</pre>\n";
}
// Début du tableau affichant le planning
echo "<table border=\"2\" width=\"100%\">\n";
// Début affichage première ligne (intitulé des jours)
echo "<tr>";
for ($weekcol = 0; $weekcol < 7; $weekcol++)
{
$num_week_day = ($weekcol + $weekstarts)%7;
if ($display_day[$num_week_day] == 1) // on n'affiche pas tous les jours de la semaine
echo "<th style=\"width:14%;\">" . day_name($num_week_day) . "</th>\n";
}
echo "</tr>\n";
// Fin affichage première ligne (intitulé des jours)
// Début affichage des lignes affichant les réservations
// On grise les cellules appartenant au mois précédent
$weekcol = 0;
if ($weekcol != $weekday_start) {
echo "<tr>";
for ($weekcol = 0; $weekcol < $weekday_start; $weekcol++)
{
$num_week_day = ($weekcol + $weekstarts)%7;
if ($display_day[$num_week_day] == 1) // on n'affiche pas tous les jours de la semaine