move code up one directory
[atutor.git] / mods / _standard / basiclti / tool / instructor_view.php
1 <?php
2 define('AT_INCLUDE_PATH', '../../../../include/');
3 require(AT_INCLUDE_PATH.'vitals.inc.php');
4 authenticate(AT_PRIV_BASICLTI);
5
6 if ( !is_int($_SESSION['course_id']) || $_SESSION['course_id'] < 1 ) {
7     $msg->addFeedback('NEED_COURSE_ID');
8     exit;
9 }
10
11 require_once('forms.php');
12
13 $tool = intval($_REQUEST['id']);
14
15 if (isset($_POST['done'])) {
16         header('Location: '.AT_BASE_HREF.'mods/_standard/basiclti/index_instructor.php');
17         exit;
18
19
20 $sql = "SELECT * FROM ".TABLE_PREFIX."basiclti_tools WHERE id = ".$tool.
21        " AND course_id = ". $_SESSION['course_id'];
22 $result = mysql_query($sql, $db) or die(mysql_error());
23 $toolrow = mysql_fetch_assoc($result);
24 if ( $toolrow['id'] != $tool ) {
25     $msg->addFeedback('COULD_NOT_LOAD_TOOL');
26     header('Location: '.AT_BASE_HREF.'mods/_standard/basiclti/index_instructor.php');
27     exit;
28 }
29
30 include(AT_INCLUDE_PATH.'header.inc.php');
31
32 $msg->printAll();
33
34 ?>
35 <form method="post" action="<?php echo $_SERVER['PHP_SELF'];  ?>" name="basiclti_form" enctype="multipart/form-data">
36   <input type="hidden" name="form_basiclti" value="true" />
37   <input type="hidden" name="id" value="<?php echo $tool; ?>" />
38   <div class="input-form">
39     <fieldset class="group_form"><legend class="group_form"><?php echo _AT('properties'); ?></legend>
40 <?php at_form_view($toolrow, $blti_instructor_form); ?>
41         <div class="buttons">
42                 <input type="submit" name="done" value="<?php echo _AT('done');?>" />
43         </div>
44     </fieldset>
45   </div>
46 </form>
47
48 <?php
49 require(AT_INCLUDE_PATH.'footer.inc.php');