Anda di halaman 1dari 4

1.

<body>
2. <?php
3. session_start();
4. if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
5.
echo "<link href='style.css' rel='stylesheet' type='text/css'>
6. <center>Untuk mengakses modul, Anda harus login <br>";
7.
echo "<a href=../../index.php><b>LOGIN</b></a></center>";
8. }
9. else{
10. $aksi="bagian/bag_tampil_raker/aksi_tampil.php";
11. $tahun=$_POST['tahun'];
12. echo "Tahun : ".$tahun;
13. switch($_GET[act]){
14.
// Tampil Divisi
15.
default:
16.
echo "<h2>View Raker</h2>
17.
<form method=POST
action='?module=tampil_raker_kaur&act=input'>
18.
<table>
19.
<tr><td>
20.
Tahun : <select name='tahun' class='required' title='Bulan
harus dipilih'>
21.
<option value=0 selected>- Pilih Tahun -</option>
22.
<option value=2011>2011</option>
23.
<option value=2012>2012</option>
24.
<option value=2013>2013</option>
25.
<option value=2014>2014</option>
26.
<option value=2015>2015</option>
27.
<option value=2016>2016</option>
28.
29.
</select>
30.
</td></tr>";
31. ?>
32.
<script>
33. function buka(){
34.
window.open("pesan.php","","width=500,height=400,toolbar=0");
35. }
36. </script>
37. <a href="javascript:buka()" class="view-all">Kirim Pesan</a>
38. <?php
39.
echo"<tr><td colspan=2><input type='submit' name='submit'
value=Tampilkan></td></tr></table> </form> ";
40. }
41. }

42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.

?>
<?php
$module=$_GET[module];
$act=$_GET[act];
if ($module=='tampil_raker_kaur' AND $act=='input'){
if(isset($_POST['submit'])){
$Tahun = $_POST['tahun'];

$sql ="SELECT i.id_raker, r.no, i.id_bulan, i.realisasi,


r.nama_raker_kaur, r.id_raker_kaur
54.
FROM isiraker i
55.
JOIN kaur r
56.
ON (i.id_raker = r.id_raker_kaur)
57.
WHERE tahun ='$Tahun'
58.
AND no ='$_SESSION[no]'";
59.
$result = mysql_query($sql);
60.
if(mysql_num_rows($result) > 0){
61.
$proker = Array();
62.
while ( $row = mysql_fetch_object($result) ){
63.
$proker[$row->nama_raker_kaur][$row->id_bulan] = $row>realisasi;
64.
}
65.
?>
66.
67.
<a
href="http://localhost/tugaskp2/bagian/bag_tampil_pdf/pdf.php?tahun=<
?php echo $tahun ?>" target="_blank" >Download PDF</a>
68.
<table>
69.
<hr>
70.
<p><font color="blue">
71.
<?php echo"Presentase Realisasi Tahun $Tahun";?>
</font></p>
72.
<tr>
73.
<th width='5%' rowspan=2><div
align=center><strong>NO</strong></div></th>
74.
<th width='35%' rowspan=2><div align=center><strong>NAMA
RAKER</strong></div></th>
75.
<th colspan='52%'><div align=center><strong>REALISASI (Bulan)
dalam persen %</strong></div></th>
76.
</tr>
77.
<tr>
78.
<th width=4 height=23><div
align=center><strong>Jan</strong></div></th>
79.
<th width=4 height=23><div
align=center><strong>Feb</strong></div></th>

80.

<th width=4 height=23><div


align=center><strong>Mar</strong></div></th>
81.
<th width=4 height=23><div
align=center><strong>Apr</strong></div></th>
82.
<th width=4 height=23><div
align=center><strong>Mei</strong></div></th>
83.
<th width=4 height=23><div
align=center><strong>Jun</strong></div></th>
84.
<th width=4 height=23><div
align=center><strong>Jal</strong></div></th>
85.
<th width=4 height=23><div
align=center><strong>Aug</strong></div></th>
86.
<th width=4 height=23><div
align=center><strong>Sep</strong></div></th>
87.
<th width=4 height=23><div
align=center><strong>Okt</strong></div></th>
88.
<th width=4 height=23><div
align=center><strong>Nov</strong></div></th>
89.
<th width=4 height=23><div
align=center><strong>Des</strong></div></th>
90.
<th width=4 height=23><div
align=center><strong>Total</strong></div></th>
91.
</tr>
92.
<?php
93.
$no=1;
94.
95.
foreach( $proker as $key => $ar_value ){
96.
97.
$total = 0;
98.
echo '<tr><td>'.$no.'</td>';
99.
$no++;
100.
echo "<td>$key</td>";
101.
102.
103.
for($i=1;$i<=12;$i++){
104.
if(empty($ar_value[$i])){
105.
echo "<td>0</td>";
106.
}
107.
108.
else{ echo "<td><b>$ar_value[$i]<b></td>";
109.
$total += $ar_value[$i];
110.
}
111.
}
112.
echo '<td><font
color=blue><b>'.$total.'</b></font></td>';
113.
echo '</tr>';
114.
}
115.
?>

116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.

</table>
<?php
}else{
echo 'Data tidak ditemukan !!!';
}
}
}
?>
</body>
</html>

Anda mungkin juga menyukai