print.php 1.8 KB

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