print.php 2.0 KB

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