print.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. // setting the language file
  3. $langFile = "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(AGENDA_TABLE);
  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/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')); ?>" 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')); ?>" onclick="javascript:window.print();" />
  60. </center>
  61. </body>
  62. </html>