function escape($string) { global $output_as_csv; if ($output_as_csv) { $string = str_replace('"', '""', $string); } else { $string = mrbs_nl2br(htmlspecialchars($string)); } return $string; }
function escape($string) { global $output_format; switch ($output_format) { case OUTPUT_HTML: $string = mrbs_nl2br(htmlspecialchars($string)); break; case OUTPUT_CSV: $string = str_replace('"', '""', $string); break; default: // do nothing break; } return $string; }
function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display) { global $typel; global $enable_periods; // Display Area/Room, but only when it changes: $area_room = htmlspecialchars($row['area_name']) . " - " . htmlspecialchars($row['room_name']); $date = utf8_strftime("%d-%b-%Y", $row['start_time']); // entries to be sorted on area/room echo "<div class=\"div_report\">\n"; if ($sortby == "r") { if ($area_room != $last_area_room) { echo "<h2>" . get_vocab("room") . ": " . $area_room . "</h2>\n"; } if ($date != $last_date || $area_room != $last_area_room) { echo "<h3>" . get_vocab("date") . ": " . $date . "</h3>\n"; $last_date = $date; } // remember current area/room that is being processed. // this is done here as the if statement above needs the old // values if ($area_room != $last_area_room) { $last_area_room = $area_room; } } else { if ($date != $last_date) { echo "<h2>" . get_vocab("date") . ": " . $date . "</h2>\n"; } if ($area_room != $last_area_room || $date != $last_date) { echo "<h3>" . get_vocab("room") . ": " . $area_room . "</h3>\n"; $last_area_room = $area_room; } // remember current date that is being processed. // this is done here as the if statement above needs the old // values if ($date != $last_date) { $last_date = $date; } } echo "<div class=\"report_entry_title\">\n"; echo "<div class=\"report_entry_name\">\n"; // Brief Description (title), linked to view_entry: echo "<a href=\"view_entry.php?id=" . $row['entry_id'] . "\">" . htmlspecialchars($row['name']) . "</a>\n"; echo "</div>\n"; echo "<div class=\"report_entry_when\">\n"; // what do you want to display duration or end date/time if ($display == "d") { // Start date/time and duration: echo (empty($enable_periods) ? describe_span($row['start_time'], $row['end_time']) : describe_period_span($row['start_time'], $row['end_time'])) . "\n"; } else { // Start date/time and End date/time: echo (empty($enable_periods) ? start_to_end($row['start_time'], $row['end_time']) : start_to_end_period($row['start_time'], $row['end_time'])) . "\n"; } echo "</div>\n"; echo "</div>\n"; echo "<table>\n"; echo "<colgroup>\n"; echo "<col class=\"col1\">\n"; echo "<col class=\"col2\">\n"; echo "</colgroup>\n"; // Description: echo "<tr><td>" . get_vocab("description") . ":</td><td>" . mrbs_nl2br(htmlspecialchars($row['description'])) . "</td></tr>\n"; // Entry Type: $et = empty($typel[$row['type']]) ? "?" . $row['type'] . "?" : $typel[$row['type']]; echo "<tr><td>" . get_vocab("type") . ":</td><td>{$et}</td></tr>\n"; // Created by and last update timestamp: echo "<tr class=\"createdby\"><td>" . get_vocab("createdby") . ":</td><td>" . htmlspecialchars($row['create_by']) . "</td></tr>\n"; echo "<tr class=\"lastupdate\"><td>" . get_vocab("lastupdate") . ":</td><td>" . date_time_string($row['last_updated']) . "</td></tr>\n"; echo "</table>\n"; echo "</div>\n\n"; }
<tr> <td><?php echo get_vocab("description"); ?> :</td> <?php echo "<td" . ($keep_private ? " class=\"private\"" : "") . ">" . mrbs_nl2br($description) . "</td>\n"; ?> </tr> <tr> <td><?php echo get_vocab("room"); ?> :</td> <td><?php echo mrbs_nl2br($area_name . " - " . $room_name); ?> </td> </tr> <tr> <td><?php echo get_vocab("start_date"); ?> :</td> <td><?php echo $start_date; ?> </td> </tr> <tr> <td><?php