calendar_view_print.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php // $id: $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2008 Dokeos S.A.
  6. For a full list of contributors, see "credits.txt".
  7. The full license can be read in "license.txt".
  8. This program is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU General Public License
  10. as published by the Free Software Foundation; either version 2
  11. of the License, or (at your option) any later version.
  12. See the GNU General Public License for more details.
  13. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  14. ==============================================================================
  15. */
  16. /**
  17. ==============================================================================
  18. * @package dokeos.admin
  19. * @author Carlos Vargas
  20. * This file is the calendar/print.php
  21. ==============================================================================
  22. */
  23. // name of the language file that needs to be included
  24. $language_file = 'agenda';
  25. $id=$_GET['id'];
  26. if(strstr($id,','))
  27. {
  28. $id=explode(',',$id);
  29. $id=array_map('intval',$id);
  30. $id=implode(',',$id);
  31. }
  32. else
  33. {
  34. $id=intval($id);
  35. }
  36. // setting the global file that gets the general configuration, the databases, the languages, ...
  37. require('../inc/global.inc.php');
  38. $TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
  39. $sql = "SELECT * FROM $TABLEAGENDA WHERE id IN($id) ORDER BY start_date DESC";
  40. $result = api_sql_query($sql,__FILE__,__LINE__);
  41. ?>
  42. <html>
  43. <head>
  44. <title><?php echo get_lang('Print'); ?></title>
  45. <style type="text/css" media="screen, projection">
  46. /*<![CDATA[*/
  47. @import "../css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  48. /*]]>*/
  49. </style>
  50. </head>
  51. <body style="margin: 15px; padding: 0px;">
  52. <center>
  53. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  54. </center>
  55. <br /><br />
  56. <?php
  57. while($row=Database::fetch_array($result))
  58. {
  59. $row['content'] = $row['content'];
  60. $row['content'] = make_clickable($row['content']);
  61. $row['content'] = text_filter($row['content']);
  62. $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
  63. if(!empty($row['title']))
  64. {
  65. echo '<b>'.$row['title'].'</b><br /><br />';
  66. }
  67. echo get_lang('StartTime').' : ';
  68. echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($row["start_date"])))."&nbsp;&nbsp;&nbsp;";
  69. echo ucfirst(strftime($timeNoSecFormat,strtotime($row["start_date"])))."";
  70. echo '<br />';
  71. echo get_lang('EndTime').' : ';
  72. echo api_ucfirst(format_locale_date($dateFormatLong,strtotime($row["end_date"])))."&nbsp;&nbsp;&nbsp;";
  73. echo ucfirst(strftime($timeNoSecFormat,strtotime($row["end_date"])))."";
  74. echo '<br /><br />';
  75. echo $row['content'].'<hr size="1" noshade="noshade" />';
  76. }
  77. ?>
  78. <br /><br />
  79. <center>
  80. <input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
  81. </center>
  82. </body>
  83. </html>