-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathList_Laporan_Mingguan2.php
238 lines (199 loc) · 6.21 KB
/
List_Laporan_Mingguan2.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="images/icon/profile.png"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>LIST REALISASI KINERJA MINGGUAN PEGAWAI</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
#main{
height: 900px;
}
</style>
</head>
<body>
<div id="bg">
<div id= "main">
<div id="header">
<div id="logo">
<h1><a href="http://www.pln.co.id">PT. PLN (Persero) </a> </h1>
<h2><a href="https://simdiklat.pln-pusdiklat.co.id/portal/"> Pusat Pendidikan dan Pelatihan </a></h2>
</div>
</div>
<div id="buttons">
<ul>
<?
include "inc/config.inc.php";
include "inc/function.inc.php";
include "inc/tools.inc.php";
$act = "Informasi Pegawai";
if(!ceksession($session, $act)) header("Location: errorsession.htm");
/* cari nipeg pengunjung */
$sql = "select user from $tbl_session where session='$session'";
$q = mysql_query($sql);
list($user) = mysql_fetch_row($q);
$sql1 = "select kd_posisi from $tbl_bio01 where nipeg='$user'";
$q1 = mysql_query($sql1);
list($kd_posisi) = mysql_fetch_row($q1);
print "
<li class=first><a href=info-pegawai.php?session=$session>Awal</a></li>
<li><a href=daftar-pegawai.php?session=$session>Daftar Pegawai</a></li>
<li><a href=cek-pegawai.php?session=$session&nipeg=$user&pos=$kd_posisi>Biodata</a></li>
<li><a href=ubah-data.php?session=$session>Koreksi Data</a></li>
<li><a href=Dozir.php?session=$session>Lihat Dosir</a></li>
<li><a href=Input_Restitusi.php?session=$session>Input Restitusi</a></li>
<li class='dropdown'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>Menu 1 <span class='caret'></span></a>
<ul class='dropdown-menu'>
<li><a href='#' style='color:black'>Form 4.1</a></li>
<li><a href='#' style='color:black'>Form 4.2</a></li>
</ul>
</li>
";
/* cari nipeg pengunjung */
$sql = "select user from $tbl_session where session='$session'";
$q = mysql_query($sql);
list($nipeg) = mysql_fetch_row($q);
/* cek apakah pengunjung adalah admin atau bukan */
$sql = "select nipeg from $tbl_admin where nipeg='$nipeg'";
$q = mysql_query($sql);
list($adadata) = mysql_fetch_row($q);
/* apabila admin, tambahan menu baru */
$sql = "select nipeg from admin_dosir where nipeg like '$adadata'";
$q = mysql_query($sql);
list($cek_nipeg) = mysql_fetch_row($q);
$sql = "select nipeg from super_admin where nipeg like '$adadata'";
$q = mysql_query($sql);
list($super) = mysql_fetch_row($q);
if($super != '') {
print "
<li><a href=daftar-pesan.php?session=$session>Daftar Pesan</a></li>
<li><a href=importSAP.php?session=$session>Import Data dari SAP</a></li>
";
}
if($cek_nipeg != ''){
print "
<li><a href=inputdozir1.php?session=$session>Input Dosir</a></li>
";
}
print "
<li><a href=logout.php?session=$session>Keluar</a></li>
";
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "dbsipeg";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql2 = "SELECT nipeg FROM laporan_harian WHERE nipeg = '$user'";
$result = mysqli_query($conn, $sql2);
if ($result->num_rows > 0) {
//header("Location: Form_PLT432.php?session=$session&user2=$user");
// output data of each row
// while($row = $result->fetch_assoc()) {
// echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
//}
} else {
//echo "0 results";
}
$sql2 = "SELECT kd_posisi FROM bio01 WHERE nipeg = '$user'";
$result = mysqli_query($conn, $sql2);
if ($result->num_rows > 0) {
//header("Location: Form_PLT2.php?session=$session");
while($row = $result->fetch_assoc()) {
$posisi = $row["kd_posisi"];
$posisi = str_replace(" ","",$posisi);
}
} else {
//echo "0 results";
}
$sql2 = "SELECT wig.nipeg, bio01.kd_posisi
FROM bio01
INNER JOIN wig
ON bio01.nipeg=wig.nipeg;
";
$result = mysqli_query($conn, $sql2);
if ($result->num_rows > 0) {
//header("Location: Form_PLT2.php?session=$session");
while($row = $result->fetch_assoc()) {
$nama = $row["kd_posisi"];
$array = str_split($nama);
$num_digits = strlen($array);
$jumlah ="";
for($i=0;$i<$num_digits;$i++)
{
$jumlah .= $array[$i];
}
$pengisi = $row["nipeg"];
if($jumlah == $posisi)
{
//header("Location: Form_PLT2.php?session=$session&user2=$pengisi");
}
else{}
}
} else {
}
?>
</ul></div>
<div class="container">
<br>
<div class="row">
<div class="col-md-6 col-md-offset-1"><b style="font-size:20px">LIST REALISASI KINERJA MINGGUAN PEGAWAI</b></div>
</div>
<br>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "dbsipeg";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
print '<div class="row">
<div class="col-md-6 col-md-offset-1">';
echo '<div class="col-xs-7 spacer2"></div>';
print '<table style="width:100%">
<tr>
<th>Pekan</th>
<th>Tanggal</th>
<th>Lihat</th>
</tr>';
$pekan = 1;
$sql2 = "select distinct(pekan) from realisasi_lagmeasure1 where nipeg = '$user2'";
$result2 = $conn->query($sql2);
if ($result2->num_rows > 0) {
while($row = $result2->fetch_assoc()) {
print'
<tr>
<td>Pekan ke- '.$pekan.'</td>
<td>'.$row["tanggal"].'</td>
<td><a href="Form_PLT442.php?session='.$session.'&pekan='.$pekan.'&user2='.$user2.'">Detail</a></td>
</tr>';
$pekan = $pekan +1;
}
}
echo '</table>';
print '</div></div>';
$conn->close();
?>
</div>
</div>
</div>
</body>
</html>