copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,845 @@
|
||||
<!doctype html>
|
||||
<html class="fixed sidebar-left-collapsed">
|
||||
|
||||
<head>
|
||||
|
||||
<!-- Basic -->
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>MASTER DATA</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;
|
||||
}
|
||||
|
||||
.bordergoldall {
|
||||
border-left-style: solid;
|
||||
border-right-style: solid;
|
||||
border-top-style: solid;
|
||||
border-bottom-style: solid;
|
||||
border-width: 5px;
|
||||
border-color: gold;
|
||||
}
|
||||
|
||||
.borderorangeall {
|
||||
border-left-style: solid;
|
||||
border-right-style: solid;
|
||||
border-top-style: solid;
|
||||
border-bottom-style: solid;
|
||||
border-width: 5px;
|
||||
border-color: orange;
|
||||
}
|
||||
|
||||
.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">
|
||||
|
||||
<?php
|
||||
$id_karyawan = $this->session->userdata('id_karyawan');
|
||||
$nama_panggilan = $this->session->userdata('nama_panggilan');
|
||||
$username = $this->session->userdata('username');
|
||||
$tgl_now = date('d/m/Y');
|
||||
?>
|
||||
|
||||
<header class="page-header">
|
||||
<h2><b>Data Master Supplier | </b><b style="color:LightGreen">[<?=$tampil?>]</b></h2>
|
||||
</header>
|
||||
|
||||
<!-- start: page -->
|
||||
<section class="panel panel-featured panel-featured-dark">
|
||||
<header class="panel-heading">
|
||||
<div class="panel-actions">
|
||||
<a data-toggle="modal" data-target="#modalFitur" style="color:Coral"><b>Fitur </b><i class="fa fa-question-circle"></i></a>  
|
||||
<a onclick="tutupTab()"><b style="color:Black">Tutup <i class="fa fa-times"></i></b></a>
|
||||
</div>
|
||||
<h2 class="panel-title"><b style="color:Olive">DATA SUPPLIER</b></h2>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel panel-accordion">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" <?php if ($hak>=2) { ?>href="#collapseOne" onclick="setBersih()"<?php } ?>>
|
||||
<b class="f18" style="color:DarkGreen"><b style="color:Black">[1]</b> DATA BARU <?php if ($hak<=1) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseOne" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group bordergoldall">
|
||||
<h4><div class="col-md-12">
|
||||
<b style="color:DarkCyan"><i>Note : [Warna Merah harus diisi.]</i></b>
|
||||
</div></h4>
|
||||
<br><br>
|
||||
<h4><div class="col-md-2"><b style="color:Red">Nama Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="nama_suppliernew" rows="3" cols="3" class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="50" placeholder="Nama Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Alias Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="alias_suppliernew" rows="3" cols="3" class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="50" placeholder="Alias Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:Red">Kota</b></div></h4>
|
||||
<input type="hidden" id="id_kotanew" class="form-control">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input autocomplete="off" style="background:lightgrey;" type="text" id="nama_kotanew" class="form-control" placeholder="Klik pada Icon" required>
|
||||
<span class="input-group-addon" data-toggle="modal" data-target="#modalAmbilKota" onclick="isiMasterKota(1)"><i class="fa fa-compass text-danger"></i></span>
|
||||
</div>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:Red">TOP Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="number" id="top_suppliernew" class="form-control" onchange="cekNilai()" autocomplete="off" data-plugin-maxlength maxlength="3" placeholder="TOP Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Alamat Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="alamat_suppliernew" rows="3" cols="3" class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="128" placeholder="Alamat Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Telepon Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="telp_suppliernew" class="form-control" autocomplete="off" data-plugin-maxlength maxlength="20" placeholder="Telepon Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">PIC Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="pic_suppliernew" class="form-control" autocomplete="off" data-plugin-maxlength maxlength="50" placeholder="PIC Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">NPWP Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="npwp_suppliernew" data-plugin-masked-input data-input-mask="99.999.999.9-999.999" placeholder="__.___.___._-___.___" class="form-control" autocomplete="off">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Email Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="email_suppliernew" class="form-control" autocomplete="off" data-plugin-maxlength maxlength="50" placeholder="Email Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="button" class="btn btn-success" onclick="tambahData()"><b>Tambah Data</b> <i class="fa fa-plus"></i></button>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-accordion">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" <?php if ($hak>0) { ?>href="#collapseTwo" onclick="setBersih()"<?php } ?>>
|
||||
<b class="f18" style="color:DarkGreen"><b style="color:Black">[2]</b> CARI DATA <i style="color:Brown">(Ubah/Hapus)</i> <?php if ($hak==0) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseTwo" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<h4><div class="col-md-2"><b style="color:Red">Pilih Data</b></div></h4>
|
||||
<input type="hidden" id="id_supplierLihat" class="form-control">
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
<input autocomplete="off" style="background:lightgrey;" type="text" id="nama_supplierTemp" class="form-control" placeholder="Klik pada Icon" required>
|
||||
<span class="input-group-addon" data-toggle="modal" data-target="#modalAmbilSupplier" onclick="isiMasterSupplier()"><i class="fa fa-cube text-danger"></i></span>
|
||||
</div>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group borderorangeall" id="detailData" hidden="hidden">
|
||||
<h4><div class="col-md-12">
|
||||
<b style="color:DarkOrchid"><i>Note : [Semua Perubahan akan Otomatis tersimpan.]</i></b><br>
|
||||
<b style="color:DarkCyan"><i>Note : [Warna Merah harus diisi.]</i></b>
|
||||
</div></h4>
|
||||
<br><br>
|
||||
<input type="hidden" id="top_supplierTemp" class="form-control">
|
||||
<h4><div class="col-md-2"><b style="color:Red">Nama Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="nama_suppliered" rows="3" cols="3" <?php if ($hak>=1) { ?>onchange="ubahData(1)"<?php } ?> class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="50" placeholder="Nama Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Alias Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="alias_suppliered" rows="3" cols="3" <?php if ($hak>=1) { ?>onchange="ubahData(9)"<?php } ?> class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="50" placeholder="Alias Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:Red">Kota</b></div></h4>
|
||||
<input type="hidden" id="id_kotaed" class="form-control">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input autocomplete="off" style="background:lightgrey;" type="text" id="nama_kotaed" class="form-control" placeholder="Klik pada Icon" required>
|
||||
<span class="input-group-addon" data-toggle="modal" data-target="#modalAmbilKota" onclick="isiMasterKota(2)"><i class="fa fa-compass text-danger"></i></span>
|
||||
</div>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:Red">TOP Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="number" id="top_suppliered" class="form-control" <?php if ($hak>=1) { ?>onchange="ubahData(3)"<?php } ?> autocomplete="off" data-plugin-maxlength maxlength="3" placeholder="TOP Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Alamat Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="alamat_suppliered" rows="3" cols="3" <?php if ($hak>=1) { ?>onchange="ubahData(2)"<?php } ?> class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="50" placeholder="Alamat Supplier"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Telepon Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="telp_suppliered" class="form-control" <?php if ($hak>=1) { ?>onchange="ubahData(8)"<?php } ?> autocomplete="off" data-plugin-maxlength maxlength="30" placeholder="Telepon Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">PIC Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="pic_suppliered" class="form-control" <?php if ($hak>=1) { ?>onchange="ubahData(5)"<?php } ?> autocomplete="off" data-plugin-maxlength maxlength="50" placeholder="PIC Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">NPWP Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="npwp_suppliered" data-plugin-masked-input data-input-mask="99.999.999.9-999.999" <?php if ($hak>=1) { ?>onchange="ubahData(6)"<?php } ?> placeholder="__.___.___._-___.___" class="form-control" autocomplete="off">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><div class="col-md-2"><b style="color:DarkSlateGray">Email Supplier</b></div></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="email_suppliered" class="form-control" autocomplete="off" <?php if ($hak>=1) { ?>onchange="ubahData(7)"<?php } ?> data-plugin-maxlength maxlength="50" placeholder="Email Supplier">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<div class="col-md-12 text-right" id="buttonDelete" hidden="hidden">
|
||||
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#modalHapus" onclick="hapusData()"><b>Hapus Data</b> <i class="fa fa-minus"></i></button>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-accordion">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" <?php if ($hak>0) { ?>href="#collapseThree" onclick="setBersih()"<?php } ?>>
|
||||
<b class="f18" style="color:DarkGreen"><b style="color:Black">[3]</b> CETAK DATA <?php if ($hak==0) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseThree" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<h4><div class="col-md-2"><b style="color:Red">Kota</b></div></h4>
|
||||
<input type="hidden" id="id_kotalap" class="form-control">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input autocomplete="off" style="background:lightgrey;" type="text" id="nama_kotalap" class="form-control" placeholder="Klik pada Icon" required>
|
||||
<span class="input-group-addon" data-toggle="modal" data-target="#modalAmbilKota" onclick="isiMasterKota(3)"><i class="fa fa-compass text-danger"></i></span>
|
||||
</div>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= form_open('Menu/MD_Excel_DataSupplier', array('id' => 'formmaster'), array('method' => 'MD_Excel_DataSupplier')); ?>
|
||||
<h4><div class="col-md-2"><b style="color:SlateBlue">Menu</b></div></h4>
|
||||
<div class="col-md-10 btn-group">
|
||||
<input type="hidden" id="id_kotafill" name="id_kotafill" class="form-control">
|
||||
<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>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div id="modalFitur" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" style="width:50%">
|
||||
<div class="modal-content">
|
||||
<header class="panel-heading">
|
||||
<h4 class="panel-title"><b>Fitur Teknis</b></h4>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-text">
|
||||
<div class="form-group">
|
||||
<h5>
|
||||
<b style="color:DarkRed">Berikut ini adalah Daftar Menu yang dapat diakses sesuai dengan Hak Akses Anda.</b><br>
|
||||
<br><b style="color:DarkGreen">AKSES PENUH/OPERATOR</b><br><b> Semua Fungsi (Tambah, Ubah, Hapus)</b><br>
|
||||
<br><b style="color:DarkGreen">TERBATAS</b><br><b>Hanya dapat Membaca Data</b><br>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalAmbilKota" class="modal fade ui-front" tabindex="-1" role="dialog" data-keyboard="false">
|
||||
<div class="modal-dialog modal-lg" style="width:60%">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><b>Isi Data | <b style="color:Red">[Kota]</b></b></h2>
|
||||
<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="modal-wrapper">
|
||||
<div class="modal-text">
|
||||
<div class="row form-bordered">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<input type="hidden" id="kotaVerse">
|
||||
<input type="text" id="kotaSearch" oninput="cariDataKota()" autocomplete="off" class="form-control populate" placeholder="Cari Kota..."></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered table-striped mb-none">
|
||||
<thead>
|
||||
<?php if ($hak>1) { ?>
|
||||
<th class="center default">Pilih</th>
|
||||
<?php } ?>
|
||||
<th class="default">Nama</th>
|
||||
</thead>
|
||||
<tbody id="isiTabelKota"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalAmbilSupplier" class="modal fade ui-front" tabindex="-1" role="dialog" data-keyboard="false">
|
||||
<div class="modal-dialog modal-lg" style="width:60%">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><b>Isi Data | <b style="color:Red">[Supplier]</b></b></h2>
|
||||
<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="modal-wrapper">
|
||||
<div class="modal-text">
|
||||
<div class="row form-bordered">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="supplierSearch" oninput="cariDataSupplier()" autocomplete="off" class="form-control populate" placeholder="Cari Supplier..."></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered table-striped mb-none">
|
||||
<thead>
|
||||
<?php if ($hak>1) { ?>
|
||||
<th class="center default">Pilih</th>
|
||||
<?php } ?>
|
||||
<th class="default">Nama</th>
|
||||
<th class="default">Alias</th>
|
||||
<th class="default">Alamat</th>
|
||||
<th class="default">Kota</th>
|
||||
</thead>
|
||||
<tbody id="isiTabelSupplier"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalHapus" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<?= form_open('Menu/MD_Hapus_DataSupplier', array('id' => 'formmaster'), array('method' => 'MD_Hapus_DataSupplier')); ?>
|
||||
<div class="modal-content">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><b>Hapus Data</b></h2>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-text">
|
||||
<input type="hidden" name="id_supplierdel" id="id_supplierdel" class="form-control">
|
||||
<h4>Apakah ingin menghapus Data?</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 type="submit" name="SubmitButton" id="SubmitButton" class="btn btn-danger"><b>Hapus</b> <i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
</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>
|
||||
function tutupTab() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function isiMasterKota(verse) {
|
||||
PNotify.removeAll();
|
||||
document.getElementById("kotaVerse").value = verse;
|
||||
document.getElementById("kotaSearch").value = null;
|
||||
document.getElementById("kotaSearch").innerHTML = "";
|
||||
tampilkanDataMasterKota(verse, null);
|
||||
}
|
||||
|
||||
function isiMasterSupplier() {
|
||||
PNotify.removeAll();
|
||||
document.getElementById("supplierSearch").value = null;
|
||||
document.getElementById("supplierSearch").innerHTML = "";
|
||||
tampilkanDataMasterSupplier(null);
|
||||
}
|
||||
|
||||
function cariDataKota() {
|
||||
var verse = document.getElementById("kotaVerse").value;
|
||||
var search = document.getElementById("kotaSearch").value;
|
||||
tampilkanDataMasterKota(verse, search);
|
||||
}
|
||||
|
||||
function cariDataSupplier() {
|
||||
var search = document.getElementById("supplierSearch").value;
|
||||
tampilkanDataMasterSupplier(search);
|
||||
}
|
||||
|
||||
function tampilkanDataMasterKota(verse, textSearch) {
|
||||
var hak = <?=$hak?>;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
search : textSearch,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/GE_AmbilData_MasterKota',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
JUMLAH = response.data.length;
|
||||
var baris = '';
|
||||
|
||||
for (var i = 1; i <= JUMLAH; i++) {
|
||||
var id = response.data[i - 1]['ID_KOTA'];
|
||||
var nama = response.data[i - 1]['NAMA_KOTA'];
|
||||
|
||||
baris += '<tr>';
|
||||
if (hak>1) {
|
||||
baris += '<td class="center" style="vertical-align: middle;" ><button onclick="pilihKota(' + id + ',' + verse + ')"><i class="fa fa-circle text-primary"></i></button></td>';
|
||||
}
|
||||
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Black">' + nama + '</b></td>';
|
||||
baris += '</tr>';
|
||||
}
|
||||
$('#isiTabelKota').html(baris);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function tampilkanDataMasterSupplier(textSearch) {
|
||||
var hak = <?=$hak?>;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
search : textSearch,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/GE_AmbilData_MasterSupplier',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
JUMLAH = response.data.length;
|
||||
var baris = '';
|
||||
|
||||
for (var i = 1; i <= JUMLAH; i++) {
|
||||
var id = response.data[i - 1]['ID_SUPPLIER'];
|
||||
var nama = response.data[i - 1]['NAMA_SUPPLIER'];
|
||||
var alias = response.data[i - 1]['ALIAS_SUPPLIER'];
|
||||
var alamat = response.data[i - 1]['ALAMAT_SUPPLIER'];
|
||||
var kota = response.data[i - 1]['NAMA_KOTA'];
|
||||
|
||||
baris += '<tr>';
|
||||
if (hak>1) {
|
||||
baris += '<td class="center" style="vertical-align: middle;" ><button onclick="pilihSupplier(' + id + ')"><i class="fa fa-circle text-primary"></i></button></td>';
|
||||
}
|
||||
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Black">' + nama + '</b></td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:DarkGreen">' + alias + '</b></td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Chocolate">' + alamat + '</b></td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Tomato">' + kota + '</b></td>';
|
||||
baris += '</tr>';
|
||||
}
|
||||
$('#isiTabelSupplier').html(baris);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function pilihKota(id, verse) {
|
||||
PNotify.removeAll();
|
||||
if (verse==1) {
|
||||
document.getElementById("id_kotanew").value = id;
|
||||
} else if (verse==2) {
|
||||
document.getElementById("id_kotaed").value = id;
|
||||
} else if (verse==3) {
|
||||
document.getElementById("id_kotalap").value = id;
|
||||
}
|
||||
$('#modalAmbilKota').modal('hide');
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/GE_AmbilData_PilihKota",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_kota : id
|
||||
},
|
||||
success: function(response) {
|
||||
if (verse==1) {
|
||||
document.getElementById("nama_kotanew").value = response.nama_kota;
|
||||
} else if (verse==2) {
|
||||
document.getElementById("nama_kotaed").value = response.nama_kota;
|
||||
ubahData(4);
|
||||
} else if (verse==3) {
|
||||
document.getElementById("nama_kotalap").value = response.nama_kota;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function pilihSupplier(id) {
|
||||
PNotify.removeAll();
|
||||
document.getElementById("id_supplierLihat").value = id;
|
||||
$('#modalAmbilSupplier').modal('hide');
|
||||
lihatData(id);
|
||||
}
|
||||
|
||||
function setBersih() {
|
||||
document.getElementById('detailData').style.display = 'none';
|
||||
document.getElementById("id_kotanew").value = null;
|
||||
document.getElementById("id_kotaed").value = null;
|
||||
document.getElementById("id_kotalap").value = null;
|
||||
document.getElementById("nama_kotanew").value = null;
|
||||
document.getElementById("nama_kotaed").value = null;
|
||||
document.getElementById("nama_kotalap").value = null;
|
||||
document.getElementById("nama_suppliernew").value = null;
|
||||
document.getElementById("nama_suppliered").value = null;
|
||||
document.getElementById("nama_supplierTemp").value = null;
|
||||
document.getElementById("alias_suppliernew").value = null;
|
||||
document.getElementById("alias_suppliered").value = null;
|
||||
document.getElementById("alamat_suppliernew").value = null;
|
||||
document.getElementById("alamat_suppliered").value = null;
|
||||
document.getElementById("top_suppliernew").value = null;
|
||||
document.getElementById("top_suppliered").value = null;
|
||||
document.getElementById("pic_suppliernew").value = null;
|
||||
document.getElementById("pic_suppliered").value = null;
|
||||
document.getElementById("npwp_suppliernew").value = null;
|
||||
document.getElementById("npwp_suppliered").value = null;
|
||||
document.getElementById("email_suppliernew").value = null;
|
||||
document.getElementById("email_suppliered").value = null;
|
||||
document.getElementById("telp_suppliernew").value = null;
|
||||
document.getElementById("telp_suppliered").value = null;
|
||||
document.getElementById("id_supplierLihat").value = null;
|
||||
}
|
||||
|
||||
function cekNilai() {
|
||||
PNotify.removeAll();
|
||||
|
||||
var nilai = document.getElementById("top_suppliernew").value;
|
||||
|
||||
var nilai = nilai.replace(/,/g,'.');
|
||||
|
||||
var cekNumber = isNaN(nilai);
|
||||
if (cekNumber==true) {
|
||||
notify("not_number");
|
||||
document.getElementById("top_suppliernew").value = null;
|
||||
}
|
||||
|
||||
if (nilai<0 || nilai=="") {
|
||||
notify("less_zero");
|
||||
document.getElementById("top_suppliernew").value = null;
|
||||
}
|
||||
}
|
||||
|
||||
function lihatData(id) {
|
||||
document.getElementById('detailData').style.display = 'block';
|
||||
var hak = <?=$hak?>;
|
||||
|
||||
if (id!="" && hak>0) {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/MD_Ambil_DataSupplier",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_supplier : id,
|
||||
},
|
||||
success: function(response) {
|
||||
document.getElementById("id_kotaed").value = response.id_kota;
|
||||
document.getElementById("nama_kotaed").value = response.nama_kota;
|
||||
document.getElementById("nama_suppliered").value = response.nama_supplier;
|
||||
document.getElementById("nama_supplierTemp").value = response.nama_supplier;
|
||||
document.getElementById("alias_suppliered").value = response.alias_supplier;
|
||||
document.getElementById("top_suppliered").value = response.top_supplier;
|
||||
document.getElementById("top_supplierTemp").value = response.top_supplier;
|
||||
document.getElementById("alamat_suppliered").value = response.alamat_supplier;
|
||||
document.getElementById("pic_suppliered").value = response.pic_supplier;
|
||||
document.getElementById("npwp_suppliered").value = response.npwp_supplier;
|
||||
document.getElementById("email_suppliered").value = response.email_supplier;
|
||||
document.getElementById("telp_suppliered").value = response.telp_supplier;
|
||||
if (hak==1) {
|
||||
document.getElementById("nama_suppliered").disabled = true;
|
||||
document.getElementById("alias_suppliered").disabled = true;
|
||||
document.getElementById("alamat_suppliered").disabled = true;
|
||||
document.getElementById("telp_suppliered").disabled = true;
|
||||
document.getElementById("id_kotaed").disabled = true;
|
||||
document.getElementById("top_suppliered").disabled = true;
|
||||
document.getElementById("npwp_suppliered").disabled = true;
|
||||
document.getElementById("email_suppliered").disabled = true;
|
||||
document.getElementById("pic_suppliered").disabled = true;
|
||||
} else {
|
||||
document.getElementById('buttonDelete').style.display = 'block';
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
document.getElementById('detailData').style.display = 'none';
|
||||
document.getElementById('buttonDelete').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function tambahData() {
|
||||
var status = 0;
|
||||
var nama_supplier = document.getElementById("nama_suppliernew").value;
|
||||
var alias_supplier = document.getElementById("alias_suppliernew").value;
|
||||
var alamat_supplier = document.getElementById("alamat_suppliernew").value;
|
||||
var telp_supplier = document.getElementById("telp_suppliernew").value;
|
||||
var top_supplier = document.getElementById("top_suppliernew").value;
|
||||
var pic_supplier = document.getElementById("pic_suppliernew").value;
|
||||
var npwp_supplier = document.getElementById("npwp_suppliernew").value;
|
||||
var email_supplier = document.getElementById("email_suppliernew").value;
|
||||
var id_kota = document.getElementById("id_kotanew").value;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (nama_supplier=="") {
|
||||
notify("nama_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (id_kota=="") {
|
||||
notify("kotaid_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (top_supplier=="") {
|
||||
notify("top_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status==0) {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/MD_Tambah_DataSupplier",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
nama_supplier : nama_supplier,
|
||||
alias_supplier : alias_supplier,
|
||||
alamat_supplier : alamat_supplier,
|
||||
telp_supplier : telp_supplier,
|
||||
top_supplier : top_supplier,
|
||||
pic_supplier : pic_supplier,
|
||||
npwp_supplier : npwp_supplier,
|
||||
email_supplier : email_supplier,
|
||||
id_kota : id_kota,
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_add");
|
||||
delayReload(1000,"<?= base_url() ?>index.php/Menu/MD_MasterSupplier/");
|
||||
} else if (response.value==2) {
|
||||
notify("name_same");
|
||||
document.getElementById("nama_suppliernew").value = null;
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setBersih();
|
||||
}
|
||||
|
||||
function ubahData(menu) {
|
||||
//1. Ganti Nama Supplier
|
||||
//2. Ganti Alamat Supplier
|
||||
//3. Ganti TOP Supplier
|
||||
//4. Ganti Kota
|
||||
//5. Ganti PIC Supplier
|
||||
//6. Ganti NPWP Supplier
|
||||
//7. Ganti Email Supplier
|
||||
//8. Ganti Telepon Supplier
|
||||
//9. Ganti Alias Supplier
|
||||
|
||||
var id_supplier = document.getElementById("id_supplierLihat").value;
|
||||
var id_kota = document.getElementById("id_kotaed").value;
|
||||
var nama_supplier = document.getElementById("nama_suppliered").value;
|
||||
var nama_supplierTemp = document.getElementById("nama_supplierTemp").value;
|
||||
var alias_supplier = document.getElementById("alias_suppliered").value;
|
||||
var top_supplier = document.getElementById("top_suppliered").value;
|
||||
var top_supplierTemp = document.getElementById("top_supplierTemp").value;
|
||||
var alamat_supplier = document.getElementById("alamat_suppliered").value;
|
||||
var pic_supplier = document.getElementById("pic_suppliered").value;
|
||||
var npwp_supplier = document.getElementById("npwp_suppliered").value;
|
||||
var email_supplier = document.getElementById("email_suppliered").value;
|
||||
var telp_supplier = document.getElementById("telp_suppliered").value;
|
||||
var status = 0;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
var top_supplier = top_supplier.replace(/,/g,'.');
|
||||
|
||||
if (top_supplier<0 || top_supplier=="") {
|
||||
notify("less_zero");
|
||||
document.getElementById("top_suppliered").value = top_supplierTemp;
|
||||
}
|
||||
|
||||
if (id_supplier!="") {
|
||||
if (nama_supplier.length==0 || top_supplier.length==0) {
|
||||
notify("datainput_null");
|
||||
document.getElementById("nama_suppliered").value = nama_supplierTemp;
|
||||
document.getElementById("top_suppliered").value = top_supplierTemp;
|
||||
status++;
|
||||
}
|
||||
if (id_kota=="") {
|
||||
status++;
|
||||
}
|
||||
} else {
|
||||
if (id_kota=="") {
|
||||
status++;
|
||||
}
|
||||
}
|
||||
|
||||
if (status==0) {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/MD_Ubah_DataSupplier",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_supplier : id_supplier,
|
||||
id_kota : id_kota,
|
||||
nama_supplier : nama_supplier,
|
||||
alias_supplier : alias_supplier,
|
||||
alamat_supplier : alamat_supplier,
|
||||
top_supplier : top_supplier,
|
||||
pic_supplier : pic_supplier,
|
||||
npwp_supplier : npwp_supplier,
|
||||
email_supplier : email_supplier,
|
||||
telp_supplier : telp_supplier,
|
||||
menu : menu,
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_ed");
|
||||
lihatData(id_supplier);
|
||||
} else if (response.value==2) {
|
||||
notify("name_same");
|
||||
document.getElementById("nama_suppliered").value = nama_supplierTemp;
|
||||
} else if (response.value==3) {
|
||||
notify("latest");
|
||||
delayReload(1000,"<?= base_url() ?>index.php/Menu/MD_MasterSupplier/");
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hapusData() {
|
||||
PNotify.removeAll();
|
||||
document.getElementById("id_supplierdel").value = document.getElementById("id_supplierLihat").value;
|
||||
}
|
||||
|
||||
function isiData() {
|
||||
document.getElementById("id_kotafill").value = document.getElementById("id_kotalap").value;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user