function invalid_booking($message) { global $day, $month, $year, $area, $room; print_header($day, $month, $year, $area, isset($room) ? $room : ""); echo "<h1>" . get_vocab('invalid_booking') . "</h1>\n"; echo "<p>{$message}</p>\n"; // Print footer and exit print_footer(TRUE); }
function create_field_entry_timezone() { global $timezone, $zoneinfo_outlook_compatible; $special_group = "Others"; echo "<div>\n"; echo "<label for=\"area_timezone\">" . get_vocab("timezone") . ":</label>\n"; // If possible we'll present a list of timezones that this server supports and // which also have a corresponding VTIMEZONE definition. // Otherwise we'll just have to let the user type in a timezone, which introduces // the possibility of an invalid timezone. if (function_exists('timezone_identifiers_list')) { $timezones = array(); $timezone_identifiers = timezone_identifiers_list(); foreach ($timezone_identifiers as $value) { if (strpos($value, '/') === FALSE) { // There are some timezone identifiers (eg 'UTC') on some operating // systems that don't fit the Continent/City model. We'll put them // into the special group $continent = $special_group; $city = $value; } else { // Note: timezone identifiers can have three components, eg // America/Argentina/Tucuman. To keep things simple we will // treat anything after the first '/' as a single city and // limit the explosion to two list($continent, $city) = explode('/', $value, 2); } // Check that there's a VTIMEZONE definition $tz_dir = $zoneinfo_outlook_compatible ? TZDIR_OUTLOOK : TZDIR; $tz_file = "{$tz_dir}/{$value}.ics"; // UTC is a special case because we can always produce UTC times in iCalendar if ($city == 'UTC' || file_exists($tz_file)) { $timezones[$continent][] = $city; } } echo "<select id=\"area_timezone\" name=\"area_timezone\">\n"; foreach ($timezones as $continent => $cities) { if (count($cities) > 0) { echo "<optgroup label=\"" . htmlspecialchars($continent) . "\">\n"; foreach ($cities as $city) { if ($continent == $special_group) { $timezone_identifier = $city; } else { $timezone_identifier = "{$continent}/{$city}"; } echo "<option value=\"" . htmlspecialchars($timezone_identifier) . "\"" . ($timezone_identifier == $timezone ? " selected=\"selected\"" : "") . ">" . htmlspecialchars($city) . "</option>\n"; } echo "</optgroup>\n"; } } echo "</select>\n"; } else { echo "<input id=\"area_timezone\" name=\"area_timezone\" value=\"" . htmlspecialchars($timezone) . "\">\n"; } echo "</div>\n"; }
function get_loc_field_name($name) { global $vocab; // Search for indexes "user_name", "user_password", etc, in the localization array. if (isset($vocab["user_" . $name])) { return get_vocab("user_" . $name); } // If there is no entry (likely if user-defined fields have been added), return itself. return $name; }
function generateOwnerButtons($id, $series) { global $user, $create_by, $status, $area; global $PHP_SELF, $reminders_enabled, $last_reminded, $reminder_interval; $this_page = basename($PHP_SELF); // Remind button if you're the owner AND there's a booking awaiting // approval AND sufficient time has passed since the last reminder // AND we want reminders in the first place if ($reminders_enabled && $user == $create_by && $status & STATUS_AWAITING_APPROVAL && working_time_diff(time(), $last_reminded) >= $reminder_interval) { echo "<tr>\n"; echo "<td> </td>\n"; echo "<td>\n"; generateButton("approve_entry_handler.php", $id, $series, "remind", $this_page . "?id={$id}&area={$area}", get_vocab("remind_admin")); echo "</td>\n"; echo "</tr>\n"; } }
function display_series_header($row, $table_id) { echo "<tr>"; // no \n so as not to create another child in the DOM echo "<th class=\"control\" onClick=\"toggle_table('{$table_id}')\"> </th>\n"; // reservation name, with a link to the view_entry page echo "<th class=\"header_name\"><a href=\"view_entry/id:" . $row['repeat_id'] . "-series:1\">" . htmlspecialchars($row['name']) . "</a></th>\n"; // create_by, area and room names echo "<th class=\"header_create\">" . htmlspecialchars($row['create_by']) . "</th>\n"; echo "<th class=\"header_area\">" . htmlspecialchars($row['area_name']) . "</th>\n"; echo "<th class=\"header_room\">" . htmlspecialchars($row['room_name']) . "</th>\n"; echo "<th class=\"header_start_time\">" . get_vocab("series") . "</th>\n"; echo "<th class=\"header_action\">\n"; display_buttons($row, TRUE); echo "</th>\n"; echo "</tr>\n"; }
/** * admin_col_gauche.php * colonne de gauche des écrans d'administration * des sites, des domaines et des ressources de l'application GRR * Dernière modification : $Date: 2010-04-07 15:38:13 $ * @author Laurent Delineau <*****@*****.**> * @author Marc-Henri PAMISEUX <*****@*****.**> * @copyright Copyright 2003-2008 Laurent Delineau * @copyright Copyright 2008 Marc-Henri PAMISEUX * @link http://www.gnu.org/licenses/licenses.html * @package admin * @version $Id: admin_col_gauche.php,v 1.13 2010-04-07 15:38:13 grr Exp $ * @filesource * * This file is part of GRR. * * GRR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GRR is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRR; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function affichetableau($liste, $titre = '') { global $chaine, $vocab; if (count($liste) > 0) { echo "<fieldset>\n"; echo "<legend>{$titre}</legend><ul>\n"; $k = 0; foreach ($liste as $key) { if ($chaine == $key) { echo "<li><span class=\"bground\"><b>" . get_vocab($key) . "</b></span></li>\n"; } else { echo "<li><a href='" . $key . "'>" . get_vocab($key) . "</a></li>\n"; } $k++; } echo "</ul></fieldset>\n"; } }
function generate_search_nav_html($search_pos, $total, $num_records, $search_str) { global $day, $month, $year; global $search; $html = ''; $has_prev = $search_pos > 0; $has_next = $search_pos < $total - $search["count"]; if ($has_prev || $has_next) { $html .= "<div id=\"record_numbers\">\n"; $html .= get_vocab("records") . ($search_pos + 1) . get_vocab("through") . ($search_pos + $num_records) . get_vocab("of") . $total; $html .= "</div>\n"; $html .= "<div id=\"record_nav\">\n"; $base_query_string = "search_str=" . urlencode($search_str) . "&" . "total={$total}&" . "from_year={$year}&" . "from_month={$month}&" . "from_day={$day}"; // display a "Previous" button if necessary if ($has_prev) { $query_string = $base_query_string . "&search_pos=" . max(0, $search_pos - $search["count"]); $html .= "<a href=\"search.php?{$query_string}\">"; } $html .= get_vocab("previous"); if ($has_prev) { $html .= "</a>"; } // add a separator for Next and Previous $html .= " | "; // display a "Previous" button if necessary if ($has_next) { $query_string = $base_query_string . "&search_pos=" . max(0, $search_pos + $search["count"]); $html .= "<a href=\"search.php?{$query_string}\">"; } $html .= get_vocab("next"); if ($has_next) { $html .= "</a>"; } $html .= "</div>\n"; } return $html; }
function do_summary(&$count, &$hours, &$room_hash, &$name_hash) { global $enable_periods; // Make a sorted array of area/rooms, and of names, to use for column // and row indexes. Use the rooms and names hashes built by accumulate(). // At PHP4 we could use array_keys(). reset($room_hash); while (list($room_key) = each($room_hash)) { $rooms[] = $room_key; } ksort($rooms); reset($name_hash); while (list($name_key) = each($name_hash)) { $names[] = $name_key; } ksort($names); $n_rooms = sizeof($rooms); $n_names = sizeof($names); echo "<div id=\"div_summary\">\n"; echo "<h1>" . (empty($enable_periods) ? get_vocab("summary_header") : get_vocab("summary_header_per")) . "</h1>\n"; echo "<table>\n"; echo "<thead>\n"; echo "<tr><th> </th>\n"; for ($c = 0; $c < $n_rooms; $c++) { echo "<th colspan=\"2\">{$rooms[$c]}</th>\n"; $col_count_total[$c] = 0; $col_hours_total[$c] = 0.0; } echo "<th colspan=\"2\"><br>" . get_vocab("total") . "</th></tr>\n"; $grand_count_total = 0; $grand_hours_total = 0; echo "</thead>\n"; echo "<tbody>\n"; for ($r = 0; $r < $n_names; $r++) { $row_count_total = 0; $row_hours_total = 0.0; $name = $names[$r]; echo "<tr><td>{$name}</td>\n"; for ($c = 0; $c < $n_rooms; $c++) { $room = $rooms[$c]; if (isset($count[$room][$name])) { $count_val = $count[$room][$name]; $hours_val = $hours[$room][$name]; cell($count_val, $hours_val); $row_count_total += $count_val; $row_hours_total += $hours_val; $col_count_total[$c] += $count_val; $col_hours_total[$c] += $hours_val; } else { echo "<td class=\"count\"> </td><td> </td>\n"; } } cell($row_count_total, $row_hours_total); echo "</tr>\n"; $grand_count_total += $row_count_total; $grand_hours_total += $row_hours_total; } echo "<tr><td>" . get_vocab("total") . "</td>\n"; for ($c = 0; $c < $n_rooms; $c++) { cell($col_count_total[$c], $col_hours_total[$c]); } cell($grand_count_total, $grand_hours_total); echo "</tr></tbody></table>\n"; echo "</div>\n"; }
function do_summary(&$count, &$hours, &$room_hash, &$name_hash) { global $enable_periods; # Make a sorted array of area/rooms, and of names, to use for column # and row indexes. Use the rooms and names hashes built by accumulate(). # At PHP4 we could use array_keys(). reset($room_hash); while (list($room_key) = each($room_hash)) { $rooms[] = $room_key; } ksort($rooms); reset($name_hash); while (list($name_key) = each($name_hash)) { $names[] = $name_key; } ksort($names); $n_rooms = sizeof($rooms); $n_names = sizeof($names); echo "<hr><h1>" . (empty($enable_periods) ? get_vocab("summary_header") : get_vocab("summary_header_per")) . "</h1><table border=2 cellspacing=4>\n"; echo "<tr><td> </td>\n"; for ($c = 0; $c < $n_rooms; $c++) { echo "<td class=\"BL\" align=left><b>{$rooms[$c]}</b></td>\n"; $col_count_total[$c] = 0; $col_hours_total[$c] = 0.0; } echo "<td class=\"BR\" align=right><br><b>" . get_vocab("total") . "</b></td></tr>\n"; $grand_count_total = 0; $grand_hours_total = 0; for ($r = 0; $r < $n_names; $r++) { $row_count_total = 0; $row_hours_total = 0.0; $name = $names[$r]; echo "<tr><td class=\"BR\" align=right><b>{$name}</b></td>\n"; for ($c = 0; $c < $n_rooms; $c++) { $room = $rooms[$c]; if (isset($count[$room][$name])) { $count_val = $count[$room][$name]; $hours_val = $hours[$room][$name]; cell($count_val, $hours_val); $row_count_total += $count_val; $row_hours_total += $hours_val; $col_count_total[$c] += $count_val; $col_hours_total[$c] += $hours_val; } else { echo "<td> </td>\n"; } } cell($row_count_total, $row_hours_total); echo "</tr>\n"; $grand_count_total += $row_count_total; $grand_hours_total += $row_hours_total; } echo "<tr><td class=\"BR\" align=right><b>" . get_vocab("total") . "</b></td>\n"; for ($c = 0; $c < $n_rooms; $c++) { cell($col_count_total[$c], $col_hours_total[$c]); } cell($grand_count_total, $grand_hours_total); echo "</tr></table>\n"; }
$description = substr($description, 0, $maxlength['room.description']); // Add SQL escaping $room_name_q = addslashes($name); $description_q = addslashes($description); if (empty($capacity)) { $capacity = 0; } // Acquire a mutex to lock out others who might be editing rooms if (!sql_mutex_lock("{$tbl_room}")) { fatal_error(TRUE, get_vocab("failed_to_acquire")); } // Check that the room name is unique within the area if (sql_query1("SELECT COUNT(*) FROM {$tbl_room} WHERE room_name='{$room_name_q}' AND area_id={$area} LIMIT 1") > 0) { $error = "invalid_room_name"; } else { $sql = "INSERT INTO {$tbl_room} (room_name, sort_key, area_id, description, capacity)\n VALUES ('{$room_name_q}', '{$room_name_q}', {$area}, '{$description_q}',{$capacity})"; if (sql_command($sql) < 0) { trigger_error(sql_error(), E_USER_WARNING); fatal_error(TRUE, get_vocab("fatal_db_error")); } } // Release the mutex sql_mutex_unlock("{$tbl_room}"); } if (!empty($error)) { $url = formatURLError($area, $error); } else { $url = formatURLError($area, NULL); } $returl = "admin/{$url}"; header("Location: {$returl}");
function display_series_title_row($row) { echo "<tr id=\"row_" . $row['repeat_id'] . "\">\n"; echo "<td class=\"control\"> </td>\n"; // reservation name, with a link to the view_entry page echo "<td><a href=\"view_entry.php?id=" . $row['repeat_id'] . "&series=1\">" . 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"; echo "<td>"; // <span> for sorting echo "<span title=\"" . $row['start_time'] . "\"></span>"; echo get_vocab("series"); echo "</td>\n"; echo "<td>\n"; display_buttons($row, TRUE); echo "</td>\n"; echo "</tr>\n"; }
} echo '</tr>' . PHP_EOL; reset($rooms); } echo '</table>' . PHP_EOL; } grr_sql_free($res); if ($_GET['pview'] != 1) { echo '<div id="toTop">' . PHP_EOL; echo '<b>' . get_vocab('top_of_page') . '</b>' . PHP_EOL; bouton_retour_haut(); echo '</div>' . PHP_EOL; } echo '</div>' . PHP_EOL; echo '</div>' . PHP_EOL; affiche_pop_up(get_vocab('message_records'), 'user'); ?> <script type="text/javascript"> $(document).ready(function(){ $('table.table-bordered td').each(function(){ var $row = $(this); var height = $row.height(); var h2 = $row.find('a').height(); $row.find('a').css('height', height); $row.find('a').css('padding-top', height/2 - h2/2); }); }); jQuery(document).ready(function($){ $("#popup_name").draggable({containment: "#container"}); $("#popup_name").resizable();
} } 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") { // We are only going to let them delete an area if there are // no rooms. its easier $n = sql_query1("select count(*) from {$tbl_room} where area_id={$area}"); if ($n == 0) { // OK, nothing there, lets blast it away sql_command("delete from {$tbl_area} where id={$area}"); // Redirect back to the admin page header("Location: admin.php"); } else { // There are rooms left in the area print_header($day, $month, $year, $area); echo "<p>\n"; echo get_vocab("delarea"); echo "<a href=\"admin.php\">" . get_vocab("backadmin") . "</a>"; echo "</p>\n"; include "trailer.inc"; } }
function do_summary(&$count, &$hours, &$room_hash, &$breve_description_hash, $enable_periods, $decompte, $csv = "n") { global $vocab; if ($csv != "n") { echo " ;"; } // Make a sorted array of area/rooms, and of names, to use for column // and row indexes. Use the rooms and names hashes built by accumulate(). // At PHP4 we could use array_keys(). reset($room_hash); $rooms = array(); while (list($room_key) = each($room_hash)) { $rooms[] = $room_key; } ksort($rooms); reset($breve_description_hash); $breve_descriptions = array(); while (list($breve_description_key) = each($breve_description_hash)) { $breve_descriptions[] = $breve_description_key; } ksort($breve_descriptions); $n_rooms = sizeof($rooms); $n_names = sizeof($breve_descriptions); // On affiche uniquement pour une sortie HTML if ($csv == "n") { if ($_GET["sumby"] == "6") { $premiere_cellule = get_vocab("sum_by_creator"); } else { if ($_GET["sumby"] == "3") { $premiere_cellule = get_vocab("sum_by_descrip"); } else { if ($_GET["sumby"] == "5") { $premiere_cellule = get_vocab("type"); } else { $premiere_cellule = grr_sql_query1("SELECT fieldname FROM " . TABLE_PREFIX . "_overload WHERE id='" . $_GET["sumby"] . "'"); } } } if ($enable_periods == 'y') { echo "<hr /><h1>" . get_vocab("summary_header_per") . "</h1><table class=\"table table-bordered table-striped\">\n"; } else { echo "<hr /><h1>" . get_vocab("summary_header") . "</h1><table class=\"table table-bordered table-striped\">\n"; } echo "<tr><td class=\"BL\" align=\"left\"><b>" . $premiere_cellule . " \\ " . get_vocab("room") . "</b></td>\n"; } $col_count_total = array(); $col_hours_total = array(); for ($c = 0; $c < $n_rooms; $c++) { if ($csv == "n") { echo "<td class=\"BL\" align=\"left\"><b>{$rooms[$c]}</b></td>\n"; } else { echo "{$rooms[$c]};"; } $col_count_total[$c] = 0; $col_hours_total[$c] = 0.0; } if ($csv == "n") { echo "<td class=\"BR\" align=\"right\"><br /><b>" . get_vocab("total") . "</b></td></tr>\n"; } else { echo html_entity_decode($vocab['total']) . ";\r\n"; } $grand_count_total = 0; $grand_hours_total = 0; for ($r = 0; $r < $n_names; $r++) { $row_count_total = 0; $row_hours_total = 0.0; $breve_description = $breve_descriptions[$r]; if ($csv == "n") { echo "<tr><td class=\"BR\" align=\"right\"><b>{$breve_description}</b></td>\n"; } else { echo "{$breve_description};"; } for ($c = 0; $c < $n_rooms; $c++) { $room = $rooms[$c]; if (isset($count[$room][$breve_description])) { $count_val = $count[$room][$breve_description]; $hours_val = $hours[$room][$breve_description]; cell($count_val, $hours_val, $csv, $decompte); $row_count_total += $count_val; $row_hours_total += $hours_val; $col_count_total[$c] += $count_val; $col_hours_total[$c] += $hours_val; } else { if ($csv == "n") { echo "<td> </td>\n"; } else { echo ";"; } } } cell($row_count_total, $row_hours_total, $csv, $decompte); if ($csv == "n") { echo "</tr>\n"; } else { echo "\r\n"; } $grand_count_total += $row_count_total; $grand_hours_total += $row_hours_total; } if ($csv == "n") { echo "<tr><td class=\"BR\" align=\"right\"><b>" . get_vocab("total") . "</b></td>\n"; } else { echo html_entity_decode($vocab['total']) . ";"; } for ($c = 0; $c < $n_rooms; $c++) { cell($col_count_total[$c], $col_hours_total[$c], $csv, $decompte); } cell($grand_count_total, $grand_hours_total, $csv, $decompte); if ($csv == "n") { echo "</tr></table>\n"; } }
</tr> <tr> <td><input type="text" name="cleanDay" size="2" value="<?php echo $_POST['cleanDay']; ?> " style="text-align: center;"/></td> <td>/</td> <td><input type="text" name="cleanMonth" size="2" value="<?php echo $_POST['cleanMonth']; ?> " style="text-align: center;"/></td> <td>/</td> <td><input type="text" name="cleanYear" size="4" value="<?php echo $_POST['cleanYear']; ?> " style="text-align: center;"/></td> </tr> </table> <input class="btn btn-primary" type="submit" value="<?php echo get_vocab("OK"); ?> " style="font-variant: small-caps;" /> </fieldset> </form> </div> <?php echo "</td></tr></table>"; ?> </body> </html>
defaultOptions.bProcessing = true; defaultOptions.bScrollCollapse = true; defaultOptions.bStateSave = true; defaultOptions.iDisplayLength = 25; defaultOptions.sDom = 'C<"clear">lfrtip'; defaultOptions.sScrollX = "100%"; defaultOptions.sPaginationType = "full_numbers"; defaultOptions.oColReorder = {}; defaultOptions.oColVis = {sSize: "auto", buttonText: '<?php echo escape_js(get_vocab("show_hide_columns")); ?> ', bRestore: true, sRestore: '<?php echo escape_js(get_vocab("restore_original")); ?> '}; defaultOptions.fnInitComplete = function(){ if (((leftCol !== undefined) && (leftCol !== null)) || ((rightCol !== undefined) && (rightCol !== null)) ) { <?php // Fix the left and/or right columns. This has to be done when // initialisation is complete as the language files are loaded // asynchronously ?> var options = {}; if ((leftCol !== undefined) && (leftCol !== null))
?> </td> </tr> <!-- Pour sélectionner le jour_cycle qui débutera le premier Jours/Cycles --> <tr> <td> <?php echo get_vocab("debut_Jours/Cycles") . get_vocab("deux_points") . "<br /><i>" . get_vocab("explication_debut_Jours_Cycles") . "</i>"; ?> </td> <td> <?php echo '<select class="form-control" name="jourDebut" id="jourDebut">'; for ($i = 1; $i < 21; $i++) { if ($i == Settings::get("jour_debut_Jours/Cycles")) { echo "<option selected=\"selected\">" . $i . "</option>\n"; } else { echo "<option>" . $i . "</option>\n"; } } ?> </select> </td> </tr> </table> <?php echo "<div id=\"fixe\" style=\"text-align:center;\"><input type=\"submit\" value=\"" . get_vocab("save") . "\" style=\"font-variant: small-caps;\"/></div>\n"; echo "<div><input type=\"hidden\" value=\"1\" name=\"page_calend\" /></div>\n"; echo "</form>"; // fin de l'affichage de la colonne de droite echo "</td></tr></table></body>\n</html>";
echo "<script type=\"text/javascript\">\n<!--\n"; echo "EndActiveCell();\n"; echo "// -->\n</script>"; } } else { echo ' '; } } elseif ($descr != "") { #if it is booked then show echo " <a href=\"view_entry.php?id={$id}" . "&area={$area}&day={$wday}&month={$wmonth}&year={$wyear}\" " . "title=\"{$long_descr}\">{$descr}</a>"; } else { echo " \" "; } echo "</td>\n"; } # next lines to display times on right side if (FALSE != $times_right_side) { if ($enable_periods) { tdcell("red"); $time_t_stripped = preg_replace("/^0/", "", $time_t); echo "<a href=\"{$hilite_url}={$time_t}\" title=\"" . get_vocab("highlight_line") . "\">" . $periods[$time_t_stripped] . "</a></td>"; } else { tdcell("red"); echo "<a href=\"{$hilite_url}={$time_t}\" title=\"" . get_vocab("highlight_line") . "\">" . utf8_strftime(hour_min_format(), $t) . "</a></td>"; } } echo "</tr>\n"; } echo "</table>"; show_colour_key(); include "trailer.inc";
$del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_entry_moderate WHERE (start_time > ".getSettingValue('end_bookings').")"); $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_calendar WHERE DAY > ".getSettingValue("end_bookings")); } header("Location: ./admin_config.php"); } else if (isset($_GET['valid']) and ($_GET['valid'] == "no")) { header("Location: ./admin_config.php"); } # print the page header print_header("","","","",$type="with_session", $page="admin"); echo "<h2>".get_vocab('admin_confirm_change_date_bookings.php')."</h2>"; echo "<p>".get_vocab("msg_del_bookings")."</p>"; ?> <form action="admin_confirm_change_date_bookings.php" method='get'> <div> <input type="submit" value="<?php echo get_vocab("save");?>" /> <input type="hidden" name="valid" value="yes" /> <input type="hidden" name="begin_bookings" value=" <?php echo $_GET['begin_bookings']; ?>" /> <input type="hidden" name="end_bookings" value=" <?php echo $_GET['end_bookings']; ?>" /> </div> </form> <form action="admin_confirm_change_date_bookings.php" method='get'> <div> <input type="submit" value="<?php echo get_vocab("cancel");?>" /> <input type="hidden" name="valid" value="no" /> </div> </form> </body> </html>
print_header("", "", "", $type = "with_session"); affiche_pop_up($msg, "admin"); ?> <p>| <a href="admin_user_modify.php?user_login=<?php echo $user_login; ?> "><?php echo get_vocab("back"); ?> </a> |</p> <?php echo "<h3>" . get_vocab("pwd_change") . "</h3>\n"; if ($user_login != getUserName()) { echo "<form action=\"admin_change_pwd.php\" method='post'>\n<div>"; echo get_vocab("login") . " : {$user_login}"; echo "\n<br />" . get_vocab("last_name") . get_vocab("deux_points") . $user_nom . " " . get_vocab("first_name") . get_vocab("deux_points") . $user_prenom; echo "\n<br />" . get_vocab("pwd_msg_warning"); echo "\n<br /><br />" . get_vocab("new_pwd1") . get_vocab("deux_points") . "<input type=\"password\" name=\"reg_password1\" value=\"\" size=\"20\" />"; echo "\n<br />" . get_vocab("new_pwd2") . get_vocab("deux_points") . "<input type=\"password\" name=\"reg_password2\" value=\"\" size=\"20\" />"; echo "\n<input type=\"hidden\" name=\"valid\" value=\"yes\" />"; echo "\n<input type=\"hidden\" name=\"user_login\" value=\"{$user_login}\" />"; echo "\n<br /><input type=\"submit\" value=\"" . get_vocab("save") . "\" /></div></form>"; } else { echo "<\ndiv><br />" . get_vocab("pwd_msg_warning2") . "</div>"; } ?> </body> </html>
} print_header("", "", "", $type = "with_session"); // Affichage de la colonne de gauche include "admin_col_gauche.php"; $themessage = str_replace("'", "\\'", get_vocab("admin_purge_accounts_confirm")); $themessage2 = str_replace("'", "\\'", get_vocab("admin_purge_accounts_confirm2")); $themessage3 = str_replace("'", "\\'", get_vocab("admin_purge_tables_confirm")); $themessage4 = str_replace("'", "\\'", get_vocab("admin_purge_accounts_confirm4")); echo "<h2>" . get_vocab('admin_purge_accounts.php') . "</h2>"; echo get_vocab('admin_clean_accounts_desc'); echo "<div style=\"text-align:center;\">\n\n<form id=\"purge_liaison\" action=\"admin_purge_accounts.php\" method=\"post\">\n\n\t<div>\n\t\t<input type=\"hidden\" name=\"do_purge_table_liaison\" value=\"1\" />\n\n\t\t<input\n\t\ttype=\"button\"\n\t\tvalue=\"" . get_vocab('admin_purge_tables_liaison') . "\"\n\t\tonclick=\"return confirmButton('purge_liaison', '{$themessage3}')\" />\n\n\t</div></form></div>"; echo "<hr />"; echo get_vocab('admin_purge_accounts_desc'); echo "<div style=\"text-align:center;\">\n\n\t<form id=\"purge_sauf_privileges\" action=\"admin_purge_accounts.php\" method=\"post\">\n\n\t\t<div>\n\t\t\t<input type=\"hidden\" name=\"do_purge_sauf_privileges\" value=\"1\" />\n\n\t\t\t<input\n\t\t\ttype=\"button\"\n\t\t\tvalue=\"" . get_vocab('admin_purge_accounts_sauf_privileges') . "\"\n\t\t\tonclick=\"return confirmButton('purge_sauf_privileges', '{$themessage4}')\" />\n\n\t\t</div></form></div>"; echo "<div style=\"text-align:center;\">\n\n\t\t<form id=\"purge\" action=\"admin_purge_accounts.php\" method=\"post\">\n\n\t\t\t<div>\n\t\t\t\t<input type=\"hidden\" name=\"do_purge\" value=\"1\" />\n\n\t\t\t\t<input\n\t\t\t\ttype=\"button\"\n\t\t\t\tvalue=\"" . get_vocab('admin_purge_accounts') . "\"\n\t\t\t\tonclick=\"return confirmButton('purge', '{$themessage}')\" />\n\n\t\t\t</div></form></div>"; echo "<div style=\"text-align:center;\">\n\n\t\t\t<form id=\"purge_avec_resa\" action=\"admin_purge_accounts.php\" method=\"post\">\n\n\t\t\t\t<div>\n\t\t\t\t\t<input type=\"hidden\" name=\"do_purge_avec_resa\" value=\"1\" />\n\n\t\t\t\t\t<input\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvalue=\"" . get_vocab('admin_purge_accounts_with_bookings') . "\"\n\t\t\t\t\tonclick=\"return confirmButton('purge_avec_resa', '{$themessage2}')\" />\n\n\t\t\t\t</div></form></div>"; if (isset($_POST['do_purge_table_liaison'])) { if ($_POST['do_purge_table_liaison'] == 1) { NettoyerTablesJointure(); } } if (isset($_POST['do_purge_sauf_privileges'])) { if ($_POST['do_purge_sauf_privileges'] == 1) { supprimerReservationsUtilisateursEXT("n", "n"); } } if (isset($_POST['do_purge'])) { if ($_POST['do_purge'] == 1) { supprimerReservationsUtilisateursEXT("n", "y"); } }
} if ($type_cible != '') { echo "<input type=\"hidden\" name=\"type_cible\" value=\"" . $type_cible . "\" />\n"; } echo get_vocab("Objet du message") . get_vocab("deux_points"); echo "<br /><input type=\"text\" name=\"objet_message\" id=\"objet_message\" size=\"40\" maxlength=\"256\" value='' placeholder=\"Objet\"/>\n"; echo "<textarea name=\"message\" cols=\"50\" rows=\"5\" placeholder=\"Votre message\">" . $corps_message . "</textarea><br />"; echo get_vocab("E-mail pour la reponse") . get_vocab("deux_points"); echo "<input type=\"text\" name=\"email_reponse\" id=\"email_reponse\" size=\"40\" maxlength=\"256\" "; if ($email_reponse != '') { echo "value='" . $email_reponse . "' "; } else { if ($fin_session == 'n' && getUserName() != '') { $user_email = grr_sql_query1("SELECT email FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='******'"); if ($user_email != "" && $user_email != -1) { echo "value='" . $user_email . "' "; } } } echo "/>\n"; echo "<br />\n"; echo "<p style=\"text-align:center;\">"; echo "<input type='button' value='" . get_vocab("submit") . "' onclick='verif_et_valide_envoi();' />\n"; echo "</p>\n"; echo "</div>\n"; echo "</form>\n"; echo "<script type='text/javascript'>\n\tfunction verif_et_valide_envoi() {\n\t\tif (document.getElementById('objet_message')) {\n\t\t\tobjet=document.getElementById('objet_message').value;\n\t\t\tif (objet=='') {\n\t\t\t\talert('Vous n\\'avez pas saisi d\\'objet au message. Ce champ est obligatoire.');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tif (document.getElementById('email_reponse')) {\n\t\t\temail=document.getElementById('email_reponse').value;\n\t\t\tif (email=='') {\n\t\t\t\tconfirmation=confirm('Vous n\\'avez pas saisi d\\'adresse courriel/email.\\nVous ne pourrez pas recevoir de réponse par courrier électronique.\\nSouhaitez-vous néanmoins poster le message?');\n\t\t\t\tif (confirmation) {\n\t\t\t\t\tdocument.getElementById('doc').submit();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar verif = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}\$/\n\t\t\t\tif (verif.exec(email) == null) {\n\t\t\t\t\tconfirmation=confirm('L\\'adresse courriel/email saisie ne semble pas valide.\\nVeuillez contrôler la saisie et confirmer votre envoi si l\\'adresse est correcte.\\nSouhaitez-vous néanmoins poster le message?');\n\t\t\t\t\tif (confirmation) {\n\t\t\t\t\t\tdocument.getElementById('doc').submit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdocument.getElementById('doc').submit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('doc').submit();\n\t\t}\n\t}\n</script>\n"; break; } echo "</div>"; include_once 'include/trailer.inc.php';
<?php } ?> <!-- End if ($edit_series) --> <TR> <TD colspan=2 align=center> <SCRIPT LANGUAGE="JavaScript"> document.writeln ( '<INPUT TYPE="button" NAME="save_button" VALUE="<?php echo get_vocab("save"); ?> " ONCLICK="validate_and_submit()">' ); </SCRIPT> <NOSCRIPT> <INPUT TYPE="submit" VALUE="<?php echo get_vocab("save"); ?> "> </NOSCRIPT> </TD></TR> </TABLE> <INPUT TYPE=HIDDEN NAME="returl" VALUE="<?php echo $HTTP_REFERER; ?> "> <!--INPUT TYPE=HIDDEN NAME="room_id" VALUE="<?php echo $room_id; ?> "--> <INPUT TYPE=HIDDEN NAME="create_by" VALUE="<?php
echo get_vocab("namebooker"); ?> </TH> <TH><?php echo get_vocab("description"); ?> </TH> <TH><?php echo get_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']}\">" . get_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']}\">"; if (empty($enable_periods)) { $link_str = time_date_string($row[4]); } else { list(, $link_str) = period_date_string($row[4]); } echo "{$link_str}</A></TD>"; echo "</TR>\n"; } echo "</table>\n";
{ alertMessage += '<?php echo escape_js(mrbs_entity_decode(get_vocab("conflict"))); ?> ' + ": \n\n"; var conflictsList = getErrorList(result.conflicts); alertMessage += conflictsList.text; } if (result.rules_broken.length > 0) { if (result.conflicts.length > 0) { alertMessage += "\n\n"; } alertMessage += '<?php echo escape_js(mrbs_entity_decode(get_vocab("rules_broken"))); ?> ' + ": \n\n"; var rulesList = getErrorList(result.rules_broken); alertMessage += rulesList.text; } window.alert(alertMessage); } turnOnPageRefresh(); }, 'json'); } <?php // if (rectanglesIdentical(r1, r2)) ?> }; <?php
echo " />" . get_vocab("twentyfourhour_format_12") . "</label>\n<br />"; echo "<label><input type=\"radio\" name=\"twentyfourhour_format_area\" value=\"1\" "; if ($row['twentyfourhour_format_area'] == 1) { echo " checked=\"checked\""; } echo " />" . get_vocab("twentyfourhour_format_24") . "</label>\n"; echo "</td>\n"; echo "</tr>\n"; // L'utilisateur ne peut reserver qu'une duree limitee (-1 desactivee), exprimee en minutes echo "<tr>\n<td>" . get_vocab("duree_max_resa_area") . get_vocab("deux_points"); echo "</td>\n<td><input class=\"form-control\" type=\"text\" name=\"duree_max_resa_area1\" size=\"5\" value=\"" . $row["duree_max_resa_area"] . "\" /></td></tr>\n"; echo "</table>"; echo "<table>"; // Nombre max de reservation par domaine echo "<tr><td>" . get_vocab("max_booking") . " - " . get_vocab("all_rooms_of_area") . get_vocab("deux_points"); echo "</td><td><input class=\"form-control\" type=\"text\" name=\"max_booking\" value=\"" . $row['max_booking'] . "\" /></td>\n"; echo "</tr></table>"; echo "<div style=\"text-align:center;\">\n"; echo "<input class=\"btn btn-primary\" type=\"submit\" name=\"change_area\" value=\"" . get_vocab("save") . "\" />\n"; echo "<input class=\"btn btn-primary\" type=\"submit\" name=\"change_done\" value=\"" . get_vocab("back") . "\" />\n"; echo "<input class=\"btn btn-primary\" type=\"submit\" name=\"change_area_and_back\" value=\"" . get_vocab("save_and_back") . "\" />"; echo "</div></form>"; echo "<script type=\"text/javascript\">"; echo "aff_creneaux();"; echo "</script>"; echo "</div>"; } ?> </body> </html>
function do_summary(&$count, &$hours, &$room_hash, &$name_hash) { global $output_format, $csv_col_sep; global $times_somewhere, $periods_somewhere; // Sort the room and name arrays ksort($room_hash); ksort($name_hash); // Initialise grand total counters foreach (array(MODE_TIMES, MODE_PERIODS) as $m) { $grand_count_total[$m] = 0; $grand_hours_total[$m] = 0; } // TABLE HEAD // ---------- $head_rows = array(); $row1_cells = array(''); $row2_cells = array(''); foreach ($room_hash as $room => $mode) { $col_count_total[$room] = 0; $col_hours_total[$room] = 0.0; $mode_text = $mode == MODE_TIMES ? get_vocab("mode_times") : get_vocab("mode_periods"); $row1_cells[] = $room; $row1_cells[] = ''; // The cell before is really spanning two columns. We'll sort it out with JavaScript $row2_cells[] = get_vocab("entries"); $row2_cells[] = $mode == MODE_PERIODS ? get_vocab("periods") : get_vocab("hours"); } // Add the total column(s) onto the end if ($times_somewhere) { $row1_cells[] = get_vocab("total") . " (" . get_vocab("mode_times") . ")"; $row1_cells[] = ''; $row2_cells[] = get_vocab("entries"); $row2_cells[] = get_vocab("hours"); } if ($periods_somewhere) { $row1_cells[] = get_vocab("total") . " (" . get_vocab("mode_periods") . ")"; $row1_cells[] = ''; $row2_cells[] = get_vocab("entries"); $row2_cells[] = get_vocab("periods"); } // Add the rows to the array of header rows, for output later $head_rows[] = $row1_cells; $head_rows[] = $row2_cells; // TABLE BODY // ---------- $body_rows = array(); foreach ($name_hash as $name => $is_present) { foreach (array(MODE_TIMES, MODE_PERIODS) as $m) { $row_count_total[$m] = 0; $row_hours_total[$m] = 0; } $cells = array(); $cells[] = $name; foreach ($room_hash as $room => $mode) { if (isset($count[$room][$name])) { $count_val = $count[$room][$name]; $hours_val = $hours[$room][$name]; $cells[] = entries_format($count_val); $format = $mode == MODE_TIMES ? FORMAT_TIMES : FORMAT_PERIODS; $cells[] = sprintf($format, $hours_val); $row_count_total[$mode] += $count_val; $row_hours_total[$mode] += $hours_val; $col_count_total[$room] += $count_val; $col_hours_total[$room] += $hours_val; } else { $cells[] = $output_format == OUTPUT_HTML ? " " : ''; $cells[] = $output_format == OUTPUT_HTML ? " " : ''; } } // Add the total column(s) onto the end if ($times_somewhere) { $cells[] = entries_format($row_count_total[MODE_TIMES]); $cells[] = sprintf(FORMAT_TIMES, $row_hours_total[MODE_TIMES]); } if ($periods_somewhere) { $cells[] = entries_format($row_count_total[MODE_PERIODS]); $cells[] = sprintf(FORMAT_PERIODS, $row_hours_total[MODE_PERIODS]); } $body_rows[] = $cells; foreach (array(MODE_TIMES, MODE_PERIODS) as $m) { $grand_count_total[$m] += $row_count_total[$m]; $grand_hours_total[$m] += $row_hours_total[$m]; } } // TABLE FOOT // ---------- $foot_rows = array(); $cells = array(); $cells[] = get_vocab("total"); foreach ($room_hash as $room => $mode) { $cells[] = entries_format($col_count_total[$room]); $format = $mode == MODE_TIMES ? FORMAT_TIMES : FORMAT_PERIODS; $cells[] = sprintf($format, $col_hours_total[$room]); } // Add the total column(s) onto the end if ($times_somewhere) { $cells[] = entries_format($grand_count_total[MODE_TIMES]); $cells[] = sprintf(FORMAT_TIMES, $grand_hours_total[MODE_TIMES]); } if ($periods_somewhere) { $cells[] = entries_format($grand_count_total[MODE_PERIODS]); $cells[] = sprintf(FORMAT_PERIODS, $grand_hours_total[MODE_PERIODS]); } $foot_rows[] = $cells; // OUTPUT THE TABLE // ---------------- if ($output_format == OUTPUT_HTML) { // <tfoot> has to come before <tbody> output_head_rows($head_rows, $output_format); output_foot_rows($foot_rows, $output_format); output_body_rows($body_rows, $output_format); } else { output_head_rows($head_rows, $output_format); output_body_rows($body_rows, $output_format); output_foot_rows($foot_rows, $output_format); } }
<?php // $Id: help.php 2338 2012-07-18 10:54:42Z cimorrison $ require "defaultincludes.inc"; require_once "version.inc"; // Check the user is authorised for this page checkAuthorised(); print_header($day, $month, $year, $area, isset($room) ? $room : ""); echo "<h3>" . get_vocab("about_mrbs") . "</h3>\n"; echo "<table id=\"version_info\">\n"; echo "<tr><td><a href=\"http://mrbs.sourceforge.net\">" . get_vocab("mrbs") . "</a>:</td><td>" . get_mrbs_version() . "</td></tr>\n"; echo "<tr><td>" . get_vocab("database") . ":</td><td>" . sql_version() . "</td></tr>\n"; echo "<tr><td>" . get_vocab("system") . ":</td><td>" . php_uname() . "</td></tr>\n"; echo "<tr><td>" . get_vocab("servertime") . ":</td><td>" . utf8_strftime($strftime_format['datetime'], time()) . "</td></tr>\n"; echo "<tr><td>PHP:</td><td>" . phpversion() . "</td></tr>\n"; echo "</table>\n"; echo "<p>\n" . get_vocab("browserlang") . ":\n"; echo implode(", ", array_keys($langs)); echo "\n</p>\n"; echo "<h3>" . get_vocab("help") . "</h3>\n"; echo "<p>\n"; echo get_vocab("please_contact") . '<a href="mailto:' . htmlspecialchars($mrbs_admin_email) . '">' . htmlspecialchars($mrbs_admin) . "</a> " . get_vocab("for_any_questions") . "\n"; echo "</p>\n"; require_once "site_faq" . $faqfilelang . ".html"; output_trailer();
?> </td> <td> <input class="form-control" type="text" name="sessionMaxLength" size="16" value="<?php echo Settings::get("sessionMaxLength"); ?> " /> </td> </tr> </table> <?php echo "<p>" . get_vocab("explain_session_max_length") . "</p>"; //Longueur minimale du mot de passe exigé echo "<hr /><h3>" . get_vocab("pwd") . "</h3>"; echo "\n<p>" . get_vocab("pass_leng_explain") . get_vocab("deux_points") . "\n<input class=\"form-control\" type=\"text\" name=\"pass_leng\" value=\"" . htmlentities(Settings::get("pass_leng")) . "\" size=\"20\" /></p>"; // // Url de déconnexion //******************* // echo "<hr /><h3>" . get_vocab("Url_de_deconnexion") . "</h3>\n"; echo "<p>" . get_vocab("Url_de_deconnexion_explain") . "</p>\n"; echo "<p><i>" . get_vocab("Url_de_deconnexion_explain2") . "</i>"; echo "<br />" . get_vocab("Url_de_deconnexion") . get_vocab("deux_points") . "\n"; $value_url = Settings::get("url_disconnect"); echo "<input class=\"form-control\" type=\"text\" name=\"url_disconnect\" size=\"40\" value =\"{$value_url}\"/>\n<br /><br /></p>"; echo "\n<hr />"; echo "\n<p><input type=\"hidden\" name=\"page_config\" value=\"4\" />"; echo "\n<br /></p><div id=\"fixe\" style=\"text-align:center;\"><input class=\"btn btn-primary\" type=\"submit\" name=\"ok\" value=\"" . get_vocab("save") . "\" style=\"font-variant: small-caps;\"/></div>"; echo "\n</form>"; // fin de l'affichage de la colonne de droite echo "\n</td></tr></table>";
// Release the mutex sql_mutex_unlock("{$tbl_area}"); } if ($type == "room") { // Truncate the name and description fields to the maximum length as a precaution. $name = substr($name, 0, $maxlength['room.room_name']); $description = substr($description, 0, $maxlength['room.description']); // Add SQL escaping $room_name_q = addslashes($name); $description_q = addslashes($description); if (empty($capacity)) { $capacity = 0; } // Acquire a mutex to lock out others who might be editing rooms if (!sql_mutex_lock("{$tbl_room}")) { fatal_error(TRUE, get_vocab("failed_to_acquire")); } // Check that the room name is unique within the area if (sql_query1("SELECT COUNT(*) FROM {$tbl_room} WHERE room_name='{$room_name_q}' AND area_id={$area} LIMIT 1") > 0) { $error = "invalid_room_name"; } else { $sql = "insert into {$tbl_room} (room_name, area_id, description, capacity)\n values ('{$room_name_q}',{$area}, '{$description_q}',{$capacity})"; if (sql_command($sql) < 0) { fatal_error(1, sql_error()); } } // Release the mutex sql_mutex_unlock("{$tbl_room}"); } $returl = "admin.php?area={$area}" . (!empty($error) ? "&error={$error}" : ""); header("Location: {$returl}");