added kadis login
This commit is contained in:
113
application/views/kepaladinas/menu/admin_detail.php
Normal file
113
application/views/kepaladinas/menu/admin_detail.php
Normal file
@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("admin/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("admin/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2"></div>
|
||||
<div class="col-xs-8">
|
||||
<form class="box-content" onsubmit="update_data(event)">
|
||||
<h4 class="box-title" id="header_peta">Ubah Username dan Password</h4>
|
||||
<div class="form-group">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" class="form-control" id="username" placeholder="Masukkan Username" required value="<?= $cek_data->username ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" class="form-control" id="password" placeholder="Masukkan Password" minlength="6" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="konfirm_password">Konfirm Password</label>
|
||||
<input type="password" class="form-control" id="konfirm_password" minlength="6" placeholder="Masukkan Konfirm Password" required>
|
||||
</div>
|
||||
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="form-group text-center">
|
||||
<button type="submit" class="btn btn-primary btn-xs waves-effect waves-light">Ganti Username Dan Password</button>
|
||||
</div>
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</form>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
<div class="col-xs-2"></div>
|
||||
|
||||
< <!-- /.col-xs-12 -->
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('admin/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('admin/scripts') ?>
|
||||
|
||||
<script>
|
||||
function update_data(e) {
|
||||
e.preventDefault();
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
var confirm_password = $('#konfirm_password').val();
|
||||
if (password != confirm_password) {
|
||||
toastr.error('Password Tidak Sama');
|
||||
// focus
|
||||
$('#password').focus();
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
url: server_url_api + "ganti_data_admin",
|
||||
type: 'POST',
|
||||
data: {
|
||||
username: username,
|
||||
password: password,
|
||||
nik: '<?= $cek_data->nik ?>',
|
||||
id_dinas : '<?= $cek_data->id_dinas ?>'
|
||||
},
|
||||
beforeSend: function(res) {
|
||||
// $('#modal_karyawan').modal('hide');
|
||||
block_ui("Update Data");
|
||||
},
|
||||
success: function(data) {
|
||||
$.unblockUI();
|
||||
// console.log(data);
|
||||
toastr.success('Berhasil Update Data');
|
||||
$("#password").val('');
|
||||
$("#konfirm_password").val('');
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
$.unblockUI();
|
||||
// console.log(errorThrown)
|
||||
// console.log(textStatus)
|
||||
const statusCode = XMLHttpRequest.status;
|
||||
const responseJSON = XMLHttpRequest.responseJSON;
|
||||
console.log(statusCode);
|
||||
console.log(responseJSON)
|
||||
if (statusCode != 500 || statusCode != 0) {
|
||||
toastr.error(responseJSON.message);
|
||||
} else {
|
||||
toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
701
application/views/kepaladinas/menu/cetak_pdf.php
Normal file
701
application/views/kepaladinas/menu/cetak_pdf.php
Normal file
@ -0,0 +1,701 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- <button id="download-button">Download as PDF</button>
|
||||
<button onclick="exportTableToExcel('invoice')">Export Table Data To Excel File</button> -->
|
||||
<div id="invoice">
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td width="2%">
|
||||
<td width="17%">
|
||||
<img src="<?= base_url() ?>assets/images/logo_mamuju_tengah.png" width="100px" height="120px">
|
||||
</td>
|
||||
<td width="60%" style="text-align: center;">
|
||||
<h3 style="display: block;font-size: 20px;">PEMERINTA KABUPATEN MAMUJU TENGAH<br>DINAS PARIWISATA KEPEMUDAAN DAN OLAHRAGA</h3>
|
||||
<p style="font-style: italic;"> <b>Alamat : </b> Jl, Abdul Majid Pattaro Pura Kab. Mamuju Tengah, Prov. Sulawesi Barat</p>
|
||||
</td>
|
||||
<td width="17%"></td>
|
||||
<td width="2%">
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<!-- create hr with black 2px -->
|
||||
<hr style="border: 3px solid black;"><br>
|
||||
<center><b><u><?=$title2?></u></b></center>
|
||||
<center><?=$title3?></center><br>
|
||||
<?php
|
||||
// get the first day full name
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('model');
|
||||
$first_day = date('l', strtotime($year . '-' . $month . '-01'));
|
||||
// get the number of days in the month
|
||||
$days_in_month = date('t', strtotime($year . '-' . $month . '-01'));
|
||||
// print_r($days_in_month);
|
||||
|
||||
// loop the days in the month start from day monday to friday, if day is saturday or sunday, skip it, if day start not from monday, add empty cell
|
||||
|
||||
// $week_array = [];
|
||||
$day_array = [];
|
||||
|
||||
for ($i = 1; $i <= $days_in_month; $i++) {
|
||||
$tanggal = strlen($i) == 1 ? "0" . $i : $i;
|
||||
$date = $year . '-' . $month . '-' . $tanggal;
|
||||
$day = date('l', strtotime($date));
|
||||
if ($day == 'Saturday' || $day == 'Sunday') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if the day is not monday, add the previous to monday but null
|
||||
|
||||
|
||||
// if reach day friday, add the week array to week array
|
||||
|
||||
|
||||
$day_array[] = ['date' => $date, 'day' => $day];
|
||||
// echo '<div class="col-md-1" style="background-color: #f2f2f2; border: 1px solid #ddd; padding: 10px; margin: 5px; text-align: center; height: 100px; width: 100px; float: left;">';
|
||||
// echo $i;
|
||||
// echo '</div>';
|
||||
}
|
||||
|
||||
// print_r($day_array[0]['day']);
|
||||
// if $day_array[0]['day'] is tuesday, add monday to array, if $day_array[0]['day'] is wednesday, add monday and tuesday to array, if $day_array[0]['day'] is thursday, add monday, tuesday, and wednesday to array, if $day_array[0]['day'] is friday, add monday, tuesday, wednesday, and thursday to array
|
||||
if ($day_array[0]['day'] == 'Tuesday') {
|
||||
$day_array = array_merge([['date' => '', 'day' => 'Monday']], $day_array);
|
||||
} else if ($day_array[0]['day'] == 'Wednesday') {
|
||||
$day_array = array_merge([['date' => '', 'day' => 'Monday'], ['date' => '', 'day' => 'Tuesday']], $day_array);
|
||||
} else if ($day_array[0]['day'] == 'Thursday') {
|
||||
$day_array = array_merge([['date' => '', 'day' => 'Monday'], ['date' => '', 'day' => 'Tuesday'], ['date' => '', 'day' => 'Wednesday']], $day_array);
|
||||
} else if ($day_array[0]['day'] == 'Friday') {
|
||||
$day_array = array_merge([['date' => '', 'day' => 'Monday'], ['date' => '', 'day' => 'Tuesday'], ['date' => '', 'day' => 'Wednesday'], ['date' => '', 'day' => 'Thursday']], $day_array);
|
||||
}
|
||||
|
||||
// if $day_array[count($day_array) - 1]['day'] is monday, add tuesday , wednesday, thursday, and friday to array, if $day_array[count($day_array) - 1]['day'] is tuesday, add wednesday, thursday, and friday to array, if $day_array[count($day_array) - 1]['day'] is wednesday, add thursday and friday to array, if $day_array[count($day_array) - 1]['day'] is thursday, add friday to array
|
||||
|
||||
if ($day_array[count($day_array) - 1]['day'] == 'Monday') {
|
||||
$day_array = array_merge($day_array, [['date' => '', 'day' => 'Tuesday'], ['date' => '', 'day' => 'Wednesday'], ['date' => '', 'day' => 'Thursday'], ['date' => '', 'day' => 'Friday']]);
|
||||
} else if ($day_array[count($day_array) - 1]['day'] == 'Tuesday') {
|
||||
$day_array = array_merge($day_array, [['date' => '', 'day' => 'Wednesday'], ['date' => '', 'day' => 'Thursday'], ['date' => '', 'day' => 'Friday']]);
|
||||
} else if ($day_array[count($day_array) - 1]['day'] == 'Wednesday') {
|
||||
$day_array = array_merge($day_array, [['date' => '', 'day' => 'Thursday'], ['date' => '', 'day' => 'Friday']]);
|
||||
} else if ($day_array[count($day_array) - 1]['day'] == 'Thursday') {
|
||||
$day_array = array_merge($day_array, [['date' => '', 'day' => 'Friday']]);
|
||||
}
|
||||
|
||||
// print_r($day_array);
|
||||
|
||||
$week_array = [];
|
||||
|
||||
for ($i = 0; $i < count($day_array); $i++) {
|
||||
if ($i % 5 == 0) {
|
||||
$week_array[] = [$day_array[$i], $day_array[$i + 1], $day_array[$i + 2], $day_array[$i + 3], $day_array[$i + 4]];
|
||||
}
|
||||
}
|
||||
foreach ($week_array as $week) {
|
||||
?>
|
||||
<table border="1" style="margin-left:auto;margin-right:auto;width:97%;" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="3" valign="middle" style="text-align: center;">NO</th>
|
||||
<th rowspan="3" valign="middle" style="text-align: center;">NAMA</th>
|
||||
<th rowspan="3" style="text-align: center;" width="5%">JAM/<br>PARAF</th>
|
||||
<th colspan="4" style="text-align: center;" width="15%">
|
||||
<?php
|
||||
// change the date format to d-m-Y
|
||||
$date = $week[0]['date'] != null ? date('d/m/Y', strtotime($week[0]['date'])) : '-';
|
||||
echo $CI->model->hari($week[0]['day']) . ', ' . $date;
|
||||
?>
|
||||
</th>
|
||||
<!-- <th>Status</th> -->
|
||||
<th colspan="4" style="text-align: center;" width="15%">
|
||||
<?php
|
||||
// change the date format to d-m-Y
|
||||
$date = $week[1]['date'] != null ? date('d/m/Y', strtotime($week[1]['date'])) : '-';
|
||||
echo $CI->model->hari($week[1]['day']) . ', ' . $date;
|
||||
?>
|
||||
</th>
|
||||
<!-- <th>Jam Istirehat</th> -->
|
||||
<th colspan="4" style="text-align: center;" width="15%">
|
||||
<?php
|
||||
// change the date format to d-m-Y
|
||||
$date = $week[2]['date'] != null ? date('d/m/Y', strtotime($week[2]['date'])) : '-';
|
||||
echo $CI->model->hari($week[2]['day']) . ', ' . $date;
|
||||
?>
|
||||
</th>
|
||||
<th colspan="4" style="text-align: center;" width="15%">
|
||||
<?php
|
||||
// change the date format to d-m-Y
|
||||
$date = $week[3]['date'] != null ? date('d/m/Y', strtotime($week[3]['date'])) : '-';
|
||||
echo $CI->model->hari($week[3]['day']) . ', ' . $date;
|
||||
?>
|
||||
</th>
|
||||
<th colspan="4" style="text-align: center;" width="15%">
|
||||
<?php
|
||||
// change the date format to d-m-Y
|
||||
$date = $week[4]['date'] != null ? date('d/m/Y', strtotime($week[4]['date'])) : '-';
|
||||
echo $CI->model->hari($week[4]['day']) . ', ' . $date;
|
||||
?>
|
||||
</th>
|
||||
<th rowspan="3" style="text-align: center;">Ket</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <th rowspan="3">NAMA</th> -->
|
||||
<!-- <th>JAM/PARAF</th> -->
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Pagi</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Siang</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Pagi</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Siang</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Pagi</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Siang</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Pagi</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Siang</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Pagi</th>
|
||||
<th colspan="2" style="text-align: center;" width="7.5%">Siang</th>
|
||||
<!-- <th>Aksi</th> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <th rowspan="3">NAMA</th> -->
|
||||
<!-- <th>JAM/PARAF</th> -->
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<th style="text-align: center;" width="3.75%">M</th>
|
||||
<th style="text-align: center;" width="3.75%">P</th>
|
||||
<!-- <th>Aksi</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$no = 1;
|
||||
foreach ($list_karyawan as $key => $value) {
|
||||
if ($value->status == $stat) {
|
||||
?>
|
||||
<tr>
|
||||
<td rowspan="4" style="text-align: center;"><b><?= $no++; ?></b></td>
|
||||
<td><b><?= $value->nama; ?></b></td>
|
||||
<td rowspan="2" style="text-align: center;">Jam</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_senin = null;
|
||||
if ($week[0]['date'] != null) {
|
||||
$cek_data_senin = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[0]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_senin) > 0) {
|
||||
$cek_data_senin = $cek_data_senin[0];
|
||||
} else {
|
||||
$cek_data_senin = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_masuk != '') ? "  " . $cek_data_senin->jam_masuk . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_istirehat != '') ? "  " . $cek_data_senin->jam_istirehat . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_masuk_kembali != '') ? "  " . $cek_data_senin->jam_masuk_kembali . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_pulang != '') ? "  " . $cek_data_senin->jam_pulang . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_selasa = null;
|
||||
if ($week[1]['date'] != null) {
|
||||
$cek_data_selasa = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[1]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_selasa) > 0) {
|
||||
$cek_data_selasa = $cek_data_selasa[0];
|
||||
} else {
|
||||
$cek_data_selasa = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_masuk != '') ? "  " . $cek_data_selasa->jam_masuk . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_istirehat != '') ? "  " . $cek_data_selasa->jam_istirehat . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_masuk_kembali != '') ? "  " . $cek_data_selasa->jam_masuk_kembali . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_pulang != '') ? "  " . $cek_data_selasa->jam_pulang . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_rabu = null;
|
||||
if ($week[2]['date'] != null) {
|
||||
$cek_data_rabu = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[2]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_rabu) > 0) {
|
||||
$cek_data_rabu = $cek_data_rabu[0];
|
||||
} else {
|
||||
$cek_data_rabu = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_masuk != '') ? "  " . $cek_data_rabu->jam_masuk . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_istirehat != '') ? "  " . $cek_data_rabu->jam_istirehat . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_masuk_kembali != '') ? "  " . $cek_data_rabu->jam_masuk_kembali . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_pulang != '') ? "  " . $cek_data_rabu->jam_pulang . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_kamis = null;
|
||||
if ($week[3]['date'] != null) {
|
||||
$cek_data_kamis = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[3]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_kamis) > 0) {
|
||||
$cek_data_kamis = $cek_data_kamis[0];
|
||||
} else {
|
||||
$cek_data_kamis = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_masuk != '') ? "  " . $cek_data_kamis->jam_masuk . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_istirehat != '') ? "  " . $cek_data_kamis->jam_istirehat . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_masuk_kembali != '') ? "  " . $cek_data_kamis->jam_masuk_kembali . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_pulang != '') ? "  " . $cek_data_kamis->jam_pulang . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_jumat = null;
|
||||
if ($week[4]['date'] != null) {
|
||||
$cek_data_jumat = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[4]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_jumat) > 0) {
|
||||
$cek_data_jumat = $cek_data_jumat[0];
|
||||
} else {
|
||||
$cek_data_jumat = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_masuk != '') ? "  " . $cek_data_jumat->jam_masuk . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_istirehat != '') ? "  " . $cek_data_jumat->jam_istirehat . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_masuk_kembali != '') ? "  " . $cek_data_jumat->jam_masuk_kembali . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_pulang != '') ? "  " . $cek_data_jumat->jam_pulang . "    " : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><?= $value->nik; ?>  </b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $value->pangkat; ?></td>
|
||||
<td rowspan="2" style="text-align: center;">Paraf</td>
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_senin = null;
|
||||
if ($week[0]['date'] != null) {
|
||||
$cek_data_senin = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[0]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_senin) > 0) {
|
||||
$cek_data_senin = $cek_data_senin[0];
|
||||
} else {
|
||||
$cek_data_senin = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_masuk != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_istirehat != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_masuk_kembali != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_senin != null && $cek_data_senin->jam_pulang != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_selasa = null;
|
||||
if ($week[1]['date'] != null) {
|
||||
$cek_data_selasa = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[1]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_selasa) > 0) {
|
||||
$cek_data_selasa = $cek_data_selasa[0];
|
||||
} else {
|
||||
$cek_data_selasa = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_masuk != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_istirehat != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_masuk_kembali != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_selasa != null && $cek_data_selasa->jam_pulang != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_rabu = null;
|
||||
if ($week[2]['date'] != null) {
|
||||
$cek_data_rabu = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[2]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_rabu) > 0) {
|
||||
$cek_data_rabu = $cek_data_rabu[0];
|
||||
} else {
|
||||
$cek_data_rabu = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_masuk != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_istirehat != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_masuk_kembali != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_rabu != null && $cek_data_rabu->jam_pulang != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_kamis = null;
|
||||
if ($week[3]['date'] != null) {
|
||||
$cek_data_kamis = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[3]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_kamis) > 0) {
|
||||
$cek_data_kamis = $cek_data_kamis[0];
|
||||
} else {
|
||||
$cek_data_kamis = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_masuk != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_istirehat != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_masuk_kembali != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_kamis != null && $cek_data_kamis->jam_pulang != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
$cek_data_jumat = null;
|
||||
if ($week[4]['date'] != null) {
|
||||
$cek_data_jumat = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, 'tanggal' => $week[4]['date'], 'id_dinas' => $id_dinas])->result();
|
||||
|
||||
if (count($cek_data_jumat) > 0) {
|
||||
$cek_data_jumat = $cek_data_jumat[0];
|
||||
} else {
|
||||
$cek_data_jumat = null;
|
||||
}
|
||||
}
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_masuk != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_istirehat != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_masuk_kembali != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
<td rowspan="2" style="text-align: center;">
|
||||
<?php
|
||||
echo ($cek_data_jumat != null && $cek_data_jumat->jam_pulang != '') ? '<i class="fa fa-check-circle" aria-hidden="true"></i> ' : '-';
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td rowspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $value->jabatan; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
<br><br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br><br>
|
||||
<table style="width: 97%;">
|
||||
<tr>
|
||||
<td width="5%"></td>
|
||||
<td width="25%">
|
||||
<b>Keterangan :</b>
|
||||
</td>
|
||||
<td width="40%"></td>
|
||||
<td width="25%">
|
||||
Topoyo, / <?php echo date('d / '); echo $CI->model->bulan( date('m'));?> / 2022
|
||||
</td>
|
||||
<td width="5%"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
TK = Tanpa Keterangan
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<b>Kepala Dinas Pariwisata</b>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
S = Sakit
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<b>Kepemudaaan Dan Olahraga</b>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
I = Izin
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
DL = Dinas Luar
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
C = Cuti
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
M = Masuk
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<b>HJ. NANDA . S. Kep ., MM</b>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
P = Pulang
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
Pangkat: Pembina Tk. IIVb
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
Nip . 12312321
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
const button = document.getElementById('download-button');
|
||||
|
||||
function generatePDF() {
|
||||
// Choose the element that your content will be rendered to.
|
||||
const element = document.getElementById('invoice');
|
||||
// Choose the element and save the PDF for your user.
|
||||
// add margin on top and bottom every new page
|
||||
html2pdf().from(element).set({
|
||||
margin: 1,
|
||||
filename: '<?= $title; ?>.pdf',
|
||||
html2canvas: {
|
||||
scale: 2, // A mayor escala, mejores gráficos, pero más peso
|
||||
letterRendering: true,
|
||||
},
|
||||
jsPDF: {
|
||||
unit: 'in',
|
||||
format: 'a4',
|
||||
orientation: 'landscape' // landscape o portrait
|
||||
}
|
||||
}).save();
|
||||
}
|
||||
|
||||
generatePDF();
|
||||
</script>
|
||||
<script>
|
||||
function exportTableToExcel(tableID, filename = '') {
|
||||
var downloadLink;
|
||||
var dataType = 'application/vnd.ms-excel';
|
||||
var tableSelect = document.getElementById(tableID);
|
||||
var tableHTML = tableSelect.outerHTML.replace(/ /g, '%20');
|
||||
|
||||
// Specify file name
|
||||
filename = filename ? filename + '.xls' : 'excel_data.xls';
|
||||
|
||||
// Create download link element
|
||||
downloadLink = document.createElement("a");
|
||||
|
||||
document.body.appendChild(downloadLink);
|
||||
|
||||
if (navigator.msSaveOrOpenBlob) {
|
||||
var blob = new Blob(['\ufeff', tableHTML], {
|
||||
type: dataType
|
||||
});
|
||||
navigator.msSaveOrOpenBlob(blob, filename);
|
||||
} else {
|
||||
// Create a link to the file
|
||||
downloadLink.href = 'data:' + dataType + ', ' + tableHTML;
|
||||
|
||||
// Setting the file name
|
||||
downloadLink.download = filename;
|
||||
|
||||
//triggering the function
|
||||
downloadLink.click();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
333
application/views/kepaladinas/menu/index.php
Normal file
333
application/views/kepaladinas/menu/index.php
Normal file
@ -0,0 +1,333 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content">
|
||||
<h4 class="box-title" id="header_peta">Peta Absensi</h4>
|
||||
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="form-group">
|
||||
<div id="map" style="width: 100%; height: 500px"></div>
|
||||
|
||||
</div>
|
||||
<div class="form-group text-center" id="title_peta"></div>
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content">
|
||||
<h4 class="box-title" id="header_absensi">Absensi Pegawai</h4>
|
||||
|
||||
<div class="card-content">
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_karyawan" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>Status</th>
|
||||
<th>Last Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($list_karyawan as $key => $value) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $value->nik ?></td>
|
||||
<td><?= $value->nama ?></td>
|
||||
<td id="status_<?= $value->nik ?>"> <?= $value->status_kerja ?> </td>
|
||||
<td id="lu_<?= $value->nik ?>"> - </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD7B9RynI4hQM_Y4BG9GYxsTLWwYkGASRo&libraries=geometry,drawing,places&v=weekly®ion=ID&language=id"></script>
|
||||
|
||||
<script>
|
||||
$('#table_list_karyawan').DataTable({
|
||||
|
||||
})
|
||||
var id_dinas = <?= $id_dinas ?>;
|
||||
$("#header_peta").html(`Peta Absensi <i>(${getTodayDate()})</i>`)
|
||||
$("#header_absensi").html(`Absensi Pegawai <i>(${getTodayDate()})</i>`)
|
||||
|
||||
let markersOverlay = [];
|
||||
|
||||
function addInfoWindow(marker, message) {
|
||||
|
||||
var infoWindow = new google.maps.InfoWindow({
|
||||
content: message
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
infoWindow.open(map, marker);
|
||||
});
|
||||
}
|
||||
async function initMap() {
|
||||
map = new google.maps.Map(document.getElementById("map"), {
|
||||
zoom: 17.5,
|
||||
center: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
mapTypeId: 'hybrid',
|
||||
streetViewControl: false,
|
||||
});
|
||||
|
||||
const cityCircle = new google.maps.Circle({
|
||||
strokeColor: "#FF0000",
|
||||
strokeOpacity: 0.3,
|
||||
strokeWeight: 0.3,
|
||||
fillColor: "#FF0000",
|
||||
fillOpacity: 0.3,
|
||||
map,
|
||||
center: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
radius: <?= $radius ?>,
|
||||
});
|
||||
|
||||
const marker = new google.maps.Marker({
|
||||
position: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
map: map,
|
||||
title: 'Center',
|
||||
icon: 'https://maps.google.com/mapfiles/ms/icons/green-dot.png',
|
||||
});
|
||||
|
||||
markersOverlay[0] = marker;
|
||||
|
||||
let dinas_html = `<div class="card-content">
|
||||
<div class="form-group>
|
||||
<label for="nik"><?= $dinas ?></label>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
addInfoWindow(marker, dinas_html);
|
||||
|
||||
setInterval(
|
||||
async function() {
|
||||
clearOverlays()
|
||||
markers = []
|
||||
markers = [{
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
|
||||
}]
|
||||
let all_data;
|
||||
try {
|
||||
const the_data = await $.ajax({
|
||||
url: server_url_api + "get_today_absensi?id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
// block_ui("Mengambil Data Karyawan");
|
||||
},
|
||||
});
|
||||
// console.log(the_data);
|
||||
all_data = the_data.data;
|
||||
|
||||
for (let i = 0; i < all_data.length; i++) {
|
||||
markers.push(all_data[i])
|
||||
// console.log(all_data)
|
||||
}
|
||||
|
||||
let arr = []
|
||||
for (let i = 0; i < markers.length; i++) {
|
||||
console.log(markers[i]['lat'])
|
||||
let latlng = new google.maps.LatLng(markers[i]['lat'], markers[i]['lng']);
|
||||
arr.push(latlng);
|
||||
let color = i > 0 ? 'blue' : 'green'
|
||||
|
||||
const marker = new google.maps.Marker({
|
||||
position: {
|
||||
lat: markers[i]['lat'],
|
||||
lng: markers[i]['lng']
|
||||
},
|
||||
map: map,
|
||||
title: 'Center',
|
||||
icon: `https://maps.google.com/mapfiles/ms/icons/${color}-dot.png`,
|
||||
});
|
||||
|
||||
markersOverlay[i] = marker;
|
||||
if (i > 0) {
|
||||
let html = `<div class="card-content">
|
||||
<div class="form-group>
|
||||
<label for="nik">NIK</label>
|
||||
<input type="text" class="form-control" value="${markers[i]['nik']}" disabled>
|
||||
</div>
|
||||
<div class="form-group>
|
||||
<label for="nik">Nama</label>
|
||||
<input type="text" class="form-control" value="${markers[i]['nama']}" disabled>
|
||||
</div>
|
||||
<div class="form-group>
|
||||
<label for="nik">Last Updated</label>
|
||||
<input type="text" class="form-control" value="${markers[i]['last_updated']}" disabled>
|
||||
</div>
|
||||
<div class="form-group>
|
||||
<label for="nik">Status</label>
|
||||
<input type="text" class="form-control" value="${markers[i]['status']}" disabled>
|
||||
</div>
|
||||
</div>`
|
||||
$("#lu_" + markers[i]['nik']).html(markers[i]['last_updated']);
|
||||
$("#status_" + markers[i]['nik']).html(markers[i]['status']);
|
||||
addInfoWindow(marker, html);
|
||||
} else {
|
||||
addInfoWindow(marker, dinas_html);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
if (markers.length > 1) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
bounds.extend(arr[i]);
|
||||
}
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}, 5000)
|
||||
|
||||
}
|
||||
google.maps.event.addDomListener(window, 'load', initMap);
|
||||
|
||||
function clearOverlays() {
|
||||
if (markersOverlay) {
|
||||
for (i in markersOverlay) {
|
||||
markersOverlay[i].setMap(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addMinutes(time, minutes) {
|
||||
return new Date(new Date('1970-01-01T' + time + 'Z').getTime() + minutes * 60000).toISOString().substr(11, 5);
|
||||
}
|
||||
|
||||
async function check_data() {
|
||||
// console.log("selalu jalankan")
|
||||
// get current time
|
||||
const today = new Date();
|
||||
// chnage time to overall seconds
|
||||
let time = today.getHours() * 3600 + today.getMinutes() * 60 + today.getSeconds();
|
||||
|
||||
let data
|
||||
try {
|
||||
// get today day name in id
|
||||
|
||||
const day = today.toLocaleString('id-ID', {
|
||||
weekday: 'long'
|
||||
});
|
||||
// console.log(day)
|
||||
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "check_jadwal?hari=" + day + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
// beforeSend: function(res) {
|
||||
// block_ui("Mengambil Data Informasi Libur");
|
||||
// },
|
||||
});
|
||||
data = data.data
|
||||
// console.log(data);
|
||||
// create const jam_masuk and jam_pulang
|
||||
let jam_masuk = data.jam_masuk
|
||||
let jam_pulang = data.jam_pulang
|
||||
|
||||
// add 30 minutes before jam_masuk
|
||||
// add 30 minutes after jam_pulang
|
||||
jam_masuk = addMinutes(jam_masuk, -30)
|
||||
jam_pulang = addMinutes(jam_pulang, 30)
|
||||
|
||||
// get the overall seconds of jam_masuk and jam_pulang
|
||||
jam_masuk = jam_masuk.split(":")[0] * 3600 + jam_masuk.split(":")[1] * 60
|
||||
jam_pulang = jam_pulang.split(":")[0] * 3600 + jam_pulang.split(":")[1] * 60
|
||||
|
||||
console.log("jam_masuk", jam_masuk)
|
||||
console.log("jam_pulang", jam_pulang)
|
||||
console.log("time", time)
|
||||
|
||||
if (time >= jam_masuk && time <= jam_pulang) {
|
||||
$("#map").attr("hidden", false);
|
||||
$("#title_peta").attr("style", "display:none");
|
||||
} else {
|
||||
$("#map").attr("hidden", true);
|
||||
$("#title_peta").attr("style", "display:block");
|
||||
$("#title_peta").html("Peta tidak dapat ditampilkan saat ini, Diluar Jam Kerja");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
// await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
$("#map").attr("hidden", true);
|
||||
$("#title_peta").attr("style", "display:block");
|
||||
$("#title_peta").html("Peta tidak dapat ditampilkan saat ini, Diluar Jam Kerja ");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
check_data()
|
||||
setInterval(
|
||||
check_data, 5000
|
||||
)
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
164
application/views/kepaladinas/menu/jam_kerja.php
Normal file
164
application/views/kepaladinas/menu/jam_kerja.php
Normal file
@ -0,0 +1,164 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">List Hari Jam Kerja</h4>
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="card-content">
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_hari" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hari</th>
|
||||
<th>Jam Masuk</th>
|
||||
<th>Jam Istirehat</th>
|
||||
<th>Jam Masuk Kembali</th>
|
||||
<th>Jam Pulang</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="text-align: center;">
|
||||
<tr id="senin">
|
||||
<td class="harinya">Senin</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="selasa">
|
||||
<td class="harinya">Selasa</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="rabu">
|
||||
<td class="harinya">Rabu</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="kamis">
|
||||
<td class="harinya">Kamis</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="jumat">
|
||||
<td class="harinya">Jumat</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="sabtu">
|
||||
<td class="harinya">Sabtu</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
<tr id="ahad">
|
||||
<td class="harinya">Ahad</td>
|
||||
<td class="jam_masuk">-</td>
|
||||
<td class="jam_istirehat">-</td>
|
||||
<td class="jam_masuk_kembali">-</td>
|
||||
<td class="jam_pulang">-</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
|
||||
<!-- <script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script> -->
|
||||
|
||||
<script>
|
||||
var id_dinas = <?= $id_dinas ?>;
|
||||
var all_data = [];
|
||||
|
||||
async function get_all_data() {
|
||||
let data;
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "jam_kerja?id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Jam Kerja");
|
||||
},
|
||||
});
|
||||
data = data.data
|
||||
all_data = data
|
||||
data.forEach((item, index) => {
|
||||
$("#table_list_hari #" + item['hari'] + " .jam_masuk").html(tConvert(item['jam_masuk']))
|
||||
$("#table_list_hari #" + item['hari'] + " .jam_istirehat").html(tConvert(item['jam_istirehat']))
|
||||
$("#table_list_hari #" + item['hari'] + " .jam_masuk_kembali").html(tConvert(item['jam_masuk_kembali']))
|
||||
$("#table_list_hari #" + item['hari'] + " .jam_pulang").html(tConvert(item['jam_pulang']))
|
||||
})
|
||||
// data_karyawan = data;
|
||||
await $.unblockUI();
|
||||
} catch (error) {
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
get_all_data();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
324
application/views/kepaladinas/menu/karyawan.php
Normal file
324
application/views/kepaladinas/menu/karyawan.php
Normal file
@ -0,0 +1,324 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">List Pegawai </h4>
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-success btn-sm waves-effect waves-light" onclick="buka_modal_cetak()">Cetak List Pegawai</button>
|
||||
</div>
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_karyawan" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>No Telpon</th>
|
||||
<th>Jabatan</th>
|
||||
<th>Pangkat</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_karyawan" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1" data-keyboard="false" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form class="modal-content" onsubmit="return tambah_edit(event)" id="form_tambah_karyawan">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1"></h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group text-center" id="div_img" style="display: none;">
|
||||
<img src="" class="avatar" id="img_container" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nik">Foto</label>
|
||||
<input type="file" class="form-control" id="foto" required="true">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nik">NIP Pegawai</label>
|
||||
<input type="hidden" id="status_form">
|
||||
<input type="text" class="form-control" id="nik" placeholder="Masukkan NIK Pegawai" minlength="14" maxlength="18" onkeypress="return isNumberKey(event)" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control" id="nama" placeholder="Masukkan Nama Pegawai" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">No Telepon</label>
|
||||
<input type="text" class="form-control" id="no_telpon" placeholder="Masukkan No Telepon Pegawai" minlength="10" maxlength="14" onkeypress="return isNumberKey(event)" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="jabatan">Jabatan</label>
|
||||
<select name="jabatan" id="jabatan" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Jabatan</option>
|
||||
<option value="Kepala Dinas">Kepala Dinas</option>
|
||||
<option value="Sekretaris">Sekretaris</option>
|
||||
<option value="Bendahara Keuangan">Bendahara Keuangan</option>
|
||||
<option value="Kepala Bidang">Kepala Bidang</option>
|
||||
<option value="Analisis Kebijakan">Analisis Kebijakan</option>
|
||||
<option value="Adyatama Kepariwisataan dan Ekonomi">Adyatama Kepariwisataan dan Ekonomi</option>
|
||||
<option value="Kasubag Perencanaan">Kasubag Perencanaan</option>
|
||||
<option value="Fungsional Umum">Fungsional Umum</option>
|
||||
<option value="Kasubag Kepegawaian">Kasubag Kepegawaian</option>
|
||||
<option value="Staf">Staf</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pangkat">Pangkat</label>
|
||||
<select name="pangkat" id="pangkat" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Pangkat</option>
|
||||
<option value="Tiada">Tiada</option>
|
||||
<option value="I A">I A</option>
|
||||
<option value="I B">I B</option>
|
||||
<option value="I C">I C</option>
|
||||
<option value="I D">I D</option>
|
||||
<option value="II A">II A</option>
|
||||
<option value="II B">II B</option>
|
||||
<option value="II C">II C</option>
|
||||
<option value="II D">II D</option>
|
||||
<option value="III A">III A</option>
|
||||
<option value="III B">III B</option>
|
||||
<option value="III C">III C</option>
|
||||
<option value="III D">III D</option>
|
||||
<option value="IV A">IV A</option>
|
||||
<option value="IV B">IV B</option>
|
||||
<option value="IV C">IV C</option>
|
||||
<option value="IV D">IV D</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="keanggotaan">Keanggotaan</label>
|
||||
<select name="keanggotaan" id="keanggotaan" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Keanggotaan</option>
|
||||
<option value="Sekretariat">Sekretariat</option>
|
||||
<option value="Olahraga">Olahraga</option>
|
||||
<option value="Pemuda">Pemuda</option>
|
||||
<option value="Ekonomi Kreatif">Ekonomi Kreatif</option>
|
||||
<option value="Pariwisata">Pariwisata</option>
|
||||
<option value="Keuangan">Keuangan</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status">Status</label>
|
||||
<select name="status" id="status" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Status</option>
|
||||
<option value="PNS">PNS</option>
|
||||
<option value="Kontrak">Kontrak</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="jenis_kelamin">Jenis Kelamin</label>
|
||||
<select name="jenis_kelamin" id="jenis_kelamin" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Opsi</option>
|
||||
<option value="Laki-laki">Laki-laki</option>
|
||||
<option value="Perempuan">Perempuan</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tanggal_lahir">Tanggal Lahir</label>
|
||||
<input type="date" class="form-control" id="tanggal_lahir" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tempat_lahir">Tempat Lahir</label>
|
||||
<input type="text" class="form-control" id="tempat_lahir" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="alamat">Alamat</label>
|
||||
<textarea name="alamat" id="alamat" cols="30" rows="10" class="form-control" style="resize: none;" placeholder="Masukkan Alamat" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" id="button_simpan_edit" class="btn btn-primary btn-xs waves-effect waves-light"></button>
|
||||
<button type="button" class="btn btn-danger btn-xs waves-effect waves-light" data-dismiss="modal">Batalkan</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_list_pegawai" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1">Cetak List Pegawai</h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" id="isi_surat"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script async>
|
||||
var id_dinas = <?= $id_dinas ?>;
|
||||
|
||||
var data_karyawan;
|
||||
|
||||
var table;
|
||||
|
||||
function datatables() {
|
||||
table = $('#table_list_karyawan').DataTable({
|
||||
// "searching": false,
|
||||
"lengthMenu": [
|
||||
[5, 10, 15, -1],
|
||||
[5, 10, 15, "All"]
|
||||
],
|
||||
"pageLength": 10,
|
||||
"ordering": true,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
// "order": [[ 4, 'desc' ]],
|
||||
|
||||
"ajax": {
|
||||
"url": server_url + "kepaladinas/karyawan",
|
||||
"type": "POST",
|
||||
data: {
|
||||
proses: 'table_karyawan'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
"columnDefs": [{
|
||||
"targets": [0],
|
||||
"orderable": false,
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
datatables()
|
||||
|
||||
document.getElementById("foto").onchange = function() {
|
||||
let foto_produk = document.getElementById('foto').files[0];
|
||||
check_file(foto_produk)
|
||||
}
|
||||
|
||||
function buka_modal_tambah() { // buka modal untuk tambah karyawan
|
||||
$(".modal-title").html("Form Tambah Pegawai")
|
||||
$("#status_form").val("tambah")
|
||||
$("#button_simpan_edit").html("Tambah Pegawai")
|
||||
// reset form_tambah_karyawan
|
||||
$("#div_img").attr('style', "display : none")
|
||||
$("#form_tambah_karyawan")[0].reset()
|
||||
$('#modal_karyawan').modal('show');
|
||||
}
|
||||
|
||||
async function karyawan_edit(nik) {
|
||||
// console.log(nik);
|
||||
$(".modal-title").html("Form Edit Pegawai")
|
||||
$("#status_form").val("edit")
|
||||
$("#button_simpan_edit").html("Edit Pegawai")
|
||||
$("#foto").attr('required', false)
|
||||
$("#foto").val(null)
|
||||
$("#div_img").removeAttr("style")
|
||||
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "karyawan?nik=" + nik + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Pegawai");
|
||||
},
|
||||
});
|
||||
data = data.data
|
||||
data_karyawan = data;
|
||||
await $.unblockUI();
|
||||
$("#nik").val(data.nik)
|
||||
$("#nama").val(data.nama)
|
||||
$("#no_telpon").val(data.no_telpon)
|
||||
$("#jabatan").val(data.jabatan)
|
||||
$("#tanggal_lahir").val(data.tanggal_lahir)
|
||||
$("#alamat").html(data.alamat)
|
||||
$("#nik").attr("disabled", true)
|
||||
$("#img_container").attr("src", server_url + data.image)
|
||||
selectElement('pangkat', data.pangkat);
|
||||
selectElement('status', data.status);
|
||||
selectElement('jenis_kelamin', data.jenis_kelamin);
|
||||
selectElement('keanggotaan', data.keanggotaan);
|
||||
$("#tempat_lahir").val(data.tempat_lahir)
|
||||
$('#modal_karyawan').modal('show');
|
||||
} catch (error) {
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cek_laporan(nik, stat) {
|
||||
if (stat == 'tidak') {
|
||||
toastr.info("Pegawai Ini Tidak Memiliki Laporan Kegiatan");
|
||||
return
|
||||
}
|
||||
|
||||
window.location.href = server_url + "kepaladinas/karyawan/" + nik;
|
||||
}
|
||||
|
||||
function buka_modal_cetak() {
|
||||
const laporan = `<embed src="${server_url}kepaladinas/cetak_list_pegawai" frameborder="1" width="100%" height="600px">`;
|
||||
$("#isi_surat").empty();
|
||||
$("#isi_surat").append(laporan);
|
||||
$('#modal_list_pegawai').modal('show');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
175
application/views/kepaladinas/menu/karyawan_detail.php
Normal file
175
application/views/kepaladinas/menu/karyawan_detail.php
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title" id="title_laporan">Laporan Kegiatan Pegawai </h4>
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="card-content">
|
||||
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_laporan" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Tanggal Upload</th>
|
||||
<th>Judul</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_detail_laporan" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1" >
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1">Detail Kegiatan</h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group text-center" id="div_img" style="display: none;">
|
||||
<img src="" class="avatar" id="img_container" width="250px" height="250px" alt="avatar">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="waktu">Waktu Kegiatan</label>
|
||||
<input type="text" class="form-control" id="waktu" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul Kegiatan</label>
|
||||
<input type="text" class="form-control" id="judul" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="keterangan">Keterangan Kegiatan</label>
|
||||
<textarea name="keterangan" id="keterangan" cols="30" rows="10" class="form-control" style="resize: none;" disabled></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger btn-xs waves-effect waves-light" data-dismiss="modal">Tutup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
var id_dinas = <?= $id_dinas ?>;
|
||||
|
||||
$("#title_laporan").html("Laporan Kegiatan Pegawai <?= $nama ?> | <i><?= $nik ?></i>");
|
||||
|
||||
function datatables() {
|
||||
table = $('#table_list_laporan').DataTable({
|
||||
// "searching": false,
|
||||
"lengthMenu": [
|
||||
[5, 10, 15, -1],
|
||||
[5, 10, 15, "All"]
|
||||
],
|
||||
"pageLength": 10,
|
||||
"ordering": true,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
// "order": [[ 4, 'desc' ]],
|
||||
|
||||
"ajax": {
|
||||
"url": server_url + "kepaladinas/karyawan",
|
||||
"type": "POST",
|
||||
data: {
|
||||
proses: 'table_laporan',
|
||||
nik: '<?= $nik ?>'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
"columnDefs": [{
|
||||
"targets": [0],
|
||||
"orderable": false,
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
datatables()
|
||||
|
||||
async function cek_laporan(id_lapoaran) {
|
||||
// console.log(id_lapoaran)
|
||||
let data;
|
||||
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "detail_kegiatan?id_laporan=" + id_lapoaran,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Detail Laporan")
|
||||
},
|
||||
});
|
||||
data = data.data
|
||||
console.log(data)
|
||||
$("#waktu").val(data.created_at)
|
||||
$("#judul").val(data.nama_laporan)
|
||||
$("#keterangan").val(data.ket_laporan)
|
||||
if(data.image == null) {
|
||||
$("#div_img").hide()
|
||||
$("#img_container").attr("src", "")
|
||||
} else {
|
||||
$("#div_img").show()
|
||||
console.log
|
||||
$("#img_container").attr("src", server_url + data.image)
|
||||
}
|
||||
await $.unblockUI();
|
||||
// show modal
|
||||
$("#modal_detail_laporan").modal("show")
|
||||
// console.log(data)
|
||||
} catch (error) {
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
221
application/views/kepaladinas/menu/laporan copy.php
Normal file
221
application/views/kepaladinas/menu/laporan copy.php
Normal file
@ -0,0 +1,221 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("admin/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("admin/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2"></div>
|
||||
<div class="col-xs-8">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Filter Laporan </h4>
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
<div class="col-xs-2"></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Laporan Absensi Bulan <?= $month ?>, Tahun <?= $year ?></h4>
|
||||
|
||||
<div class="card-content">
|
||||
<div style="overflow-x: auto;" class="form-group">
|
||||
<table id="example" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>NAMA</th>
|
||||
<th>JAM/PARAF</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Status</th>
|
||||
<th>Jam Masuk</th>
|
||||
<th>Jam Istirehat</th>
|
||||
<th>Jam Masuk Kembali</th>
|
||||
<th>Jam Pulang</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- <tbody>
|
||||
<?php
|
||||
for ($i = $first_date; $i <= $last_date; $i++) {
|
||||
|
||||
foreach ($list_karyawan as $key => $value) {
|
||||
$tanggal = strlen($i) == 1 ? "0" . $i : $i;
|
||||
// echo
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('model');
|
||||
$check_absensi = $CI->model->tampil_data_where('tb_absensi_karyawan', ['nik' => $value->nik, "tanggal" => $year . "-" . $month . "-" . $tanggal])->result();
|
||||
|
||||
$status = '-';
|
||||
$jam_masuk = "-";
|
||||
$jam_istirehat = "-";
|
||||
$jam_masuk_kembali = "-";
|
||||
$jam_pulang = "-";
|
||||
|
||||
if (count($check_absensi) > 0) {
|
||||
$status = 'Masuk Kerja';
|
||||
$jam_masuk = $check_absensi[0]->jam_masuk;
|
||||
$jam_istirehat = $check_absensi[0]->jam_istirehat ?? '-';
|
||||
$jam_masuk_kembali = $check_absensi[0]->jam_masuk_kembali ?? '-';
|
||||
$jam_pulang = $check_absensi[0]->jam_pulang ?? '-';
|
||||
}
|
||||
|
||||
$check_libur = $CI->model->tampil_data_where('tb_informasi_libur', ['nik' => $value->nik, "tanggal" => $year . "-" . $month . "-" . $tanggal])->result();
|
||||
|
||||
if (count($check_libur) > 0) {
|
||||
$status = "Libur";
|
||||
$idnya = $check_libur[0]->id_libur;
|
||||
}
|
||||
|
||||
$check_perjalanan_dinas = $CI->model->tampil_data_where('tb_informasi_perjalanan_dinas', ['nik' => $value->nik, "tanggal" => $year . "-" . $month . "-" . $tanggal])->result();
|
||||
|
||||
if (count($check_perjalanan_dinas) > 0) {
|
||||
$status = "Perjalanan Dinas";
|
||||
$idnya = $check_perjalanan_dinas[0]->id_perjalanan_dinas;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $value->nama ?> / <?= $value->nik ?> </td>
|
||||
<td><?= $value->jabatan ?></td>
|
||||
<td><?= $tanggal ?>-<?= $month ?>-<?= $year ?></td>
|
||||
<td><?= $status ?></td>
|
||||
<td><?= $jam_masuk ?></td>
|
||||
<td><?= $jam_istirehat ?></td>
|
||||
<td><?= $jam_masuk_kembali ?></td>
|
||||
<td><?= $jam_pulang ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($status == 'Libur' || $status == "Perjalanan Dinas") {
|
||||
?>
|
||||
<center><button type='button' onclick='check_info("<?= $status ?>" ,<?= $idnya ?>)' title='Check Informasi <?= $status ?>' class='btn btn-primary btn-circle btn-sm waves-effect waves-light'><i class='ico zmdi zmdi-info-outline'></i></button></center>
|
||||
<?php
|
||||
} else {
|
||||
echo "-";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody> -->
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<div id="iframeDisplay"></div>
|
||||
<button type="button" id="button_cetak" class="btn btn-primary btn-xs waves-effect waves-light" onclick="displayIframe()">Cetak Laporan</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('admin/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_pdf" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1" data-keyboard="false">
|
||||
<div class="modal-dialog modal-lg" role="document" >
|
||||
<div class="modal-content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('admin/scripts') ?>
|
||||
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
// $(document).ready(function() {
|
||||
// var groupColumn = 2;
|
||||
// var table = $('#example').DataTable({
|
||||
// columnDefs: [{
|
||||
// visible: false,
|
||||
// targets: groupColumn
|
||||
// }],
|
||||
// order: [
|
||||
// [groupColumn, 'asc']
|
||||
// ],
|
||||
// displayLength: 25,
|
||||
// drawCallback: function(settings) {
|
||||
// var api = this.api();
|
||||
// var rows = api.rows({
|
||||
// page: 'current'
|
||||
// }).nodes();
|
||||
// var last = null;
|
||||
|
||||
// api
|
||||
// .column(groupColumn, {
|
||||
// page: 'current'
|
||||
// })
|
||||
// .data()
|
||||
// .each(function(group, i) {
|
||||
// if (last !== group) {
|
||||
// $(rows)
|
||||
// .eq(i)
|
||||
// .before('<tr class="group text-center"><td colspan="8">' + group + '</td></tr>');
|
||||
|
||||
// last = group;
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
|
||||
// // Order by the grouping
|
||||
// $('#example tbody').on('click', 'tr.group', function() {
|
||||
// var currentOrder = table.order()[0];
|
||||
// if (currentOrder[0] === groupColumn && currentOrder[1] === 'asc') {
|
||||
// table.order([groupColumn, 'desc']).draw();
|
||||
// } else {
|
||||
// table.order([groupColumn, 'asc']).draw();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
|
||||
<script>
|
||||
async function check_info(stat, id) {
|
||||
console.log(stat, id)
|
||||
}
|
||||
|
||||
function displayIframe() {
|
||||
document.getElementById("iframeDisplay").innerHTML = "<iframe src=\"../HtmlPage1.html\" height=\"200\" width=\"300\" ></iframe>";
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
1297
application/views/kepaladinas/menu/laporan.php
Normal file
1297
application/views/kepaladinas/menu/laporan.php
Normal file
File diff suppressed because it is too large
Load Diff
169
application/views/kepaladinas/menu/libur.php
Normal file
169
application/views/kepaladinas/menu/libur.php
Normal file
@ -0,0 +1,169 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
|
||||
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">List Libur</h4>
|
||||
<div class="card-content">
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_libur" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Range Tanggal</th>
|
||||
<th>List Pegawai</th>
|
||||
<th>Created At</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_informasi_libur" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1"> Informasi Libur</h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="nik">Range Tanggal</label>
|
||||
<input type="text" class="form-control" id="range_tanggal" disabled>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nik">List Pegawai</label>
|
||||
<textarea name="list_karyawan" class="form-control" id="list_karyawan" cols="30" rows="10" style="resize: none;" disabled></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">Keterangan</label>
|
||||
<textarea name="keterangan" class="form-control" id="keterangan" cols="30" rows="10" style="resize: none;" disabled></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">Created At</label>
|
||||
<input type="text" class="form-control" id="created_at" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="isi_surat"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
<!-- Select2 -->
|
||||
<script src="<?= base_url() ?>assets/plugin/select2/js/select2.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
var table;
|
||||
|
||||
function datatables() {
|
||||
table = $('#table_list_libur').DataTable({
|
||||
// "searching": false,
|
||||
"lengthMenu": [
|
||||
[5, 10, 15, -1],
|
||||
[5, 10, 15, "All"]
|
||||
],
|
||||
"pageLength": 10,
|
||||
"ordering": true,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
// "order": [[ 4, 'desc' ]],
|
||||
|
||||
"ajax": {
|
||||
"url": server_url + "kepaladinas/libur",
|
||||
"type": "POST",
|
||||
data: {
|
||||
proses: 'table_libur'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
"columnDefs": [{
|
||||
"targets": [2, 4],
|
||||
"orderable": false,
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
datatables()
|
||||
|
||||
async function check_info(id_libur) {
|
||||
// console.log(id_libur)
|
||||
let data
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "libur?id_libur=" + id_libur + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Informasi Libur");
|
||||
},
|
||||
});
|
||||
data = data.data
|
||||
console.log(data);
|
||||
|
||||
await $.unblockUI();
|
||||
$("#range_tanggal").val(data.range_tanggal)
|
||||
$("#keterangan").val(data.ket)
|
||||
$("#list_karyawan").val(data.list_karyawan)
|
||||
$("#created_at").val(data.created_at)
|
||||
// console.log(data.file)
|
||||
const laporan = `<embed src="${server_url}${data.file}" frameborder="1" width="100%" height="500px">`;
|
||||
$("#isi_surat").empty();
|
||||
$("#isi_surat").append(laporan);
|
||||
$('#modal_informasi_libur').modal('show');
|
||||
} catch (error) {
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
|
||||
|
||||
}
|
||||
// $('#modal_informasi_libur').modal('show');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
97
application/views/kepaladinas/menu/pengaturan.php
Normal file
97
application/views/kepaladinas/menu/pengaturan.php
Normal file
@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content">
|
||||
<h4 class="box-title">Titik Lokasi Dinas</h4>
|
||||
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="form-group">
|
||||
<div id="map" style="width: 100%; height: 500px"></div>
|
||||
</div>
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /.row -->
|
||||
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD7B9RynI4hQM_Y4BG9GYxsTLWwYkGASRo&libraries=geometry,drawing,places&v=weekly®ion=ID&language=id">
|
||||
</script>
|
||||
<!-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD7B9RynI4hQM_Y4BG9GYxsTLWwYkGASRo&&language=id®ion=ID&callback=initAutocomplete&libraries=places&v=weekly&sensor=false" defer></script> -->
|
||||
<script>
|
||||
let map;
|
||||
async function initMap() {
|
||||
map = new google.maps.Map(document.getElementById("map"), {
|
||||
zoom: 19.5,
|
||||
center: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
mapTypeId: 'hybrid',
|
||||
streetViewControl: false,
|
||||
});
|
||||
|
||||
const marker = new google.maps.Marker({
|
||||
position: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
map: map,
|
||||
title: 'Center',
|
||||
icon: 'https://maps.google.com/mapfiles/ms/icons/blue-dot.png',
|
||||
});
|
||||
|
||||
const cityCircle = new google.maps.Circle({
|
||||
strokeColor: "#FF0000",
|
||||
strokeOpacity: 0.3,
|
||||
strokeWeight: 0.3,
|
||||
fillColor: "#FF0000",
|
||||
fillOpacity: 0.3,
|
||||
map,
|
||||
center: {
|
||||
lat: <?= $lat ?>,
|
||||
lng: <?= $lng ?>
|
||||
},
|
||||
radius: <?= $radius ?>,
|
||||
});
|
||||
}
|
||||
google.maps.event.addDomListener(window, 'load', initMap);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
168
application/views/kepaladinas/menu/perjalanan_dinas.php
Normal file
168
application/views/kepaladinas/menu/perjalanan_dinas.php
Normal file
@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
|
||||
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">List Libur</h4>
|
||||
<div class="card-content">
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_perjalanan_dinas" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Range Tanggal</th>
|
||||
<th>List Pegawai</th>
|
||||
<th>Created At</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_informasi_perjalanan_dinas" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1"> Informasi Perjalanan Dinas</h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="nik">Range Tanggal</label>
|
||||
<input type="text" class="form-control" id="range_tanggal" disabled>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nik">List Pegawai</label>
|
||||
<textarea name="list_karyawan" class="form-control" id="list_karyawan" cols="30" rows="10" style="resize: none;" disabled></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">Keterangan</label>
|
||||
<textarea name="keterangan" class="form-control" id="keterangan" cols="30" rows="10" style="resize: none;" disabled></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama">Created At</label>
|
||||
<input type="text" class="form-control" id="created_at" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="isi_surat"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
<!-- Select2 -->
|
||||
<script src="<?= base_url() ?>assets/plugin/select2/js/select2.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
var table;
|
||||
|
||||
function datatables() {
|
||||
table = $('#table_list_perjalanan_dinas').DataTable({
|
||||
// "searching": false,
|
||||
"lengthMenu": [
|
||||
[5, 10, 15, -1],
|
||||
[5, 10, 15, "All"]
|
||||
],
|
||||
"pageLength": 10,
|
||||
"ordering": true,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
// "order": [[ 4, 'desc' ]],
|
||||
|
||||
"ajax": {
|
||||
"url": server_url + "kepaladinas/perjalanan_dinas",
|
||||
"type": "POST",
|
||||
data: {
|
||||
proses: 'table_dinas'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
"columnDefs": [{
|
||||
"targets": [2, 4],
|
||||
"orderable": false,
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
datatables()
|
||||
|
||||
async function check_info(id_perjalanan_dinas) {
|
||||
// console.log(id_perjalanan_dinas)
|
||||
let data
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "perjalanan_dinas?id_perjalanan_dinas=" + id_perjalanan_dinas + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Informasi Perjalanan Dinas");
|
||||
},
|
||||
});
|
||||
data = data.data
|
||||
console.log(data);
|
||||
|
||||
await $.unblockUI();
|
||||
$("#range_tanggal").val(data.range_tanggal)
|
||||
$("#keterangan").val(data.ket)
|
||||
$("#list_karyawan").val(data.list_karyawan)
|
||||
$("#created_at").val(data.created_at)
|
||||
const laporan = `<embed src="${server_url}${data.sppd}" frameborder="1" width="100%" height="500px">`;
|
||||
$("#isi_surat").empty();
|
||||
$("#isi_surat").append(laporan);
|
||||
$('#modal_informasi_perjalanan_dinas').modal('show');
|
||||
} catch (error) {
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
|
||||
|
||||
}
|
||||
// $('#modal_informasi_perjalanan_dinas').modal('show');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
440
application/views/kepaladinas/menu/surat_masuk.php
Normal file
440
application/views/kepaladinas/menu/surat_masuk.php
Normal file
@ -0,0 +1,440 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<?php $this->load->view("kepaladinas/header"); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php $this->load->view("kepaladinas/side_topbar"); ?>
|
||||
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">List Surat </h4>
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="card-content">
|
||||
<!-- <div class="form-group">
|
||||
<button type="button" class="btn btn-primary btn-sm waves-effect waves-light" onclick="buka_modal_input_surat()">Input Surat</button>
|
||||
</div> -->
|
||||
<div style="overflow-x: auto">
|
||||
<table id="table_list_surat" class="table table-striped table-bordered display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No Surat</th>
|
||||
<th>Tanggal Pengiriman</th>
|
||||
<th>Tanggal Diterima</th>
|
||||
<th>No Agenda</th>
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /#flot-chart-1.flot-chart -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- /.col-xs-12 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/footer') ?>
|
||||
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_surat_masuk" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form class="modal-content" onsubmit="return edit_surat(event)" id="form_input_surat">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1"></h4>
|
||||
<!-- <p style="font-size: 10px;"><i>(Geserkan marker ke titik kordinat dinas)</i></p> -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- <div class="form-group text-center" id="div_img" style="display: none;">
|
||||
<img src="" class="avatar" id="img_container" />
|
||||
</div> -->
|
||||
<!-- <div class="form-group">
|
||||
<label for="nik">Foto</label>
|
||||
<input type="file" class="form-control" id="foto" required="true">
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label for="asal_surat">Asal Surat</label>
|
||||
<input type="hidden" id="id_surat_masuk">
|
||||
<input type="text" class="form-control" id="asal_surat" placeholder="Masukkan Asal Surat" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="no_surat">No. Surat</label>
|
||||
<input type="text" class="form-control" id="no_surat" placeholder="000/0000.0/00/0000" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tanggal_pengiriman">Tanggal Pengiriman</label>
|
||||
<input type="date" class="form-control" id="tanggal_pengiriman" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tanggal_diterima">Tanggal Diterima</label>
|
||||
<input type="date" class="form-control" id="tanggal_diterima" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="no_agenda">No. Agenda</label>
|
||||
<input type="text" class="form-control" id="no_agenda" placeholder="000" minlength="1" maxlength="3" onkeypress="return isNumberKey(event)" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sifat">Sifat</label>
|
||||
<select name="sifat" id="sifat" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Sifat</option>
|
||||
<option value="Tiada">Tiada</option>
|
||||
<option value="Segera">Segera</option>
|
||||
<option value="Rahsia">Rahsia</option>
|
||||
<option value="Sangat Rahsia">Sangat Rahsia</option>
|
||||
<!-- <option value="I C">I C</option>
|
||||
<option value="I D">I D</option>
|
||||
<option value="II A">II A</option>
|
||||
<option value="II B">II B</option>
|
||||
<option value="II C">II C</option>
|
||||
<option value="II D">II D</option>
|
||||
<option value="III A">III A</option>
|
||||
<option value="III B">III B</option>
|
||||
<option value="III C">III C</option>
|
||||
<option value="III D">III D</option>
|
||||
<option value="IV A">IV A</option>
|
||||
<option value="IV B">IV B</option>
|
||||
<option value="IV C">IV C</option>
|
||||
<option value="IV D">IV D</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="perihal">Perihal</label>
|
||||
<textarea name="perihal" id="perihal" cols="30" rows="10" class="form-control" style="resize: none;" placeholder="Masukkan Perihal" required></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="diteruskan_kepada">Diteruskan Kepada</label>
|
||||
<select name="diteruskan_kepada" id="diteruskan_kepada" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Opsi</option>
|
||||
<option value="Tiada">Tiada</option>
|
||||
<option value="Sekretaris">Sekretaris</option>
|
||||
<option value="Bidang Pemuda">Bidang Pemuda</option>
|
||||
<option value="Bidang Olahraga">Bidang Olahraga</option>
|
||||
<option value="Bidang Pariwisata">Bidang Pariwisata</option>
|
||||
<option value="Bidang Ekonomi Kreatif">Bidang Ekonomi Kreatif</option>
|
||||
<option value="Sub Bagian Perencanaan">Sub Bagian Perencanaan</option>
|
||||
<option value="Sub Bagian Keuangan Dan Kepegawaian">Sub Bagian Keuangan Dan Kepegawaian</option>
|
||||
<option value="Sub Bagian Umum Dan Perlengkapan">Sub Bagian Umum Dan Perlengkapan</option>
|
||||
<option value="Kasi Sarana Dan Prasarana Olahraga">Kasi Sarana Dan Prasarana Olahraga</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="respon">Respon</label>
|
||||
<select name="respon" id="respon" class="form-control" required>
|
||||
<option value="" disabled selected>-Pilih Opsi</option>
|
||||
<option value="Tiada">Tiada</option>
|
||||
<option value="Tanggapan dan Saran">Tanggapan dan Saran</option>
|
||||
<option value="Proses Lebih Lanjut">Proses Lebih Lanjut</option>
|
||||
<option value="Koordinasi dan Konfirmasi">Koordinasi dan Konfirmasi</option>
|
||||
<option value="Didampingi / Diwakili">Didampingi / Diwakili</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="div_file_surat">
|
||||
<label for="file">Upload File PDF Surat </label>
|
||||
<input type="file" class="form-control" id="file_surat" required>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label for="file">URL File PDF Surat</label>
|
||||
<input type="text" class="form-control" id="url_surat" placeholder="http://">
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label for="catatan">Catatan</label>
|
||||
<textarea name="catatan" id="catatan" cols="30" rows="10" class="form-control" style="resize: none;" placeholder="Masukkan Catatan" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" id="button_simpan" class="btn btn-primary btn-xs waves-effect waves-light">Update Detail Surat</button>
|
||||
<button type="button" id="button_batal" class="btn btn-danger btn-xs waves-effect waves-light" data-dismiss="modal">Batalkan</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- create modal for who pdf -->
|
||||
<div class="modal fade" id="modal_pdf" tabindex="-1" role="dialog" aria-labelledby="modal_pdf" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modal_pdf">Isi Surat</h4>
|
||||
|
||||
</div>
|
||||
<div class="modal-body" id="isi_laporan">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-xs" data-dismiss="modal">Tutup</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('kepaladinas/scripts') ?>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() ?>assets/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
var id_dinas = <?= $id_dinas ?>;
|
||||
|
||||
var table;
|
||||
|
||||
function datatables() {
|
||||
table = $('#table_list_surat').DataTable({
|
||||
// "searching": false,
|
||||
"lengthMenu": [
|
||||
[5, 10, 15, -1],
|
||||
[5, 10, 15, "All"]
|
||||
],
|
||||
"pageLength": 10,
|
||||
"ordering": true,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
// "order": [[ 4, 'desc' ]],
|
||||
|
||||
"ajax": {
|
||||
"url": server_url + "kepaladinas/surat_masuk",
|
||||
"type": "POST",
|
||||
data: {
|
||||
proses: 'table_surat_masuk'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
"columnDefs": [{
|
||||
"targets": [6],
|
||||
"orderable": false,
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
datatables()
|
||||
|
||||
function buka_modal_input_surat() {
|
||||
// clear form
|
||||
$('#form_input_surat')[0].reset();
|
||||
$("#myModalLabel-1").html('Form Input Surat Masuk');
|
||||
$("#form_input_surat :input").prop("disabled", false);
|
||||
$('#modal_surat_masuk').modal('show');
|
||||
}
|
||||
|
||||
document.getElementById("file_surat").onchange = function() {
|
||||
let file_surat = document.getElementById('file_surat').files[0];
|
||||
check_file_surat(file_surat)
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function check_info(id) {
|
||||
// console.log(id)
|
||||
|
||||
let data;
|
||||
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "surat_masuk?id_surat=" + id + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Surat Masuk");
|
||||
},
|
||||
});
|
||||
data = data.data;
|
||||
console.log(data)
|
||||
$("#asal_surat").val(data.asal_surat);
|
||||
$("#id_surat_masuk").val(data.id_surat_masuk);
|
||||
$("#no_surat").val(data.no_surat);
|
||||
$("#tanggal_pengiriman").val(data.tanggal_pengiriman);
|
||||
$("#tanggal_diterima").val(data.tanggal_diterima);
|
||||
$("#no_agenda").val(data.no_agenda);
|
||||
selectElement('sifat', data.sifat ?? '');
|
||||
$("#perihal").val(data.perihal);
|
||||
selectElement('diteruskan_kepada', data.diteruskan_kepada ?? '');
|
||||
selectElement('respon', data.respon ?? '');
|
||||
$("#catatan").val(data.catatan ?? '');
|
||||
// hide div_file_surat
|
||||
$("#div_file_surat").hide();
|
||||
|
||||
$("#myModalLabel-1").html('Detail Surat Masuk');
|
||||
|
||||
// disable all input in form_input_surat
|
||||
$("#form_input_surat :input").prop("disabled", true);
|
||||
$("#sifat").prop("disabled", false);
|
||||
$("#diteruskan_kepada").prop("disabled", false);
|
||||
$("#respon").prop("disabled", false);
|
||||
$("#catatan").prop("disabled", false);
|
||||
$("#button_simpan").prop("disabled", false);
|
||||
$("#button_batal").prop("disabled", false);
|
||||
|
||||
|
||||
// show modal
|
||||
$('#modal_surat_masuk').modal('show');
|
||||
|
||||
await $.unblockUI();
|
||||
} catch (e) {
|
||||
// console.log(e)
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function lihat_surat(id) {
|
||||
|
||||
let data;
|
||||
|
||||
try {
|
||||
data = await $.ajax({
|
||||
url: server_url_api + "surat_masuk?id_surat=" + id + "&id_dinas=" + id_dinas,
|
||||
type: 'get',
|
||||
async: false,
|
||||
beforeSend: function(res) {
|
||||
block_ui("Mengambil Data Surat Masuk");
|
||||
},
|
||||
});
|
||||
data = data.data;
|
||||
console.log(server_url+data.fail)
|
||||
const laporan = `<embed src="${server_url}${data.fail}" frameborder="1" width="100%" height="600px">`;
|
||||
|
||||
$("#isi_laporan").empty();
|
||||
$("#isi_laporan").append(laporan);
|
||||
$("#modal_pdf").modal("show");
|
||||
|
||||
await $.unblockUI();
|
||||
} catch (e) {
|
||||
// console.log(e)
|
||||
await $.unblockUI();
|
||||
const statusCode = error.status;
|
||||
console.log(error)
|
||||
console.log(statusCode)
|
||||
if (statusCode == 0 || statusCode == 500) return toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
|
||||
const message = error.responseJSON.message
|
||||
toastr.error(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function edit_surat(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const id_surat_masuk = $('#id_surat_masuk').val();
|
||||
const no_surat = $('#no_surat').val();
|
||||
const sifat = $('#sifat').val();
|
||||
const diteruskan_kepada = $('#diteruskan_kepada').val();
|
||||
const respon = $('#respon').val();
|
||||
const catatan = $('#catatan').val();
|
||||
|
||||
console.log(id_surat_masuk,sifat, diteruskan_kepada, respon, catatan)
|
||||
|
||||
|
||||
var formData = new FormData();
|
||||
|
||||
|
||||
|
||||
// create swal ask before submit
|
||||
swal({
|
||||
title: 'Apakah Anda Yakin?',
|
||||
text: "Data surat masuk akan diubah",
|
||||
icon: 'info',
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "Batal",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-danger",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "Ya, Simpan",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-primary",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
}).then((result) => {
|
||||
|
||||
if (result) {
|
||||
$.ajax({
|
||||
url: server_url_api + "surat_masuk",
|
||||
type: 'PUT',
|
||||
data: {
|
||||
id_surat_masuk: id_surat_masuk,
|
||||
sifat: sifat,
|
||||
diteruskan_kepada: diteruskan_kepada,
|
||||
respon: respon,
|
||||
catatan: catatan,
|
||||
no_surat: no_surat,
|
||||
id_dinas: id_dinas
|
||||
},
|
||||
beforeSend: function(res) {
|
||||
// $('#modal_karyawan').modal('hide');
|
||||
block_ui("Sedang Proses");
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data)
|
||||
// hide modal
|
||||
$.unblockUI();
|
||||
$('#modal_surat_masuk').modal('hide');
|
||||
// console.log(data)
|
||||
// destroy table
|
||||
$('#table_list_surat').DataTable().destroy();
|
||||
// reload table
|
||||
datatables();
|
||||
// close modal
|
||||
toastr.success(data.message);
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
$.unblockUI();
|
||||
// console.log(errorThrown)
|
||||
// console.log(textStatus)
|
||||
const statusCode = XMLHttpRequest.status;
|
||||
const responseJSON = XMLHttpRequest.responseJSON;
|
||||
console.log(statusCode);
|
||||
console.log(responseJSON)
|
||||
if (statusCode != 500 || statusCode != 0) {
|
||||
toastr.error(responseJSON.message);
|
||||
} else {
|
||||
toastr.error("Jaringan atau server bermasalah, sila refresh kembali halaman");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Dibuat oleh Kicap Karan. https://www.kicap-karan.com -->
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user