print.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // name of the language file that needs to be included
  3. $language_file = 'agenda';
  4. $id=$_GET['id'];
  5. if(strstr($id,','))
  6. {
  7. $id=explode(',',$id);
  8. $id=array_map('intval',$id);
  9. $id=implode(',',$id);
  10. }
  11. else
  12. {
  13. $id=intval($id);
  14. }
  15. // setting the global file that gets the general configuration, the databases, the languages, ...
  16. include('../inc/global.inc.php');
  17. $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
  18. $sql = "SELECT * FROM $TABLEAGENDA WHERE id IN($id) ORDER BY start_date DESC";
  19. $result = api_sql_query($sql,__FILE__,__LINE__);
  20. ?>
  21. <html>
  22. <head>
  23. <title><?php echo get_lang('Print'); ?></title>
  24. <style type="text/css" media="screen, projection">
  25. /*<![CDATA[*/
  26. @import "../css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  27. /*]]>*/
  28. </style>
  29. </head>
  30. <body style="margin: 15px; padding: 0px;">
  31. <center>
  32. <input type="button" value="<?php echo htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  33. </center>
  34. <br /><br />
  35. <?php
  36. while($row=mysql_fetch_array($result))
  37. {
  38. $row['content'] = $row['content'];
  39. $row['content'] = make_clickable($row['content']);
  40. $row['content'] = text_filter($row['content']);
  41. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  42. if(!empty($row['title']))
  43. {
  44. echo '<b>'.$row['title'].'</b><br /><br />';
  45. }
  46. echo get_lang('StartTime').' : ';
  47. echo ucfirst(format_locale_date($dateFormatLong,strtotime($row["start_date"])))."&nbsp;&nbsp;&nbsp;";
  48. echo ucfirst(strftime($timeNoSecFormat,strtotime($row["start_date"])))."";
  49. echo '<br />';
  50. echo get_lang('EndTime').' : ';
  51. echo ucfirst(format_locale_date($dateFormatLong,strtotime($row["end_date"])))."&nbsp;&nbsp;&nbsp;";
  52. echo ucfirst(strftime($timeNoSecFormat,strtotime($row["end_date"])))."";
  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 htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  60. </center>
  61. </body>
  62. </html>