calendar_view_print.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. * @author Carlos Vargas
  6. * This file is the calendar/print.php
  7. */
  8. // name of the language file that needs to be included
  9. $language_file = 'agenda';
  10. $id=$_GET['id'];
  11. if(strstr($id,','))
  12. {
  13. $id=explode(',',$id);
  14. $id=array_map('intval',$id);
  15. $id=implode(',',$id);
  16. }
  17. else
  18. {
  19. $id=intval($id);
  20. }
  21. // setting the global file that gets the general configuration, the databases, the languages, ...
  22. //require('../inc/global.inc.php');
  23. $TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
  24. $sql = "SELECT * FROM $TABLEAGENDA WHERE id IN($id) ORDER BY start_date DESC";
  25. $result = Database::query($sql);
  26. ?>
  27. <html>
  28. <head>
  29. <title><?php echo get_lang('Print'); ?></title>
  30. </head>
  31. <body style="margin: 15px; padding: 0px;">
  32. <center>
  33. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  34. </center>
  35. <br /><br />
  36. <?php
  37. while($row=Database::fetch_array($result))
  38. {
  39. $row['content'] = $row['content'];
  40. $row['content'] = Text::make_clickable($row['content']);
  41. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  42. if(!empty($row['title']))
  43. {
  44. echo '<b>'.$row['title'].'</b><br /><br />';
  45. }
  46. echo get_lang('StartTime').' : ';
  47. echo api_convert_and_format_date($row["start_date"], null, date_default_timezone_get());
  48. echo '<br />';
  49. echo get_lang('EndTime').' : ';
  50. echo api_convert_and_format_date($row["end_date"], null, date_default_timezone_get());
  51. echo '<br /><br />';
  52. echo $row['content'].'<hr size="1" noshade="noshade" />';
  53. }
  54. ?>
  55. <br /><br />
  56. <center>
  57. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  58. </center>
  59. </body>
  60. </html>