-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnewtest.php
115 lines (110 loc) · 3.59 KB
/
newtest.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ONLINE EXAMINATION</title>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:700, 600,500,400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="style4.css">
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="main.js"></script>
</head>
<body>
<div class="header">
<div class="logo">
<i class="fa fa-book"></i>
<span>Online Exam</span>
</div>
</div>
<div class="side-nav">
<div class="logo">
<i class="fa fa-book"></i>
<span>Online Exam</span>
</div>
<nav>
<ul>
<li>
<a href="useroption.html">
<span><i class="fa fa-plus"></i></span>
<span>Add Users</span>
</a>
</li>
<li>
<a href="listofmem.php">
<span><i class="fa fa-user"></i></span>
<span>Users</span>
</a>
</li>
<li class="active">
<a href="newtest.php">
<span><i class="fa fa-question"></i></span>
<span>New Test</span>
</a>
</li>
<li>
<a href="adminveiw.php">
<span><i class="fa fa-lock"></i></span>
<span>Profile</span>
</a>
</li>
<li>
<a href="welcome.html">
<span><i class="fa fa-sign-out"></i></span>
<span>Logout</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="popup-content">
<form method="POST">
<div class="inputcase">
<label>TEST ID</label>
<input type="number" name="testid" placeholder="Test Id" required />
</div><br>
<div class="inputcase">
<label>TEST NAME</label>
<input type="text" name="testname" placeholder="Test name" required />
</div><br>
<div class="inputcase">
<label>SUBJECT</label>
<select name="subjectid">
<option value=1>DBMS</option>
<option value=2>Web Technology</option>
<option value=3>Data Structure</option>
</select>
</div><br>
<div class="inputcase">
<label>NO. OF QUESTION</label>
<input type="text" name="totalque" placeholder="Total question" required />
</div><br>
<div class="inputcase">
<input type="submit" name="cancel" value="cancel" class="btn2" />
<input type="submit" name="pop" class="btn1" value="Submit"/>
</div>
</form>
<img src="test.png" class="test">
</div>
<?php
if(isset($_POST['pop'])){
$test_id=$_POST["testid"];
$test_name=$_POST["testname"];
$sub_id=$_POST["subjectid"];
$total_que=$_POST["totalque"];
$con=mysqli_connect("localhost","root","","onlineexam_db") or die('Database not connected');
$query="INSERT INTO `test`(`test_id`, `sub_id`, `test_name`, `total_que`) VALUES ($test_id,$sub_id,'$test_name','$total_que')";
$rs=mysqli_query($con,$query)or die("Could Not Perform the Query");
$i=1;
header("location: test.php?test_id=".$test_id."&total_que=".$total_que."&i=".$i);
}
if(isset($_POST['cancel'])){
header("location: newtest.php");
}
?>
</body>
</html>