Files
shopee-apps/application/views/proses/LA_StokSupplierPembelian_1.php
2026-06-13 16:02:07 +10:00

418 lines
15 KiB
PHP

<!doctype html>
<html class="fixed sidebar-left-collapsed">
<head>
<!-- Basic -->
<meta charset="UTF-8">
<title>LAPORAN</title>
<meta name="keywords" content="HTML5 Admin Template" />
<meta name="description" content="Porto Admin - Responsive HTML5 Template">
<meta name="author" content="okler.net">
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Vendor CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/magnific-popup/magnific-popup.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
<!-- Specific Page Vendor CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/select2/select2.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/pnotify/pnotify.custom.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/base/jquery-ui.css" />
<!-- Theme CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/theme.css" />
<!-- Skin CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/skins/default.css" />
<!-- Theme Custom CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/theme-custom.css">
<!-- Head Libs -->
<script src="<?php echo base_url('') ?>assets/vendor/modernizr/modernizr.js"></script>
</head>
<script src="<?= base_url() ?>assets/bower_components/jquery/jquery-3.3.1.min.js"></script>
<script src="<?= base_url() ?>assets/bower_components/sweetalert2/sweetalert2.all.min.js"></script>
<style>
.ui-front {
z-index: 9999;
}
.solid {
border-left-style: solid;
border-width: 5px;
border-color: darkcyan;
}
.f18 {
font-size: 18px;
}
</style>
<script type="text/javascript">
let base_url = '<?= base_url() ?>';
</script>
<body>
<section class="body">
<!-- start: header -->
<?php $this->load->view('template/header'); ?>
<!-- end: header -->
<div class="inner-wrapper">
<!-- start: sidebar -->
<?php $this->load->view('template/sidebar'); ?>
<!-- end: sidebar -->
<section role="main" class="content-body">
<header class="page-header">
<h2><b>Data Laporan Stok Supplier | <a data-toggle="modal" data-target="#modalFitur"><b style="color:LightGreen"><?=$tampil?> <i class="fa fa-question-circle"></i></b></a> | Diambil <b style="color:LightPink" id="jamTerakhir"></b></b></h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<?php if ($ex==0) { ?>
<li><span><a href="<?php echo base_url('') ?>index.php"><b style="color:Silver">Dashboard <i class="fa fa-home"></i></b></a></span></li>
<?php } else if ($ex==1) { ?>
<li><span><a onclick="tutupTab()"><b style="color:Silver">Tutup Tab <i class="fa fa-times"></i></b></a></span></li>
<?php } ?>
<li><span><b style="color:DeepSkyBlue">Pusat Data</span></b></li>
</ol>
<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
</div>
</header>
<!-- start: page -->
<section class="panel panel-featured panel-featured-dark">
<header class="panel-heading">
<h2 class="panel-title"><b style="color:Black">STOK SUPPLIER</b></h2>
</header>
<div class="panel-body">
<?php if ($hak>0) { ?>
<?= form_open('Menu/LA_Excel_DataStokSupplierPembelian', array('method' => 'post')); ?>
<div class="form-group">
<h4><div class="col-md-2"><b style="color:SlateBlue">Supplier</b></div></h4>
<div class="col-md-6">
<div class="form-group">
<select data-plugin-selectTwo id="id_supplier" class="form-control populate">
<option value="" selected>Semua Supplier</option>
<?php if (is_array($supplier) || is_object($supplier)) {
foreach ($supplier as $key) { ?>
<option value="<?= $key['ID_SUPPLIER'] ?>" ><?= $key['NAMA_SUPPLIER'] ?> (<?= $key['NAMA_KOTA'] ?>)</option>
<?php }
} ?>
</select>
</div>
</div>
</div>
<div class="form-group">
<h4><div class="col-md-2"><b style="color:SlateBlue">Kop</b></div></h4>
<div class="col-md-6">
<div class="form-group">
<select data-plugin-selectTwo id="id_corp" class="form-control populate">
<option value="" selected>Semua Kop</option>
<?php if (is_array($corp) || is_object($corp)) {
foreach ($corp as $key) { ?>
<option value="<?= $key['ID_CORP'] ?>" ><?= $key['ALIAS_CORP'] ?></option>
<?php }
} ?>
</select>
</div>
</div>
</div>
<div class="form-group">
<h4><div class="col-md-2"><b style="color:SlateBlue">Periode</b></div></h4>
<div class="col-md-4">
<div class="input-daterange input-group">
<input type="date" class="form-control" id="tgl_awal" onfocusout="cekTanggal(value, 1)" value="<?=$tgl?>" required>
<span class="input-group-addon">s.d</span>
<input type="date" class="form-control" id="tgl_akhir" onfocusout="cekTanggal(value, 2)" value="<?=$tgl?>" required>
</div>
</div>
</div>
<div class="form-group">
<h4><div class="col-md-2"><b style="color:SlateBlue">Menu</b></div></h4>
<div class="col-md-10 btn-group">
<input type="hidden" class="form-control" id="id_supplierfill" name="id_supplierfill">
<input type="hidden" class="form-control" id="id_corpfill" name="id_corpfill">
<input type="hidden" class="form-control" id="tgl_awalfill" name="tgl_awalfill">
<input type="hidden" class="form-control" id="tgl_akhirfill" name="tgl_akhirfill">
<?php if ($hak>0) { ?>
<button type="button" id="lihatButton" class="btn btn-default" onclick="lihatData()"><b style="color:DarkSlateGray">Lihat <i class="fa fa-search"></i></b></button>
<button type="submit" class="btn btn-default" onclick="isiData()" target="_blank"><b style="color:DarkGreen">Excel <i class="fa fa-file-excel-o"></i></b></button>
<button type="button" class="btn btn-default" onclick="reloadData()"><b style="color:FireBrick">Reset <i class="fa fa-rotate-left"></i></b></button>
<element id="progressRotate" hidden="hidden"><h4><div class="col-md-3"><b style="color:Red"><i class="fa fa-refresh fa-spin"></i> <i>Memuat Data<span id="wait">.</span></i></b></div><h4></element>
<?php } else { ?>
<button type="button" class="btn btn-default"><b style="color:Red">Tidak Berhak <i class="fa fa-times"></i></b></button>
<?php } ?>
</div>
</div>
<?= form_close(); ?>
<div class="form-group">
<div class="col-md-4 pull-right">
<div class="input-group">
<span style="background-color:SeaShell" class="input-group-addon"><b id="cocok" style="color:Black">0 Data Sesuai</b></span>
<input disabled type="text" placeholder="Cari.." autocomplete="off" class="form-control" id="isiCari" onkeyup="cariData()">
</div>
</div>
</div>
<small class="help-block"></small>
<div class="col-md-12">
<table class="table table-bordered table-striped mb-none" id="idTabel">
<thead>
<tr class="headerTabel">
<th class="default center">No</th>
<th class="default">Kode</th>
<th class="default">SJ | Nota</th>
<th class="default">Supplier</th>
<th class="default">List Barang</th>
</tr>
</thead>
<tbody id="isiTabelData"></tbody>
</table>
</div>
<?php } ?>
</div>
</section>
<!-- end: page -->
</section>
</div>
</section>
<div id="modalFitur" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" style="width:35%">
<div class="modal-content">
<header class="panel-heading">
<h4 class="panel-title"><b>Fitur Teknis</b></h4>
<div class="panel-actions">
<a class="text-dark" data-dismiss="modal"><b>Tutup </b><i class="fa fa-times"></i></a>
</div>
</header>
<div class="panel-body">
<div class="form-group">
<h5>
<b style="color:Green">AKSES PENUH/OPERATOR</b><br><b> Semua Menu dapat digunakan.</b><br>
</h5>
</div>
</div>
</div>
</div>
</div>
<?php
$this->load->view('template/sidebar_right');
$this->load->view('template/script_vendor');
$this->load->view('template/script_flashdata');
$this->load->view('template/notification');
?>
<script>
$(document).ready(function() {
var baris = '';
baris += '<tr>';
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Tomato">Data belum dipilih...</b></i></h5></td>';
baris += '</tr>';
$('#isiTabelData').html(baris);
var time = new Date().toLocaleTimeString('en-US',{hour12:false});
$('#jamTerakhir').html(time);
})
var dots = window.setInterval( function() {
var wait = document.getElementById("wait");
if (wait.innerHTML.length > 3)
wait.innerHTML = "";
else
wait.innerHTML += ".";
}, 500);
function cariData() {
PNotify.removeAll();
var search = document.getElementById("isiCari").value.toLowerCase();
var tr = document.getElementById("idTabel").getElementsByTagName("tr");
var max = 5;
var found = 0;
var words = search.split(" ");
var limit = words.length;
for (h = 0; h<=words.length; h++) { // Loop untuk ambil Target Tampil
if (words[h]=="") {
limit--;
}
}
for (i = 0; i < tr.length; i++) { // Loop sejumlah Total TR
if (tr[i].classList.contains("headerTabel")) {
continue;
}
var counter = 0;
for (j = 0; j < max; j++) { // Loop Sejumlah Kolom yang ada
td = tr[i].getElementsByTagName("td")[j];
if (td) {
txtValue = td.textContent || td.innerText;
for (k = 0; k<=words.length; k++) { // Loop sejumlah Berapa Potongan Kata
if (words[k]!="") {
if (txtValue.toLowerCase().indexOf(words[k]) > -1) {
counter++;
}
}
}
}
}
if (search=="") {
tr[i].style.display = "";
found++;
} else if (counter>0) {
if (limit==1) {
tr[i].style.display = "";
found++;
} else {
if (counter>=limit) {
tr[i].style.display = "";
found++;
} else {
tr[i].style.display = "none";
}
}
} else {
tr[i].style.display = "none";
}
$('#cocok').html(found+" Data Sesuai");
}
}
function cekTanggal(value, id) {
PNotify.removeAll();
var now = "<?=$tgl?>";
if (value=="") {
notify("date_empty");
if (id==1) {
document.getElementById("tgl_awal").value = now;
} else if (id==2) {
document.getElementById("tgl_akhir").value = now;
}
}
$.ajax({
url: "<?= base_url() ?>index.php/Menu/GE_AmbilData_CekTanggal",
type: "POST",
dataType: "json",
data: {
tgl_input : value,
},
success: function(response) {
if (response.value==1) {
notify("day_lock");
if (id==1) {
document.getElementById("tgl_awal").value = now;
} else if (id==2) {
document.getElementById("tgl_akhir").value = now;
}
}
}
});
}
function isiData() {
document.getElementById('id_supplierfill').value = document.getElementById('id_supplier').value;
document.getElementById('id_corpfill').value = document.getElementById('id_corp').value;
document.getElementById('tgl_awalfill').value = document.getElementById('tgl_awal').value;
document.getElementById('tgl_akhirfill').value = document.getElementById('tgl_akhir').value;
}
function lihatData() {
PNotify.removeAll();
tampilkanData();
}
function reloadData() {
location.reload();
}
function tampilkanData() {
var id_supplier = document.getElementById("id_supplier").value;
var id_corp = document.getElementById("id_corp").value;
var awal = document.getElementById("tgl_awal").value;
var akhir = document.getElementById("tgl_akhir").value;
var baris = '';
baris += '<tr>';
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Tomato">Memuat Data...</b></i></h5></td>';
baris += '</tr>';
$('#isiTabelData').html(baris);
document.getElementById('progressRotate').style.display = 'block';
$.ajax({
type: 'POST',
data: {
id_supplier : id_supplier,
id_corp : id_corp,
awal : awal,
akhir : akhir
},
url: '<?= base_url('') ?>index.php/Menu/LA_Ambil_DataStokSupplierPembelian',
dataType: 'json',
success: function(response) {
JUMLAH = response.data.length;
var baris = '';
if (JUMLAH==0) {
baris += '<tr>';
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Red">Tidak ada Data yang Sesuai.</b></i></h5></td>';
baris += '</tr>';
$('#isiTabelData').html(baris);
document.getElementById("isiCari").disabled = true;
} else {
for (var i = 1; i <= JUMLAH; i++) {
var kode = response.data[i - 1]['KODE_PEMBELIAN'];
var sj = response.data[i - 1]['SJ_PEMBELIAN'];
var inv = response.data[i - 1]['INV_PEMBELIAN'];
var tanggal = response.data[i - 1]['TGLINV'];
var kop = response.data[i - 1]['ALIAS_CORP'];
var sup = response.data[i - 1]['NAMA_SUPPLIER'];
var kota = response.data[i - 1]['NAMA_KOTA'];
var list = response.data[i - 1]['LIST'];
baris += '<tr>';
baris += '<td class="center" style="vertical-align: middle;" >' + i + '</td>';
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Black">' + kode + '</b> <b style="color:Tomato">['+ kop +']</b><br>(' + tanggal + ')</td>';
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Blue"><u>' + sj + '</u></b><br><b style="color:Green">'+ inv +'</b></td>';
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Chocolate">' + sup + '</b><br>('+ kota +')</td>';
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Crimson">' + list + '</b></td>';
baris += '</tr>';
}
$('#isiTabelData').html(baris);
document.getElementById("isiCari").disabled = false;
}
document.getElementById('progressRotate').style.display = 'none';
$('#cocok').html(JUMLAH+" Data Sesuai");
}
});
}
function tutupTab() {
window.close();
}
</script>
</body>
</html>