step 2 : proses rekap absensi
This commit is contained in:
102
index.php
102
index.php
@@ -10,28 +10,63 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-100 flex justify-center items-center h-screen">
|
||||
<div class="card w-100 bg-white shadow shadow-2xl mx-auto">
|
||||
<div class="card inline-block w-auto bg-white shadow shadow-2xl mx-auto">
|
||||
<div class="card-title px-5 py-3">
|
||||
<h2 class="card-title">Report Absensi</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Start Date & End Date -->
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="text-left">
|
||||
<div class="label">
|
||||
<span class="label-text">Start Date</span>
|
||||
</div>
|
||||
<input type="date" placeholder="Start Date" id="start_date" name="start_date"
|
||||
class="input input-bordered w-full max-w-xs">
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="label">
|
||||
<span class="label-text">End Date</span>
|
||||
</div>
|
||||
<input type="date" id="End Date" name="end_date" class="input input-bordered w-full max-w-xs">
|
||||
|
||||
<!-- alert -->
|
||||
<div role="alert" id="alert_error" class="alert alert-error w-full" style="display:none">
|
||||
<span class="text-white" id="message_error"></span>
|
||||
<div>
|
||||
<button class="btn btn-sm" onclick="closeAlert()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start Date & End Date -->
|
||||
<!-- alert -->
|
||||
|
||||
<!-- bulan & tahun -->
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="text-left">
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Bulan</span>
|
||||
</div>
|
||||
<select class="select select-bordered w-full" id="bulan">
|
||||
<option value="-" selected>Silahkan Pilih Bulan</option>
|
||||
<option value="1">Januari</option>
|
||||
<option value="2">Februari</option>
|
||||
<option value="3">Maret</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">Mei</option>
|
||||
<option value="6">Juni</option>
|
||||
<option value="7">Juli</option>
|
||||
<option value="8">Agustus</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">Oktober</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12">Desember</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Tahun</span>
|
||||
</div>
|
||||
<select class="select select-bordered w-full" id="tahun">
|
||||
<option value="-" selected>Silahkan Pilih Tahun</option>
|
||||
<?php
|
||||
$tahun_sekarang = date('Y');
|
||||
for ($tahun = $tahun_sekarang - 2; $tahun <= $tahun_sekarang; $tahun++) {
|
||||
echo "<option value=\"$tahun\">$tahun</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- bulan & tahun -->
|
||||
|
||||
<!-- Dropdown jenis report -->
|
||||
<div class="text-left">
|
||||
@@ -39,8 +74,8 @@
|
||||
<div class="label">
|
||||
<span class="label-text">Jenis Report</span>
|
||||
</div>
|
||||
<select class="select select-bordered w-full">
|
||||
<option value="-" selected>Pilih Jenis Report</option>
|
||||
<select class="select select-bordered w-full" id="jenis_report">
|
||||
<option value="-" selected>Silahkan Pilih Jenis Report</option>
|
||||
<option value="Absensi">Absensi</option>
|
||||
</select>
|
||||
</label>
|
||||
@@ -53,10 +88,10 @@
|
||||
<div class="label">
|
||||
<span class="label-text">Office / Kantor</span>
|
||||
</div>
|
||||
<select class="select select-bordered w-full">
|
||||
<option value="-" selected>Pilih Kantor</option>
|
||||
<select class="select select-bordered w-full" id="kantor">
|
||||
<option value="-" selected>Silahkan Pilih Kantor</option>
|
||||
<option value="1">PT Sadhana Abiyasa Sampoerna</option>
|
||||
<option value="2">PT Sadhana Abiyasa Sampoerna</option>
|
||||
<!-- <option value="2">PT Sistem Integrasi Medika</option> -->
|
||||
<option value="3">PT Sismedika (RS Sansani Pekanbaru)</option>
|
||||
<option value="4">PT Sismedika (RSPAD Gatot Subroto)</option>
|
||||
</select>
|
||||
@@ -67,10 +102,10 @@
|
||||
<!-- Button Xls & PDF -->
|
||||
<div class="grid grid-cols-2 gap-4 py-5">
|
||||
<div class="text-left">
|
||||
<button class="btn btn-outline btn-success">XLS</button>
|
||||
<button class="btn btn-outline btn-success" onclick="reportXlS()">XLS</button>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-outline btn-warning">PDF</button>
|
||||
<button class="btn btn-outline btn-warning" onclick="reportPDF()">PDF</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Button Xls & PDF -->
|
||||
@@ -78,8 +113,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal show pdf -->
|
||||
<dialog id="modal_show_pdf" class="modal">
|
||||
<div class="modal-box w-11/12 max-w-5xl">
|
||||
<h3 class="font-bold text-lg">Report PDF</h3>
|
||||
<embed src="" type="application/pdf" id="pdf_viewer" width="100%" height="600px"></embed>
|
||||
<!-- <iframe class="w-full aspect-video" id="pdf_viewer"></iframe> -->
|
||||
<div class="modal-action">
|
||||
<form method="dialog">
|
||||
<button class="btn">Close</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
<!-- modal show pdf -->
|
||||
|
||||
<!-- Penambahan script untuk Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Penambahan jQuery -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<script src="prosesRekap.js?ts=<?php echo date('Y-m-d H:i:s')?>">
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
85
prosesRekap.js
Normal file
85
prosesRekap.js
Normal file
@@ -0,0 +1,85 @@
|
||||
function closeAlert() {
|
||||
$('#alert_error').css({ "display": "none" });
|
||||
}
|
||||
|
||||
function reportXlS() {
|
||||
var bulan = $('#bulan').val();
|
||||
var tahun = $('#tahun').val();
|
||||
var jenis_report = $('#jenis_report').val();
|
||||
var kantor = $('#kantor').val();
|
||||
const now = Date.now();
|
||||
|
||||
if(bulan == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih bulan');
|
||||
} else{
|
||||
if(tahun == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Tahun');
|
||||
} else{
|
||||
if (jenis_report == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Jenis Report ex : Absensi');
|
||||
} else {
|
||||
if (kantor == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Kantor');
|
||||
} else {
|
||||
$('#alert_error').css({ "display": "none" });
|
||||
|
||||
var pdfViewer = document.getElementById('pdf_viewer');
|
||||
// var modal = document.getElementById('modal_show_pdf');
|
||||
pdfViewer.src = "https://devone.aplikasi.web.id/birt/run?__report=report/one/absensi/rpt_r_ab_002.rptdesign&__format=xls&PYear="+tahun+"&PMonth="+bulan+"&PCompanyID="+kantor+"&username=adminsas%20&tm="+now;
|
||||
// modal.showModal();
|
||||
|
||||
// document.getElementById('modal_show_pdf').showModal()
|
||||
console.log('bulan : ' + bulan);
|
||||
console.log('tahun : ' + tahun);
|
||||
console.log('jenis_report : ' + jenis_report);
|
||||
console.log('kantor : ' + kantor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reportPDF() {
|
||||
var bulan = $('#bulan').val();
|
||||
var tahun = $('#tahun').val();
|
||||
var jenis_report = $('#jenis_report').val();
|
||||
var kantor = $('#kantor').val();
|
||||
const now = Date.now();
|
||||
|
||||
if(bulan == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih bulan');
|
||||
} else{
|
||||
if(tahun == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Tahun');
|
||||
} else{
|
||||
if (jenis_report == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Jenis Report ex : Absensi');
|
||||
} else {
|
||||
if (kantor == "-") {
|
||||
$('#alert_error').css({ "display": "inline" });
|
||||
$('#message_error').text('Silahkan Pilih Kantor');
|
||||
} else {
|
||||
$('#alert_error').css({ "display": "none" });
|
||||
|
||||
var pdfViewer = document.getElementById('pdf_viewer');
|
||||
var modal = document.getElementById('modal_show_pdf');
|
||||
pdfViewer.src = "https://devone.aplikasi.web.id/birt/run?__report=report/one/absensi/rpt_r_ab_002.rptdesign&__format=pdf&PYear="+tahun+"&PMonth="+bulan+"&PCompanyID="+kantor+"&username=adminsas%20&tm="+now;
|
||||
modal.showModal();
|
||||
|
||||
// document.getElementById('modal_show_pdf').showModal()
|
||||
console.log('bulan : ' + bulan);
|
||||
console.log('tahun : ' + tahun);
|
||||
console.log('jenis_report : ' + jenis_report);
|
||||
console.log('kantor : ' + kantor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user