264 lines
11 KiB
PHP
264 lines
11 KiB
PHP
<!doctype html>
|
|
<html class="fixed sidebar-left-collapsed">
|
|
<head>
|
|
|
|
<!-- Basic -->
|
|
<meta charset="UTF-8">
|
|
|
|
<title>MENU 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" />
|
|
<link rel="stylesheet" href="<?php echo base_url('')?>assets/vendor/bootstrap-timepicker/css/bootstrap-timepicker.css" />
|
|
|
|
<!-- Specific Page Vendor CSS -->
|
|
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.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/summernote/summernote.css" />
|
|
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/summernote/summernote-bs3.css" />
|
|
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/codemirror/lib/codemirror.css" />
|
|
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/codemirror/theme/monokai.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>
|
|
|
|
<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">
|
|
|
|
<?php
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$level = $this->session->userdata('level');
|
|
$nama_panggilan = $this->session->userdata('nama_panggilan');
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$username = $this->session->userdata('username');
|
|
$tgl_now = date('d/m/Y');
|
|
|
|
if (strpos($jabatan,"GUDANG")!==FALSE OR strpos($jabatan,"ADMIN KEUANGAN")!==FALSE OR strpos($jabatan,"SALES")!==FALSE OR $jabatan=="ADMINISTRATOR" OR $jabatan=="ADMIN ITP") {
|
|
|
|
} else {
|
|
$jabatan = "DILARANG";
|
|
}
|
|
?>
|
|
|
|
<header class="page-header">
|
|
<h2><strong>Stok Supplier</strong></h2>
|
|
|
|
<div class="right-wrapper pull-right">
|
|
<ol class="breadcrumbs">
|
|
<li><span><strong style="color:Gold">Master Data </span></strong></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">
|
|
<div class="panel-actions">
|
|
<a href="<?php echo base_url('') ?>index.php" class="text-dark"><strong>Kembali</strong><i class="fa fa-backward"></i></a>
|
|
</div>
|
|
<h2 class="panel-title" style="color:Tomato"><b>DATA STOK</b></h2>
|
|
</header>
|
|
<div class="panel-body">
|
|
<div class="form-group">
|
|
<h4><label class="col-md-2 control-label"><b style="color:Red">Supplier</b></label></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><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Merk</b></label></h4>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<select data-plugin-selectTwo id="id_merk" class="form-control populate">
|
|
<option value="" selected>Semua Merk</option>
|
|
<?php if (is_array($merk) || is_object($merk)) {
|
|
foreach ($merk as $key) { ?>
|
|
<option value="<?= $key['ID_MERK'] ?>" ><?= $key['NAMA_MERK'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<?= form_open('Menu/LA_Excel_Sub2_C1_StokSupplier', array('method' => 'post'), array('id' => 'formlaporan')); ?>
|
|
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Menu</b></label></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_merkfill" name="id_merkfill">
|
|
<input type="hidden" class="form-control" id="jenis_cetak" name="jenis_cetak">
|
|
<?php if ($jabatan!="DILARANG") { ?>
|
|
<button type="button" class="btn btn-default" onclick="lihatData()"><b style="color:Navy">Preview <i class="fa fa-search"></i></b></button>
|
|
<button type="submit" class="btn btn-default" onclick="isiData(1)" target="_blank"><b style="color:DarkGreen">Excel NonSN <i class="fa fa-file-excel-o"></i></b></button>
|
|
<button type="submit" class="btn btn-default" onclick="isiData(2)" target="_blank"><b style="color:DarkOrange">Excel SN <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>
|
|
<e 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></e>
|
|
<?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>
|
|
<?= form_close(); ?>
|
|
</div>
|
|
<br>
|
|
<div class="col-md-12">
|
|
<table class="table table-bordered table-striped mb-none" id="previewData">
|
|
<thead>
|
|
<th class="default center">No</th>
|
|
<th class="default">Merk</th>
|
|
<th class="default">Barang</th>
|
|
<th class="center default">Kuantiti</th>
|
|
</thead>
|
|
<tbody id="isiTabel"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- end: page -->
|
|
</section>
|
|
</div>
|
|
</section>
|
|
|
|
<?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() {
|
|
JUMLAH = '';
|
|
var baris = '';
|
|
|
|
baris += '<tr>';
|
|
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Blue">Data Kosong.</b></i></h5></td>';
|
|
baris += '</tr>';
|
|
$('#isiTabel').html(baris);
|
|
})
|
|
|
|
var dots = window.setInterval( function() {
|
|
var wait = document.getElementById("wait");
|
|
if (wait.innerHTML.length > 3)
|
|
wait.innerHTML = "";
|
|
else
|
|
wait.innerHTML += ".";
|
|
}, 500);
|
|
|
|
function lihatData() {
|
|
var id_supplier = document.getElementById('id_supplier').value;
|
|
var id_merk = document.getElementById('id_merk').value;
|
|
|
|
PNotify.removeAll();
|
|
|
|
if (id_supplier=="") {
|
|
notify("supplier_null");
|
|
} else {
|
|
$('#isiTabel').html(null);
|
|
|
|
buttonUnhide2 = document.getElementById('progressRotate');
|
|
buttonUnhide2.style.display = 'block';
|
|
|
|
$.ajax({
|
|
url: "<?= base_url() ?>index.php/Menu/LA_Ambil_Sub2_C1_StokSupplier",
|
|
type: "POST",
|
|
dataType: "json",
|
|
data: {
|
|
id_supplier : id_supplier,
|
|
id_merk : id_merk,
|
|
},
|
|
success: function(response) {
|
|
var baris = '';
|
|
JUMLAH = response.data.length;
|
|
|
|
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>';
|
|
$('#isiTabel').html(baris);
|
|
} else {
|
|
for (var i = 1; i <= JUMLAH; i++) {
|
|
var merk = response.data[i - 1]['NAMA_MERK'];
|
|
var korang = response.data[i - 1]['KODE_BARANG'];
|
|
var narang = response.data[i - 1]['NAMA_BARANG'];
|
|
var qty = response.data[i - 1]['TOTAL'];
|
|
|
|
baris += '<tr>';
|
|
baris += '<td class="text-center" style="vertical-align: middle;">' + i + '</td>';
|
|
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Indigo">' + merk + '</b></td>';
|
|
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:FireBrick">' + korang + '</b><br>(' + narang + ')</td>';
|
|
baris += '<td class="text-center" style="vertical-align: middle;"><b style="color:DarkGreen">' + qty + '</b></td>';
|
|
baris += '</tr>';
|
|
}
|
|
$('#isiTabel').html(baris);
|
|
}
|
|
|
|
buttonHide = document.getElementById('progressRotate');
|
|
buttonHide.style.display = 'none';
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function isiData(id) {
|
|
document.getElementById('id_supplierfill').value = document.getElementById('id_supplier').value;
|
|
document.getElementById('id_merkfill').value = document.getElementById('id_merk').value;
|
|
document.getElementById('jenis_cetak').value = id;
|
|
}
|
|
|
|
function reloadData() {
|
|
location.reload();
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|