} if (isset($id) && !est_hors_reservation(mktime(0, 0, 0, $month, $day, $year), $area)) { if ($compteur[$id] == 0) { if ($cellules[$id] != 1) { if (isset($today[$room][$t + ($cellules[$id] - 1) * $resolution]["id"])) { $id_derniere_ligne_du_bloc = $today[$room][$t + ($cellules[$id] - 1) * $resolution]["id"]; if ($id_derniere_ligne_du_bloc != $id) { $cellules[$id] = $cellules[$id] - 1; } } } tdcell_rowspan($c, $cellules[$id]); } $compteur[$id] = 1; } else { tdcell($c); } if (!isset($id) || est_hors_reservation(mktime(0, 0, 0, $month, $day, $year), $area)) { $hour = date("H", $t); $minute = date("i", $t); $date_booking = mktime($hour, $minute, 0, $month, $day, $year); if (est_hors_reservation(mktime(0, 0, 0, $month, $day, $year), $area)) { echo '<img src="img_grr/stop.png" alt="' . get_vocab("reservation_impossible") . '" title="' . get_vocab("reservation_impossible") . '" width="16" height="16" class="' . $class_image . '" />' . PHP_EOL; } else { if ((authGetUserLevel(getUserName(), -1) > 1 || auth_visiteur(getUserName(), $room) == 1) && UserRoomMaxBooking(getUserName(), $room, 1) != 0 && verif_booking_date(getUserName(), -1, $room, $date_booking, $date_now, $enable_periods) && verif_delais_max_resa_room(getUserName(), $room, $date_booking) && verif_delais_min_resa_room(getUserName(), $room, $date_booking) && ($statut_room[$room] == "1" || $statut_room[$room] == "0" && authGetUserLevel(getUserName(), $room) > 2) && $_GET['pview'] != 1) { if ($enable_periods == 'y') { echo '<a href="edit_entry.php?room=' . $room . '&period=' . $time_t_stripped . '&year=' . $year . '&month=' . $month . '&day=' . $day . '&page=day" title="' . get_vocab("cliquez_pour_effectuer_une_reservation") . '" ><span class="glyphicon glyphicon-plus"></span></a>' . PHP_EOL; } else { echo '<a href="edit_entry.php?room=' . $room . '&hour=' . $hour . '&minute=' . $minute . '&year=' . $year . '&month=' . $month . '&day=' . $day . '&page=day" title="' . get_vocab("cliquez_pour_effectuer_une_reservation") . '" ><span class="glyphicon glyphicon-plus"></span></a>' . PHP_EOL; } } else {
echo '<br />' . PHP_EOL; } if ($clef == 1) { echo '<img src="img_grr/skey.png" alt="clef">' . PHP_EOL; } if (Settings::get('show_courrier') == 'y') { if ($courrier == 1) { echo '<img src="img_grr/scourrier.png" alt="courrier">' . PHP_EOL; } else { echo '<br /><img src="img_grr/hourglass.png" alt="buzy">' . PHP_EOL; } } echo '</span>' . PHP_EOL; } else { echo PHP_EOL . '<table class="table-header"><tr>'; tdcell($d[$cday]["color"][$i]); if ($d[$cday]["res"][$i] != '-') { echo '<img src="img_grr/buzy.png" alt="', get_vocab("ressource actuellement empruntee"), '" title="', get_vocab("ressource actuellement empruntee"), '" width="20" height="20" class="image" />', PHP_EOL; } if (isset($d[$cday]["option_reser"][$i]) && $d[$cday]["option_reser"][$i] != -1) { echo '<img src="img_grr/small_flag.png" alt="', get_vocab("reservation_a_confirmer_au_plus_tard_le"), '" title="', get_vocab("reservation_a_confirmer_au_plus_tard_le"), ' ', time_date_string_jma($d[$cday]["option_reser"][$i], $dformat), '" width="20" height="20" class="image" />', PHP_EOL; } if (isset($d[$cday]["moderation"][$i]) && $d[$cday]["moderation"][$i] == 1) { echo '<img src="img_grr/flag_moderation.png" alt="', get_vocab("en_attente_moderation"), '" title="', get_vocab("en_attente_moderation"), '" class="image" />', PHP_EOL; } $Son_GenreRepeat = grr_sql_query1("SELECT " . TABLE_PREFIX . "_type_area.type_name FROM " . TABLE_PREFIX . "_type_area," . TABLE_PREFIX . "_entry WHERE " . TABLE_PREFIX . "_entry.type=" . TABLE_PREFIX . "_type_area.type_letter AND " . TABLE_PREFIX . "_entry.id = '" . $d[$cday]["id"][$i] . "';"); if ($Son_GenreRepeat == -1) { echo '<span class="small_planning">', PHP_EOL, '<b>', $d[$cday]["data"][$i], '</b><br>'; } else { echo '<span class="small_planning">' . $d[$cday]["data"][$i] . '<br>' . $Son_GenreRepeat . '<br>' . PHP_EOL; }
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";
function cell_html($cell, $query_strings, $is_invalid = FALSE) { // draws a single cell in the main table of the day and week views // // $cell is a two dimensional array that is part of the map of the whole // display and looks like this: // // $cell[n][id] // [is_repeat] // [is_multiday_start] // [is_multiday_end] // [color] // [data] // [long_descr] // [create_by] // [room_id] // [start_time] // [slots] // [status] // // where n is the number of the booking in the cell. There can be none, one or many // bookings in a cell. If there are no bookings then a blank cell is drawn with a link // to the edit entry form. If there is one booking, then the booking is shown in that // cell. If there is more than one booking then all the bookings are shown, but they can // be shown in two different ways: minimised and maximised. By default they are shown // minimised, so that the standard row height is preserved. By clicking a control // the cell can be maximised. (Multiple bookings can arise in a cell if the resolution // of an existing database in increased or the booking day is shifted). // $query_strings is an array containg the query strings (or partial query strings) to be // appended to the link used for the cell. It is indexed as follows: // ['new_periods'] the string to be used for an empty cell if using periods // ['new_times'] the string to be used for an empty cell if using times // ['booking'] the string to be used for a full cell // // $is_invalid specifies whether the slot actually exists or is one of the non-existent // slots in the transition to DST global $main_cell_height, $main_table_cell_border_width; global $user, $month, $timetohighlight; global $enable_periods, $times_along_top, $show_plus_link; global $approval_enabled, $confirmation_enabled; $html = ''; // if the time slot has got multiple bookings, then draw a mini-table if (isset($cell[1]["id"])) { // Find out how many bookings there are (needed to calculate heights) $n_bookings = 0; while (isset($cell[$n_bookings]["id"])) { $n_bookings++; } // Make the class maximized by default so that if you don't have JavaScript then // you can still see all the bookings. If you have JavaScript it will overwrite // the class and make it minimized. $html .= "<td class=\"multiple_booking maximized\">\n"; // First draw the mini table $html .= "<div class=\"celldiv slots1 mini\">\n"; $html .= "<div class=\"multiple_control\">+</div>\n"; $html .= "<table>\n"; $html .= "<tbody>\n"; $row_height = $main_cell_height - ($n_bookings - 1) * $main_table_cell_border_width; // subtract the borders (first row has no top border) $row_height = $row_height / $n_bookings; // split what's left between the bookings $row_height = (int) ceil($row_height); // round up, so that (a) there's no empty space at the bottom // and (b) each stripe is at least 1 unit high for ($n = 0; $n < $n_bookings; $n++) { $id = $cell[$n]["id"]; $is_repeat = $cell[$n]["is_repeat"]; $is_multiday_start = $cell[$n]["is_multiday_start"]; $is_multiday_end = $cell[$n]["is_multiday_end"]; $status = $cell[$n]["status"]; $color = $cell[$n]["color"]; $descr = htmlspecialchars($cell[$n]["data"]); $long_descr = htmlspecialchars($cell[$n]["long_descr"]); $class = $color; if ($status & STATUS_PRIVATE) { $class .= " private"; } if ($approval_enabled && $status & STATUS_AWAITING_APPROVAL) { $class .= " awaiting_approval"; } if ($confirmation_enabled && $status & STATUS_TENTATIVE) { $class .= " tentative"; } if ($is_multiday_start) { $class .= " multiday_start"; } if ($is_multiday_end) { $class .= " multiday_end"; } $html .= "<tr>\n"; $html .= "<td class=\"{$class}\"" . ($n == 0 ? " style=\"border-top-width: 0\"" : "") . ">\n"; $html .= "<div style=\"overflow: hidden; " . "height: " . $row_height . "px; " . "max-height: " . $row_height . "px; " . "min-height: " . $row_height . "px\">\n"; $html .= " \n"; $html .= "</div>\n"; $html .= "</td>\n"; $html .= "</tr>\n"; } $html .= "</tbody>\n"; $html .= "</table>\n"; $html .= "</div>\n"; // Now draw the maxi table $html .= "<div class=\"maxi\">\n"; $total_height = $n_bookings * $main_cell_height; $total_height += ($n_bookings - 1) * $main_table_cell_border_width; // (first row has no top border) $html .= "<div class=\"multiple_control\" " . "style =\"height: " . $total_height . "px; " . "min-height: " . $total_height . "px; " . "max-height: " . $total_height . "px; " . "\">-</div>\n"; $html .= "<table>\n"; $html .= "<tbody>\n"; for ($n = 0; $n < $n_bookings; $n++) { $id = $cell[$n]["id"]; $is_repeat = $cell[$n]["is_repeat"]; $is_multiday_start = $cell[$n]["is_multiday_start"]; $is_multiday_end = $cell[$n]["is_multiday_end"]; $status = $cell[$n]["status"]; $color = $cell[$n]["color"]; $descr = htmlspecialchars($cell[$n]["start_time"] . " " . $cell[$n]["data"]); $long_descr = htmlspecialchars($cell[$n]["long_descr"]); $class = $color; if ($status & STATUS_PRIVATE) { $class .= " private"; } if ($approval_enabled && $status & STATUS_AWAITING_APPROVAL) { $class .= " awaiting_approval"; } if ($confirmation_enabled && $status & STATUS_TENTATIVE) { $class .= " tentative"; } if ($is_multiday_start) { $class .= " multiday_start"; } if ($is_multiday_end) { $class .= " multiday_end"; } $html .= "<tr>\n"; $html .= "<td class=\"{$class}\"" . ($n == 0 ? " style=\"border-top-width: 0\"" : "") . ">\n"; $html .= "<div class=\"celldiv slots1\">\n"; // we want clipping of overflow $html .= "<a href=\"view_entry.php?id={$id}&" . $query_strings['booking'] . "\" title=\"{$long_descr}\">"; $html .= $is_repeat ? "<img class=\"repeat_symbol\" src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" . get_vocab("series") . "\" width=\"10\" height=\"10\">" : ''; $html .= "{$descr}</a>\n"; $html .= "</div>\n"; $html .= "</td>\n"; $html .= "</tr>\n"; } $html .= "</tbody>\n"; $html .= "</table>\n"; $html .= "</div>\n"; $html .= "</td>\n"; } else { if (isset($cell[0]["id"])) { $id = $cell[0]["id"]; $is_repeat = $cell[0]["is_repeat"]; $is_multiday_start = $cell[0]["is_multiday_start"]; $is_multiday_end = $cell[0]["is_multiday_end"]; $status = $cell[0]["status"]; $color = $cell[0]["color"]; $descr = isset($cell[0]["data"]) ? htmlspecialchars($cell[0]["data"]) : NULL; $long_descr = htmlspecialchars($cell[0]["long_descr"]); $slots = $cell[0]["slots"]; } else { unset($id); $slots = 1; } // $c is the colour of the cell that the browser sees. Zebra stripes normally, // row_highlight if we're highlighting that line and the appropriate colour if // it is booked (determined by the type). // We tell if its booked by $id having something in it if (isset($id)) { $c = $color; if ($status & STATUS_PRIVATE) { $c .= " private"; } if ($approval_enabled && $status & STATUS_AWAITING_APPROVAL) { $c .= " awaiting_approval"; } if ($confirmation_enabled && $status & STATUS_TENTATIVE) { $c .= " tentative"; } if ($is_multiday_start) { $c .= " multiday_start"; } if ($is_multiday_end) { $c .= " multiday_end"; } // Add a class to bookings that this user is allowed to edit so that the // JavaScript can turn them into resizable bookings /*if (getWritable($cell[0]['create_by'], $user, $cell[0]['room_id'])) { $c .= " writable"; if ($is_repeat) { $c .= " series"; } }*/ } else { $c = $is_invalid ? "invalid" : "new"; } // Don't put in a <td> cell if the slot is booked and there's no description. // This would mean that it's the second or subsequent slot of a booking and so the // <td> for the first slot would have had a rowspan that extended the cell down for // the number of slots of the booking. if (!isset($id) || isset($descr)) { $html .= tdcell($c, $slots); // If the room isn't booked then allow it to be booked if (!isset($id)) { // Don't provide a link if the slot doesn't really exist if (!$is_invalid) { $html .= "<div class=\"celldiv slots1\">\n"; // a bookable slot is only one unit high $html .= "<a href=\"edit_entry.php?" . ($enable_periods ? $query_strings['new_periods'] : $query_strings['new_times']) . "\">\n"; if ($show_plus_link) { $html .= "<img src=\"images/new.gif\" alt=\"New\" width=\"10\" height=\"10\">\n"; } $html .= "</a>\n"; $html .= "</div>\n"; } } else { $html .= "<div data-id=\"{$id}\" class=\"celldiv slots" . ($times_along_top ? "1" : $slots) . "\">\n"; $html .= "<a href=\"view_entry.php?id={$id}&" . $query_strings['booking'] . "\" title=\"{$long_descr}\">"; $html .= $is_repeat ? "<img class=\"repeat_symbol {$c}\" src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" . get_vocab("series") . "\" width=\"10\" height=\"10\">" : ''; $html .= "{$descr}</a>\n"; $html .= "</div>\n"; } $html .= "</td>\n"; } } return $html; }
} //Anything to display for this day? if (isset($d[$cday][$cmonth][$cyear]["id"][0])) { $n = count($d[$cday][$cmonth][$cyear]["id"]); //Show the start/stop times, 2 per line, linked to view_entry. //If there are 12 or fewer, show them, else show 11 and "...". for ($i = 0; $i < $n; $i++) { if ($i == 11 && $n > 12) { echo " ...\n"; break; } for ($i = 0; $i < $n; $i++) { if ($d[$cday][$cmonth][$cyear]["room"][$i] == $row[0]) { //if ($i > 0 && $i % 2 == 0) echo "<br />"; else echo " "; echo "\n<br />\n<table width=\"100%\" border=\"0\" ><tr>\n"; tdcell($d[$cday][$cmonth][$cyear]["color"][$i]); if ($d[$cday][$cmonth][$cyear]["res"][$i] != '-') { echo " <img src=\"img_grr/buzy.png\" alt=\"" . get_vocab("ressource actuellement empruntee") . "\" title=\"" . get_vocab("ressource actuellement empruntee") . "\" width=\"20\" height=\"20\" class=\"image\" /> \n"; } // si la réservation est à confirmer, on le signale if (isset($d[$cday][$cmonth][$cyear]["option_reser"][$i]) && $d[$cday][$cmonth][$cyear]["option_reser"][$i] != -1) { echo " <img src=\"img_grr/small_flag.png\" alt=\"" . get_vocab("reservation_a_confirmer_au_plus_tard_le") . "\" title=\"" . get_vocab("reservation_a_confirmer_au_plus_tard_le") . " " . time_date_string_jma($d[$cday][$cmonth][$cyear]["option_reser"][$i], $dformat) . "\" width=\"20\" height=\"20\" class=\"image\" /> \n"; } // si la réservation est à modérer, on le signale if (isset($d[$cday][$cmonth][$cyear]["moderation"][$i]) && $d[$cday][$cmonth][$cyear]["moderation"][$i] == 1) { echo " <img src=\"img_grr/flag_moderation.png\" alt=\"" . get_vocab("en_attente_moderation") . "\" title=\"" . get_vocab("en_attente_moderation") . "\" class=\"image\" /> \n"; } if ($acces_fiche_reservation) { echo "<a title=\"" . htmlspecialchars($d[$cday][$cmonth][$cyear]["data"][$i]) . "\" href=\"view_entry.php?id=" . $d[$cday][$cmonth][$cyear]["id"][$i] . "&page=month\">" . $d[$cday][$cmonth][$cyear]["who1"][$i][0] . "</a>"; } else { echo $d[$cday][$cmonth][$cyear]["who1"][$i][0];
} else { if (($authGetUserLevel > 1 || $auth_visiteur == 1) && $UserRoomMaxBooking != 0 && verif_booking_date(getUserName(), -1, $room, $date_booking, $date_now, $enable_periods) && verif_delais_max_resa_room(getUserName(), $room, $date_booking) && verif_delais_min_resa_room(getUserName(), $room, $date_booking) && ($this_statut_room == "1" || $this_statut_room == "0" && authGetUserLevel(getUserName(), $room) > 2) && $_GET['pview'] != 1) { if ($enable_periods == 'y') { echo "<a href=\"edit_entry.php?room={$room}" . "&period={$time_t_stripped}&year={$wyear}&month={$wmonth}" . "&day={$wday}&page=week\" title=\"" . get_vocab("cliquez_pour_effectuer_une_reservation") . "\"><span class=\"glyphicon glyphicon-plus\"></span>"; echo "</a>"; } else { echo "<a href=\"edit_entry.php?room={$room}" . "&hour={$hour}&minute={$minute}&year={$wyear}&month={$wmonth}" . "&day={$wday}&page=week\" title=\"" . get_vocab("cliquez_pour_effectuer_une_reservation") . "\"><span class=\"glyphicon glyphicon-plus\"></span>"; echo "</a>"; } } else { echo " "; } } } else { if (est_hors_reservation(mktime(0, 0, 0, $wmonth, $wday, $wyear), $area)) { echo tdcell($empty_color) . "<img src=\"img_grr/stop.png\" alt=\"" . get_vocab("reservation_impossible") . "\" title=\"" . get_vocab("reservation_impossible") . "\" width=\"16\" height=\"16\" class=\"" . $class_image . "\" />"; } else { if (isset($d[$weekday][$slot - $decale_slot * $nb_case]["id"])) { if ($enable_periods == 'y') { // Nb de case pour crénau $nbrow = ($d[$weekday][$slot - $decale_slot * $nb_case]['horaireFin'] - $d[$weekday][$slot - $decale_slot * $nb_case]['horaireDebut']) / 60; } else { $nbrow = $d[$weekday][$slot - $decale_slot * $nb_case]["duree"]; } tdcell_rowspan($d[$weekday][$slot - $decale_slot * $nb_case]["color"], $nbrow); if ($acces_fiche_reservation) { if (Settings::get("display_level_view_entry") == 0) { $currentPage = 'week'; $id = $d[$weekday][$slot - $decale_slot * $nb_case]["id"]; echo "<a title=\"" . htmlspecialchars($d[$weekday][$slot - $decale_slot * $nb_case]["who"]) . "\" data-width=\"675\" onclick=\"request({$id},{$wday},{$wmonth},{$wyear},'{$currentPage}',readData);\" data-rel=\"popup_name\" class=\"poplight\">"; } else {
function show_colour_key($area_id) { echo '<table class="legende"><caption class="titre">Légendes des réservations</caption>' . PHP_EOL; $sql = "SELECT DISTINCT t.id, t.type_name, t.type_letter FROM " . TABLE_PREFIX . "_type_area t\n\tLEFT JOIN " . TABLE_PREFIX . "_j_type_area j on j.id_type=t.id\n\tWHERE (j.id_area IS NULL or j.id_area != '" . $area_id . "')\n\tORDER BY t.order_display"; $res = grr_sql_query($sql); if ($res) { $nct = -1; for ($i = 0; $row = grr_sql_row($res, $i); $i++) { // La requête sql précédente laisse passer les cas où un type est non valide dans le domaine concerné ET au moins dans un autre domaine, d'où le test suivant $test = grr_sql_query1("SELECT id_type FROM " . TABLE_PREFIX . "_j_type_area WHERE id_type = '" . $row[0] . "' and id_area='" . $area_id . "'"); if ($test == -1) { $type_name = $row[1]; $type_letter = $row[2]; if ($nct == -1) { echo '<tr>' . PHP_EOL; } if (++$nct == 2) { $nct = 0; echo '</tr>' . PHP_EOL, '<tr>' . PHP_EOL; } tdcell($type_letter); echo $type_name, '</td>' . PHP_EOL; } } if ($i % 2 == 1) { echo '<td></td>', PHP_EOL, '</tr>' . PHP_EOL; } echo '</table>' . PHP_EOL; } }
$wday = date("d", $wt); $wmonth = date("m", $wt); $wyear = date("Y", $wt); if (!isset($d[$weekday][$slot]["color"])) { tdcell($empty_color); $hour = date("H", $wt); $minute = date("i", $wt); echo "<center>"; if ($pview != 1) { echo "<a href=\"edit_entry.php?room={$room}&area={$area}" . "&hour={$hour}&minute={$minute}&year={$wyear}&month={$wmonth}" . "&day={$wday}\"><img src=new.gif width=10 height=10 border=0>"; } else { echo ' '; } echo "</a></center>"; } else { tdcell($d[$weekday][$slot]["color"]); if (!isset($d[$weekday][$slot]["id"])) { echo " \" "; } else { echo " <a href=\"view_entry.php?id=" . $d[$weekday][$slot]["id"] . "&area={$area}&day={$wday}&month={$wmonth}&year={$wyear}\">" . htmlspecialchars($d[$weekday][$slot]["data"]) . "</a>"; } } echo "</td>\n"; $wt += 86400; } echo "</tr>\n"; $t += $resolution; } echo "</table>"; if ($pview != 1) { show_colour_key();
} if ($d[$weekday][$slot-$decale_slot*$nb_case]["description"]!= "") echo "<br /><i>".$d[$weekday][$slot-$decale_slot*$nb_case]["description"]."</i>"; } } } echo "</td>\n"; } $wt += 86400; $num_week_day++;// Pour le calcul des jours à afficher $num_week_day = $num_week_day % 7;// Pour le calcul des jours à afficher } // répétition de la première colonne tdcell("cell_hours"); if($enable_periods=='y'){ $time_t = date("i", $t); $time_t_stripped = preg_replace( "/^0/", "", $time_t ); echo $periods_name[$time_t_stripped] . "</td>\n"; } else { echo affiche_heure_creneau($t,$resolution)."</td>\n"; } echo "</tr>\n"; $t += $resolution; } // répétition de la première ligne echo "<tr>\n<th> </th>\n"; $num_week_day = $weekstarts; $i=$time;
echo "//]]>\n"; echo "</script>\n"; } echo "</div>\n"; } else { echo "<div class=\"celldiv" . $slots . "\">\n"; // we want clipping of overflow echo " <a class=\"booking\" href=\"view_entry.php?id={$id}" . "&area={$area}&day={$wday}&month={$wmonth}&year={$wyear}\" " . "title=\"{$long_descr}\">{$descr}</a>\n"; echo "</div>\n"; } echo "</td>\n"; } } // next lines to display times on right side if (FALSE != $times_right_side) { tdcell("times", 1); echo "<div class=\"celldiv1\">\n"; if ($enable_periods) { $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>"; } else { echo "<a href=\"{$hilite_url}={$time_t}\" title=\"" . get_vocab("highlight_line") . "\">" . utf8_strftime(hour_min_format(), $t) . "</a>"; } echo "</div></td>\n"; } echo "</tr>\n"; } echo "</tbody>\n"; echo "</table>\n"; print $before_after_links_html; show_colour_key();
$res = grr_sql_query($sql); if (!$res) { fatal_error(0, grr_sql_error()); } $row4 = grr_sql_row($res, 0); $description = $row4[0]; $sql = "SELECT nom, prenom from " . TABLE_PREFIX . "_utilisateurs where login = '******'"; $res = grr_sql_query($sql); if (!$res) { fatal_error(0, grr_sql_error()); } $row5 = grr_sql_row($res, 0); $nom_modo = $row5[1] . ' ' . $row5[0]; if (authGetUserLevel(getUserName(), -1) > 1) { echo '<tr><td><b>' . get_vocab("moderation") . get_vocab("deux_points") . '</b></td>'; tdcell("avertissement"); echo '<strong>' . get_vocab("moderation_refusee") . '</strong> par ' . $nom_modo; if ($description != "") { echo ' : <br />(' . $description . ')'; } echo '</td>', PHP_EOL, '</tr>', PHP_EOL; } } } if (getWritable($beneficiaire, getUserName(), $id) && verif_booking_date(getUserName(), $id, $room_id, -1, $date_now, $enable_periods) && verif_delais_min_resa_room(getUserName(), $room_id, $row[10]) && !$was_del) { ?> <tr> <td colspan="2"> <?php echo "<input class=\"btn btn-primary\" type=\"button\" onclick=\"location.href='edit_entry.php?id={$id}&day={$day}&month={$month}&year={$year}&page={$page}'\" value=\"" . get_vocab("editentry") . "\">"; echo "<input class=\"btn btn-info\" type=\"button\" onclick=\"location.href='edit_entry.php?id={$id}&day={$day}&month={$month}&year={$year}&page={$page}&copier'\" value=\"" . get_vocab("copyentry") . "\">";
echo '<img src="img_grr/skey.png" alt="clef">'; } $courrier = grr_sql_query1("SELECT courrier FROM " . TABLE_PREFIX . "_entry WHERE " . TABLE_PREFIX . "_entry.id= " . $d[$weekday][$slot - $decale_slot * $nb_case]['id'] . ""); if (Settings::get('show_courrier') == 'y') { if ($courrier == 1) { echo '<img src="img_grr/scourrier.png" alt="courrier">' . PHP_EOL; } else { echo '<img src="img_grr/hourglass.png" alt="buzy">' . PHP_EOL; } } if ($acces_fiche_reservation) { echo "</a>"; } } if (!isset($d[$weekday][$slot - $decale_slot * $nb_case]["id"])) { echo tdcell($empty_color) . ""; } if (isset($d[$weekday][$slot - $decale_slot * $nb_case]["statut"]) && $d[$weekday][$slot - $decale_slot * $nb_case]["statut"] != '-') { echo '<img src="img_grr/buzy.png" alt="' . get_vocab("ressource actuellement empruntee") . '" title="' . get_vocab("ressource actuellement empruntee") . '" width="20" height="20" class="image" />' . PHP_EOL; } if ($this_delais_option_reservation > 0 && isset($d[$weekday][$slot - $decale_slot * $nb_case]["option_reser"]) && $d[$weekday][$slot - $decale_slot * $nb_case]["option_reser"] != -1) { echo '<img src="img_grr/small_flag.png" alt="' . get_vocab("reservation_a_confirmer_au_plus_tard_le") . '" title="' . get_vocab("reservation_a_confirmer_au_plus_tard_le") . ' ' . time_date_string_jma($d[$weekday][$slot - $decale_slot * $nb_case]["option_reser"], $dformat) . '" width="20" height="20" class="image" />' . PHP_EOL; } if (isset($d[$weekday][$slot - $decale_slot * $nb_case]["moderation"]) && $d[$weekday][$slot - $decale_slot * $nb_case]["moderation"] == '1') { echo '<img src="img_grr/flag_moderation.png" alt="' . get_vocab("en_attente_moderation") . '" title="' . get_vocab("en_attente_moderation") . '" class="image" />' . PHP_EOL; } } } } $wt += 86400; $num_week_day++;
} } elseif ($moderate == 3) { // Modération refusée // recupération des infos de moderation $sql = "select motivation_moderation, login_moderateur from ".TABLE_PREFIX."_entry_moderate where id=".$id; $res = grr_sql_query($sql); if (! $res) fatal_error(0, grr_sql_error()); $row4 = grr_sql_row($res, 0); $description = $row4[0]; // recuperation du nom du moderateur $sql ="select nom, prenom from ".TABLE_PREFIX."_utilisateurs where login = '******'"; $res = grr_sql_query($sql); if (! $res) fatal_error(0, grr_sql_error()); $row5 = grr_sql_row($res, 0); $nom_modo = $row5[1]. ' '. $row5[0]; if (authGetUserLevel(getUserName(),-1) > 1) { // les visiteurs n'ont pas accès à cette information echo '<tr><td><b>'.get_vocab("moderation").get_vocab("deux_points").'</b></td>'; tdcell("avertissement"); echo '<strong>'.get_vocab("moderation_refusee").'</strong> par '.$nom_modo; if ($description != "") echo ' : <br />('.$description.')'; echo "</td></tr>"; } } if ((getWritable($beneficiaire, getUserName(),$id)) and verif_booking_date(getUserName(), $id, $room_id, -1, $date_now, $enable_periods) and verif_delais_min_resa_room(getUserName(), $room_id, $row[10]) and (!$was_del)) { ?> <tr> <td colspan="2"> <?php echo "<a href=\"edit_entry.php?id=$id&day=$day&month=$month&year=$year&page=$page\">".get_vocab("editentry")."</a>"; echo " - <a href=\"edit_entry.php?id=$id&day=$day&month=$month&year=$year&page=$page&copy\">".get_vocab("copyentry")."</a>"; if ($can_delete_or_create=="y") { $message_confirmation = str_replace ( "'" , "\\'" , get_vocab("confirmdel").get_vocab("deleteentry")); ?>
function show_colour_key($area_id) { echo "<table border=\"0\"><tr>\n"; $nct = 0; $sql = "SELECT DISTINCT t.id, t.type_name, t.type_letter FROM ".TABLE_PREFIX."_type_area t LEFT JOIN ".TABLE_PREFIX."_j_type_area j on j.id_type=t.id WHERE (j.id_area IS NULL or j.id_area != '".$area_id."') ORDER BY t.order_display"; $res = grr_sql_query($sql); if ($res) { for ($i = 0; ($row = grr_sql_row($res, $i)); $i++) { // La requête sql précédente laisse passer les cas où un type est non valide dans le domaine concerné ET au moins dans un autre domaine, d'où le test suivant $test = grr_sql_query1("select id_type from ".TABLE_PREFIX."_j_type_area where id_type = '".$row[0]."' and id_area='".$area_id."'"); if ($test == -1) { $id_type = $row[0]; $type_name = $row[1]; $type_letter = $row[2]; if (++$nct > 10) { $nct = 0; echo "</tr><tr>"; } tdcell($type_letter); echo "$type_name</td>\n"; } } echo "</tr></table>\n"; } }
function show_colour_key() { global $typel; echo "<table border=0><tr>\n"; $nct = 0; for ($ct = "A"; $ct <= "Z"; $ct++) { if (!empty($typel[$ct])) { if (++$nct > 5) { $nct = 0; echo "</tr><tr>"; } tdcell($ct); echo "{$typel[$ct]}</td>\n"; } } echo "</tr></table>\n"; }
function drawTimeTableColum($room, $capacity, $time) { global $resolution, $showSingleEntrysAsBlock; $wday = date("d", $time); $wmonth = date("m", $time); $wyear = date("Y", $time); $hour = date("H", $time); $minute = date("i", $time); $time2 = $time + $resolution; $start = $time; $end = $time2; $area_id = 4; $roomentries = checkTime_Room($start, $end, $area_id, $room); if (count($roomentries)) { print_r($roomentries); $num_entry = count($roomentries[$room]); } else { $num_entry = ''; } if ($num_entry > 0) { tdcell("nofreeslots"); } else { tdcell("white"); } echo "<center>"; echo $num_entry; echo '<input type="radio" name="starttime" value="' . $wyear . ';' . $wmonth . ';' . $wday . ';' . $hour . ';' . $minute . ';' . $room . ';day">' . chr(10); echo '<input type="radio" name="endtime" value="' . $wyear . ';' . $wmonth . ';' . $wday . ';' . $hour . ';' . $minute . ';' . $room . ';day">' . chr(10); //if(!$showSingleEntrysAsBlock&&$available==1&&$capacity==1) //{ //do nothing echo "<a href=\"edit_entry2.php?view=week&room={$room}" . "&hour={$hour}&minute={$minute}&year={$wyear}&month={$wmonth}" . "&day={$wday}\"><img src=img/new.gif width=10 height=10 border=0></a>"; /*} elseif ($available > 0) { echo "<a href=\"edit_entry2.php?view=week&room=$room" . "&hour=$hour&minute=$minute&year=$wyear&month=$wmonth" . "&day=$wday\"> ( $available / $capacity ) <img src=img/new.gif width=10 height=10 border=0></a>"; } elseif ($showSingleEntrysAsBlock) { echo " ( $available / $capacity )"; }*/ echo "</center>"; #begin table for entry list boxes #if there is only one entry, show this as text instead of box /* if($reserviert==1&&!$showSingleEntrysAsBlock){ $type = mysql_result($entries, 0 , 0); $id = mysql_result($entries, 0 , 1 ); $thetitle = mysql_result($entries, 0 , 2); $links="view_entry.php?view=week&id=".$id."&day=$wday&month=$wmonth&year=$wyear"; echo "<a href=\"$links\">",substr($thetitle,0,20),"</a>"; } else { echo "<table cellspacing=3 cellpadding=0 border=0><tr>"; for ($i = 0 ; $i < $reserviert ; $i++){ $type = mysql_result($entries, $i , 0); $id = mysql_result($entries, $i , 1 ); $thetitle = mysql_result($entries, $i , 2); $links="view_entry.php?view=week&id=".$id."&day=$wday&month=$wmonth&year=$wyear"; echo "<td class=$type><a onmouseover=\"return overlib('<b>",addslashes($thetitle),"</b><br>", _("from"), " ", strftime('%d.%b.%Y %H:%M',mysql_result($entries,$i,3)),"<br>", _("till"), " ",strftime('%d.%b.%Y %H:%M',mysql_result($entries,$i,4)),"');\" onmouseout=\"return nd();\" href=\"$links\" ><img src=img/pixel.gif width=10 height=10 border=0></a></td>"; } echo "</tr></table>"; }*/ echo "</td>"; }