-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasdf.php
130 lines (87 loc) · 2.63 KB
/
asdf.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
<!DOCTYPE html>
<html>
<head>
<title>Report!</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="wrapper">
<h1 align="center">Report</h1>
</div>
<form action="" method="get" >
</form>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "talent";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$test = $_GET["pram_id"];
//echo "<script>alert($test)</script>";
$sql = "SELECT param_id, name,gender,age FROM parameter WHERE param_id =$test";
$result = $conn->query($sql) or die("invalid data");
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) { ?>
<label style="text-align: center; border:1px solid black;width:100%"><?php echo $row["name"]; ?></label><br>
<label style="text-align: center; border:1px solid black;width:100%"><?php echo $row["age"]; ?></label><br>
<label style="text-align: center; border:1px solid black;width:100%"><?php echo $row["gender"]; ?></label><br>
<?php }
} else {
echo "0 results";
}
$conn->close();
?>
<div class="row">
<div class="col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>lowar</th>
<th>upper</th>
<th>score</th>
</tr>
</thead>
<tbody>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "talent";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$test = $_GET["pram_id"];
//echo "<script>alert($test)</script>";
$sql = "SELECT lower_limit,upper_limit, score FROM norms WHERE param_id =$test";
$result = $conn->query($sql) or die("invalid data");
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) { ?>
<tr>
<td><?php echo $row["lower_limit"]; ?></td>
<td><?php echo $row["upper_limit"]; ?></td>
<td><?php echo $row["score"]; ?></td> </tr>
<?php }
} else {
echo "0 results";
}
$conn->close();
?>
</tbody>
</table>
</div>
</div>
</body>
</html>