-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminreg (2).php
More file actions
142 lines (139 loc) · 4.17 KB
/
Copy pathadminreg (2).php
File metadata and controls
142 lines (139 loc) · 4.17 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
137
138
139
140
141
142
<?php
session_start();
//var_dump($_SESSION); die;
if (!$_SESSION['it']) {
header("location:index.php");
}
//die();
include("includes/connect.php");
include("includes/banner.php");
include("includes/itheader.php");
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo "welcome IT Technitian";?></title>
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script src="js/jquery.js"></script>
<style type="text/css">
#fter{background-color: #5da1a7;height:60px;margin-top: 0px;font-family:corbel;text-align: center;
padding-top: 3px;position: fixed;z-index: 1px;width: 1200px;
}
</style>
</head>
<body>
<div id="blankspace" style="background-color:white;
color:black;overflow:scrlol;margin-top:0px;">
 
<form method="POST" enctype="multipart/form-data" class="re">
<table id="deanregtable">
<tr>
<td>Firstname</td><td><input type="text" required name="fname" placeholder="Firstname" size="20" class="inp" title="Firstname"></td>
</tr>
<tr>
<td>Lastname</td><td><input type="text" required name="lname" placeholder="Lastname" size="20" class="inp" title="lastname"></td>
</tr>
<tr>
<td>Gender</td><td><select name="gender" required style="padding-right:30%;">
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</center>
</td>
</tr>
<tr>
<td>ID number</td><td><input type="number" pattern="119[0-9]{13}" required name="idnbr" placeholder="Identification card" size="20" title="Id number" class="inp"></td>
</tr>
<tr>
<td>Address</td><td>
<select name="location" required style="padding-right:30%;">
<option>--Select--</option>
<?php
$dis=mysql_query("SELECT * FROM district");
while ($loa=mysql_fetch_array($dis)) {
?>
<option><?= $loa['district_name'];?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Phone</td><td><input type="text" pattern="07[2,3,8]{1}[0-9]{7}" required name="phone" placeholder="Phones" size="20" class="inp" title="Enter the Dean of study's phone number"></td>
</tr>
<tr>
<td>Qualification</td><td>
<select name='qualification' required style="padding-right:30%;">
<option>A2</option>
<option>A1</option>
<option>A0</option>
<option>Postgraduate</option>
</select>
</tr>
</tr>
<tr>
<td>Email</td><td><input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" required name="emails" placeholder="emails" size="20" class="inp" title="Email"></td>
</tr>
<tr>
<td>School name</td><td><input type="text" required name="sname" size="20" class="inp" placeholder="School name"></td>
</tr>
<tr>
<td>School logo</td><td><input type="file" required name="logo"></td>
</tr>
<tr>
<td>School District</td><td>
<select required name="disname">
<option value="">--Select--</option>
<?php
$qui=mysql_query("SELECT * FROM district") or die(mysql_error());
while ($fe=mysql_fetch_array($qui)) {
?>
<option value="<?= $fe['district_id']?>"><?= $fe['district_name']?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="3" align="right" height="25" width="60">
<input type="submit" name="save" value="Sign up"></td>
</tr>
</form>
</table>
<?php
if (isset($_POST['save'])) {
$a=mysql_real_escape_string($_POST['fname']);
$b=mysql_real_escape_string($_POST['lname']);
$c=mysql_real_escape_string($_POST['gender']);
$d=mysql_real_escape_string($_POST['idnbr']);
$e=mysql_real_escape_string($_POST['location']);
$f=mysql_real_escape_string($_POST['phone']);
$g=mysql_real_escape_string($_POST['qualification']);
$h=mysql_real_escape_string($_POST['emails']);
$sname=mysql_real_escape_string($_POST['sname']);
$log=$_FILES['logo']['name'];
$disn=mysql_real_escape_string($_POST['disname']);
$i=$a;
$j=$b.date("Y");
$qcheck=mysql_query("SELECT * FROM dean WHERE firstname='$a' AND lastname='$b'") ;
if (mysql_num_rows($qcheck)>0) {
echo "<script>alert('$a $b already registered')</script>";
}else{
$sql=mysql_query("INSERT INTO dean SET firstname='$a',lastname='$b',gender='$c',idnumber='$d',
location='$e',phones='$f',qualification='$g',email='$h',username='$i',password='$j',schoolname='$sname'
,logos='$log',schoollocation='$disn'");
move_uploaded_file($_FILES['logo']['tmp_name'],"photos/".$log);
if ($sql) {
echo "dean inserted";
}
}
}
?>
</div>
<div id="fter">
<h3>Allright reserved © by Mucyo Rene</h3>
</div>
</body>
</html>