-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathresult.php
188 lines (177 loc) · 4.6 KB
/
result.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
* @System HP-pc Rax
* @author Rakshit shah <Rakshitshah1994@gmail.com>
* @copyright 2015-2017 |Rakshit shah
* @license http://rakshit.in/license/license.php | PHP License 3.0
* @version 1.1
* @since File available since Release 1.0.0
*/
include("conection.php");
if(isset($_GET["resid"]))
{
$rid = $_GET["resid"];
}
else
{
$rid = $_POST["rollno"];
}
$result= mysql_query("SELECT * FROM studentdetails where studid='$rid' ");
$result1= mysql_query("SELECT * FROM course");
$result2= mysql_query("SELECT * FROM attendance");
$result3= mysql_query("SELECT * FROM examination where studid='$rid'");
while($row1 = mysql_fetch_array($result))
{
$regno = $row1["studid"];
$name = $row1['studfname'] . " " . $row1['studlname'] ;
$fathersname = $row1["fathername"];
$course = $row1["courseid"];
$semester = $row1["semester"];
$dob = $row1["dob"];
}
?>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Result</title>
<style>
html {background:#fff; height:100%; width:100%;}
body {background:#f4f4f4; width:500px; margin:25px auto 25px; text-align:center; display:block; border:solid 1px #ccc; font:normal 14px "Trebuchet MS", Arial, Helvetica, sans-serif; line-height:22px; padding:50px;}
a {color:#F60;}
</style>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<label for="textfield">Reg No: </label>
<?php
echo $regno;
?> </p>
<p>
<label for="textfield2">Name: </label> <?php echo $name; ?>
</p>
<p>
<label for="textfield3">Father's Name:</label> <?php echo $fathersname; ?> </p>
<p>
<label for="select">Course</label>
: <?php echo $course; ?> </p>
<p>
<label for="select2">Semester</label>
: <?php echo $semester; ?></p>
<p>
<label for="textfield4">DOB</label>
: <?php echo $dob; ?>
</p>
<hr>
<table width="483" height="96" border="1">
<tr>
<td width="141">Subject</td>
<td width="67">Max Marks</td>
<td width="97">Scored marks</td>
<td width="71">Result</td>
<td width="241">Comment</td>
</tr>
<tr>
<?php
$i =1;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td> " . $i . "</td>";
echo "<td> " . $row['subname'] . "</td>";
$result4 = mysql_query("SELECT * FROM subject where subid='$row[subid]'");
while($rowa= mysql_fetch_array($result))
{
echo "<td> " . $rowa['studfname'] . " " . $rowa['studlname'] . "</td>";
}
$result55 = mysql_query("SELECT * FROM subject where subid='$row[subid]'");
}
?>
</tr>
<?php
while($row3 = mysql_fetch_array($result3))
{?>
<tr>
<td> <?php echo $row3["subid"]; ?> </td>
<td> <?php echo $row3["maxmarks"]; ?> </td>
<td> <?php echo $row3["scored"]; ?> </td>
<td> <?php echo $row3["result"]; ?> </td>
<td> <?php echo $row3["comment"]; ?> </td>
</tr>
<?php
}
?>
<tr>
<td> </td>
<td> </td>
<td>Total</td>
<td>
<?php
$result552 = mysql_query("SELECT SUM(scored) FROM examination where studid='$rid'");
while($row22 = mysql_fetch_array($result552))
{
echo $tota = $row22[0];
}
?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Percentage</td>
<td>
<?php
$perca = $tota/ mysql_num_rows($result552);
/*
* put $result3 in above line #RAX
*/
echo number_format( $perca, 2, '.', '');
?>
</td>
<td> </td>
</tr>
</table>
<p> </p>
<table width="486" height="135" border="1">
<tr>
<td width="60" height="45">Subject</td>
<td width="54">Total Classes</td>
<td width="75">Attended Classes</td>
<td width="104">Percentage</td>
<td width="205">Comment</td>
</tr>
<?php
while($row4 = mysql_fetch_array($result2))
{?>
<tr>
<td> <?php echo $row4["subid"]; ?></td>
<td> <?php echo $row4["totalclasses"]; ?> </td>
<td> <?php echo $row4["attendedclasses"]; ?> </td>
<td> <?php echo $row4["percentage"]; ?> </td>
<td> <?php echo $row4["comment"]; ?> </td>
</tr>
<?php
}
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p><a href="viewresult.php"><strong ><<Back</strong></a><br>
</p>
</form>
</body>
</html>