本文整理汇总了PHP中time_date_string函数的典型用法代码示例。如果您正苦于以下问题:PHP time_date_string函数的具体用法?PHP time_date_string怎么用?PHP time_date_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了time_date_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output_row
function output_row($row)
{
global $ajax, $json_data;
$values = array();
// booking name
$html_name = htmlspecialchars($row['name']);
$values[] = "<a title=\"{$html_name}\" href=\"view_entry.php?id=" . $row['entry_id'] . "\">{$html_name}</a>";
// created by
$values[] = htmlspecialchars($row['create_by']);
// start time and link to day view
$date = getdate($row['start_time']);
$link = "<a href=\"day.php?day={$date['mday']}&month={$date['mon']}&year={$date['year']}&area=" . $row['area_id'] . "\">";
if (empty($row['enable_periods'])) {
$link_str = time_date_string($row['start_time']);
} else {
list(, $link_str) = period_date_string($row['start_time']);
}
$link .= "{$link_str}</a>";
// add a span with the numeric start time in the title for sorting
$values[] = "<span title=\"" . $row['start_time'] . "\"></span>" . $link;
// description
$values[] = htmlspecialchars($row['description']);
if ($ajax) {
$json_data['aaData'][] = $values;
} else {
echo "<tr>\n<td>\n";
echo implode("</td>\n<td>", $values);
echo "</td>\n</tr>\n";
}
}
示例2: generateApproveButtons
function generateApproveButtons($id, $series)
{
global $returl, $PHP_SELF;
global $entry_info_time, $entry_info_user, $repeat_info_time, $repeat_info_user;
$info_time = $series ? $repeat_info_time : $entry_info_time;
$info_user = $series ? $repeat_info_user : $entry_info_user;
$this_page = basename($PHP_SELF);
if (empty($info_time)) {
$info_title = get_vocab("no_request_yet");
} else {
$info_title = get_vocab("last_request") . ' ' . time_date_string($info_time);
if (!empty($info_user)) {
$info_title .= " " . get_vocab("by") . " {$info_user}";
}
}
echo "<tr>\n";
echo "<td>" . ($series ? get_vocab("series") : get_vocab("entry")) . ":</td>\n";
echo "<td>\n";
generateButton("approve_entry_handler.php", $id, $series, "approve", $returl, get_vocab("approve"));
generateButton($this_page, $id, $series, "reject", $returl, get_vocab("reject"));
generateButton($this_page, $id, $series, "more_info", $returl, get_vocab("more_info"), $info_title);
echo "</td>\n";
echo "</tr>\n";
}
示例3: htmlspecialchars
$area_name = htmlspecialchars($row['area_name']);
$type = $row['type'];
$room_id = $row['room_id'];
$updated = time_date_string($row['last_updated']);
// need to make DST correct in opposite direction to entry creation
// so that user see what he expects to see
$duration = $row['duration'] - cross_dst($row['start_time'], $row['end_time']);
if ($enable_periods) {
list($start_period, $start_date) = period_date_string($row['start_time']);
} else {
$start_date = time_date_string($row['start_time']);
}
if ($enable_periods) {
list(, $end_date) = period_date_string($row['end_time'], -1);
} else {
$end_date = time_date_string($row['end_time']);
}
$rep_type = 0;
if ($series == 1) {
$rep_type = $row['rep_type'];
$rep_end_date = utf8_strftime('%A %d %B %Y', $row['end_date']);
$rep_opt = $row['rep_opt'];
$rep_num_weeks = $row['rep_num_weeks'];
// I also need to set $id to the value of a single entry as it is a
// single entry from a series that is used by del_entry.php and
// edit_entry.php
// So I will look for the first entry in the series where the entry is
// as per the original series settings
$sql = "SELECT id\n FROM {$tbl_entry}\n WHERE repeat_id=\"{$id}\" AND entry_type=\"1\"\n ORDER BY start_time\n LIMIT 1";
$res = sql_query($sql);
if (!$res) {
示例4: send_mail
/**
* @param integer $action
*/
function send_mail($id_entry, $action, $dformat, $tab_id_moderes = array())
{
global $vocab, $grrSettings, $locale, $weekstarts, $enable_periods, $periods_name;
$message_erreur = '';
// $action = 1 -> Création
// $action = 2 -> Modification
// $action = 3 -> Suppression
// $action = 4 -> Suppression automatique
// $action = 5 -> réservation en attente de modération
// $action = 6 -> Résultat d'une décision de modération
// $action = 7 -> Notification d'un retard dans la restitution d'une ressource.
/* fixme faire le tri entre phpMailer et la class my_mailer */
/* todo ajouter un $port smtp dans les settings */
require_once 'phpmailer/PHPMailerAutoload.php';
define('GRR_FROM', Settings::get('grr_mail_from'));
define('GRR_FROMNAME', Settings::get('grr_mail_fromname'));
require_once './include/mail.inc.php';
//$m = new my_phpmailer();
$mail = new PHPMailer();
if (Settings::get('grr_mail_method') == 'smtp') {
$smtpUsername = Settings::get('grr_mail_Username');
$smtpPassword = Settings::get('grr_mail_Password');
if ($smtpUsername != "") {
$mail->SMTPAuth = true;
$mail->Username = $smtpUsername;
$mail->Password = $smtpPassword;
} else {
$mail->SMTPAuth = false;
}
$mail->Host = Settings::get('grr_mail_smtp');
$mail->Port = 587;
$mail->isSMTP();
} else {
$mail->isSendMail();
}
//$mail->SMTPDebug = 2;
//$mail->Debugoutput = 'html';
$mail->CharSet = 'UTF-8';
$mail->setFrom(GRR_FROM, GRR_FROMNAME);
$mail->SetLanguage("fr", "./phpmailer/language/");
setlocale(LC_ALL, $locale);
$sql = "SELECT " . TABLE_PREFIX . "_entry.name,\n\t" . TABLE_PREFIX . "_entry.description,\n\t" . TABLE_PREFIX . "_entry.beneficiaire,\n\t" . TABLE_PREFIX . "_room.room_name,\n\t" . TABLE_PREFIX . "_area.area_name,\n\t" . TABLE_PREFIX . "_entry.type,\n\t" . TABLE_PREFIX . "_entry.room_id,\n\t" . TABLE_PREFIX . "_entry.repeat_id,\n\t" . grr_sql_syntax_timestamp_to_unix("" . TABLE_PREFIX . "_entry.timestamp") . ",\n\t(" . TABLE_PREFIX . "_entry.end_time - " . TABLE_PREFIX . "_entry.start_time),\n\t" . TABLE_PREFIX . "_entry.start_time,\n\t" . TABLE_PREFIX . "_entry.end_time,\n\t" . TABLE_PREFIX . "_room.area_id,\n\t" . TABLE_PREFIX . "_room.delais_option_reservation,\n\t" . TABLE_PREFIX . "_entry.option_reservation,\n\t" . TABLE_PREFIX . "_entry.moderate,\n\t" . TABLE_PREFIX . "_entry.beneficiaire_ext,\n\t" . TABLE_PREFIX . "_entry.jours,\n\t" . TABLE_PREFIX . "_entry.clef,\n\t" . TABLE_PREFIX . "_entry.courrier\n\tFROM " . TABLE_PREFIX . "_entry, " . TABLE_PREFIX . "_room, " . TABLE_PREFIX . "_area\n\tWHERE " . TABLE_PREFIX . "_entry.room_id = " . TABLE_PREFIX . "_room.id\n\tAND " . TABLE_PREFIX . "_room.area_id = " . TABLE_PREFIX . "_area.id\n\tAND " . TABLE_PREFIX . "_entry.id='" . protect_data_sql($id_entry) . "'\n\t";
$res = grr_sql_query($sql);
if (!$res) {
fatal_error(0, grr_sql_error());
}
if (grr_sql_count($res) < 1) {
fatal_error(0, get_vocab('invalid_entry_id'));
}
$row = grr_sql_row($res, 0);
grr_sql_free($res);
get_planning_area_values($row[12]);
$breve_description = bbcode(removeMailUnicode(htmlspecialchars($row[0])), 'nobbcode');
$description = bbcode(removeMailUnicode(htmlspecialchars($row[1])), 'nobbcode');
$beneficiaire = htmlspecialchars($row[2]);
$room_name = removeMailUnicode(htmlspecialchars($row[3]));
$area_name = removeMailUnicode(htmlspecialchars($row[4]));
$room_id = $row[6];
$repeat_id = $row[7];
$date_avis = strftime("%Y/%m/%d", $row[10]);
$delais_option_reservation = $row[13];
$option_reservation = $row[14];
$moderate = $row[15];
$beneficiaire_ext = htmlspecialchars($row[16]);
$jours_cycle = htmlspecialchars($row[17]);
$duration = $row[9];
if ($enable_periods == 'y') {
list($start_period, $start_date) = period_date_string($row[10]);
} else {
$start_date = time_date_string($row[10], $dformat);
}
$rep_type = 0;
if ($repeat_id != 0) {
$res = grr_sql_query("SELECT rep_type, end_date, rep_opt, rep_num_weeks FROM " . TABLE_PREFIX . "_repeat WHERE id='" . protect_data_sql($repeat_id) . "'");
if (!$res) {
fatal_error(0, grr_sql_error());
}
$test = grr_sql_count($res);
if ($test != 1) {
fatal_error(0, "Deux reservation on le meme ID.");
} else {
$row2 = grr_sql_row($res, 0);
$rep_type = $row2[0];
$rep_end_date = strftime($dformat, $row2[1]);
$rep_opt = $row2[2];
$rep_num_weeks = $row2[3];
}
grr_sql_free($res);
}
if ($enable_periods == 'y') {
toPeriodString($start_period, $duration, $dur_units);
} else {
toTimeString($duration, $dur_units);
}
$weeklist = array("unused", "every week", "week 1/2", "week 1/3", "week 1/4", "week 1/5");
if ($rep_type == 2) {
$affiche_period = $vocab[$weeklist[$rep_num_weeks]];
//.........这里部分代码省略.........
示例5: list
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 {
echo '<tr><td class="E"><b>'.get_vocab('rep_rep_days').'</b> '.$opt.'</td></tr>'."\n";
}*/
} else {
$tplArrayEditEntry['pasPeriode']['opt'] = false;
}
if ($enable_periods == 'y') {
list($start_period, $start_date) = period_date_string($start_time);
} else {
$start_date = time_date_string($start_time, $dformat);
}
$duration = $end_time - $start_time;
if ($enable_periods == 'y') {
toPeriodString($start_period, $duration, $dur_units);
} else {
toTimeString($duration, $dur_units, true);
}
$tplArrayEditEntry['pasPeriode']['startDate'] = $start_date;
$tplArrayEditEntry['pasPeriode']['duration'] = $duration;
$tplArrayEditEntry['pasPeriode']['durUnits'] = $dur_units;
$tplArrayEditEntry['pasPeriode']['repEndDate'] = $rep_end_date;
/*echo '<tr><td class="E"><b>'.get_vocab('date').get_vocab('deux_points').'</b> '.$start_date.'</td></tr>'."\n";
echo '<tr><td class="E"><b>'.get_vocab('duration').'</b> '.$duration.' '.$dur_units.'</td></tr>'."\n";
echo '<tr><td class="E"><b>'.get_vocab('rep_end_date').'</b> '.$rep_end_date.'</td></tr>'."\n";*/
}
示例6: Header
# Go back to the admin page
Header("Location: admin.php");
} else {
print_header($day, $month, $year, $area);
# We tell them how bad what theyre about to do is
# Find out how many appointments would be deleted
$sql = "select name, start_time, end_time from mrbs_entry where room_id={$room}";
$res = sql_query($sql);
if (!$res) {
echo sql_error();
} elseif (sql_count($res) > 0) {
echo get_vocab("deletefollowing") . ":<ul>";
for ($i = 0; $row = sql_row($res, $i); $i++) {
echo "<li>{$row['0']} (";
echo time_date_string($row[1]) . " -> ";
echo time_date_string($row[2]) . ")";
}
echo "</ul>";
}
echo "<center>";
echo "<H1>" . get_vocab("sure") . "</h1>";
echo "<H1><a href=\"del.php?type=room&room={$room}&confirm=Y\">" . get_vocab("YES") . "!</a> <a href=admin.php>" . get_vocab("NO") . "!</a></h1>";
echo "</center>";
include "trailer.inc";
}
}
if ($type == "area") {
# We are only going to let them delete an area if there are
# no rooms. its easier
$n = sql_query1("select count(*) from mrbs_room where area_id={$area}");
if ($n == 0) {
示例7: send_mail
function send_mail($id_entry,$action,$dformat,$tab_id_moderes=array())
{
$message_erreur = "";
// $action = 1 -> Création
// $action = 2 -> Modification
// $action = 3 -> Suppression
// $action = 4 -> Suppression automatique
// $action = 5 -> réservation en attente de modération
// $action = 6 -> Résultat d'une décision de modération
// $action = 7 -> Notification d'un retard dans la restitution d'une ressource.
global $vocab, $grrSettings, $locale, $weekstarts, $enable_periods, $periods_name;
require_once ("./include/mail.inc.php");
$m= new my_phpmailer();
$m->SetLanguage("fr","./phpmailer/language/");
setlocale(LC_ALL,$locale);
// Récupération des données concernant la réservation
$sql = "
SELECT ".TABLE_PREFIX."_entry.name,
".TABLE_PREFIX."_entry.description,
".TABLE_PREFIX."_entry.beneficiaire,
".TABLE_PREFIX."_room.room_name,
".TABLE_PREFIX."_area.area_name,
".TABLE_PREFIX."_entry.type,
".TABLE_PREFIX."_entry.room_id,
".TABLE_PREFIX."_entry.repeat_id,
" . grr_sql_syntax_timestamp_to_unix("".TABLE_PREFIX."_entry.timestamp") . ",
(".TABLE_PREFIX."_entry.end_time - ".TABLE_PREFIX."_entry.start_time),
".TABLE_PREFIX."_entry.start_time,
".TABLE_PREFIX."_entry.end_time,
".TABLE_PREFIX."_room.area_id,
".TABLE_PREFIX."_room.delais_option_reservation,
".TABLE_PREFIX."_entry.option_reservation,
".TABLE_PREFIX."_entry.moderate,
".TABLE_PREFIX."_entry.beneficiaire_ext,
".TABLE_PREFIX."_entry.jours
FROM ".TABLE_PREFIX."_entry, ".TABLE_PREFIX."_room, ".TABLE_PREFIX."_area
WHERE ".TABLE_PREFIX."_entry.room_id = ".TABLE_PREFIX."_room.id
AND ".TABLE_PREFIX."_room.area_id = ".TABLE_PREFIX."_area.id
AND ".TABLE_PREFIX."_entry.id='".protect_data_sql($id_entry)."'
";
$res = grr_sql_query($sql);
if (! $res) fatal_error(0, grr_sql_error());
if(grr_sql_count($res) < 1) fatal_error(0, get_vocab('invalid_entry_id'));
$row = grr_sql_row($res, 0);
grr_sql_free($res);
// Récupération des données concernant l'affichage du planning du domaine
/*Renvoie les paramètres d'affichage du domaine
Cas où les créneaux sont basés sur les intitulés :
$enable_periods = y
Dans ce cas chaque créneau correspond à une minute entre 12 h et 12 h 59 (on peut donc définir au plus 59 créneaux !)
$periods_name[] = tableau des intitulés des créneaux
$resolution = 60 : on impose un « pas » de 60 secondes, c'est-à-dire 1 minute
$morningstarts = 12 : début des réservation à 12 h
$eveningends = 12 :heure de fin des réservations : 12 h
$eveningends_minutes : nombre de minutes à ajouter à l'heure $eveningends pour avoir la fin réelle d'une journée. Dans ce cas, il est égal à : (nombre d'intitulé – 1)
$weekstarts =
$twentyfourhour_format = $row_[6];
Cas où les créneaux sont basés sur le temps
$enable_periods = n
$resolution
$morningstarts
$eveningends
$eveningends_minutes
$weekstarts
$twentyfourhour_format
*/
get_planning_area_values($row[12]);
$breve_description = bbcode(removeMailUnicode(grr_htmlSpecialChars($row[0])),'nobbcode');
$description = bbcode(removeMailUnicode(grr_htmlSpecialChars($row[1])),'nobbcode');
$beneficiaire = grr_htmlSpecialChars($row[2]);
$room_name = removeMailUnicode(grr_htmlSpecialChars($row[3]));
$area_name = removeMailUnicode(grr_htmlSpecialChars($row[4]));
$type = $row[5];
$room_id = $row[6];
$repeat_id = $row[7];
$updated = time_date_string($row[8],$dformat);
$date_avis = strftime("%Y/%m/%d",$row[10]);
$delais_option_reservation = $row[13];
$option_reservation = $row[14];
$moderate = $row[15];
$beneficiaire_ext = grr_htmlSpecialChars($row[16]);
$jours_cycle = grr_htmlSpecialChars($row[17]);
$duration = $row[9];
if($enable_periods=='y')
list( $start_period, $start_date) = period_date_string($row[10]);
else
$start_date = time_date_string($row[10],$dformat);
if($enable_periods=='y')
list( , $end_date) = period_date_string($row[11], -1);
else
$end_date = time_date_string($row[11],$dformat);
$rep_type = 0;
//.........这里部分代码省略.........
示例8: display_entry_row
function display_entry_row($row)
{
echo "<tr>\n";
echo "<td> </td>\n";
// reservation name, with a link to the view_entry page
echo "<td>";
echo "<a href=\"view_entry.php?id=" . $row['id'] . "\">" . htmlspecialchars($row['name']) . "</a></td>\n";
// create_by, area and room names
echo "<td>" . htmlspecialchars($row['create_by']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['area_name']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['room_name']) . "</td>\n";
// start date, with a link to the day.php
$link = getdate($row['start_time']);
echo "<td>";
// <span> for sorting
echo "<span title=\"" . $row['start_time'] . "\"></span>";
echo "<a href=\"day.php?day={$link['mday']}&month={$link['mon']}&year={$link['year']}&area=" . $row['area_id'] . "\">";
if (empty($row['enable_periods'])) {
$link_str = time_date_string($row['start_time']);
} else {
list(, $link_str) = period_date_string($row['start_time']);
}
echo "{$link_str}</a></td>";
// action buttons
echo "<td>\n";
display_buttons($row, FALSE);
echo "</td>\n";
echo "</tr>\n";
}
示例9: htmlspecialchars
$area_name = htmlspecialchars($row[4]);
$type = $row[5];
$room_id = $row[6];
$updated = time_date_string(MDB_Date::mdbstamp2Unix($row[7]));
# need to make DST correct in opposite direction to entry creation
# so that user see what he expects to see
$duration = $row[8] - cross_dst($row[9], $row[10]);
if ($enable_periods) {
list($start_period, $start_date) = period_date_string($row[9]);
} else {
$start_date = time_date_string($row[9]);
}
if ($enable_periods) {
list(, $end_date) = period_date_string($row[10], -1);
} else {
$end_date = time_date_string($row[10]);
}
$rep_type = 0;
if ($series == 1) {
$rep_type = $row[11];
$rep_end_date = utf8_strftime('%A %d %B %Y', $row[12]);
$rep_opt = $row[13];
$rep_num_weeks = $row[14];
# I also need to set $id to the value of a single entry as it is a
# single entry from a series that is used by del_entry.php and
# edit_entry.php
# So I will look for the first entry in the series where the entry is
# as per the original series settings
$types = array('integer');
$sql = "\nSELECT id\nFROM {$tbl_entry}\nWHERE repeat_id=\"{$id}\"\n AND entry_type=\"1\"\n";
# ORDER BY start_time";
示例10: htmlspecialchars
<TH><?php
echo $vocab["createdby"];
?>
</TH>
<TH><?php
echo $vocab["namebooker"];
?>
</TH>
<TH><?php
echo $vocab["description"];
?>
</TH>
<TH><?php
echo $vocab["start_date"];
?>
</TH>
</TR>
<?php
for ($i = 0; $row = sql_row($result, $i); $i++) {
echo "<TR>";
echo "<TD><A HREF=\"view_entry.php?id={$row['0']}\">{$vocab['view']}</A></TD>\n";
echo "<TD>" . htmlspecialchars($row[1]) . "</TD>\n";
echo "<TD>" . htmlspecialchars($row[2]) . "</TD>\n";
echo "<TD>" . htmlspecialchars($row[3]) . "</TD>\n";
// generate a link to the day.php
$link = getdate($row[4]);
echo "<TD><A HREF=\"day.php?day={$link['mday']}&month={$link['mon']}&year={$link['year']}&area={$row['5']}\">" . time_date_string($row[4]) . "</A></TD>";
echo "</TR>\n";
}
echo "</TABLE>\n";
include "trailer.inc";
示例11: display_entry_row
function display_entry_row($row)
{
echo "<tr>\n";
echo "<td class=\"control\"> </td>\n";
// reservation name, with a link to the view_entry page
echo "<td>";
echo "<a href=\"view_entry/id:" . $row['id'] . "\">" . htmlspecialchars($row['name']) . "</a></td>\n";
// create_by, area and room names
echo "<td>" . htmlspecialchars($row['create_by']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['area_name']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['room_name']) . "</td>\n";
// start date, with a link to the day.php
$link = getdate($row['start_time']);
echo "<td>";
$url = formatURLFull($link[year], $link[mon], $link[mday], $row['area_id'], NULL);
echo "<a href=\"day/{$url}\">";
if (empty($row['enable_periods'])) {
$link_str = time_date_string($row['start_time']);
} else {
list(, $link_str) = period_date_string($row['start_time']);
}
echo "{$link_str}</a></td>";
// action buttons
echo "<td>\n";
display_buttons($row, FALSE);
echo "</td>\n";
echo "</tr>\n";
}
示例12: get_vocab
?>
</th>
<th><?php
echo get_vocab("start_date");
?>
</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_row_keyed($result, $i); $i++) {
echo "<tr>\n";
echo "<td><a href=\"view_entry.php?id=" . $row['entry_id'] . "\">" . get_vocab("view") . "</a></td>\n";
echo "<td>" . htmlspecialchars($row['create_by']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['name']) . "</td>\n";
echo "<td>" . htmlspecialchars($row['description']) . "</td>\n";
// generate a link to the day.php
$link = getdate($row['start_time']);
echo "<td><a href=\"day.php?day={$link['mday']}&month={$link['mon']}&year={$link['year']}&area=" . $row['area_id'] . "\">";
if (empty($enable_periods)) {
$link_str = time_date_string($row['start_time']);
} else {
list(, $link_str) = period_date_string($row['start_time']);
}
echo "{$link_str}</a></td>";
echo "</tr>\n";
}
echo "</tbody>\n";
echo "</table>\n";
require_once "trailer.inc";
示例13: print_header
//print the page header
print_header("", "", "", $type = "with_session");
echo "<div class=\"page_sans_col_gauche\">";
//We tell them how bad what theyre about to do is
//Find out how many appointments would be deleted
$sql = "SELECT name, start_time, end_time FROM " . TABLE_PREFIX . "_entry WHERE room_id={$room}";
$res = grr_sql_query($sql);
if (!$res) {
echo grr_sql_error();
} else {
if (grr_sql_count($res) > 0) {
echo get_vocab("deletefollowing") . ":<ul>";
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
echo "<li>{$row['0']} (";
echo time_date_string($row[1], $dformat) . " -> ";
echo time_date_string($row[2], $dformat) . ")";
}
echo "</ul>";
}
}
echo "<h1 style=\"text-align:center;\">" . get_vocab("sure") . "</h1>";
echo "<h1 style=\"text-align:center;\"><a href=\"admin_room_del.php?type=room&room={$room}&confirm=Y&id_area={$id_area}\">" . get_vocab("YES") . "!</a> <a href=\"admin_room.php?id_area={$id_area}\">" . get_vocab("NO") . "!</a></h1>";
echo "</div>";
}
}
if ($type == "area") {
// Seul l'admin peut supprimer un domaine
if (authGetUserLevel(getUserName(), $id_area, 'area') < 5) {
showAccessDenied($back);
exit;
}
示例14: reporton
//.........这里部分代码省略.........
// Description:
if ($output_as_csv) {
$line = csv_row_add_value($line, $row['description']);
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("description") . ":</td>\n";
echo "<td>" . escape($row['description']) . "</td>\n";
echo "</tr>\n";
}
// Entry Type:
$et = empty($typel[$row['type']]) ? "?" . $row['type'] . "?" : $typel[$row['type']];
if ($output_as_csv) {
$line = csv_row_add_value($line, $et);
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("type") . ":</td>\n";
echo "<td>" . escape($et) . "</td>\n";
echo "</tr>\n";
}
// Created by:
if ($output_as_csv) {
$line = csv_row_add_value($line, $row['create_by']);
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("createdby") . ":</td>\n";
echo "<td>" . escape($row['create_by']) . "</td>\n";
echo "</tr>\n";
}
// Confirmation status
if ($confirmation_somewhere) {
// Translate the status field bit into meaningful text
if ($row['confirmation_enabled']) {
$confirmation_status = $row['status'] & STATUS_TENTATIVE ? get_vocab("tentative") : get_vocab("confirmed");
} else {
$confirmation_status = '';
}
// Now output the text
if ($output_as_csv) {
$line = csv_row_add_value($line, $confirmation_status);
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("confirmation_status") . ":</td>\n";
echo "<td>" . escape($confirmation_status) . "</td>\n";
echo "</tr>\n";
}
}
// Approval status
if ($approval_somewhere) {
// Translate the status field bit into meaningful text
if ($row['approval_enabled']) {
$approval_status = $row['status'] & STATUS_AWAITING_APPROVAL ? get_vocab("awaiting_approval") : get_vocab("approved");
} else {
$approval_status = '';
}
// Now output the text
if ($output_as_csv) {
$line = csv_row_add_value($line, $approval_status);
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("approval_status") . ":</td>\n";
echo "<td>" . escape($approval_status) . "</td>\n";
echo "</tr>\n";
}
}
// Now do any custom fields
foreach ($custom_fields as $key => $value) {
// Output a yes/no if it's a boolean or integer <= 2 bytes (which we will
// assume are intended to be booleans)
if ($field_natures[$key] == 'boolean' || $field_natures[$key] == 'integer' && isset($field_lengths[$key]) && $field_lengths[$key] <= 2) {
$output = empty($row[$key]) ? get_vocab("no") : get_vocab("yes");
} else {
$output = isset($row[$key]) ? $row[$key] : '';
}
if ($output_as_csv) {
$line = csv_row_add_value($line, $output);
} else {
echo "<tr>\n";
echo "<td>" . get_loc_field_name($tbl_entry, $key) . ":</td>\n";
echo "<td>" . escape($output) . "</td>\n";
echo "</tr>\n";
}
}
// Last updated:
if ($output_as_csv) {
$line = csv_row_add_value($line, time_date_string($row['last_updated']));
} else {
echo "<tr>\n";
echo "<td>" . get_vocab("lastupdate") . ":</td>\n";
echo "<td>" . time_date_string($row['last_updated']) . "</td>\n";
echo "</tr>\n";
}
if ($output_as_csv) {
// terminate and output the line
$line .= $csv_row_sep;
echo $line;
} else {
echo "</table>\n";
echo "</div>\n\n";
}
}
示例15: sql_query
// We tell them how bad what theyre about to do is
// Find out how many appointments would be deleted
$sql = "select name, start_time, end_time from {$tbl_entry} where room_id={$room}";
$res = sql_query($sql);
if (!$res) {
echo sql_error();
} else {
if (sql_count($res) > 0) {
echo "<p>\n";
echo get_vocab("deletefollowing") . ":\n";
echo "</p>\n";
echo "<ul>\n";
for ($i = 0; $row = sql_row_keyed($res, $i); $i++) {
echo "<li>" . htmlspecialchars($row['name']) . " (";
echo time_date_string($row['start_time']) . " -> ";
echo time_date_string($row['end_time']) . ")</li>\n";
}
echo "</ul>\n";
}
}
echo "<div id=\"del_room_confirm\">\n";
echo "<p>" . get_vocab("sure") . "</p>\n";
echo "<div id=\"del_room_confirm_links\">\n";
echo "<a href=\"del.php?type=room&room={$room}&confirm=Y\"><span id=\"del_yes\">" . get_vocab("YES") . "!</span></a>\n";
echo "<a href=\"admin.php\"><span id=\"del_no\">" . get_vocab("NO") . "!</span></a>\n";
echo "</div>\n";
echo "</div>\n";
include "trailer.inc";
}
}
if ($type == "area") {