print.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /**
  8. * Code
  9. */
  10. // name of the language file that needs to be included
  11. $language_file = 'agenda';
  12. $id=$_GET['id'];
  13. if(strstr($id,',')) {
  14. $id=explode(',',$id);
  15. $id=array_map('intval',$id);
  16. $id=implode(',',$id);
  17. } else {
  18. $id=intval($id);
  19. }
  20. // setting the global file that gets the general configuration, the databases, the languages, ...
  21. require_once '../inc/global.inc.php';
  22. $course_id = api_get_course_int_id();
  23. $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
  24. $sql = "SELECT * FROM $TABLEAGENDA WHERE c_id = $course_id AND 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. $row['content'] = $row['content'];
  44. $row['content'] = Text::make_clickable($row['content']);
  45. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  46. if(!empty($row['title'])) {
  47. echo '<h2>'.$row['title'].'</h2><br />';
  48. }
  49. echo get_lang('StartTime').' : ';
  50. echo api_convert_and_format_date($row["start_date"]);
  51. echo '<br />';
  52. echo get_lang('EndTime').' : ';
  53. echo api_convert_and_format_date($row["end_date"]);
  54. echo '<br /><br />';
  55. echo $row['content'].'<hr size="1" noshade="noshade" />';
  56. }
  57. ?>
  58. <br /><br />
  59. <center>
  60. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'), ENT_QUOTES); ?>" onClick="javascript: window.print();" />
  61. </center>
  62. </body>
  63. </html>