-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
133 lines (133 loc) · 5.39 KB
/
sidebar.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
<div class="col-md-3">
<div class="panel panel-flat">
<div class="panel-body">
<div class="block-title">
<span>
JUMLAH PEMILIH
</span>
</div>
<table class="table table-bordered table-hover table-striped" style="width: 100%">
<tr>
<th><b>DPT</th>
<td>
<?php
// mengambil data pemilih DPT
$a = mysqli_query($config,"select * from pemilih where pemilih_kategori='DPT'");
// menghitung jumlahnya
$jumlah = mysqli_num_rows($a);
echo $jumlah;
?>
</td>
</tr>
<tr>
<th><b>DPTb</th>
<td width="1%">
<?php
// mengambil semua data pemilih DPTb
$a = mysqli_query($config,"select * from pemilih where pemilih_kategori='DPTb'");
// jumlah // mengambil semua data pemilih DPTb
$jumlah = mysqli_num_rows($a);
echo $jumlah;
?>
</td>
</tr>
</table>
<hr/>
<div class="block-title">
<span>
JADWAL VOTING
</span>
</div>
<div class="alert alert-info">
<?php
// query untuk mengambil data jadwal voting
$data = mysqli_query($config,"select * from jadwal_voting");
// menampilkan data jadwal voting
while($d=mysqli_fetch_array($data)){
?>
<p><center style="font-size:12px" >Tgl <b><?php echo date('d/m/Y',strtotime($d['jv_mulai'])); ?></b> Jam <b><?php echo date('H:i',strtotime($d['jv_mulai'])); ?></b> WIB
s/d <p> Jam <b><?php echo date('H:i',strtotime($d['jv_berakhir'])); ?></b> WIB Tgl <b><?php echo date('d/m/Y',strtotime($d['jv_berakhir'])); ?></b></center></p></div>
<?php
}
?>
<hr>
<div class="block-title">
<span>
HASIL VOTING
</span>
</div>
<table class="table table-bordered table-hover table-striped" style="width: 100%">
<tr>
<th><b>Nama Calon Geuchik</th>
<th><b>Jumlah Suara</th>
</tr>
<?php
$geuchik = mysqli_query($config,"select * from geuchik");
while($g=mysqli_fetch_array($geuchik)){
?>
<tr>
<td><?php echo $g['geuchik_nama']; ?></td>
<td width="1%" class="text-center">
<?php
date_default_timezone_set("Asia/Jakarta");
// cek apakah sekarang dalam masa voting atau tidak
$cek_tanggal = mysqli_query($config,"select * from jadwal_voting where jv_mulai <= now() and jv_berakhir >= now()");
$cek = mysqli_num_rows($cek_tanggal);
if($cek > 0){
echo "<div>0</div>";
}
else{
$id_g = md5 ($g['geuchik_id']);
$gg = mysqli_query($config,"select * from voting where voting_geuchik='$id_g'");
echo mysqli_num_rows($gg);
}
?>
</td>
</tr>
<?php
}
?>
</table>
<hr>
<div class="block-title">
<span>
KATAGORI POSTING
</span>
</div><br>
<?php
$kategori = mysqli_query($config,"select * from kategori");
while($p=mysqli_fetch_array($kategori)){
?>
<a href="kategori.php?id=<?php echo $p['kategori_id']; ?>"><?php echo $p['kategori_nama']; ?></a>
<br/>
<?php
}
?>
<hr>
<div class="block-title">
<span>
POSTING LAINYA
</span>
</div><br>
<?php
$posting = mysqli_query($config,"select * from posting order by posting_id desc limit 3");
while($p=mysqli_fetch_array($posting)){
?>
<!-- <a href="posting.php?id=<?php echo $p['posting_id']; ?>"><?php echo $p['posting_judul']; ?></a>
<br/>
<small class="text-muted"><?php echo date('d-m-Y',strtotime($p['posting_tanggal'])); ?></small>
<br/> -->
<div class="row">
<div class="col-md-3" style="padding: 10px">
<img style="width: 100%" src="images/posting/<?php echo $p['posting_gambar']; ?>" class="img-responsive">
</div>
<div class="col-md-9">
<a href="posting.php?id=<?php echo $p['posting_id'];?>"><?php echo substr($p['posting_judul'],0,40); ?>...</a><p>
<small class="text-muted">Posting : <?php echo date('d-m-Y',strtotime($p['posting_tanggal'])); ?></small>
</div>
</div>
<?php
}
?>
</div>
</div>