-
Notifications
You must be signed in to change notification settings - Fork 0
/
marksheet.php
118 lines (96 loc) · 1.91 KB
/
marksheet.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
<?php
if(isset($_POST['sub'])) {
$a=$_POST['math'];
$b=$_POST['account'];
$c=$_POST['comp'];
$d=$_POST['eco'];
$e=$_POST['eng'];
}
else{
@header('location:form.php');
}
$t=$a+$b+$c+$d+$e;
$p=$t/500*100;
if(100<=$a||100<=$b||100<=$c||100<=$d||100<=$e){
echo "Invalid input";
exit();
}
elseif ($a<40||$b<40||$c<40||$d<40||$e<40) {
$Result="FAILED";
}
elseif ($a>=40&&$b>=40&&$c>=40&&$d>=40&&$e>=40) {
$Result= "PASSED";
}
if ($p>=40&&$p<60) {
$div="Second";
}
elseif ($p>=60&&$p<80) {
$div="First";
}
elseif ($p>=80) {
$div="Distinction";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Result</title>
</head>
<body>
<table border="solid 3" align="center" width="50%">
<caption style="font-size: 40px;">Marksheet</caption>
<tr>
<th>S.N</th>
<th>Subject</th>
<th>Fullmark</th>
<th>Pass mark</th>
<th>Obtained marks</th>
</tr>
<tr>
<th>1.</th>
<th>Maths</th>
<th>100</th>
<th>40</th>
<th><?php echo $_POST['math']; ?></th>
</tr>
<tr>
<th>2.</th>
<th>Account</th>
<th>100</th>
<th>40</th>
<th><?php echo $_POST['account']; ?></th>
</tr>
<tr>
<th>3.</th>
<th>Computer</th>
<th>100</th>
<th>40</th>
<th><?php echo $_POST['comp']; ?></th>
</tr>
<tr>
<th>4.</th>
<th>Economics</th>
<th>100</th>
<th>40</th>
<th><?php echo $_POST['eco']; ?></th>
</tr>
<tr>
<th>5.</th>
<th>English</th>
<th>100</th>
<th>40</th>
<th><?php echo $_POST['eng']; ?></th>
</tr>
<tr align="center">
<th colspan="4">
Total</th>
<th>
<?php
echo $t;
echo '<tr><th colspan="4">'.'Percentage'.'</th><th>'.'</b>'.$p.'<b>%</b>'.'</th></tr>';
echo'<tr><th colspan="4">'.'Result'.'</th><th>'.$Result.'</th</tr>';
echo'<tr><th colspan="4">'.'Division'.'</th><th>'.$div.'</th</tr>';
?></th></tr>
</table>
</body>
</html>