forked from HackedK/ProjectPUBG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest2PHPstyle.php
157 lines (130 loc) · 3.46 KB
/
test2PHPstyle.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<style>
table{
border: 1px solid black;
border: 1px solid black;
}
tr {
height: 30px;
padding-left: 100px;
}
td {
text-allign: center;
padding-left:100px;
border: 1px solid black;
}
th{
border: 1px solid black;
text-allign: center;
}
</style>
<script>
function validateForm() {
// you can write a code for validating your forms (if you want).
var x = document.forms["form"]["form"].value;
if (x == " ") {
alert("The form must be filled out!");
return false;
} else{
alert("Form accepted...");
return false;
}
}
</script>
</head>
<body>
<?php
require "Data/Config/config.php";
//$server = "localhost";
//$username = "root";
//$password = "root";
//$db = "pubg";
//'<form name="Sakila" action='form_display.php' method='POST' onsubmit="return validateForm()">';
/*
*/
// Create connection
$conn = mysqli_connect($server, $username, $password, $db);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully<br><br>";
// forms need to be generated here inside the PHP tag.
// Select data from the "city" table.
$obj = [];
$sql = "SELECT name, region, season, `match`, `update`, rate, rounds, wins, top10, kills, suicides, teamkills, headshots, roadkills, assists
FROM `pubg`.`mydb` where region is not null;"
;
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$obj["name"] = $row["name"];
$obj["rounds"] = $row["rounds"];
$obj["teamkills"] = $row["teamkills"];
$obj["region"] = $row["region"];
$obj["top10"] = $row["top10"];
$obj["assists"] = $row["assists"];
$obj["season"] = $row["season"];
$obj["rate"] = $row["rate"];
$obj["roadkills"] = $row["roadkills"];
$obj["match"] = $row["match"];
$obj["wins"] = $row["wins"];
$obj["suicides"] = $row["suicides"];
$obj["update"] = $row["update"];
}
}
//echo "<pre>";
// print_r($obj);
//echo "</pre>";
?>
<table>
<tr> <td><th> Play </td></th>
<td><th> Wins </td></th>
<td><th> Kills </td></th>
</tr>
<tr>
<td> Players </td>
<td id="player"> <?php echo $obj["name"]; ?> </td>
<td> Rounds </td>
<td id="round123"><?php echo $obj["rounds"]; ?> </td>
<td> Team Kills </td>
<td id="teamkills123"><?php echo $obj["teamkills"]; ?> </td>
</tr>
<tr>
<td> Region </td>
<td id="region1"><?php echo $obj["region"]; ?> </td>
<td> Top 10 </td>
<td id="topten"><?php echo $obj["top10"]; ?> </td>
<td> Assists </td>
<td id="assists123"><?php echo $obj["assists"]; ?> </td>
</tr>
<tr>
<td> Season </td>
<td id="season2"><?php echo $obj["season"]; ?> </td>
<td> Rating </td>
<td id="rating123"><?php echo $obj["rate"]; ?> </td>
<td> Road Kills </td>
<td id="roadkills123"><?php echo $obj["roadkills"]; ?> </td>
</tr>
<tr>
<td> Match </td>
<td id="match123"><?php echo $obj["match"]; ?> </td>
<td> Win Ratio </td>
<td id="winratio123"><?php echo $obj["wins"]; ?> </td>
<td> Suicide </td>
<td id="suicide123"><?php echo $obj["suicides"]; ?> </td>
</tr>
<tr>
<td> Last Updated </td>
<td id="lastupdate"><?php echo $obj["update"]; ?> </td>
<td>Wins</td>
<td> <?php echo $obj["wins"];?> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>