-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathform.php
98 lines (92 loc) · 2.72 KB
/
form.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
<head>
<!-- Hello -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="logic.js"></script>
<title>Document</title>
</head>
<body onload="removeDupes();checkCompatability();">
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "rolecall";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$skill=$_REQUEST['skill'];
if($skill!=" "){
$sql = "SELECT * FROM personal_analysis WHERE Skills LIKE '%$skill%' OR Program LIKE '%$skill%'";
$result = $conn->query($sql);
}else{
$result=null;
}
if ($result->num_rows > 0) {
// output data of each row
$i=0;
while($row = $result->fetch_assoc()) {
$i++;
echo "<div class='employee' id='e$i' onclick='select(this.id)'>
<section>
<img src='avatar.png' alt='Avatar'>
<h1 class='name'>" . $row["Ename"] ."</h1>
</section>
<section class='employee-content'>
<div class='skills'>
<h1>Skills</h1>";
$str_arr = explode (",", $row["Skills"]);
$str_arr2 = explode (",", $row["slevel"]);
$str_arr3 = explode (",", $row["Program"]);
$str_arr4 = explode (",", $row["plevel"]);
foreach($str_arr as $level){
echo "<h2 class='skill-content'> ".$level."</h2>";
}
echo "</div>
<div class='sLevel'>
<h1>Level</h1>";
foreach($str_arr2 as $level){
echo "<h2 class='skill-content'> ".$level."</h2>";
}
echo "</div>
<div class='Programs'>
<h1>Programs</h1>";
foreach($str_arr3 as $level){
echo "<h2 class='skill-content'> ".$level."</h2>";
}
echo "</div>";
echo "<div>
<h1>Level</h1>";
foreach($str_arr4 as $level){
echo "<h2 class='skill-content'> ".$level."</h2>";
}
echo "</div>
<div class='personality'>
<div class='personality-tab'>
<h2 class='personality-content'>Colour</h2>
<h3 class='personality-content'>". $row['Colour'] ."</h3>
<img class='personality-content' src='check.png' alt='Option'>
</div>
<div class='personality-tab'>
<h2 class='personality-content'>Brigs</h2>
<h3 class='personality-content'>". $row['MBTI'] ."</h3>
<img class='personality-content' src='check.png' alt='Option'>
</div>
<div class='personality-tab'>
<h2 class='personality-content'>Work</h2>
<h3 class='personality-content'>". $row['Work'] ."</h3>
</div>
</div>
</section>
</div>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</body>