-
Notifications
You must be signed in to change notification settings - Fork 0
/
mark.php
110 lines (93 loc) · 2.85 KB
/
mark.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
<?php
include"database.php";
session_start();
if(!isset($_SESSION["TID"]))
{
echo"<script>window.open('teacher_login.php?mes=Access Denied...','_self');</script>";
}
if(isset($_GET["rno"]))
{
$sql="select * from student where RNO='{$_GET["rno"]}'";
$res=$db->query($sql);
if($res->num_rows<=0)
{
header("location:add_mark.php?err=Invalid Register no..");
}
else
{
$rows=$res->fetch_assoc();
$class=$rows["SCLASS"];
$regno=$_GET["rno"];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ASP</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<?php include"navbar.php";?><br>
<div id="section">
<?php include"sidebar.php";?><br>
<h3 class="text">Welcome <?php echo $_SESSION["TNAME"]; ?></h3><br><hr><br>
<div class="content">
<h3>Add Marks</h3><br>
<?php
if(isset($_POST["submit"]))
{
$sq="insert into mark(REGNO,SUB,MARK,TERM,CLASS) values ('{$_POST["regno"]}','{$_POST["sub"]}','{$_POST["mark"]}','{$_POST["etype"]}','{$_POST["class"]}')";
if($db->query($sq))
{
echo "<div class='success'>Insert Success</div>";
}
else
{
echo "<div class='error'>Insert Failed</div>";
}
}
?>
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"];?>">
<div class="lbox">
<label> Register No</label><br>
<input type="text" style="background:#b1b1b1;" value="<?php echo $regno;?>" class="input3" name="regno" readonly><br><br>
<label>Class</label><br>
<input type="text" style="background:#b1b1b1;" value="<?php echo $class ?>" class="input3" name="class" readonly><br><br>
<label> Select Term</label><br>
<select name="etype" required class="input3">
<option value="">Select</option>
<option value="I-Term">I-Term</option>
<option value="II-Term">II-Term</option>
<option value="III-Term">III-Term</option>
</select>
<br><br>
</div>
<div class="rbox">
<label>Subject</label><br>
<select name="sub" required class="input3">
<?php
$s="SELECT * FROM sub";
$re=$db->query($s);
if($re->num_rows>0)
{
echo"<option value=''>Select</option>";
while($r=$re->fetch_assoc())
{
echo "<option value='{$r["SNAME"]}'>{$r["SNAME"]}</option>";
}
}
?>
</select>
<br><br>
<label >Mark :</label><br>
<input class="input3" name="mark" id="mark" type="mark" required>
<br><br>
<button type="submit" style="float:right;" class="btn" name="submit"> Add Mark Details</button>
</form>
</div>
</div>
</div>
<?php include"footer.php";?>
</body>
</html>