-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_assignment.php
154 lines (131 loc) · 5.42 KB
/
add_assignment.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php include('header_dashboard.php'); ?>
<?php include('session.php'); ?>
<body id="class_div">
<?php include('navbar_teacher.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('teacher_add_assignment_sidebar.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<ul class="breadcrumb">
<?php
$school_year_query = mysqli_query($conn,"select * from school_year order by school_year DESC")or die(mysqli_error());
$school_year_query_row = mysqli_fetch_array($school_year_query);
$school_year = $school_year_query_row['school_year'];
?>
<li><a href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div id="count_class" class="muted pull-right">
</div>
</div>
<div class="block-content collapse in">
<div class="span4">
<form class="" id="add_downloadble" method="post" enctype="multipart/form-data" name="upload" >
<div class="control-group">
<label class="control-label" for="inputEmail">File</label>
<div class="controls">
<input name="uploaded_file" class="input-file uniform_on" id="fileInput" type="file" >
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<input type="hidden" name="id" value="<?php echo $session_id ?>"/>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="text" name="name" Placeholder="File Name" class="input">
</div>
</div>
<div class="control-group">
<div class="controls">
<textarea id="assigntextare" placeholder="Description" name="desc" required></textarea>
</div>
</div>
<script>
jQuery(document).ready(function($){
$("#add_downloadble").submit(function(e){
$.jGrowl("Uploading File Please Wait......", { sticky: true });
e.preventDefault();
var _this = $(e.target);
var formData = new FormData($(this)[0]);
$.ajax({
type: "POST",
url: "add_assignment_save.php",
data: formData,
success: function(html){
$.jGrowl("Assignment Successfully Added", { header: 'Assignment Added' });
window.location = 'add_assignment.php';
},
cache: false,
contentType: false,
processData: false
});
});
});
</script>
</div>
<div class="span8">
<div class="alert alert-info">Check The Class you want to put this file.</div>
<div class="pull-left">
Check All <input type="checkbox" name="selectAll" id="checkAll" />
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
<table cellpadding="0" cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th></th>
<th>Class Name</th>
<th>Subject Code</th>
</tr>
</thead>
<tbody>
<?php $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_id = '$session_id' and school_year = '$school_year' ")or die(mysqli_error());
$count = mysqli_num_rows($query);
while($row = mysqli_fetch_array($query)){
$id = $row['teacher_class_id'];
?>
<tr id="del<?php echo $id; ?>">
<td width="30">
<input id="" class="" name="selector[]" type="checkbox" value="<?php echo $id; ?>">
</td>
<td><?php echo $row['class_name']; ?></td>
<td><?php echo $row['subject_code']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span10">
<hr>
<center>
<div class="control-group">
<div class="controls">
<button name="Upload" type="submit" value="Upload" class="btn btn-success" /><i class="icon-upload-alt"></i> Upload</button>
</div>
</div>
</center>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<?php/* include('teacher_right_sidebar.php') */?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>