copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,693 @@
|
||||
<!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;
|
||||
}
|
||||
|
||||
</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');
|
||||
|
||||
$datShm = $this->Amod->getData_SetHakMenu_byKARYAWAN_byKODE_byNAMA($id_karyawan, "MD", "MASTER - Kontak");
|
||||
if ($datShm==FALSE) {
|
||||
$hak = 0;
|
||||
$tampil = "TIDAK BERHAK";
|
||||
} else {
|
||||
$hak = $datShm[0]['AKSES_ID'];
|
||||
$tampil = $datShm[0]['NAMA_AKSES'];
|
||||
}
|
||||
?>
|
||||
|
||||
<header class="page-header">
|
||||
<h2><b>Data Master Kontak | </b><b style="color:LightGreen">[<?=$tampil?>]</b></h2>
|
||||
<div class="right-wrapper pull-right">
|
||||
<ol class="breadcrumbs">
|
||||
<li><a onclick="tutupTab()"><b style="color:LightPink">Tutup Master <i class="fa fa-times"></i></b></a></li>
|
||||
</ol>
|
||||
<a class="sidebar-right-toggle" onclick="tutupTab()"></a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- start: page -->
|
||||
<div class="col-md-12">
|
||||
<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" onclick="setBersih()" data-parent="#accordion" <?php if ($hak>=2) { ?>href="#collapseOne"<?php } ?>>
|
||||
<h4><b style="color:Indigo">[1] DATA BARU <?php if ($hak<=1) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b></h4>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseOne" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group bordergoldall">
|
||||
<h4><label class="col-md-12 control-label">
|
||||
<b style="color:DarkCyan"><i>Note : [Warna Merah harus diisi.]</i></b>
|
||||
</label></h4>
|
||||
<br><br>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Nama Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="nama_kontaknew" rows="3" cols="3" class="form-control" autocomplete="off" style="text-transform:uppercase" data-plugin-maxlength maxlength="64" placeholder="Nama Kontak"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Keterangan Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea autocomplete="off" type="text" id="ket_kontaknew" rows="3" cols="3" class="form-control" data-plugin-maxlength maxlength="64" placeholder="Keterangan Kontak"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Akun</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_akunnew" class="form-control populate">
|
||||
<option value="" selected>Pilih Akun</option>
|
||||
<?php if (is_array($akun) || is_object($akun)) {
|
||||
foreach ($akun as $key) { ?>
|
||||
<option value="<?= $key['ID_AKUN'] ?>" ><?= $key['NAMA_AKUN'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Telepon Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="telp_kontaknew" class="form-control" autocomplete="off" data-plugin-maxlength maxlength="20" placeholder="Telepon Kontak">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Posisi</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_posisinew" class="form-control populate">
|
||||
<option value="" selected>Pilih Posisi</option>
|
||||
<?php if (is_array($posisi) || is_object($posisi)) {
|
||||
foreach ($posisi as $key) { ?>
|
||||
<option value="<?= $key['ID_POSISI'] ?>" ><?= $key['NAMA_POSISI'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Email Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="email_kontaknew" class="form-control" autocomplete="off" data-plugin-maxlength maxlength="64" placeholder="Email Kontak">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="button" class="btn btn-success" onclick="tambahData()"><strong>Tambah Data</strong> <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" onclick="setBersih()" data-parent="#accordion" <?php if ($hak>0) { ?>href="#collapseTwo"<?php } ?>>
|
||||
<h4><b style="color:Indigo">[2] CARI DATA <i style="color:Brown">(Ubah/Hapus)</i> <?php if ($hak==0) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b></h4>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseTwo" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Pilih Data</b></label></h4>
|
||||
<div class="col-md-10">
|
||||
<select data-plugin-selectTwo name="id_kontakLihat" id="id_kontakLihat" onchange="lihatData(value);" class="form-control populate">
|
||||
<option value="" selected>Pilih Kontak/Reset</option>
|
||||
<?php if (is_array($kontak) || is_object($kontak)) {
|
||||
foreach ($kontak as $key) { ?>
|
||||
<option value="<?= $key['ID_KONTAK'] ?>"><?= $key['NAMA_KONTAK'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group borderorangeall" id="detailData" hidden="hidden">
|
||||
<h4><label class="col-md-12 control-label">
|
||||
<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>
|
||||
</label></h4>
|
||||
<br><br>
|
||||
<input type="hidden" id="nama_kontakTemp" class="form-control">
|
||||
<input type="hidden" id="id_akunTemp" class="form-control">
|
||||
<input type="hidden" id="id_posisiTemp" class="form-control">
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Nama Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="nama_kontaked" 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="64" placeholder="Nama Kontak"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Keterangan Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<textarea type="text" id="ket_kontaked" rows="3" cols="3" <?php if ($hak>=1) { ?>onchange="ubahData(4)"<?php } ?> class="form-control" autocomplete="off" data-plugin-maxlength maxlength="64" placeholder="Keterangan Kontak"></textarea>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Akun</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_akuned" <?php if ($hak>=1) { ?>onchange="ubahData(5)"<?php } ?> class="form-control populate">
|
||||
<?php if (is_array($akun) || is_object($akun)) {
|
||||
foreach ($akun as $key) { ?>
|
||||
<option value="<?= $key['ID_AKUN'] ?>" ><?= $key['NAMA_AKUN'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Telepon Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="telp_kontaked" class="form-control" <?php if ($hak>=1) { ?>onchange="ubahData(3)"<?php } ?> autocomplete="off" data-plugin-maxlength maxlength="30" placeholder="Telepon Kontak">
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:Red">Posisi</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_posisied" <?php if ($hak>=1) { ?>onchange="ubahData(6)"<?php } ?> class="form-control populate">
|
||||
<?php if (is_array($posisi) || is_object($posisi)) {
|
||||
foreach ($posisi as $key) { ?>
|
||||
<option value="<?= $key['ID_POSISI'] ?>" ><?= $key['NAMA_POSISI'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<small class="help-block"></small>
|
||||
</div>
|
||||
</div>
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Email Kontak</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<input type="text" id="email_kontaked" class="form-control" autocomplete="off" <?php if ($hak>=1) { ?>onchange="ubahData(2)"<?php } ?> data-plugin-maxlength maxlength="64" placeholder="Email Kontak">
|
||||
<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()"><strong>Hapus Data</strong> <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" onclick="setBersih()" data-parent="#accordion" <?php if ($hak>0) { ?>href="#collapseThree"<?php } ?>>
|
||||
<h4><b style="color:Indigo">[3] CETAK DATA <?php if ($hak==0) { ?><i class="fa fa-ban text-danger"></i><?php } ?></b></h4>
|
||||
</a>
|
||||
</h2>
|
||||
</header>
|
||||
<div id="collapseThree" class="accordion-body collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Akun</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_akunlap" class="form-control populate">
|
||||
<option value="" selected>Semua Akun</option>
|
||||
<?php if (is_array($akun) || is_object($akun)) {
|
||||
foreach ($akun as $key) { ?>
|
||||
<option value="<?= $key['ID_AKUN'] ?>" ><?= $key['NAMA_AKUN'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<h4><label class="col-md-2 control-label"><b style="color:DarkSlateGray">Posisi</b></label></h4>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select data-plugin-selectTwo id="id_posisilap" class="form-control populate">
|
||||
<option value="" selected>Semua Posisi</option>
|
||||
<?php if (is_array($posisi) || is_object($posisi)) {
|
||||
foreach ($posisi as $key) { ?>
|
||||
<option value="<?= $key['ID_POSISI'] ?>" ><?= $key['NAMA_POSISI'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= form_open('Menu/MD_Excel_DataKontak', array('id' => 'formmaster'), array('method' => 'MD_Excel_DataKontak')); ?>
|
||||
<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" id="id_akunfill" name="id_akunfill" class="form-control">
|
||||
<input type="hidden" id="id_posisifill" name="id_posisifill" 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>
|
||||
|
||||
<div id="modalHapus" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<?= form_open('Menu/MD_Hapus_DataKontak', array('id' => 'formmaster'), array('method' => 'MD_Hapus_DataKontak')); ?>
|
||||
<div class="modal-content">
|
||||
<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_kontakdel" id="id_kontakdel" 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"><strong>Hapus</strong> <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>
|
||||
$(document).ready(function() {
|
||||
otm();
|
||||
});
|
||||
|
||||
function otm() {
|
||||
var JEJAK1 = <?= $jejakAkun ?>;
|
||||
var JEJAK2 = <?= $jejakPosisi ?>;
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/GE_AmbilMaster_DataAkun",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.value != JEJAK1) {
|
||||
var id_akun1 = document.getElementById("id_akunnew").value;
|
||||
var id_akun2 = document.getElementById("id_akuned").value;
|
||||
var id_akun3 = document.getElementById("id_akunlap").value;
|
||||
document.getElementById("id_akunnew").value = null;
|
||||
document.getElementById("id_akuned").value = null;
|
||||
document.getElementById("id_akunlap").value = null;
|
||||
$('#id_akunnew').select2().select2('val', null);
|
||||
$('#id_akuned').select2().select2('val', null);
|
||||
$('#id_akunlap').select2().select2('val', null);
|
||||
document.getElementById("id_akunnew").innerHTML = "";
|
||||
document.getElementById("id_akuned").innerHTML = "";
|
||||
document.getElementById("id_akunlap").innerHTML = "";
|
||||
var listData = response.master;
|
||||
var isiMaster1 = document.getElementById('id_akunnew');
|
||||
isiMaster1.innerHTML = isiMaster1.innerHTML + '<option value="">Pilih Akun</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster1.innerHTML = isiMaster1.innerHTML + '<option value="' + listData[i]['ID_AKUN'] + '">' + listData[i]['NAMA_AKUN'] + '</option>';
|
||||
}
|
||||
var isiMaster2 = document.getElementById('id_akuned');
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster2.innerHTML = isiMaster2.innerHTML + '<option value="' + listData[i]['ID_AKUN'] + '">' + listData[i]['NAMA_AKUN'] + '</option>';
|
||||
}
|
||||
var isiMaster3 = document.getElementById('id_akunlap');
|
||||
isiMaster3.innerHTML = isiMaster3.innerHTML + '<option value="">Semua Akun</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster3.innerHTML = isiMaster3.innerHTML + '<option value="' + listData[i]['ID_AKUN'] + '">' + listData[i]['NAMA_AKUN'] + '</option>';
|
||||
}
|
||||
|
||||
$('#id_akunnew').val(id_akun1).trigger('change');
|
||||
$('#id_akuned').val(id_akun2).trigger('change');
|
||||
$('#id_akunlap').val(id_akun3).trigger('change');
|
||||
JEJAK1 = response.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/GE_AmbilMaster_DataPosisi",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.value != JEJAK2) {
|
||||
var id_posisi1 = document.getElementById("id_posisinew").value;
|
||||
var id_posisi2 = document.getElementById("id_posisied").value;
|
||||
var id_posisi3 = document.getElementById("id_posisilap").value;
|
||||
document.getElementById("id_posisinew").value = null;
|
||||
document.getElementById("id_posisied").value = null;
|
||||
document.getElementById("id_posisilap").value = null;
|
||||
$('#id_posisinew').select2().select2('val', null);
|
||||
$('#id_posisied').select2().select2('val', null);
|
||||
$('#id_posisilap').select2().select2('val', null);
|
||||
document.getElementById("id_posisinew").innerHTML = "";
|
||||
document.getElementById("id_posisied").innerHTML = "";
|
||||
document.getElementById("id_posisilap").innerHTML = "";
|
||||
var listData = response.master;
|
||||
var isiMaster1 = document.getElementById('id_posisinew');
|
||||
isiMaster1.innerHTML = isiMaster1.innerHTML + '<option value="">Pilih Posisi</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster1.innerHTML = isiMaster1.innerHTML + '<option value="' + listData[i]['ID_POSISI'] + '">' + listData[i]['NAMA_POSISI'] + '</option>';
|
||||
}
|
||||
var isiMaster2 = document.getElementById('id_posisied');
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster2.innerHTML = isiMaster2.innerHTML + '<option value="' + listData[i]['ID_POSISI'] + '">' + listData[i]['NAMA_POSISI'] + '</option>';
|
||||
}
|
||||
var isiMaster3 = document.getElementById('id_posisilap');
|
||||
isiMaster3.innerHTML = isiMaster3.innerHTML + '<option value="">Semua Posisi</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster3.innerHTML = isiMaster3.innerHTML + '<option value="' + listData[i]['ID_POSISI'] + '">' + listData[i]['NAMA_POSISI'] + '</option>';
|
||||
}
|
||||
|
||||
$('#id_posisinew').val(id_posisi1).trigger('change');
|
||||
$('#id_posisied').val(id_posisi2).trigger('change');
|
||||
$('#id_posisilap').val(id_posisi3).trigger('change');
|
||||
JEJAK2 = response.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function tutupTab() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function setBersih() {
|
||||
document.getElementById('detailData').style.display = 'none';
|
||||
document.getElementById("id_akunnew").value = null;
|
||||
document.getElementById("id_akuned").value = null;
|
||||
document.getElementById("id_akunlap").value = null;
|
||||
document.getElementById("id_posisinew").value = null;
|
||||
document.getElementById("id_posisied").value = null;
|
||||
document.getElementById("id_posisilap").value = null;
|
||||
document.getElementById("nama_kontaknew").value = null;
|
||||
document.getElementById("nama_kontaked").value = null;
|
||||
document.getElementById("ket_kontaknew").value = null;
|
||||
document.getElementById("ket_kontaked").value = null;
|
||||
document.getElementById("email_kontaknew").value = null;
|
||||
document.getElementById("email_kontaked").value = null;
|
||||
document.getElementById("telp_kontaknew").value = null;
|
||||
document.getElementById("telp_kontaked").value = null;
|
||||
document.getElementById("id_kontakLihat").value = null;
|
||||
$('#id_akunnew').select2().select2('val', null);
|
||||
$('#id_akuned').select2().select2('val', null);
|
||||
$('#id_akunlap').select2().select2('val', null);
|
||||
$('#id_posisinew').select2().select2('val', null);
|
||||
$('#id_posisied').select2().select2('val', null);
|
||||
$('#id_posisilap').select2().select2('val', null);
|
||||
$('#id_kontakLihat').select2().select2('val', 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_DataKontak",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_kontak : id,
|
||||
},
|
||||
success: function(response) {
|
||||
document.getElementById("id_akuned").value = response.id_akun;
|
||||
document.getElementById("id_akunTemp").value = response.id_akun;
|
||||
document.getElementById("id_posisied").value = response.id_posisi;
|
||||
document.getElementById("id_posisiTemp").value = response.id_posisi;
|
||||
document.getElementById("nama_kontaked").value = response.nama_kontak;
|
||||
document.getElementById("nama_kontakTemp").value = response.nama_kontak;
|
||||
document.getElementById("email_kontaked").value = response.email_kontak;
|
||||
document.getElementById("telp_kontaked").value = response.telp_kontak;
|
||||
document.getElementById("ket_kontaked").value = response.ket_kontak;
|
||||
$('#id_akuned').select2().select2('val', response.id_akun);
|
||||
$('#id_posisied').select2().select2('val', response.id_posisi);
|
||||
if (hak==1) {
|
||||
document.getElementById("nama_kontaked").disabled = true;
|
||||
document.getElementById("telp_kontaked").disabled = true;
|
||||
document.getElementById("id_akuned").disabled = true;
|
||||
document.getElementById("id_posisied").disabled = true;
|
||||
document.getElementById("email_kontaked").disabled = true;
|
||||
document.getElementById("ket_kontaked").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_kontak = document.getElementById("nama_kontaknew").value;
|
||||
var email_kontak = document.getElementById("email_kontaknew").value;
|
||||
var telp_kontak = document.getElementById("telp_kontaknew").value;
|
||||
var ket_kontak = document.getElementById("ket_kontaknew").value;
|
||||
var id_akun = document.getElementById("id_akunnew").value;
|
||||
var id_posisi = document.getElementById("id_posisinew").value;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (nama_kontak=="") {
|
||||
notify("nama_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (id_akun=="") {
|
||||
notify("akunid_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (id_posisi=="") {
|
||||
notify("posisiid_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status==0) {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/MD_Tambah_DataKontak",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
nama_kontak : nama_kontak,
|
||||
telp_kontak : telp_kontak,
|
||||
email_kontak : email_kontak,
|
||||
ket_kontak : ket_kontak,
|
||||
id_akun : id_akun,
|
||||
id_posisi : id_posisi,
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_add");
|
||||
delayReload(1000,"<?= base_url() ?>index.php/Menu/MD_MasterKontak/");
|
||||
} else if (response.value==2) {
|
||||
notify("kontak_same");
|
||||
document.getElementById("nama_kontaknew").value = null;
|
||||
document.getElementById("id_akunnew").value = null;
|
||||
document.getElementById("id_posisinew").value = null;
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setBersih();
|
||||
}
|
||||
|
||||
function ubahData(menu) {
|
||||
//1. Ganti Nama Kontak
|
||||
//2. Ganti Email Kontak
|
||||
//3. Ganti Telepon Kontak
|
||||
//4. Ganti Keterangan Kontak
|
||||
//5. Ganti Akun
|
||||
//6. Ganti Posisi
|
||||
|
||||
var id_kontak = document.getElementById("id_kontakLihat").value;
|
||||
var id_akun = document.getElementById("id_akuned").value;
|
||||
var id_akunTemp = document.getElementById("id_akunTemp").value;
|
||||
var id_posisi = document.getElementById("id_posisied").value;
|
||||
var id_posisiTemp = document.getElementById("id_posisiTemp").value;
|
||||
var nama_kontak = document.getElementById("nama_kontaked").value;
|
||||
var nama_kontakTemp = document.getElementById("nama_kontakTemp").value;
|
||||
var email_kontak = document.getElementById("email_kontaked").value;
|
||||
var telp_kontak = document.getElementById("telp_kontaked").value;
|
||||
var ket_kontak = document.getElementById("ket_kontaked").value;
|
||||
var status = 0;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (id_kontak!="") {
|
||||
if (nama_kontak.length==0) {
|
||||
notify("datainput_null");
|
||||
document.getElementById("nama_kontaked").value = nama_kontakTemp;
|
||||
status++;
|
||||
}
|
||||
}
|
||||
|
||||
if (id_akun=="") {
|
||||
status++;
|
||||
}
|
||||
|
||||
if (id_posisi=="") {
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status==0) {
|
||||
$.ajax({
|
||||
url: "<?= base_url() ?>index.php/Menu/MD_Ubah_DataKontak",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_kontak : id_kontak,
|
||||
id_akun : id_akun,
|
||||
id_posisi : id_posisi,
|
||||
nama_kontak : nama_kontak,
|
||||
email_kontak : email_kontak,
|
||||
telp_kontak : telp_kontak,
|
||||
ket_kontak : ket_kontak,
|
||||
menu : menu,
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_ed");
|
||||
|
||||
document.getElementById("id_kontakLihat").value = null;
|
||||
$('#id_kontakLihat').select2().select2('val', null);
|
||||
document.getElementById("id_kontakLihat").innerHTML = "";
|
||||
var listData = response.kontak;
|
||||
var isiMaster = document.getElementById('id_kontakLihat');
|
||||
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="">Pilih Kontak/Reset</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="' + listData[i]['ID_KONTAK'] + '">' + listData[i]['NAMA_KONTAK'] + '</option>';
|
||||
}
|
||||
$('#id_kontakLihat').val(id_kontak).trigger('change');
|
||||
} else if (response.value==2) {
|
||||
notify("kontak_same");
|
||||
document.getElementById("nama_kontaked").value = nama_kontakTemp;
|
||||
document.getElementById("id_akuned").value = id_akunTemp;
|
||||
document.getElementById("id_posisied").value = id_posisiTemp;
|
||||
$('#id_akuned').select2().select2('val', id_akunTemp);
|
||||
$('#id_posisied').select2().select2('val', id_posisiTemp);
|
||||
} else if (response.value==3) {
|
||||
notify("latest");
|
||||
delayReload(1000,"<?= base_url() ?>index.php/Menu/MD_MasterKontak/");
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hapusData() {
|
||||
PNotify.removeAll();
|
||||
document.getElementById("id_kontakdel").value = document.getElementById("id_kontakLihat").value;
|
||||
}
|
||||
|
||||
function isiData() {
|
||||
document.getElementById("id_akunfill").value = document.getElementById("id_akunlap").value;
|
||||
document.getElementById("id_posisifill").value = document.getElementById("id_posisilap").value;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user