92
92
(Lampiran 1)
Login.php <?phprequire_once "core/init.php";
error_reporting(0);
if($_SESSION['sess_nama']){
if($_SESSION['sess_admin']){
header('Location: home_admin.php');
}else{
header('Location: home_user.php');
}
}
$err = '<div class="cta">silakan isi username dan password di atas</div>';
if(isset($_POST['submit'])){
$nama = $_POST['username'];
$pass = $_POST['password'];
if(!empty(trim($nama)) && !empty(trim($pass))){
if(cek_data($nama, $pass)){
$_SESSION['sess_nama'] = $nama;
if(cek_status($_SESSION['sess_nama'])==1){
//$superUser = true; //super user adalah admin
$_SESSION['sess_admin'] = true;//$superUser;
header('Location: welcome_admin.php');
}else{
//$superUser = false;
$_SESSION['sess_admin'] = false;//$superUser;
}
}else{
$err = '<div class="cta" style="color:red;">username atau password salah</div>';
}
}else{
$err = '<div class="cta" style="color:red;">username dan password harus diisi!</div>';
}}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Sistem Informasi TPP Disperindag</title>
<link rel="stylesheet" href="views/css/reset.css">
<link rel="stylesheet" href="views/css/style.css">
</head>
<body>
<!-- Form Mixin-->
<!-- Input Mixin-->
<!-- Button Mixin-->
<!-- Pen Title-->
<div class="pen-title">
<img src="views/logo.png" style="width:75px;height:90px;"></img>
<h1>Selamat Datang!</h1>
<h2>Sistem Informasi TPP Disdagperin</h2>
</div>
<!-- Form Module-->
<div class="toggle disable"><i class="fa fa-times fa-pencil"></i>
</div>
<div class="form">
<h2>Login Form</h2>
<form action="" method="post">
<input type="text" name="username" id="username" placeholder="Username"/>
<input type="password" name="password" id="password" placeholder="Password"/>
<button type="submit" name="submit" onclick="cekDataKosong()">Login</button>
</form>
</div>
<?= $err ?></div>
</div>
</body>
<script>
function cekDataKosong(){
var user, pass;
//pesan = document.getElementById("pesan");
//pesan.innerHTML = "";
user = document.getElementById("username").value;
pass = document.getElementById("password").value;
try{
if(user == "" || pass == "") throw "Username dan password tidak boleh kosong";
}
catch(ex){
alert(ex);
}
</script>
</html>
Welcome_user.php <?php
require_once "core/init.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
//echo ($_SESSION['sess_nama']);
//echo ($_SESSION['sess_admin']);
$id = ambil_id($_SESSION['sess_nama']);
$_SESSION['sess_id']= $id;
require_once "views/header_user.php";
?>
<html>
<div class="container">
<div class="alert alert-info">
<h2>Selamat Datang di Sistem Informasi TPP Disdagperin Kab. Boyolali<br>
Silakan pilih menu yang ada untuk menginput data!</h2>
</div>
</div>
</div>
</html>
require_once "core/init.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
//echo ($_SESSION['sess_nama']);
//echo ($_SESSION['sess_admin']);
$id = ambil_id($_SESSION['sess_nama']);
//echo ($id);
$_SESSION['sess_id']= $id;
//echo ($_SESSION['sess_id']);
$dataPegawai = showDataPegawai($id);
require_once "views/header_user.php";
?>
<html>
<div class="container" style="width:70%;">
<h1 class="text-center"><strong>Data Pegawai</strong></h1>
<div class="panel panel-primary">
<div class="panel panel-heading">
<h4 class="text-left"><strong> Detail </strong></h4>
</div>
<div class="panel panel-body">
<?php while ($row=mysqli_fetch_assoc($dataPegawai)):?>
<div class="row">
<div class="col col-sm-6">NIP</div>
<div class="col col-sm-6"><?= $row['NIP']?></div>
<div class="row">
<div class="col col-sm-6">Nama</div>
<div class="col col-sm-6"><?= $row['Nama']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Golongan</div>
<div class="col col-sm-6"><?= $row['Golongan']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Jabatan</div>
<div class="col col-sm-6"><?= $row['Jabatan']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Alamat</div>
<div class="col col-sm-6 "><?= $row['Alamat']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Nilai TPP Maksimal</div>
<div class="col col-sm-6 ">Rp <?=
number_format($row['TPPMax'],2,',','.')?></div>
</div>
</div>
</div></div>
<?php endwhile; ?>
</tbody>
</div>
</html>
require_once "core/init.php";
require_once "views/header_user.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
//mengambil data pegawai lalu dimasukkan ke form
$id = ambil_id($_SESSION['sess_nama']);
$_SESSION['sess_id']= $id;
$dataPegawai = showDataPegawai($_SESSION['sess_id']);
$row=mysqli_fetch_assoc($dataPegawai);
//memanggil fungsi waktu
date_default_timezone_set("Asia/Jakarta");
$today = date("Y-m-d");
$kkjid = $_SESSION['sess_id'].'-'.date("Ymd"); //membuat id untuk KKJ
$dataKegiatan = showDataKegiatan($kkjid,$today);
//echo($kkjid);
//echo($today);
if (isset($_POST['tambah'])) {
// membuat variabel untuk menampung data dari form
$kkjid ; //membuat id untuk KKJ
$userid = $_SESSION['sess_id']; //untuk menangkap user id
$tgl = $_POST['Tanggal'];
$kegiatan = $_POST['Kegiatan'];
$shk = $_POST['SatuanHasilKerja'];
$jvk = $_POST['JumlahVolumeKerja'];
$jwmt = $_POST['JumlahWaktuMelaksanakanTugas'];
if($kegiatan == "" || $shk == "" || $jvk == "" || $nwl == "" || $jwmt == ""){
//jika ada salah satu data yang kosong maka akan return ke input_kkj
echo '<script language="javascript">';
echo 'alert("Pastikan semua data diisi dengan benar")';
echo '</script>';
}else{
if(tambahDataKegiatan($kkjid, $userid, $tgl, $kegiatan, $shk, $jvk, $nwl, $jwmt)){
echo '<script language="javascript">';
echo 'alert("Data kegiatan berhasil ditambah");';
echo 'window.location="input_kkj.php"';
echo '</script>';
//header('Location: input_kkj.php');
}
}
}
?>
<!DOCTYPE html>
<html>
<div class="container" style="width:90%;">
<h1 class="text-center"><strong>Input KKJ</strong></h1>
<form class="form-inline" action="" method="post">
<div class="panel panel-primary">
<div class="panel panel-heading">
<h4 class="text-left"><strong> Form input kkj </strong></h4>
</div>
<table id="table-pegawai" class="table table-striped"><!--table untuk menampilkan informasi awal untuk kkj-->
<tr class="info">
<td>Tanggal</td>
<td><input type="text" name="Tanggal" id="Tanggal" value="<?= $today ?>">
<input type="hidden" name="Hariini" id="Hariini" value="<?= $today ?>"></td>
</tr>
<tr>
<td>Nama</td>
<td><?= $row['Nama']?></td>
</tr>
<tr class="info">
<td>Jabatan</td>
<td><?= $row['Jabatan']?></td>
</tr>
<tr>
<td>Unit Kerja</td>
<td><?= $row['UnitKerja']?></td>
</tr>
</table>
<hr>
<h3 class="text-left"><strong> Input Kegiatan </strong></h1>
<div class="row">
<div class="col col-sm-1"></div>
<div class="col col-sm-4">Kegiatan<br>
<textarea class="form-control" type="text" name="Kegiatan" id="Kegiatan" style="width:320px;"></textarea></div>
<select class="form-control" id="SatuanHasilKerja" name="SatuanHasilKerja">
<option>Kegiatan</option>
<option>Dokumen</option>
</select></div>
<div class="col col-sm-2">Jumlah Volume Kerja*<br>
<input class="form-control" type="numbers" name="JumlahVolumeKerja" id="JumlahVolumeKerja"
style="width:75px;" onkeyup="tambahFunction()"></div>
<div class="col col-sm-2">Norma Waktu Lazim*<br>
<input class="form-control" type="numbers" name="NormaWaktuLazim" id="NormaWaktuLazim" style="width:75px;"
onkeyup="tambahFunction()"></div>
</div>
<div class="row">
<div class="col col-sm-4"></div>
<div class="col col-sm-4">Jumlah Waktu Melaksanakan Tugas
<input class="form-control" name="JumlahWaktuMelaksanakanTugas" id="JumlahWaktuMelaksanakanTugas" style="width:100px;" ></div>
<div class="col col-sm-4">
<button class="btn btn-primary btn-lg" type="submit" name="tambah" onclick="cekKegiatanKosong()">Tambah</button></div>
</div>
<script>
function tambahFunction() {
var j = document.getElementById("JumlahVolumeKerja").value;
var n = document.getElementById("NormaWaktuLazim").value;
var jwmt;
jwmt = j * n;
document.getElementById("JumlahWaktuMelaksanakanTugas").value = jwmt;
}
<p class="small">*Hanya bisa diisi angka</p>
</div></div></div>
</div></div>
<script src="views/js/jquery.js"></script>
<script src="views/js/bootstrap.min.js"></script>
<script
src="views/js/jquery.datetimepicker.full.js"></script>
<script>
$('#Tanggal').datetimepicker({
timepicker:false,
format:'Y-m-d',
onShow:function( ct ){
this.setOptions({
maxDate:jQuery('#Hariini').val()?jQuery('#Hariini').val():false
})
},
timepicker:false
});
</script>
<script>
function cekKegiatanKosong(){
var kegiatan, jvk, nwl, jwmt;
kegiatan = document.getElementById("Kegiatan").value;
jvk = document.getElementById("JumlahVolumeKerja").value;
nwl = document.getElementById("NormaWaktuLazim").value;
jwmt =
document.getElementById("JumlahWaktuMelaksanakanTugas").value;
var numbers=/^[0-9]+$/;
if(kegiatan == "" || jvk == "" || nwl == "" || jwmt == ""){
return false;
}
}
</script>
</html>
Laporan_kkj.php <?php
require_once "core/init.php";
require_once "views/header_user.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
//mengambil data pegawai lalu dimasukkan ke form
$id = ambil_id($_SESSION['sess_nama']);
$_SESSION['sess_id']= $id;
if (isset($_POST['cari'])){
$id;
$tglawal = $_POST['tglawal'];
$tglakhir = $_POST['tglakhir'];
if (!empty(trim($tglawal)) &&!empty(trim($tglakhir))){
if(showLaporanKKj($id,$tglawal,$tglakhir)){
$_SESSION['sess_tglawal'] = $tglawal; //memasukkan data tgl awal ke sesi yang nantinya akan digunakan untuk mencari hasil
$_SESSION['sess_tglakhir'] = $tglakhir;
header('Location:laporan_kkj_hasil.php');
//return true;
echo'<div class="alert alert-danger"><strong>Failed!</strong> Data tidak berhasil ditampilkan</div>';("ada yang salah");
}
}else{
echo '<div class="alert alert-danger"><strong>Failed!</strong> Tanggal tidak boleh kosong</div>';
}
}
?>
<!DOCTYPE html>
<head><style type="text/css">
<html>
.custom-date-style {
background-color: red !important;
}
.input{
}
.input-wide{width: 500px;
}
</style>
</head>
<body>
<div class="container" style="width:70%;">
<h1 class="text-center"><strong>Cetak KKJ</strong></h1>
<form class="form-inline" action="" method="post">
<div class="panel panel-primary">
<div class="panel panel-heading">
<h4 class="text-left"><strong> Detail </strong></h4>
</div>
<div class="row">
<div class="col col-sm-1"></div>
<div class="col col-sm-4">
Tanggal Awal <input type="text" name="tglawal" id="tglawal" /></div>
<div class="col col-sm-4">
Tanggl Akhir <input type="text" name="tglakhir" id="tglakhir" /></div>
<div class="col col-sm-2">
<button class="btn btn-primary btn-lg" type="submit" name="cari">Cari KKJ</button></div>
</div>
</div></div></div>
<script src="views/js/jquery.js"></script>
<script src="views/js/bootstrap.min.js"></script>
<script src="views/js/jquery.datetimepicker.full.js"></script>
<script>
$('#tglawal').datetimepicker({
timepicker:false,
format:'Y-m-d',
onShow:function( ct ){
this.setOptions({
maxDate:jQuery('#tglakhir').val()?jQuery('#tglakhir').val():false
})
},
timepicker:false
});
$('#tglakhir').datetimepicker({
timepicker:false,
timepicker:false,
format:'Y-m-d',
onShow:function( ct ){
this.setOptions({
minDate:jQuery('#tglakhir').val()?jQuery('#tglakhir').val():false
})
},
timepicker:false
});
</script>
</body>
</html>
Delete_kkj.php <?php
require_once "core/init.php";
if(isset($_GET['KegiatanID'])){
if(hapus_kegiatan($_GET['KegiatanID'])){
header('Location:input_kkj.php');
}else {
echo 'gagal menghapus data';
}
}
Delete_kkj_laporan.php <?php
require_once "core/init.php";
if(isset($_GET['KegiatanID'])){
header('Location:laporan_kkj_hasil.php');
}else {
echo 'gagal menghapus data';
}
}
Edit_kkj.php <?php
require_once "core/init.php";
require_once "views/header_user.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
$id = $_GET['KegiatanID'];
//echo($id);
if (isset($_GET['KegiatanID'])){
$dataKegiatan = editDataKegiatan($id);
while($row = mysqli_fetch_assoc($dataKegiatan)){
$kegiatan_awal = $row['NamaKegiatan'];
$shk_awal = $row['SatuanHasilKerja'];
$jvk_awal = $row['JumlahVolumeKerja'];
$nwl_awal = $row['NormaWaktuLazim'];
$jmlKerja_awal = $row['JumlahWaktuMelaksanakanTugas'];
}
}
// membuat variabel untuk menampung data dari form
$id;
$kegiatan = $_POST['Kegiatan'];
$shk = $_POST['SatuanHasilKerja'];
$jvk = $_POST['JumlahVolumeKerja'];
$nwl = $_POST['NormaWaktuLazim'];
$jmlKerja = $_POST['JumlahWaktuMelaksanakanTugas'];
if (!empty(trim($kegiatan)) && !empty(trim($shk)) && !empty(trim($jvk)) && !empty(trim($nwl)) &&
!empty(trim($jmlKerja))){
if(editDataKegiatanIni($kegiatan, $shk, $jvk, $nwl, $jmlKerja ,$id)){
header('Location: input_kkj.php');
}else{
echo("ada kesalahan data");
}
}else{
echo("harus diisi");
}
}
?>
<!DOCTYPE html>
<html>
<div class="container">
<h1 class="text-center"><strong> Edit KKJ </strong></h1>
<form class="form-inline" action="" method="post">
<h3 class="text-left"><strong> Input Kegiatan </strong></h1>
<table id="table-kegiatan" class="table table-condensed"><!--table untuk mengisi kegiatan-->
<tr>
<textarea class="form-control" type="text" name="Kegiatan" id="Kegiatan" style="width:320px;"><?= $kegiatan_awal; ?></textarea>
</td>
<td>Satuan Hasil Kerja
<select class="form-control" id="SatuanHasilKerja" name="SatuanHasilKerja" >
<option><?= $shk_awal; ?></option>
<option>Kegiatan</option>
<option>Dokumen</option>
</select>
</td>
<td>Jumlah Volume Kerja*
<input class="form-control" type="numbers" name="JumlahVolumeKerja" id="JumlahVolumeKerja" style="width:75px;" value="<?= $jvk_awal; ?>" onkeyup="tambahFunction()">
</td>
<td>Norma Waktu Lazim*
<input class="form-control" type="numbers" name="NormaWaktuLazim" id="NormaWaktuLazim" style="width:75px;" value="<?= $nwl_awal; ?>" onkeyup="tambahFunction()">
</td>
<td>Jumlah Waktu Melaksanakan Tugas*
<input class="form-control" type="numbers" name="JumlahWaktuMelaksanakanTugas"
id="JumlahWaktuMelaksanakanTugas" style="width:100px;" value="<?= $jmlKerja_awal; ?>">
</td>
<td>
<br><br>
<button class="btn btn-primary btn-lg" type="submit" name="ubah" onclick="cekKegiatanKosong()" >Ubah Data</button>
</tr>
</table>
<p class="small">*Hanya bisa diisi angka</p>
<a href="input_kkj.php"><input class="btn btn-success" value="Kembali"></input></a>
</form><hr><hr>
</div>
<script>
function tambahFunction() {
var j = document.getElementById("JumlahVolumeKerja").value;
var n = document.getElementById("NormaWaktuLazim").value;
var jwmt;
jwmt = j * n;
document.getElementById("JumlahWaktuMelaksanakanTugas").value = jwmt;
}
</script>
<script>
function cekKegiatanKosong(){
var Kegiatan, JumlahVolumeKerja, NormaWaktuLazim, JumlahWaktuMelaksanakanTugas;
kegiatan = document.getElementById("Kegiatan").value;
jvk = document.getElementById("JumlahVolumeKerja").value;
nwl = document.getElementById("NormaWaktuLazim").value;
jwmt =
document.getElementById("JumlahWaktuMelaksanakanTugas").value;
var numbers=/^[0-9]+$/;
//try{
if(kegiatan == "" || jvk == "" || nwl == "" || jwmt == ""){
alert("Input kegiatan salah, silakan cek kembali");
}
else{
alert("Data berhasil diubah");
return true;
}
}
</script>
</html>
Laporan_kkj_hasil.php <?php
require_once "core/init.php";
require_once "views/header_user.php";
//require_once "functions/excel-class.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
$tglawal = $_SESSION['sess_tglawal']; //mengamil data tglawal dari halaman sebelumnya(laporan_kkj.php)
$tglakhir = $_SESSION['sess_tglakhir'];//mengamil data tglakhir dari halaman sebelumnya(laporan_kkj.php)
$tgll = date_create($tglawal);
$tglr = date_create($tglakhir);
$id = $_SESSION['sess_id'];//mengamil data userid dari halaman sebelumnya(laporan_kkj.php)
$dataPegawai = showDataPegawai($_SESSION['sess_id']);//panggil fungsi menampilkan data pegawai
//echo($row['Nama']);
$dataKKJ= showLaporanKKj($id,$tglawal,$tglakhir);
$_SESSION['sess_dataKKJ'] = $dataKKJ; //menyimpan semua data kkj ke dalam session yang nantinya akan ditampilkan di halaman lainnya
$totaljwmt = jumlahWaktuMT($id,$tglawal,$tglakhir);
if (isset($_GET['KegiatanID'])){
$dataKegiatan = editDataKegiatan($id);
while($row = mysqli_fetch_assoc($dataKegiatan)){
$kegiatan_awal = $row['NamaKegiatan'];
$shk_awal = $row['SatuanHasilKerja'];
$jvk_awal = $row['JumlahVolumeKerja'];
$nwl_awal = $row['NormaWaktuLazim'];
$jmlKerja_awal = $row['JumlahWaktuMelaksanakanTugas'];
}
}
?>
<!DOCTYPE html>
<html>
<head><style type="text/css">
.custom-date-style {
background-color: red !important;
}
.input{
}
.input-wide{
width: 500px;
}
</style>
<body>
<div class="container">
<h2 class="text-center"><strong> Kertas Kerja Jabatan </strong></h2>
<h4 class="text-center"><?=date_format($tgll,'d M').' - '.date_format($tglr,'d M Y')?></h4>
<form class="form-inline" action="" method="" >
<table id="table-kegiatan" class="table table-striped" style="width:40%" >
<tr>
<td>Nama</td>
<td>: <?= $row['Nama'];?></td>
</tr>
<tr>
<td>Jabatan</td>
<td>: <?= $row['Jabatan'];?></td>
</tr>
<tr>
<td>Unit Kerja / SKPD</td>
<td>: <?= $row['UnitKerja'];?></td>
</tr></table>
<table id="table-kegiatan" class="table table-bordered"><!--table untuk data kegiatan ->
<thead>
<tr>
<!--<th>KKJID<br><br></th>
<th>UserID<br><br></th>-->
<th style="width:100px;">Tanggal<br><br></th>
<th>Kegiatan<br><br></th>
<th>Satuan Hasil<br> Kerja</th>
<th>Norma<br>Waktu<br>Lazim</th>
<th>Jumlah Waktu<br>Melaksanakan Tugas</th>
<th>Edit / <br>Hapus <br></th>
</tr>
</thead>
<tbody id="table-kegiatan-body">
<?php while ($row=mysqli_fetch_assoc($dataKKJ)):?>
<tr>
<!--<td><?= $row['KKJID']?></td>
<td><?= $row['UserID']?></td>-->
<td><?= $row['Tanggal']?></td>
<td><?= $row['NamaKegiatan']?></td>
<td><?= $row['SatuanHasilKerja']?></td>
<td><?= $row['JumlahVolumeKerja']?></td>
<td><?= $row['NormaWaktuLazim']?></td>
<td><?=
$row['JumlahWaktuMelaksanakanTugas']?></td>
<td style="width:90px;">
<div class="btn-group">
<!--memanggil fungsi edit_kkj.php berdasarkan id kegiatan -->
<a href="edit_kkj.php?KegiatanID=<?= $row['KegiatanID']; ?>">
<button type="button" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span></button></a>
<!--memanggil fungsi delete_kkj.php berdasarkan id kegiatan -->
<?= "<a onClick=\"javascript: return confirm('Apakah anda yakin ingin hapus kegiatan?');\"
href='delete_kkj_laporan.php?KegiatanID=".$row['KegiatanID']."'>
<button type='button' class='btn btn-danger btn-sm'>
<span class='glyphicon
</div>
</td>
</tr>
<?php endwhile;?>
<td class="info">Total Jumlah Waktu Melaksanakan Tugas (menit)</td>
<td></td><td></td><td></td>
<td class="info"><?php $row=mysqli_fetch_assoc($totaljwmt); echo($row['jml']);?></td>
</tbody>
<tfoot id="table-kegiatan-foot">
<td></td>
<td class="info">Efektifitas Jabatan</td>
<td></td><td></td><td></td>
<td class="info"><?php $efektif = $row['jml'] / 6000;
if ($efektif >= 1){
echo 1;
}else {
echo $efektif;
}
?></td>
</tfoot>
</table>
</form>
<form action="export-excel-kkj.php" method="post" >
<input class="btn btn-lg btn-success" type="submit" name="cetakKKJ" value="Cetak KKJ" />
</div>
</body>
Export_excel_kkj.php <?php
require_once "core/init.php";
$output = '';
$tglawal = $_SESSION['sess_tglawal']; //mengamil data tglawal dari halaman sebelumnya(laporan_kkj.php)
$tglakhir = $_SESSION['sess_tglakhir'];//mengamil data tglakhir dari halaman sebelumnya(laporan_kkj.php)
$tgll = date_create($tglawal);
$tglr = date_create($tglakhir);
$id = $_SESSION['sess_id'];
if(isset($_POST['cetakKKJ'])){
$dataKKJ = showLaporanKKj($id,$tglawal,$tglakhir);
dataPegawai = showDataPegawai($id);//panggil fungsi menampilkan data pegawai
$row1 =mysqli_fetch_assoc($dataPegawai);
$totaljwmt = jumlahWaktuMT($id,$tglawal,$tglakhir);
$row2 =mysqli_fetch_assoc($totaljwmt);
$output . = '
<h2 class="text-center"><strong> Kertas Kerja Jabatan </strong></h2>
<h4 class="text-center">'.date_format($tgll,'d M').' - '.date_format($tglr,'d M Y').'</h4><br>
<table id="table-kegiatan" class="table table-bordered" style="width:40%" >
<tr>
<td>Nama</td>
<td>:'.$row1['Nama'].'</td>
</tr>
<tr>
<td>:'.$row1['Jabatan'].'</td>
</tr>
<tr>
<td>Unit Kerja / SKPD</td>
<td>:'.$row1['UnitKerja'].'</td>
</table>
<table class="table" bordered="1">
<tr>
<th style="width:100px;">Tanggal<br><br></th>
<th style="width:60%;">Kegiatan<br><br></th>
<th>Satuan Hasil<br> Kerja</th>
<th>Jumlah<br>Volume<br>Kerja</th>
<th>Norma<br>Waktu<br>Lazim</th>
<th>Jumlah Waktu<br>Melaksanakan Tugas</th>
<th>Paraf</th>
</tr>';
while ($row=mysqli_fetch_assoc($dataKKJ)){
$output .= '<tr>
<td>' .$row['Tanggal'].'</td>
<td>' .$row['NamaKegiatan'].'</td>
<td>' .$row['SatuanHasilKerja'].'</td>
<td>' .$row['JumlahVolumeKerja'].'</td>
<td>' .$row['NormaWaktuLazim'].'</td>
<td>' .$row['JumlahWaktuMelaksanakanTugas'].'</td>
</tr>';
}
$output .= '<td></td>
<td>Total Jumlah Waktu Melaksanakan Tugas (menit)</td>
<td>'.$row2['jml']. '</td>
<tr><td></td>
<td>Efektifitas Jabatan</td>
<td></td><td></td><td></td>
<td>';$ej = $row2['jml'] / 6000;
if ($ej >= 1){
$ej = 1;
}else {
$ej;
}
$output .= $ej.'</td>
</tr>
</table>';
header("Contect-Type : application/xls");
header("Content-Disposition : attachment; filename=kkj-pegawai.xls");
echo $output;
}
class Excel{
function setHeader($filename)
{
header("Pragma : public");
header("Expires : 0");
header("Cache-Control : must-revalidate, post-check=0, pre-check=0");
header("Contect-Type : application/force-download");
header("Contect-Type : application/octet-stream");
header("Contect-Type : application/download");
header("Contect-Transfer-Encoding : binary");
}
function BOF(){
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
function EOF(){
echo pack("ss", 0x0A, 0x00);
}
function writeNumber($Row, $Col, $Value){
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
}
function writeLabel($Row, $Col, $Value){
$L = strlen($Value);
echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo($Value);
return;
}
}
?>
Laporan_tpp_pegawai.php <?php
require_once "core/init.php";
require_once "views/header_user.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
header('Location: login.php');
} //mengambil data pegawai lalu dimasukkan ke form
$id = ambil_id($_SESSION['sess_nama']);
if (isset($_POST['lihat'])){
$bulan = $_POST['bulan'];
$tahun = $_POST['tahun'];
if(showLaporanTPPadmin($bulan,$tahun)){
$_SESSION['bulan']= $bulan;
$_SESSION['tahun'] = $tahun;
header('Location:laporan_tpp_hasil_pegawai.php');
//return true;
}else{
echo("ada yang salah");
}
}
?>
<!DOCTYPE html>
<html>
<head><style type="text/css">
.custom-date-style {
background-color: red !important;
}
.input{
}
.input-wide{
width: 500px;
}
</style>
<body>
<div class="container">
<h1 class="text-center"><strong> LAPORAN TPP </strong></h1>
<form class="form-inline col-sm-8 col-sm-offset-2" action="" method="post">
<div class="panel panel-primary" >
<div class="panel panel-heading">
<h4 class="text-left"><strong> Form Cari KKJ </strong></h4>
</div>
<div class="panel panel-body">
<table id="table-pegawai" class="table table-condensed" style="width:50%" align="center"><!--table untuk menampilkan informasi awal untuk kkj-->
<tr>
<td>Bulan<br>
<select style="width:200px;height:30px;" name="bulan">
<option value="1">Januari</option>
<option value="2">Febuari</option>
<option value="3">Maret</option>
<option value="4">April</option>
<option value="5">Mei</option>
<option value="6">Juni</option>
<option value="7">Juli</option>
<option value="8">Agustus</option>
<option value="9">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">Desember</option>
</select>
<td>Tahun<br><input type="text" name="tahun" id="tahun" value="<?=$tahun = date('Y') ?>"></input></td>
</tr>
<tr>
<td>
<button class="btn btn-primary btn-lg" type="submit" name="lihat">Lihat TPP</button>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Laporan_tpp_hasil_pegawai <?php
require_once "core/init.php";
require_once "views/header_user.php";
//require_once "functions/excel-class.php";
if(!$_SESSION['sess_nama']){
header('Location: login.php');
}elseif($_SESSION['sess_nama'] && $_SESSION['sess_admin']){
header('Location: login.php');
}
$bulan = $_SESSION['bulan'];
$tahun = $_SESSION['tahun'];
$id = $_SESSION['sess_id'];
$tppid = $id.'-'.$bulan.'-'.$tahun;
$tppPegawai = showTPP($tppid);
$date = date_create($tahun.'-'.$bulan.'+1'.'-00');//membuat format tanggal seperti di Indonesia, hari-bulan-tahun. Tapi hanya bulan dan tahun yang ditampilkan
//setlocale(LC_MONETARY, 'en_US');
//$set = 66666666666;
//echo number_format($set, 2,',','.'); //number_format biar kaya currency di Indonesia, 2 angka dibelakang koma
?>
<!DOCTYPE html>
<html>
<head><style type="text/css">
.custom-date-style {
background-color: red !important;
}
.input{
}
.input-wide{
width: 500px;
}
</style>
</head>
<body>
<div class="container" style="width:70%;">
<h2 class="text-center"><strong> Laporan TPP </strong></h2>
<h4 class="text-center"><?=date_format($date,'M Y')?></h4>
<div class="panel panel-primary">
<div class="panel panel-heading">
<h4 class="text-left"><strong> Detail </strong></h4>
<div class="panel panel-body">
<?php while ($row=mysqli_fetch_assoc($tppPegawai)):?>
<div class="row">
<div class="col col-sm-6">NIP</div>
<div class="col col-sm-6"><?= $row['NIP']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Nama</div>
<div class="col col-sm-6"><?= $row['Nama']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Jabatan</div>
<div class="col col-sm-6"><?= $row['Jabatan']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Golongan</div>
<div class="col col-sm-6"><?= $row['Golongan']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Besar TPP</div>
<div class="col
col-sm-6">Rp<?=number_format($row['TPPMax'],2,',','.')?></div>
</div>
<div class="row">
<div class="col col-sm-6">Efektifitas Jabatan</div>
<div class="col
col-sm-6"><?=number_format($row['EfektifitasJabatan'],2,',','.')?></div>
</div>
<div class="row">
<div class="col col-sm-6"><?= $row['JumlahTidakHadir']?></div>
</div>
<div class="row">
<div class="col col-sm-6">Jumlah Penerimaan Kotor</div>
<div class="col
colsm6">Rp<?=number_format($row['PenerimaanKotor'],2,',','.')?></d iv>
</div>
<div class="row">
<div class="col col-sm-6">Pph pasal 21</div>
<div class="col col-sm-6">Rp <?=
number_format($row['Pph'],2,',','.')?></div>
</div>
<div class="row">
<div class="col col-sm-6">Jumlah Penerimaan Bersih</div>
<divclass="colcolsm6">Rp<?=number_format($row['PenerimaanBersih'], 2,',','.')?></div>
</div>
</div>
</div>
<?php endwhile; ?>
<form action="export-excel-tpp-pegawai.php" method="post" >
<a href="laporan_tpp_pegawai.php" ><input class="btn lg btn-info" type="" name="kembali" value="Kembali" /></a>
<input class="btn btn-lg btn-success" type="submit" name="cetakTPP" value="Cetak TPP"/>
</div>
</body>
</html>
require_once "core/init.php";
$output = '';
$bulan = $_SESSION['bulan'];
$tahun = $_SESSION['tahun'];
$id = $_SESSION['sess_id'];
$tppid = $id.'-'.$bulan.'-'.$tahun;
$tppPegawai = showTPP($tppid);
$date = date_create($tahun.'-'.$bulan.'+1'.'-00');
if(isset($_POST['cetakTPP'])){
$output .= '
<h2 class="text-center"><strong> Laporan TPP </strong></h2>
<h4 class="text-center">'.date_format($date,'M Y').'</h4>
<table id="table-kegiatan" class="table table-bordered"><!--table untuk data kegiatan>';
while ($row=mysqli_fetch_assoc($tppPegawai)){
$output .= '
<tr>
<td>NIP</td>
<td>'.$row['NIP'].'</td>
</tr>
<tr>
<td>Nama</td>
<td>'.$row['Nama'].'</td>
</tr>
<tr>
<td>Jabatan</td>
<td>'.$row['Jabatan'].'</td>
</tr>
<tr>
<td>'.$row['Golongan'].'</td>
</tr>
<tr>
<td>Besar TPP</td>
<td> Rp '.number_format($row['TPPMax'],2,',','.').'</td>
</tr>
<tr>
<td>Efektifitas Jabatan</td>
<td>'.$row['EfektifitasJabatan'].'</td>
</tr>
<tr>
<td>Jumlah Tidak Hadir</td>
<td>'.$row['JumlahTidakHadir'].'</td>
</tr>
<tr>
<td>Jumlah Penerimaan Kotor</td>
<td> Rp '.number_format($row['PenerimaanKotor'],2,',','.').'</td>
</tr>
<tr>
<td>Pph Pasal 21</td>
<td> Rp '.number_format($row['Pph'],2,',','.').'</td>
</tr>
<tr>
<td>Jumlah Penerimaan Bersih</td>
<td> Rp '.number_format($row['PenerimaanBersih'],2,',','.').'</td>
</tr>';}
header("Contect-Type : application/xls");
echo $output;
}
class Excel{
function setHeader($filename)
{
header("Pragma : public");
header("Expires : 0");
header("Cache-Control : must-revalidate, post-check=0, pre-check=0");
header("Contect-Type : application/force-download");
header("Contect-Type : application/octet-stream");
header("Contect-Type : application/download");
header("Content-Disposition : attachment;filename=$filename");
header("Contect-Transfer-Encoding : binary");
}
function BOF(){
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
function EOF(){
echo pack("ss", 0x0A, 0x00);
}
function writeNumber($Row, $Col, $Value){
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
}
function writeLabel($Row, $Col, $Value){
$L = strlen($Value);
echo($Value);
return;
}
}
?>
Logout.php <?php
require_once "core/init.php";
session_destroy();
header("Location: login.php");