-
Notifications
You must be signed in to change notification settings - Fork 0
/
staff.php
166 lines (148 loc) · 3.96 KB
/
staff.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
include "connect.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<script>
function validateform(){
var rollno=document.myform.rollno.value;
var seatno=document.myform.seatno.value;
var pattern=document.myform.pattern.value;
var branch=document.myform.branch.value;
var sem=document.myform.sem.value;
//var password=document.myform.password.value;
if (branch==null || branch==""){
alert("Branch must not be blank");
return false;
}
if (sem==null || sem==""){
alert("Semester must not be blank");
return false;
}
if (seatno==null || seatno==""){
alert("Seat Number must not be blank");
return false;
}
if (pattern==null || pattern==""){
alert("Pattern must not be blank");
return false;
}//else if((password.length<6) ||(password.length==' ') ){
// alert("Password must be at least 6 characters long.");
//return false;
}
</script>
</head>
<style>
input[type=text], select {
width: 50%;
height:50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 20px;
}
input[type=password], select {
width: 50%;
height:50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 20px;
}
input[type=submit] {
width: 50%;
background-color: #DC143C;
color: black;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: bold;
font-size: 20px;
}
input[type=submit]:hover {
background-color: #B22222;
}
div {
width: 50%;
height: 50%;
align: center;
border-radius: 2px;
background-color: #f2f2f2;
padding: 20px;
}
.center {
margin: auto;
width: 50%;
border: 3px solid #800000;
padding: 10px;
text-align: center;
font-size: 20px;
font-weight : bold;
}
</style>
<body>
<h3 style="text-align: left; color: #8B0000; font-family: Arial; font-size: 36px;">
GET MARKSHEET </h3>
<div class="center">
<form name="myform" method="POST" onsubmit="return validateform()" >
Enter Roll No: <input type="text" name="rollno" id="rollno"><br/>
Seat Number: <input type="text" name="seatno" id="seatno"><br/>
Branch: <input type="text" name="branch" id="branch" ><br/>
Semester: <input type="text" name="sem" id="sem"><br/>
Pattern: <input type="text" name="pattern" id="pattern"><br/>
<input type="submit" value="Get MARKSHEET" id="LOGIN" name="LOGIN"">
</form>
</div>
<div>
<?php
if(isset($_POST['LOGIN'])){
$r=$_POST['rollno'];
$q = $_POST['sem'];
$z = $_POST['pattern'];
$b= $_POST['branch'];
$s = $_POST['seatno'];
$sel=mysqli_query($db,"select * from course_table_rev where sem='$q' and pattern='$z' and branch='$b'") or die(mysqli_error($db)); ;
if(mysqli_num_rows($sel)>0){
echo
"<table width=\"600\" border=\"1\" cellpadding=\"10\" cellspacing=\"1\">
<tr>
<th>Branch</th>
<th>Semester</th>
<th>Pattern</th>
<th>Subject</th>
</tr>";
while ($arr=mysqli_fetch_array($sel)){
echo "<tr>";
echo "<td><a href=\"index.php\">".$arr['branch']."</a></td>";
echo "<td>".$arr['sem']."</td>";
echo "<td>".$arr['pattern']."</td>";
echo "<td>".$arr['subject']."</td>";
echo "</tr>";
}
$_SESSION['seatno']=$s;
$_SESSION['branch']=$b;
$_SESSION['sem']=$q;
$_SESSION['pattern']=$z;
$_SESSION['rollno']=$r;
header("Location: dummy_marksheet_template.php");
}
else
{
echo "<h2>No Results Found</h2>";
}
}
?>
</div>
</body>
</html>