calendar_view_print.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. <style type="text/css" media="screen, projection">
  31. /*<![CDATA[*/
  32. @import "../css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  33. /*]]>*/
  34. </style>
  35. </head>
  36. <body style="margin: 15px; padding: 0px;">
  37. <center>
  38. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  39. </center>
  40. <br /><br />
  41. <?php
  42. while($row=Database::fetch_array($result))
  43. {
  44. $row['content'] = $row['content'];
  45. $row['content'] = Text::make_clickable($row['content']);
  46. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  47. if(!empty($row['title']))
  48. {
  49. echo '<b>'.$row['title'].'</b><br /><br />';
  50. }
  51. echo get_lang('StartTime').' : ';
  52. echo api_convert_and_format_date($row["start_date"], null, date_default_timezone_get());
  53. echo '<br />';
  54. echo get_lang('EndTime').' : ';
  55. echo api_convert_and_format_date($row["end_date"], null, date_default_timezone_get());
  56. echo '<br /><br />';
  57. echo $row['content'].'<hr size="1" noshade="noshade" />';
  58. }
  59. ?>
  60. <br /><br />
  61. <center>
  62. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  63. </center>
  64. </body>
  65. </html>