copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,510 @@
|
||||
<!doctype html>
|
||||
<html class="fixed sidebar-left-collapsed">
|
||||
|
||||
<head>
|
||||
|
||||
<!-- Basic -->
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>PROSES | PERSEDIAAN</title>
|
||||
<meta name="keywords" content="HTML5 Admin Template" />
|
||||
<meta name="description" content="Porto Admin - Responsive HTML5 Template">
|
||||
<meta name="author" content="okler.net">
|
||||
<link rel="icon" type="image/png" href="<?php echo base_url('')?>assets/images/logoPcmBaru3.png" />
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
<!-- 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">
|
||||
<header class="page-header">
|
||||
<h2><strong>(Step 3)</strong> | Pilih SN | <strong class="text-info"><?=$kode_barang?></strong></h2>
|
||||
|
||||
<div class="right-wrapper pull-right">
|
||||
<ol class="breadcrumbs">
|
||||
<li><span><strong style="color:Orange">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 -->
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<section class="panel panel-featured panel-featured-secondary">
|
||||
<header class="panel-heading">
|
||||
<div class="panel-actions">
|
||||
<a onclick="closeTab()" class="text-dark"><strong>Tutup </strong><i class="fa fa-times"></i></a>
|
||||
</div>
|
||||
<?php if ($max<$qty) { ?>
|
||||
<h2 class="panel-title"><strong>DATA BARANG</strong><br><strong class="text-success">[<?= $persediaan[0]['NAMA_BARANG'] ?>]</strong></h2>
|
||||
<?php } else { ?>
|
||||
<h2 class="panel-title"><strong>DATA BARANG</strong><br><strong class="text-danger">[<?= $persediaan[0]['NAMA_BARANG'] ?>] <i class="fa fa-ban"></i></strong></h2>
|
||||
<?php } ?>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
|
||||
<?php if ($max<$qty) { ?>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><h4>Input <strong>(Max <?=$persediaan[0]['QTY_DFO']?> Unit)</strong></h4></label>
|
||||
<div class="col-md-9">
|
||||
<input class="form-control" name="nama_sn_e" id="nama_sn_e" type="text" placeholder="Serial Number">
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><h4>Input <strong>(Max <?=$persediaan[0]['QTY_DFO']?> Unit)</strong></h4></label>
|
||||
<div class="col-md-9">
|
||||
<input class="form-control" name="nama_sn_e" id="nama_sn_e" type="text" placeholder="SN terpenuhi, Hapus untuk Revisi" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 table-responsive">
|
||||
<table class="table table-bordered table-striped mb-none dataTable" id="tsn" role="grid" aria-describedby="datatable-editable_info">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="dark center">No</th>
|
||||
<th class="dark center">Serial Number</th>
|
||||
<th class="dark center">PILIHAN</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="isitabel">
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<section class="panel panel-featured panel-featured-primary">
|
||||
<header class="panel-heading">
|
||||
<div class="panel-actions">
|
||||
</div>
|
||||
<h2 class="panel-title"><strong>READY STOCK</strong> <strong class="text-secondary"><?=$count_snstock?> Unit</strong></h2>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 table-responsive">
|
||||
<table class="table table-bordered table-striped mb-none" id="datatable-default">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="primary center">No</th>
|
||||
<th class="primary">Serial Number</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (is_array($snstock) || is_object($snstock)) {
|
||||
$no = 1;
|
||||
foreach ($snstock as $key) { ?>
|
||||
<tr>
|
||||
<td class="center"><?= $no; ?></td>
|
||||
<td><?= $key['NAMA_SNSTOCK']; ?></td>
|
||||
</tr>
|
||||
<?php $no++;
|
||||
}
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end: page -->
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<div id="modalhapus" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><strong>Hapus Data</strong></h2>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-text">
|
||||
<input type="hidden" name="id_snhapus" id="id_snhapus" class="form-control" value="">
|
||||
<h4 id="texthapus">Are you sure that you want to delete this image?</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
|
||||
<button class="btn btn-danger " id="cfmhapus" data-dismiss="modal" onclick="confirmHapus()"><strong>Hapus</strong> <i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('template/sidebar_right'); ?>
|
||||
<!-- Vendor -->
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery/jquery.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/bootstrap/js/bootstrap.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/nanoscroller/nanoscroller.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/magnific-popup/magnific-popup.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
|
||||
|
||||
<!-- Specific Page Vendor -->
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/select2/select2.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
|
||||
<!-- Specific Page Vendor -->
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/pnotify/pnotify.custom.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-autosize/jquery.autosize.js"></script>
|
||||
|
||||
<!-- Theme Base, Components and Settings -->
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/theme.js"></script>
|
||||
|
||||
<!-- Theme Custom -->
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/theme.custom.js"></script>
|
||||
|
||||
<!-- Theme Initialization Files -->
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/theme.init.js"></script>
|
||||
|
||||
|
||||
<!-- Examples -->
|
||||
<!-- Examples -->
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/tables/examples.datatables.default.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/tables/examples.datatables.tabletools.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/tables/examples.datatables.editable.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/ui-elements/examples.notifications.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/vendor/jquery-validation/jquery.validate.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/forms/examples.validation.js"></script>
|
||||
<script src="<?php echo base_url('') ?>assets/javascripts/ui-elements/examples.modals.js"></script>
|
||||
|
||||
<!-- notif -->
|
||||
<?php $this->load->view('template/notification'); ?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var NOBARIS = '';
|
||||
var IDDETAIL = '<?= $id_dfo ?>';
|
||||
var JUMLAH = '';
|
||||
|
||||
LoadData();
|
||||
|
||||
$(document).on('click', '#hapusbaris', function(e) {
|
||||
e.preventDefault();
|
||||
var d = namabarang.value;
|
||||
alert(d);
|
||||
var no = 1;
|
||||
$(this).parent().parent().remove();
|
||||
$('#tsn tbody tr').each(function() {
|
||||
$(this).find('td:nth-child(1)').html(no);
|
||||
no++;
|
||||
});
|
||||
})
|
||||
otm();
|
||||
});
|
||||
|
||||
function resetbaris(id) {
|
||||
document.getElementById("idsn" + id).value = document.getElementById("idsn" + id).defaultValue;
|
||||
document.getElementById("sn" + id).value = document.getElementById("sn" + id).defaultValue;
|
||||
}
|
||||
|
||||
function hapus(id) {
|
||||
NOBARIS = id;
|
||||
var mIdSn = document.getElementById("idsn" + id).value;
|
||||
var mSn = document.getElementById("sn" + id).value;
|
||||
$("#id_snhapus").val(mIdSn);
|
||||
$("#texthapus").html("Apakah ingin menghapus SN <b>" + mSn + "</b>?");
|
||||
|
||||
}
|
||||
|
||||
function confirmHapus() {
|
||||
var is = document.getElementById("id_snhapus").value;
|
||||
$("#id_sno").val('');
|
||||
if (is == '') {
|
||||
resetbaris(NOBARIS);
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: 'id_sno=' + is,
|
||||
url: '<?= base_url() ?>index.php/ManagePersediaan/hapusoperasional_GA3',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
if (response.value == 1) {
|
||||
LoadData();
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN berhasil menghapus.',
|
||||
type: 'success',
|
||||
shadow: true
|
||||
});
|
||||
} else if (response.value == 2){
|
||||
location.reload();
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN gagal menghapus.',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function LoadData() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: 'id=' + <?= $id_dfo ?>,
|
||||
url: '<?= base_url('') ?>index.php/ManagePersediaan/viewSn_Operasional_Aktif',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
var baris = '';
|
||||
var total = <?= $qty ?>;
|
||||
JUMLAH = response.total;
|
||||
|
||||
for (var i = 1; i <= total; i++) {
|
||||
|
||||
if (i <= response.data.length) {
|
||||
|
||||
var sn = response.data[i - 1]['NAMA_SNO'];
|
||||
var id = response.data[i - 1]['ID_SNO'];
|
||||
|
||||
baris += '<tr>';
|
||||
baris += '<td class="center " style="vertical-align: middle;" ><b>' + i + '</b></td>';
|
||||
baris += '<td class="center" style="vertical-align: middle;">';
|
||||
baris += '<input class="form-control input-sm " name="idsn' + i + '" id="idsn' + i + '" type="hidden" value="' + id + '" placeholder="-" >';
|
||||
baris += '<input class="form-control input-sm " name="namasn' + i + '" id="sn' + i + '" type="text" value="' + sn + '" placeholder="-" >';
|
||||
baris += '</td>';
|
||||
baris += '<td class="center " style="vertical-align: middle;">';
|
||||
baris += `<button type="button" id="hapusbaris` + i + `" onclick="hapus('` + i + `')" class="btn btn-xs btn-danger " data-toggle="modal" data-target="#modalhapus" ><i class="fa fa-trash-o"></i></button>`;
|
||||
baris += ' ';
|
||||
baris += '</td>';
|
||||
baris += '</tr>';
|
||||
} else {
|
||||
baris += '<tr>';
|
||||
baris += '<td class="center " style="vertical-align: middle;" ><b>' + i + '</b></td>';
|
||||
baris += '<td class="center" style="vertical-align: middle;">';
|
||||
baris += '<input class="form-control input-sm " name="idsn' + i + '" id="idsn' + i + '" type="hidden" placeholder="-" >';
|
||||
baris += '<input class="form-control input-sm " name="namasn' + i + '" id="sn' + i + '" type="text" placeholder="-" >';
|
||||
baris += '</td>';
|
||||
baris += '<td class="center" style="vertical-align: middle;">';
|
||||
baris += `<button type="button" id="hapusbaris` + i + `" onclick="hapus('` + i + `')" class="btn btn-xs btn-danger " data-toggle="modal" data-target="#modalhapus" ><i class="fa fa-trash-o"></i></button>`;
|
||||
baris += ' ';
|
||||
baris += '</td>';
|
||||
baris += '</tr>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('#isitabel').html(baris);
|
||||
// console.log(response);
|
||||
// alert(response.data.length)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function otm() {
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/ManagePersediaan/viewSn_Operasional_Limit",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: 'id=' + <?= $id_dfo ?>,
|
||||
success: function(response) {
|
||||
if (response.jumlah_data != JUMLAH) {
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
nama_sn_e.addEventListener("keyup", function(event) {
|
||||
var dat = nama_sn_e.value;
|
||||
if (event.keyCode === 13) {
|
||||
var pnj = nama_sn_e.value.length;
|
||||
if (dat == "") {
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'Tidak boleh Kosong',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
$('[name="nama_sn_e"]').closest('.form-group').addClass('has-error');
|
||||
} else if (pnj > 50) {
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'Karakter melebihi batas',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
$('[name="nama_sn_e"]').closest('.form-group').addClass('has-error');
|
||||
|
||||
} else {
|
||||
var is = '';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: 'id_sno=' + is + '&nama_sno=' + dat + '&id_dfo=<?= $id_dfo ?>',
|
||||
|
||||
url: '<?= base_url() ?>index.php/ManagePersediaan/simpanoperasional_GA3',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
if (response.value == 1) {
|
||||
LoadData();
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN berhasil menyimpan.',
|
||||
type: 'success',
|
||||
shadow: true
|
||||
});
|
||||
} else if (response.value == 2){
|
||||
location.reload();
|
||||
} else if (response.value == 3){
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN tidak sesuai, silahkan check kembali.',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
} else if (response.value == 4){
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN sudah dipilih, silahkan masukkan data yang lain.',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Pemberitahuan',
|
||||
text: 'SN gagal menyimpan.',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
}
|
||||
$("#nama_sn_e").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
nama_sn_e.oninput = function() {
|
||||
$('[name="nama_sn_e"]').closest('.form-group').removeClass('has-error').addClass('');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
<?php if ($this->session->flashdata('success')) { ?>
|
||||
new PNotify({
|
||||
title: 'Notifikasi',
|
||||
text: 'Data berhasil <?= $this->session->flashdata('success'); ?>.',
|
||||
type: 'success',
|
||||
shadow: true
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->session->flashdata('failed')) { ?>
|
||||
new PNotify({
|
||||
title: 'Notifikasi',
|
||||
text: 'Data gagal <?= $this->session->flashdata('failed'); ?>, hubungi Administrator',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->session->flashdata('over_qty')) { ?>
|
||||
new PNotify({
|
||||
title: 'Notifikasi',
|
||||
text: 'Data melebihi jumlah stock, hubungi Team Gudang.',
|
||||
type: 'error',
|
||||
shadow: true
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->session->flashdata('quota_full')) { ?>
|
||||
new PNotify({
|
||||
title: 'Notifikasi',
|
||||
text: 'Kuantiti terpenuhi, Masuk Mode Kunci.',
|
||||
type: 'warning',
|
||||
shadow: true
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->session->flashdata('quota_free')) { ?>
|
||||
new PNotify({
|
||||
title: 'Notifikasi',
|
||||
text: 'Data bisa Input kembali.',
|
||||
type: 'warning',
|
||||
shadow: true
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
});
|
||||
|
||||
$('#datatable-default').dataTable( {
|
||||
"paging": false
|
||||
} );
|
||||
|
||||
function closeTab() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user