-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddteacher.php
145 lines (138 loc) · 5.13 KB
/
addteacher.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
<?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="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/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>
<a href="addclass.php"><span class="fa fa-university mr-3"></span> Add Class</a>
</li>
<li class="active">
<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="addteacher.php" method="POST">
<h3>Teacher Details</h3>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fa fa-address-book"></span>
</span>
</div>
<input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-at"></i>
</span>
</div>
<input type="email" class="form-control" name="email" id="email" placeholder="Email Address" required="required">
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-lock"></i>
</span>
</div>
<input type="password" class="form-control" name="password" id="password" placeholder="Password" required="required">
</select>
</div>
</div>
<div class="form-group text-center">
<button class="btn btn-primary btn-lg" name="addteacherbtn">Add Teacher</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">
Teacher 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['addteacherbtn'])){
// echo "Successful";
// var_dump($_POST);
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql1 = "INSERT into teacher (Name, Email, Password)
VALUES ('$name','$email','$password');";
// echo $sql1;
mysqli_query($con, $sql1);
echo "<script>$('#exampleModal').modal()</script>";
}
// else{
// echo "not successful";
// }
?>