-
Notifications
You must be signed in to change notification settings - Fork 22
/
add_faculty.php
138 lines (126 loc) · 3.8 KB
/
add_faculty.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
<?php
include './Database/Controler.php';
include 'header_admin.php';
?>
<!-- /. ROW -->
<script language="javascript" src="./assets/js/validation.js"></script>
<script language="javascript">
function validate_form(f1)
{
if(isEmpty(f1.fid.value,"the Faculty Id.."))
{
alert(errMsg);
f1.fid.focus();
return (false);
}
if(isEmpty(f1.facnm.value,"the Faculty Name.."))
{
alert(errMsg);
f1.facnm.focus();
return (false);
}
if(isEmpty(f1.cr.value,"the Course Name.."))
{
alert(errMsg);
f1.cr.focus();
return (false);
}
if(isEmpty(f1.email.value,"the Email Id.."))
{
alert(errMsg);
f1.email.focus();
return (false);
}
if(isEmpty(f1.pwd.value,"the Password.."))
{
alert(errMsg);
f1.pwd.focus();
return (false);
}
if(isEmpty(f1.role.value,"the Role.."))
{
alert(errMsg);
f1.role.focus();
return (false);
}
}
function validateEmail(email)
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if (!email.match(email.value))
{
alert('Invalid Email Address');
return false;
}
return true;
}
</script>
<?php
if($_SESSION["role"]==1)
{
?>
<h2>Faculty Registration</h2>
</div>
</div>
<!-- /. ROW -->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<form method="post" role="form" enctype="multipart/form-data" onSubmit="return validate_form(this)">
<div class="form-group">
<label>Faculty Id:</label>
<input class="form-control" id="fid" name="fid" placeholder="Enter First Name"/>
</div>
<div class="form-group">
<label>Faculty Name:</label>
<input class="form-control" id="facnm" name="facnm" placeholder="Enter Faculty Name" />
</div>
<div class="form-group">
<label>Course:</label>
<select class="form-control" id="cr" name="cr">
<option value="">Select Course</option>
<option value="1">MBA</option>
<option value="0">MSC</option>
<option value="2">MBA & MSC</option>
</select>
</div>
<div class="form-group">
<label>Email:</label>
<input type="text" class="form-control" id="email" name="email" onblur="validateEmail(this.value);" placeholder="Enter Email"/>
</div>
<div class="form-group">
<label>Password:</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Enter Password"/>
</div>
<!-- <div class="form-group">
<label>Confirm Password:</label>
<input class="form-control" id="s_rn" name="s_rn" placeholder="Enter Roll Number"/>
</div> -->
<div class="form-group">
<label>Role:</label>
<select class="form-control" id="role" name="role">
<option value="">Select Role</option>
<option value="1">Admin</option>
<option value="2">Faculty</option>
</select>
</div>
<center>
<button type="submit" id="submit" name="fac_submit" value="Register" class="btn btn-primary" >Register</button>
</center>
</form>
</center>
<?php
}
else
{
?>
<div class="row">
<div class="col-md-12"></div>
<img src="img/ad.jpg">
<?php
}
include 'footer.php';
?>