-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_subject_overview.php
82 lines (73 loc) · 3.4 KB
/
edit_subject_overview.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php include('header_dashboard.php'); ?>
<?php include('session.php'); ?>
<?php $get_id = $_GET['id']; ?>
<?php $subject_id = $_GET['subject_id']; ?>
<body>
<?php include('navbar_teacher.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('subject_overview_link.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<?php $class_query = mysqli_query($conn,"select * from teacher_class
LEFT JOIN class ON class.class_id = teacher_class.class_id
LEFT JOIN subject ON subject.subject_id = teacher_class.subject_id
where teacher_class_id = '$get_id'")or die(mysqli_error());
$class_row = mysqli_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo $class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo $class_row['subject_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><b>Subject Overview</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right">
<a href="subject_overview.php<?php echo '?id='.$get_id; ?>" class="btn btn-success"><i class="icon-arrow-left"></i> Back</a>
</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<?php
$subject_query = mysqli_query($conn,"select * from class_subject_overview where class_subject_overview_id = '$subject_id'")or die(mysqli_error());
$subject_row = mysqli_fetch_array($subject_query);
?>
<form class="form-horizontal" method="post">
<div class="control-group">
<label class="control-label" for="inputPassword">Subject Overview Content:</label>
<div class="controls">
<textarea name="content" id="ckeditor_full"><?php echo $subject_row['content']; ?></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button name="save" type="submit" class="btn btn-success"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if (isset($_POST['save'])){
$content = $_POST['content'];
mysqli_query($conn,"update class_subject_overview set content = '$content' where class_subject_overview_id = '$subject_id'")or die(mysqli_error());
?>
<script>
window.location = 'subject_overview.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>