<script src="{{ asset('js/jquery-1.11.2.min.js') }}"></script>
<script src="{{ asset('js/jquery-migrate-1.2.1.min.js') }}"></script>
<script src="{{ asset('js/jRespond.min.js') }}"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
<script src="{{ asset('js/nav-accordion.js') }}"></script>
<script src="{{ asset('js/hoverintent.js') }}"></script>
<script src="{{ asset('js/waves.js') }}"></script>
<script src="{{ asset('js/switchery.js') }}"></script>
<script src="{{ asset('js/jquery.loadmask.js') }}"></script>
<script src="{{ asset('js/icheck.js') }}"></script>
{{-- <script src="{{ asset('js/select2.js') }}"></script> --}}
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
<script src="{{ asset('js/bootstrap-filestyle.js') }}"></script>
<script src="{{ asset('js/bootbox.js') }}"></script>
<script src="{{ asset('js/animation.js') }}"></script>
<script src="{{ asset('js/colorpicker.js') }}"></script>
<script src="{{ asset('js/moment.js') }}"></script>
<script src="{{ asset('js/bootstrap-datepicker.js') }}"></script>
<script src="{{ asset('js/daterangepicker.js') }}"></script>
<script src="{{ asset('js/sweetalert.js') }}"></script>
<script src="{{ asset('js/calendar/fullcalendar.js') }}"></script>
<!--CHARTS-->
<script src="{{ asset('js/chart/sparkline/jquery.sparkline.js') }}"></script>
<script src="{{ asset('js/chart/easypie/jquery.easypiechart.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/excanvas.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/curvedLines.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.time.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.stack.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.axislabels.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.resize.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.tooltip.min.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.spline.js') }}"></script>
<script src="{{ asset('js/chart/flot/jquery.flot.pie.min.js') }}"></script>
<script src="{{ asset('js/chart.init.js') }}"></script>
<script src="{{ asset('js/smart-resize.js') }}"></script>
<script src="{{ asset('js/layout.init.js') }}"></script>
<script src="{{ asset('js/matmix.init.js') }}"></script>
<script src="{{ asset('js/retina.min.js') }}"></script>
<!--Data Tables-->
<script src="{{ asset('js/jquery.dataTables.js') }}"></script>
<script src="{{ asset('js/dataTables.responsive.js') }}"></script>
<script src="{{ asset('js/dataTables.tableTools.js') }}"></script>
<script src="{{ asset('js/dataTables.bootstrap.js') }}"></script>
<script src="{{ asset('js/stacktable.js') }}"></script>
<script src="{{ asset('js/bootbox.js') }}"></script>
<script src="{{ asset('js/sweetalert.js') }}"></script>
<script src="{{ asset('js/summernote.min.js') }}"></script>
<!--Forms Plugins-->
<script src="{{ asset('js/jquery.tagsinput.js') }}"></script>
<script src="{{ asset('js/jquery.mask.js') }}"></script>
<script src="{{ asset('js/jquery.bootstrap-touchspin.js') }}"></script>
<script src="{{ asset('js/bootstrap-filestyle.js') }}"></script>
<script src="{{ asset('js/selectize.js') }}"></script>
<script src="{{ asset('js/numeral-js/numeral.js') }}"></script>
@stack('scripts')
<script type="text/javascript">
function checkFile(e, ext = ['pdf', 'png', 'jpg', 'jpeg'], maxSize = 1.5) {
/// get list of files
var file_list = e.target.files;
/// go through the list of files
for (var i = 0, file; file = file_list[i]; i++) {
var sFileName = file.name;
var sFileExtension = sFileName.split('.')[sFileName.split('.').length - 1].toLowerCase();
var iFileSize = file.size;
var iConvert = (file.size / 1048576).toFixed(2);
/// OR together the accepted extensions and NOT it. Then OR the size cond.
/// It's easier to see this way, but just a suggestion - no requirement.
if (!ext.includes(sFileExtension) || iFileSize > (maxSize * 1048576).toFixed(2)) { /// 5 mb
txt = "File type : " + sFileExtension + "\n\n";
txt += "Size: " + iConvert + " MB \n\n";
var eTxt = '';
for (var i = 0; i < ext.length; i++) {
eTxt += ext[i] + ',';
}
if (eTxt != '') {
eTxt = 'adalah ' + eTxt + ' dan ';
}
txt += "Pastikan file anda " + eTxt + " tidak boleh lebih dari " + maxSize + " MB.\n\n";
swal("Ops!", txt, "info");
e.target.value = '';
e.target.setAttribute('class', 'error');
return e.preventDefault();
}
}
}
jQuery(document).ready(function($) {
$(document).on('submit', '#penform', function(e) {
console.log(this.action);
e.preventDefault();
});
function PreviewGen(type, text, layout) {
var n = noty({
text: text,
type: type,
dismissQueue: true,
layout: layout,
closeWith: ['click'],
theme: 'MatMixNoty',
maxVisible: 10
});
setTimeout(function() {
n.close();
}, 5000);
}
$('.ex-noty').on('click', function() {
var Dtype = $(this).data("type"),
Dlayout = $(this).data("layout");
PreviewGen(Dtype, n_dom[5], Dlayout);
});
/**
* Boot Box
* bootbox.js
*/
var DemoCallBack = (function() {
var elem,
hideHandler,
that = {};
that.init = function(options) {
elem = $(options.selector);
};
that.show = function(text) {
clearTimeout(hideHandler);
elem.find("span").html(text);
elem.delay(200).fadeIn().delay(3000).fadeOut();
};
return that;
}());
DemoCallBack.init({
"selector": ".bb-alert"
});
var bb_demos = {};
$(document).on("click", "a[data-bb]", function(e) {
e.preventDefault();
var type = $(this).data("bb");
if (typeof bb_demos[type] === 'function') {
bb_demos[type]();
}
});
// Alert
bb_demos.alert = function() {
bootbox.alert("Hello world!", function() {
DemoCallBack.show("Hello world callback");
});
};
// Confirm
bb_demos.confirm = function() {
bootbox.confirm("Are you sure?", function(result) {
DemoCallBack.show("Confirm result: " + result);
});
};
// Prompt
bb_demos.prompt = function() {
bootbox.prompt({
title: "What is your real name?",
value: "Kamrujaman Shohel",
callback: function(result) {
if (result === null) {
DemoCallBack.show("Prompt dismissed");
} else {
DemoCallBack.show("Hi <b>" + result + "</b>");
}
}
});
}
// Dialog
bb_demos.dialog = function() {
bootbox.dialog({
message: "I am a custom dialog",
title: "Custom title",
buttons: {
success: {
label: "Success!",
className: "btn-success",
callback: function() {
DemoCallBack.show("great success");
}
},
danger: {
label: "Danger!",
className: "btn-danger",
callback: function() {
DemoCallBack.show("uh oh, look out!");
}
},
main: {
label: "Click ME!",
className: "btn-primary",
callback: function() {
DemoCallBack.show("Primary button");
}
}
}
});
}
// Custom Html Contents
// bb_demos.custom_html = function () {
// bootbox.dialog({
// title: "That html",
// message: '<img src="images/avatar/jaman-01.jpg" alt="image"/><br/> You can also use <b>html</b>'
// });
// }
// Custom Html Forms
bb_demos.html_forms = function() {
var optionKategori = '<option value="">Pilih Semua Kategori</option>';
$.ajax({
url: '<?= url('api/helper/kategori') ?>',
type: 'GET',
success(data) {
$.each(data, function(index, value) {
optionKategori += '<option value="' + value.kd_kategori + '">' +
value.nm_kategori + '</option>';
});
$("#select-kategori").html(optionKategori);
}
});
bootbox.dialog({
size: "large",
title: "Pilih Barang.",
message: '<div class="row" style="margin-bottom:10px;">' +
' <div class="col-md-12">' +
'<form class="form-horizontal" id="penform">' +
'<div class="row">' +
'<div class=" col-md-3">' +
'<select class="form-control" name="kd_kategori" id="select-kategori">' +
optionKategori +
'</select>' +
'</div>' +
'<div class=" col-md-3">' +
'<input class="form-control search" type="text" placeholder="Search" name="s" value="<?php echo isset($_GET['s']) ? $_GET['s'] : ''; ?>">' +
'</div>' +
'</div>' +
'</form>' +
'</div>' +
'</div>' +
'<div class="row" id="list-data">' +
'</div>',
buttons: {
success: {
label: "Close",
className: "btn-default",
}
}
});
}
bb_demos.roti_forms = function() {
bootbox.dialog({
size: "large",
title: "Pilih Barang.",
message: '<div class="row" style="margin-bottom:10px;">' +
' <div class="col-md-12">' +
'<form class="form-horizontal" id="penform">' +
'<div class="row">' +
'<div class=" col-md-3">' +
'<input class="form-control search" type="text" placeholder="Search" name="s" value="<?php echo isset($_GET['s']) ? $_GET['s'] : ''; ?>">' +
'</div>' +
'</div>' +
'</form>' +
'</div>' +
'</div>' +
'<div class="row" id="list-data">' +
'</div>',
buttons: {
success: {
label: "Close",
className: "btn-default",
}
}
});
}
$(document).ready(function() {
$('.select2').select2();
$('.money').mask('000.000.000.000.000', {
reverse: true
});
$('#id_pelanggan').on('select2:select', function(e) {
$("#list-contain").html("");
list_barang = [];
get_total();
// let member = $(this).find(':selected').data('member');
// member = member.toLowerCase();
// let optionMetode = '';
// let id_pelanggan = $('#id_pelanggan').val();
// $('#optionalField').empty();
// if (member != 'umum') {
// $.ajax({
// url: '<?= url('api/helper/metode') ?>',
// type: 'GET',
// success(data){
// $.each(data, function( index, value ) {
// optionMetode += `<option value="${value.metode}">${value.metode} - ${ value.keterangan ? value.keterangan:'' }</option>`;
// });
// $('#keterangan').append(optionMetode);
// }
// });
// }else{
// $('#keterangan').empty();
// $('#keterangan').append(`
// <option value="Cash">Cash</option>`)
// }
// // Cari Limit Hutang
// $.ajax({
// url: '{{ url('api/helper/limit_hutang') }}/'+id_pelanggan,
// type:'GET',
// success(data){
// $('#limit_hutang').val(data);
// }
// });
});
let bank_trf;
let nama_rekening;
let nomor_rekening;
$('#supplier').on("select2:select", function(e) {
$.ajax({
type: "get",
url: " {{ url('api/supplier') }}/" + $(this).val(),
success: function(res) {
if (res.status == "success") {
if($('#cash').is(':checked')){
bank_trf = res.data.bank;
nama_rekening = res.data.nama_rekening;
nomor_rekening = res.data.no_rekening;
console.log(bank_trf);
$('input[name="bank_trf"]').val('CASH')
$('input[name="nama_rekening"]').val('-')
$('input[name="nomor_rekening"]').val('-')
$('input[name="nama_rekening"]').attr('readonly','readonly')
$('input[name="nomor_rekening"]').attr('readonly','readonly')
$('input[name="bank_trf"]').attr('readonly','readonly')
}else{
bank_trf = res.data.bank;
nama_rekening = res.data.nama_rekening;
nomor_rekening = res.data.no_rekening;
$('input[name="bank_trf"]').val(res.data.bank)
$('input[name="nama_rekening"]').val(res.data.nama_rekening)
$('input[name="nomor_rekening"]').val(res.data.no_rekening)
}
} else {
alert(res.message)
}
}
});
});
$('#cash').on('change', function(e){
if($('#cash').is(':checked')){
$('input[name="nama_rekening"]').attr('readonly','readonly')
$('input[name="bank_trf"]').val('CASH')
$('input[name="nama_rekening"]').val('-')
$('input[name="nomor_rekening"]').val('-')
$('input[name="nomor_rekening"]').attr('readonly','readonly')
$('input[name="bank_trf"]').attr('readonly','readonly')
}else{
$('input[name="bank_trf"]').val(bank_trf)
$('input[name="nama_rekening"]').val(nama_rekening)
$('input[name="nomor_rekening"]').val(nomor_rekening)
}
});
});
$('.master_check').on('click', function(e) {
if ($(this).is(':checked', true)) {
$("." + $(this).attr("target-class")).prop('checked', true);
} else {
$("." + $(this).attr("target-class")).prop('checked', false);
}
});
$(document).on('click', '.terpilih', function(e) {
let dHarga = ($(this).data('harga') - $(this).data('diskon')).toString().replace(
/\B(?=(\d{3})+(?!\d))/g, ",");
DemoCallBack.show("Memilih Barang " + $(this).data('nama') + "</b>");
$('#displayHarga').html('Rp. ' + dHarga);
});
if (last_order == undefined) {
var last_order = 1;
}
$(document).on('click', '#add_row', function(e) {
var l = $(".list-harga").length;
var ll = l;
last_order = last_order + ll;
cur_id = "list-harga-" + last_order;
$("#list-harga .delete_row").attr('data-id', 'list-harga-' + last_order);
$("#list-harga .pilih-barang").attr('data-id', 'list-harga-' + last_order);
$("#list-harga .harga_baru").attr('data-id', 'list-harga-' + last_order);
var c = $("#list-harga").clone();
c.attr('id', 'list-harga-' + last_order);
c.addClass('list-harga');
c.data('harga', 0);
c.show();
$("#list-contain").append(c);
$("#list-harga-" + last_order + " .jumlah").addClass('jumlahnya');
if ($("#list-harga-" + last_order + ' .select2').length) {
$('.select2').select2();
}
});
$(document).on('click', '.delete_row', function(e) {
$("#" + $(this).data('id')).remove();
});
var allVals = [];
$('#master').on('click', function(e) {
if ($(this).is(':checked', true)) {
$(".sub_chk").prop('checked', true);
} else {
$(".sub_chk").prop('checked', false);
}
});
$('.delete_all').on('click', function(e) {
var _this = $(this);
$(".sub_chk:checked").each(function() {
allVals.push($(this).attr('data-id'));
});
if (allVals.length <= 0) {
alert("Silahkan Pilih Data");
} else {
swal({
title: "Are you sure?",
text: "You will not be able to recover this Information!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete!",
cancelButtonText: "No, cancel!",
closeOnConfirm: false,
closeOnCancel: true
}, function(isConfirm) {
if (isConfirm) {
var join_selected_values = allVals.join(",");
$.ajax({
url: _this.data('url'),
type: 'GET',
data: 'ids=' + join_selected_values,
success: function(data) {
$(".sub_chk:checked").each(function() {
$(this).parents("tr").addClass(
"noty_animated bounceOutRight");
setTimeout(function() {
$(this).parents("tr")
.remove();
}, 1000);
});
swal("Deleted!", "Data Berhasil Di Hapus.",
"success");
console.log(data);
},
error: function(data) {
swal("Error!", data.responseText, "error");
console.log(data);
}
}).fail(function() {
swal("Error!", "Data Gagal Di Hapus.", "error");
});
$.each(allVals, function(index, value) {
$('table tr').filter("[data-row-id='" + value + "']")
.remove();
});
}
});
}
});
$('#tabel-barang-periode').dataTable({
"ordering": false,
sDom: "lrtip",
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [0, 1, 2, 3, 4, 5, 6, 7]
},
{
"bSearchable": false,
"aTargets": [0, 1, 2, 3, 4, 5, 6, 7]
}
]
});
$('#tabel-penjualan-periode').dataTable({
"ordering": false,
sDom: "lrtip",
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [0, 1, 2, 3, 4]
},
{
"bSearchable": false,
"aTargets": [0, 1, 2, 3, 4]
}
]
});
$('#tabel-penjualan-etalase-periode').dataTable({
"ordering": false,
sDom: "lrtip",
});
$('#tabel-pembelian-periode').dataTable({
"ordering": false,
sDom: "lrtip",
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [0, 1, 2, 3, 4]
},
{
"bSearchable": false,
"aTargets": [0, 1, 2, 3, 4]
}
]
});
$('#data-table').dataTable({
"ordering": false,
columnDefs: [{
"defaultContent": "-",
"targets": "_all"
}]
});
$('#table').dataTable({
columnDefs: [{
"defaultContent": "-",
"targets": "_all"
}]
});
$('.form-prevent').submit(function() {
$('.button-prevent').attr('disabled', 'true');
});
});
</script>
</body>
</html>
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]