remove old readme
[atutor.git] / mods / _standard / reading_list / reading_details.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2008                                      */
6 /* Written by Greg Gay, Joel Kronenberg & Chris Ridpath         */
7 /* Inclusive Design Institute                                   */
8 /* http://atutor.ca                                                                                             */
9 /*                                                              */
10 /* This program is free software. You can redistribute it and/or*/
11 /* modify it under the terms of the GNU General Public License  */
12 /* as published by the Free Software Foundation.                                */
13 /****************************************************************/
14 // $Id$
15 define('AT_INCLUDE_PATH', '../../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17
18 require(AT_INCLUDE_PATH.'header.inc.php');
19
20 $sql = "SELECT * FROM ".TABLE_PREFIX."reading_list WHERE course_id=$_SESSION[course_id] ORDER BY date_start";
21 $resultReadings = mysql_query($sql, $db);
22 ?>
23
24 <?php if (($resultReadings != 0) && ($rowReadings = mysql_fetch_assoc($resultReadings))) : ?>
25
26                 <?php do { ?>
27                         <?php $id = $rowReadings['resource_id']; 
28
29
30 $sql = "SELECT * FROM ".TABLE_PREFIX."external_resources WHERE course_id=$_SESSION[course_id] AND resource_id=$id";
31 $result = mysql_query($sql, $db);
32 if ($row = mysql_fetch_assoc($result)){ 
33         $row['type']            = intval($row['type']);
34         $row['title']           = AT_print($row['title'], 'input.text');
35         $row['author']          = AT_print($row['author'], 'input.text');
36         $row['publisher']       = AT_print($row['publisher'], 'input.text');
37         $row['date']            = AT_print($row['date'], 'input.text');
38         $row['comments']        = AT_print($row['comments'], 'input.text');
39
40         if ($row['type'] == RL_TYPE_BOOK): ?>
41         <div class="input-form">
42                 <p><?php  echo _AT('title'). ": <strong>". $row['title']. "</strong>"; ?><br/>
43                         <?php  echo _AT('rl_type_of_resource'). ": ". _AT($_rl_types[$row['type']]); ?><br/>
44                         <?php  echo _AT('author'). ": ". $row['author']; ?><br/>
45                         <?php  echo _AT('rl_publisher'). ": ". $row['publisher']; ?><br/>
46                         <?php  echo _AT('date'). ": ". $row['date']; ?><br/>
47                         <?php  echo _AT('rl_isbn_number'). ": ". $row['id']; ?><br/>
48                         <?php  echo _AT('comment'). ": ". $row['comments']; ?>
49                 </p>
50         </div>
51 <?php elseif ($row['type'] == RL_TYPE_URL): ?>
52         <div class="input-form">        
53                 <p><?php  echo _AT('title'). ": <strong>". $row['title']. "</strong>"; ?><br/>
54                         <?php  echo _AT('rl_type_of_resource'). ": ". _AT($_rl_types[$row['type']]); ?><br/>
55                         <?php echo _AT('location'). ": " ?><a href="<?php echo $row['url']?>"><?php echo $row['url']; ?></a><br/>
56                         <?php  echo _AT('author'). ": ". $row['author']; ?><br/>
57                         <?php  echo _AT('comment'). ": ". $row['comments']; ?>
58                         </p>
59         </div>
60 <?php elseif ($row['type'] == RL_TYPE_HANDOUT): ?>
61         <div class="input-form">        
62                 <p><?php  echo _AT('title'). ": <strong>". $row['title']. "</strong>"; ?><br/>
63                         <?php  echo _AT('rl_type_of_resource'). ": ". _AT($_rl_types[$row['type']]); ?><br/>
64                         <?php  echo _AT('author'). ": ". $row['author']; ?><br/>
65                         <?php  echo _AT('date'). ": ". $row['date']; ?><br/>
66                         <?php  echo _AT('comment'). ": ". $row['comments']; ?>
67                 </p>
68         </div>
69 <?php elseif ($row['type'] == RL_TYPE_AV): ?>
70         <div class="input-form">        
71                 <p><?php  echo _AT('title'). ": <strong>". $row['title']. "</strong>" ; ?><br/>
72                         <?php  echo _AT('rl_type_of_resource'). ": ". _AT($_rl_types[$row['type']]); ?><br/>
73                         <?php  echo _AT('author'). ": ". $row['author']; ?><br />
74                         <?php  echo _AT('date'). ": ". $row['date']; ?><br/>
75                         <?php  echo _AT('comment'). ": ". $row['comments']; ?>
76                 </p>
77         </div>
78 <?php elseif ($row['type'] == RL_TYPE_FILE): ?>
79         <div class="input-form">        
80                 <p><?php  echo _AT('title'). ": <strong>". $row['title']. "</strong>"; ?><br/>
81                         <?php  echo _AT('rl_type_of_resource'). ": ". _AT($_rl_types[$row['type']]); ?><br/>
82                         <?php  echo _AT('author'). ": ". $row['author']; ?><br/>
83                         <?php  echo _AT('rl_publisher'). ": ". $row['publisher']; ?><br/>
84                         <?php  echo _AT('date'). ": ". $row['date']; ?><br/>
85                         <?php  echo _AT('id'). ": ". $row['id']; ?><br/>
86                         <?php  echo _AT('comment'). ": ". $row['comments']; ?>
87                 </p>
88         </div>
89 <?php endif;
90 }
91 ?>
92         <?php } while($rowReadings = mysql_fetch_assoc($resultReadings)); ?>
93 <?php else: ?>
94         <table  class="data" style="width: 95%;"><tr>
95                 <td colspan="3"><strong><?php echo _AT('none_found'); ?></strong></td>
96         </tr></table>
97 <?php endif; ?>
98
99 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>