dokeos-calendar
[ class tree: dokeos-calendar ] [ index: dokeos-calendar ] [ all elements ]

Source for file print.php

Documentation is available at print.php

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

Documentation generated on Thu, 12 Jun 2008 09:26:31 -0500 by phpDocumentor 1.4.1