415 lines
17 KiB
PHP
415 lines
17 KiB
PHP
<!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">
|
|
<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><b>Master Pihak Ke3 | Mode : [<b style="color:PowderBlue"><i><?=$akses?></i></b>]</b></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 -->
|
|
<section class="panel panel-featured panel-featured-dark">
|
|
<header class="panel-heading">
|
|
<div class="panel-actions">
|
|
<a onclick="closeTab()" class="text-dark"><strong class="text-dark">Tutup </strong><i class="fa fa-times"></i></a>
|
|
</div>
|
|
<h2 class="panel-title">
|
|
<strong style="color:Teal">DATA PIHAKKE3</strong><?php if($hak==2) { ?><br><i style="color:DarkOrange">Note : [Tombol Kuning untuk Ubah Data]</i><br>
|
|
<i class="text-danger">Note : [Tombol Merah untuk Hapus Data]</i><?php } ?>
|
|
</h2>
|
|
</header>
|
|
<div class="panel-body">
|
|
<?php if ($hak==2) { ?>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="mb-md">
|
|
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal-tambah"><strong>Tambah Data</strong> <i class="fa fa-plus"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
<table class="table table-bordered table-striped mb-none" id="datatable-default">
|
|
<thead>
|
|
<?php if ($hak==2) { ?>
|
|
<th class="center dark">No</th>
|
|
<th class="dark">Nama Pihak Ke3</th>
|
|
<th class="dark">Alamat</th>
|
|
<th class="dark">Kota</th>
|
|
<th class="dark">Nomor Telepon</th>
|
|
<th class="center dark">PILIHAN</th>
|
|
<?php } else { ?>
|
|
<th class="center dark">No</th>
|
|
<th class="dark">Nama Pihak Ke3</th>
|
|
<th class="dark">Alamat</th>
|
|
<th class="dark">Kota</th>
|
|
<th class="dark">Nomor Telepon</th>
|
|
<?php } ?>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
if (is_array($pihakke3) || is_object($pihakke3)) {
|
|
$no = 1;
|
|
foreach ($pihakke3 as $key) { ?>
|
|
<tr>
|
|
<td class="center"><?= $no; ?></td>
|
|
<?php if ($key['LOCK']==1) { ?>
|
|
<td><?= $key['NAMA_PIHAKKE3']; ?> <i style="color:FireBrick">(Terpakai)</i></td>
|
|
<?php } else { ?>
|
|
<td><?= $key['NAMA_PIHAKKE3']; ?></td>
|
|
<?php } ?>
|
|
<td><?= $key['ALAMAT_PIHAKKE3']; ?></td>
|
|
<td><?= $key['NAMA_KOTA']; ?></td>
|
|
<td><?= $key['TELP_PIHAKKE3']; ?></td>
|
|
<?php if ($hak==2) { ?>
|
|
<td class="actions center">
|
|
<button type="button" onclick="ubahData('<?= $key['ID_PIHAKKE3']; ?>','<?= $key['NAMA_PIHAKKE3']; ?>','<?= $key['ALAMAT_PIHAKKE3']; ?>','<?= $key['TELP_PIHAKKE3']; ?>','<?= $key['KOTA_ID']; ?>')" class="btn btn-xs btn-warning" data-toggle="modal" data-target="#modal-ubah"><i class="fa fa-pencil"></i></button>
|
|
<?php if ($key['LOCK']==1) { ?>
|
|
<button disabled type="button" onclick="hapusData('<?= $key['ID_PIHAKKE3']; ?>')" class="btn btn-xs btn-danger" data-toggle="modal" data-target="#modal-hapus"><i class="fa fa-trash-o"></i></button>
|
|
<?php } else { ?>
|
|
<button type="button" onclick="hapusData('<?= $key['ID_PIHAKKE3']; ?>')" class="btn btn-xs btn-danger" data-toggle="modal" data-target="#modal-hapus"><i class="fa fa-trash-o"></i></button>
|
|
<?php } ?>
|
|
</td>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php $no++;
|
|
}
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<!-- end: page -->
|
|
</section>
|
|
|
|
<!-- Modal Tambah -->
|
|
<div class="modal fade" id="modal-tambah">
|
|
<?= form_open('ManagePihakKe3/simpan', array('id' => 'formpihakke3'), array('method' => 'add')); ?>
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<header class="panel-heading">
|
|
<h4 class="panel-title"><strong>Tambah Data </strong><b class="text-danger">[Warna Merah harus diisi]</b></h4>
|
|
</header>
|
|
<div class="modal-body ">
|
|
|
|
<div class="form-group">
|
|
<label class="col-md-2 control-label"><strong class="text-danger">Kota</strong></label>
|
|
<div class="col-md-10">
|
|
<select data-plugin-selectTwo name="id_kota" id="ID_KOTA" class="form-control populate" required>
|
|
<option value="" selected>Pilih Nama Kota</option>
|
|
<?php if (is_array($kota) || is_object($kota)) {
|
|
foreach ($kota as $key) { ?>
|
|
<option value="<?= $key['ID_KOTA'] ?>" ><?= $key['NAMA_KOTA'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">Nama</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="nama_pihakke3" id="NAMA_PIHAKKE3" class="form-control" autocomplete="off" placeholder="Nama Pihakke3" data-plugin-maxlength maxlength="50" required>
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong>Alamat</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="alamat_pihakke3" id="ALAMAT_PIHAKKE3" class="form-control" autocomplete="off" placeholder="Alamat" data-plugin-maxlength maxlength="50">
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">Telp</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="telp_pihakke3" id="TELP_PIHAKKE3" class="form-control" autocomplete="off" placeholder="Nomor Telepon" data-plugin-maxlength maxlength="30" required>
|
|
<small class="help-block"></small>
|
|
</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-success"><strong>Tambah</strong> <i class="fa fa-plus"></i></button>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
<?= form_close(); ?>
|
|
</div>
|
|
|
|
<!-- Modal Ubah -->
|
|
<div class="modal fade" id="modal-ubah">
|
|
<?= form_open('ManagePihakKe3/ubah', array('id' => 'formpihakke3'), array('method' => 'ubah')); ?>
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<header class="panel-heading">
|
|
<h4 class="panel-title"><strong>Ubah Data </strong><b class="text-danger">[Warna Merah harus diisi]</b></h4>
|
|
</header>
|
|
<div class="modal-body ">
|
|
|
|
<div class="form-group">
|
|
<input type="hidden" name="id_pihakke3ed" id="id_pihakke3ed" class="form-control">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">Kota</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<select data-plugin-selectTwo name="id_kotaed" id="id_kotaed" class="form-control populate" required>
|
|
<?php if (is_array($kota) || is_object($kota)) {
|
|
foreach ($kota as $key) { ?>
|
|
<option value="<?= $key['ID_KOTA'] ?>"><?= $key['NAMA_KOTA'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">Nama</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="nama_pihakke3ed" id="nama_pihakke3ed" class="form-control" autocomplete="off" placeholder="Nama Pihakke3" data-plugin-maxlength maxlength="50" required>
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong>Alamat</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="alamat_pihakke3ed" id="alamat_pihakke3ed" class="form-control" placeholder="Alamat" data-plugin-maxlength maxlength="50" autocomplete="off">
|
|
<small class="help-block"></small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">Telp</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<input type="text" name="telp_pihakke3ed" id="telp_pihakke3ed" class="form-control" autocomplete="off" placeholder="Nomor Telepon" data-plugin-maxlength maxlength="30">
|
|
<small class="help-block"></small>
|
|
</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-warning"><strong>Ubah </strong><i class="fa fa-pencil"></i></button>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
<?= form_close(); ?>
|
|
</div>
|
|
|
|
<!-- Modal Hapus -->
|
|
<div id="modal-hapus" class="modal fade" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<?= form_open('ManagePihakKe3/hapus', array('id' => 'formpihakke3hapus'), array('method' => 'hapus')); ?>
|
|
<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_pihakke3del" id="id_pihakke3del" 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" onclick="DisableButton(this);"><strong>Hapus</strong> <i class="fa fa-trash-o"></i></button>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
<?= form_close(); ?>
|
|
</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/jquery-ui/js/jquery-ui-1.10.4.custom.js"></script>
|
|
<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>
|
|
<script src="<?php echo base_url('') ?>assets/vendor/bootstrap-maxlength/bootstrap-maxlength.js"></script>
|
|
<!-- Specific Page Vendor -->
|
|
<script src="<?php echo base_url('') ?>assets/vendor/pnotify/pnotify.custom.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/forms/examples.advanced.form.js"></script>
|
|
|
|
<!-- notif -->
|
|
<?php $this->load->view('template/notification'); ?>
|
|
<script>
|
|
$(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('data_used')) { ?>
|
|
new PNotify({
|
|
title: 'Notifikasi',
|
|
text: 'Data terpakai, tidak bisa diproses',
|
|
type: 'error',
|
|
shadow: true
|
|
});
|
|
<?php } ?>
|
|
});
|
|
|
|
function closeTab() {
|
|
window.close();
|
|
}
|
|
|
|
function ubahData(id_pihakke3, nama_pihakke3, alamat_pihakke3, telp_pihakke3, id_kota) {
|
|
document.getElementById("id_pihakke3ed").value = id_pihakke3;
|
|
document.getElementById("nama_pihakke3ed").value = nama_pihakke3;
|
|
document.getElementById("alamat_pihakke3ed").value = alamat_pihakke3;
|
|
document.getElementById("telp_pihakke3ed").value = telp_pihakke3;
|
|
document.getElementById("id_kotaed").value = id_kota;
|
|
$('#id_kotaed').select2().select2('val', id_kota);
|
|
}
|
|
|
|
function hapusData(id_pihakke3) {
|
|
document.getElementById("id_pihakke3del").value = id_pihakke3;
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|