-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_subject.php
77 lines (69 loc) · 2.15 KB
/
create_subject.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
<?php
require_once("static/includes/sessions.php");
require_once("static/includes/functions.php");
if(!isset($_SESSION["username"])){
redirect_to('index.php');
}
require_once("static/includes/dbsetup.php");
include "static/includes/layouts/open.php";
/*
if (isset($_GET["subject"])){
$selected_subject_id = $_GET["subject"];
$selected_page_id = null;
}
elseif (isset($_GET["page"])){
$selected_page_id = $_GET["page"];
$selected_subject_id = null;
}
else{
$selected_page_id = null;
$selected_subject_id = null;
}
*/
?>
<div class="main">
<div>
<p>Create a new subject easily!</p>
</div>
<div class="page row teal lighten-5">
<?php
echo message();
?>
<form action="create_subject_action.php" method="post">
<div class="col s4">
<div class="input-field">
<input type="text" name="menu_name" placeholder="eg. health" class="validate"/>
<label for="menu_name">Subject Name</label>
</div>
<div>
<label>Position</label>
<select name="position" class="browser-default">
<?php
$subject_set = get_all_subjects();
$subject_count = mysqli_num_rows($subject_set);
for($count=1;$count< ($subject_count + 1);$count++){
echo "<option value='$count'>$count</option>";
}
echo "<option value='$count' selected='selected'>$count</option>";
?>
</select>
</div>
<div>
<label>Visible</label>
<input name="visible" type="radio" id="test1" value="1">
<label for="test1">Yes</label>
<input name="visible" type="radio" id="test2" value="0">
<label for="test2">No</label>
</div>
<br><br>
<button class="btn waves-effect waves-light" type="submit" name="submit">Create Subject
</button>
</div>
</form><br>
</div>
<a href="manage_content.php">Cancel and Go back</a>
</div>
<?php
include "static/includes/layouts/close.php";
?>