-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.php
41 lines (39 loc) · 1.65 KB
/
index2.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
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
$q = intval($_GET['q']);
require 'dbinfo.php';
$sql = "SELECT * FROM battle WHERE battle_id = '" . $q . "'";
$sql1 = "SELECT name,side FROM battle, leader, battleLeaders WHERE battle_id = battle_battle_id AND name_id = leaders_name_id AND battle_id = '" . $q . "' ORDER BY side, name ";
$result = mysqli_query($conn, $sql);
$result1 = mysqli_query($conn, $sql1);
while ($row = mysqli_fetch_array($result)) {
echo "<h1>" . $row['battle_name'] . "</h1>";
echo "<h3> Date: " . $row['date'] . "</h3>";
echo "<h3> Location: " . $row['locationName'] . "</h3>";
}
$temp = "";
while ($row = mysqli_fetch_array($result1)) {
if ($row['side'] == $temp) {
for ($i = 0; $i < (strlen($row['side']) * 2.55); $i++) {
echo " ";
}
echo "<span style='font-weight:bold;'>" . $row['name'] . "<br /> </span>";
} elseif (strlen($temp) == 0) {
echo "<span style='font-weight:bold;'>" . $row['side'] . " - " . $row['name'] . " <br /> </span>";
} elseif (strlen($temp) != 0) {
echo "<br /> <span style='font-weight:bold;'>" . $row['side'] . " - " . $row['name'] . " <br /> </span>";
}
$temp = $row['side'];
}
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($result)) {
echo"<h4 style='font-size:20px;'>" . $row['description'] . "</h4>";
}
mysqli_close($conn);
?>
</body>
</html>