-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrough2.php
131 lines (122 loc) · 3.59 KB
/
rough2.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
<?php
include "config.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
.Table {
display: table;
}
.Title {
display: table-caption;
text-align: center;
font-weight: bold;
font-size: larger;
}
.Heading {
display: table-row;
font-weight: bold;
text-align: center;
}
.Row {
display: table-row;
}
.Cell {
display: table-cell;
border: solid;
border-width: thin;
padding-left: 5px;
padding-right: 5px;
}
</style>
</head>
<body>
<div class="Table">
<fieldset>
<legend class="Title">General Member</legend>
<?php
$sql = "SELECT name, Representative FROM candidates where Representative='gm'";
$result = mysqli_query($con, $sql);
$resultcheck = mysqli_num_rows($result);
if($resultcheck > 0)
{
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo" <div class='Heading'>
<div class='Cell'>";
echo" <p>".$row['name']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>". $row['Representative']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>Button</p>
</div>
</div>";
}
} else {
echo "0 results";
}
?>
</fieldset>
<fieldset>
<legend class="Title">Slate</legend>
<?php
$sql = "SELECT name, Representative FROM candidates where Representative='slate'";
$result = mysqli_query($con, $sql);
$resultcheck = mysqli_num_rows($result);
if($resultcheck > 0)
{
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo" <div class='Heading'>
<div class='Cell'>";
echo" <p>".$row['name']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>". $row['Representative']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>Button</p>
</div>
</div>";
}
} else {
echo "0 results";
}
?>
</fieldset>
<fieldset>
<legend class="Title">Sports</legend>
<?php
$sql = "SELECT name, Representative FROM candidates where Representative='Sports'";
$result = mysqli_query($con, $sql);
$resultcheck = mysqli_num_rows($result);
if($resultcheck > 0)
{
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo" <div class='Heading'>
<div class='Cell'>";
echo" <p>".$row['name']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>". $row['Representative']."</p>";
echo" </div>
<div class='Cell'>";
echo" <p>Button</p>
</div>
</div>";
}
} else {
echo "0 results";
}
?>
</fieldset>
</div>
</body>
</html>