-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddclass.php
More file actions
136 lines (127 loc) · 4.76 KB
/
Copy pathaddclass.php
File metadata and controls
136 lines (127 loc) · 4.76 KB
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
<?php include "dbconnect.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,700">
<title>Vesit</title>
<link rel="icon" type="image/png" href="images/icons/vesitlogo.png"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/sidebar_style.css">
<link rel="stylesheet" href="css/styles_nsp.css">
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!-- <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body style="background-image: linear-gradient(to right, #A2DDF6 , #008ECC);">
<div class="wrapper d-flex align-items-stretch">
<nav id="sidebar">
<!-- <div class="custom-menu">
<button type="button" id="sidebarCollapse" class="btn btn-primary">
</button>
</div> -->
<div class="img bg-wrap text-center py-4" >
<div class="user-logo">
<div class="img" style="background-image: url(images/icons/vesitlogo1.png);"></div>
<h3>VESIT Admin</h3>
<h3></h3>
</div>
</div>
<!-- <div class="img" ></div> -->
<ul class="list-unstyled components mb-5">
<li>
<a href="addsubject.php"><span class="fa fa-book mr-3"></span> Add Subject</a>
</li>
<li class="active">
<a href="addclass.php"><span class="fa fa-university mr-3"></span> Add Class</a>
</li>
<li>
<a href="addteacher.php"><span class="fa fa-male mr-3"></span> Add Teacher</a>
</li>
<li>
<a href="addstudent.php"><span class="fa fa-user-circle-o mr-3"></span>Add Student</a>
</li>
<li>
<a href="addrelation.php"><span class="fa fa-list-ul mr-3"></span>Assign Class</a>
</li>
<li>
<a href="logout.php"><span class="fa fa-sign-out mr-3"></span> Sign Out</a>
</li>
</ul>
</nav>
<div id="content" class="p-4 p-md-5 pt-5">
<div class="signup-form" style="margin-top: 10rem;">
<form action="addclass.php" method="POST">
<h3>Class Details</h3>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fa fa-tasks"></span>
</span>
</div>
<input type="text" class="form-control" id="Branch" name="Branch" placeholder="Branch" required>
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fa fa-university"></span>
</span>
</div>
<input type="text" class="form-control" id="classname" name="classname" placeholder="Class" required>
</div>
</div>
<div class="form-group text-center">
<button class="btn btn-primary btn-lg" name="addclassbtn">Add Class</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal"
tabindex="-1"
aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"
id="exampleModalLabel">
Class Inserted Successfully!
</h5>
<button type="button"
class="close"
data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">
×
</span>
</button>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
if(isset($_POST['addclassbtn'])){
// echo "Successful";
var_dump($_POST);
$Branch = $_POST['Branch'];
$classname = $_POST['classname'];
$sql1 = "INSERT into class (class_name , branch)
VALUES ('$classname','$Branch');";
mysqli_query($con, $sql1);
// echo $sql1;
echo "<script>$('#exampleModal').modal()</script>";
}
// else{
// echo "not successful";
// }
?>