print.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * See copyright information in the Dokeos root directory, dokeos_license.txt
  4. * @package dokeos.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. {
  11. $id=explode(',',$id);
  12. $id=array_map('intval',$id);
  13. $id=implode(',',$id);
  14. }
  15. else
  16. {
  17. $id=intval($id);
  18. }
  19. // setting the global file that gets the general configuration, the databases, the languages, ...
  20. require('../inc/global.inc.php');
  21. $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
  22. $sql = "SELECT * FROM $TABLEAGENDA WHERE id IN($id) ORDER BY start_date DESC";
  23. $result = api_sql_query($sql,__FILE__,__LINE__);
  24. ?>
  25. <html>
  26. <head>
  27. <title><?php echo get_lang('Print'); ?></title>
  28. <style type="text/css" media="screen, projection">
  29. /*<![CDATA[*/
  30. @import "../css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  31. /*]]>*/
  32. </style>
  33. </head>
  34. <body style="margin: 15px; padding: 0px;">
  35. <center>
  36. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  37. </center>
  38. <br /><br />
  39. <?php
  40. while($row=Database::fetch_array($result))
  41. {
  42. $row['content'] = $row['content'];
  43. $row['content'] = make_clickable($row['content']);
  44. $row['content'] = text_filter($row['content']);
  45. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  46. if(!empty($row['title']))
  47. {
  48. echo '<b>'.$row['title'].'</b><br /><br />';
  49. }
  50. echo get_lang('StartTime').' : ';
  51. echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($row["start_date"])))."&nbsp;&nbsp;&nbsp;";
  52. echo api_ucfirst(strftime($timeNoSecFormat,strtotime($row["start_date"])))."";
  53. echo '<br />';
  54. echo get_lang('EndTime').' : ';
  55. echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($row["end_date"])))."&nbsp;&nbsp;&nbsp;";
  56. echo api_ucfirst(strftime($timeNoSecFormat,strtotime($row["end_date"])))."";
  57. echo '<br /><br />';
  58. echo $row['content'].'<hr size="1" noshade="noshade" />';
  59. }
  60. ?>
  61. <br /><br />
  62. <center>
  63. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  64. </center>
  65. </body>
  66. </html>