605 lines
24 KiB
PHP
605 lines
24 KiB
PHP
<!doctype html>
|
|
<html class="fixed sidebar-left-collapsed">
|
|
|
|
<head>
|
|
|
|
<!-- Basic -->
|
|
<meta charset="UTF-8">
|
|
|
|
<title>MENU PROYEK</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;
|
|
}
|
|
|
|
.solid {
|
|
border-top-style: solid;
|
|
border-left-style: solid;
|
|
border-bottom-style: solid;
|
|
border-right-style: solid;
|
|
border-width: 5px;
|
|
border-color: khaki;
|
|
}
|
|
|
|
.solidpro {
|
|
border-top-style: solid;
|
|
border-left-style: solid;
|
|
border-bottom-style: solid;
|
|
border-right-style: solid;
|
|
border-width: 5px;
|
|
border-color: darkolivegreen;
|
|
}
|
|
|
|
div.f13 {
|
|
font-size: 13px;
|
|
}
|
|
|
|
div.f14 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
div.f15 {
|
|
font-size: 15px;
|
|
}
|
|
|
|
.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
|
|
$jabatan = $this->session->userdata('jabatan');
|
|
$level = $this->session->userdata('level');
|
|
$nama_panggilan = $this->session->userdata('nama_panggilan');
|
|
$id_karyawan = $this->session->userdata('id_karyawan');
|
|
$tgl_now = date('d/m/Y');
|
|
|
|
$datShm = $this->Amod->getData_SetHakMenu_byKARYAWAN_byKODE_byNAMA($id_karyawan, "PR", "TRANSAKSI - Administrasi");
|
|
if ($datShm==FALSE) {
|
|
$hak = 0;
|
|
$tampil = "TIDAK BERHAK";
|
|
} else {
|
|
$hak = $datShm[0]['AKSES_ID'];
|
|
$tampil = $datShm[0]['NAMA_AKSES'];
|
|
}
|
|
if ($status_rq!=1) {
|
|
$hak = 0;
|
|
} else {
|
|
|
|
}
|
|
?>
|
|
|
|
<header class="page-header">
|
|
<h2><b>Data Rekap Kuartal | Sales : <b style="color:Yellow">[<?=$sales?>]</b></b></h2>
|
|
|
|
<div class="right-wrapper pull-right">
|
|
<ol class="breadcrumbs">
|
|
<li><span><strong style="color:Gold">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-warning">
|
|
<header class="panel-heading">
|
|
<div class="panel-actions">
|
|
<a href="<?php echo base_url('') ?>index.php/Menu/PR_Sub1_Administrasi_1" class="text-dark"><strong>Kembali</strong><i class="fa fa-backward"></i></a>
|
|
</div>
|
|
<h2 class="panel-title"><b style="color:Coral">REKAP KUARTAL | <b style="color:Black"><?=$nama_pku?> <i style="color:DarkCyan">[<?=$awal?> s.d <?=$akhir?>]</i></b></b></h2>
|
|
</header>
|
|
<div class="panel-body">
|
|
<h4><b style="color:SlateGray"><b style="color:Red"><?=$countLapor?></b> dari <b style="color:Blue"><?=$countProyekAll?></b> Proyek Sudah Dilaporkan</b></h4>
|
|
<?php if ($hak>1) { ?>
|
|
<button type="button" class="btn btn-dark" data-toggle="modal" data-target="#modalProses"><strong>Proses Data</strong> <i class="fa fa-arrow-down"></i></button>
|
|
<?php } ?>
|
|
<table class="table table-bordered table-striped mb-none" id="table1">
|
|
<thead>
|
|
<th class="center default">No</th>
|
|
<th width="180px" class="default">Kode</th>
|
|
<th class="default">Pelanggan</th>
|
|
<th class="default">Nama Proyek</th>
|
|
<th class="center">Detail SO</th>
|
|
<?php if ($hak>1) { ?>
|
|
<th class="center default">Input Biaya</th>
|
|
<?php } ?>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
if (is_array($proyek) || is_object($proyek)) {
|
|
$no = 1;
|
|
foreach ($proyek as $key) { ?>
|
|
<tr>
|
|
<?php
|
|
$diffawal = new DateTime($key['TGL_PROYEK']);
|
|
$diffakhir = new DateTime($key['TGL_KUNCI']);
|
|
$diff = date_diff($diffawal, $diffakhir);
|
|
$diff = $diff->format("%a");
|
|
|
|
if (strtotime($key['TEMPO_PROYEK'])<strtotime($key['TGL_KUNCI'])) {
|
|
$jt = 1;
|
|
} else {
|
|
$jt = 0;
|
|
}
|
|
?>
|
|
<td class="center"><?= $no; ?></td>
|
|
<td><b style="color:DarkViolet"><?= $key['KODE_PROYEK']; ?></b><br><i>(<?= $key['TANGGAL']; ?>)</i><br><b style="color:DarkGreen">Nilai : <?= $key['NILAI']; ?></b></td>
|
|
<?php if ($key['TYPE_PELANGGAN']=="0") { ?>
|
|
<td><b class="text-primary">Corporate</b> : <b style="color:FireBrick">[<?= $key['NAMA_PANGGILAN_KARYAWAN']; ?>]</b><br><?= $key['NAMA_PELANGGAN'] ?><br><i>(<?= $key['NAMA_KOTA'] ?>)</i></td>
|
|
<?php } else if ($key['TYPE_PELANGGAN']=="1") { ?>
|
|
<td><b class="text-success">Dealer</b> : <b style="color:FireBrick">[<?= $key['NAMA_PANGGILAN_KARYAWAN']; ?>]</b><br><?= $key['NAMA_PELANGGAN'] ?><br><i>(<?= $key['NAMA_KOTA'] ?>)</i></td>
|
|
<?php } else if ($key['TYPE_PELANGGAN']=="2") { ?>
|
|
<td><b style="color:DarkOrange">User</b> : <b style="color:FireBrick">[<?= $key['NAMA_PANGGILAN_KARYAWAN']; ?>]</b><br><?= $key['NAMA_PELANGGAN'] ?><br><i>(<?= $key['NAMA_KOTA'] ?>)</i></td>
|
|
<?php } ?>
|
|
<td><b style="color:Tomato"><i><?= $key['PO_PROYEK']; ?></i></b><br><b style="color:Teal">Selesai : [<?=$key['TGLKUNCI']?>]</b><br><b style="color:Navy">Tempo : [<?=$key['TEMPO']?>]</b><?php if ($jt==1) { ?> <b style="color:Teal">*Lebih dari Tempo*</b> <?php } ?><br><b style="color:SaddleBrown">Berjalan : <?=$diff?> Hari</b></td>
|
|
<td>
|
|
<?php
|
|
$nospr = 1;
|
|
foreach ($key['SPR'] as $dat) { ?>
|
|
<?= $nospr++; ?>. <?= $dat['LUNAS']; ?> <b style="color:Blue"><?= $dat['KODE_SO']; ?></b> | <b style="color:DarkRed"><?= $dat['NILAI']; ?></b><?php if ($dat['PO_SO']!="") { ?> | <b style="color:Green"><?= $dat['PO_SO']; ?> </b><?php } ?><?php if ($hak>1) { ?> |
|
|
<span data-toggle="modal" data-target="#modalUbah"><a onclick="ubahData('<?=$dat['ID_SPR']?>','<?=$dat['SO_ID']?>')" title="" data-toggle="tooltip" data-trigger="hover" data-original-title="Tombol untuk Ubah Data"><i class="fa fa-pencil text-warning"></i></a></span>
|
|
<span data-toggle="modal" data-target="#modalHapus"><a onclick="hapusData('<?=$dat['ID_SPR']?>')" title="" data-toggle="tooltip" data-trigger="hover" data-original-title="Tombol untuk Hapus Data"><i class="fa fa-times text-danger"></i></a></span><?php } ?><br>
|
|
<?php } ?>
|
|
</td>
|
|
<?php if ($hak>1) { ?>
|
|
<td class="actions center">
|
|
<?php if ($jt==1) { ?>
|
|
<span data-toggle="modal" data-target="#modalIsi"><button type="button" title="" data-toggle="tooltip" data-trigger="hover" data-original-title="Tombol untuk Isi Biaya Proyek" onclick="isiData('<?= $key['ID_PROYEK']; ?>')" class="btn btn-xs btn-warning"><i class="fa fa-reorder"></i></button></span>
|
|
<?php } ?>
|
|
</td>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php $no++;
|
|
}
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<!-- end: page -->
|
|
</section>
|
|
</div>
|
|
</section>
|
|
|
|
<div id="modalUbah" class="modal fade" tabindex="-1" role="dialog">
|
|
<?= form_open('Menu/PR_Ubah_Sub1_C3_DataSoProyek', array('id' => 'formproyek'), array('method' => 'PR_Ubah_Sub1_C3_DataSoProyek')); ?>
|
|
<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_spred" id="id_spred" class="form-control">
|
|
<input type="hidden" name="id_rqed" id="id_rqed" value="<?=$id_rq?>" class="form-control">
|
|
<div class="col-md-2">
|
|
<label><strong class="text-danger">SO Pengganti</strong></label>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<select disabled data-plugin-selectTwo name="id_soed" id="id_soed" class="form-control populate" required></select>
|
|
<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>
|
|
<?= form_close(); ?>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
</div>
|
|
|
|
<div id="modalHapus" class="modal fade">
|
|
<div class="modal-dialog">
|
|
<?= form_open('Menu/PR_Hapus_Sub1_C3_DataSoProyek', array('id' => 'formproyek'), array('method' => 'PR_Hapus_Sub1_C3_DataSoProyek')); ?>
|
|
<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_rqdel" id="id_rqdel" value="<?=$id_rq?>" class="form-control">
|
|
<input type="hidden" name="id_sprdel" id="id_sprdel" 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-times"></i></button>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
<?= form_close(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="modalIsi" class="modal fade ui-front" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static">
|
|
<div class="modal-dialog modal-lg" style="width:85%">
|
|
<header class="panel-heading">
|
|
<h2 class="panel-title"><b>Isi Data | <b id="kodeProyek" style="color:Green"></b></b><br><a style="color:DarkOrchid" data-dismiss="modal" onclick="resetIntervalAll()"><u style="color:DarkOrchid"><b>Klik untuk Keluar dari Menu</b> <i class="fa fa-times"></i></u></a></h2>
|
|
</header>
|
|
<div class="panel-body">
|
|
<div class="modal-wrapper">
|
|
<div class="modal-text">
|
|
<div class="row form-bordered">
|
|
<div class="form-group">
|
|
<div class="col-md-4">
|
|
<section class="form-group-vertical">
|
|
<input type="hidden" id="id_proyekin" class="form-control" value="">
|
|
<input type="hidden" id="id_bpryin" class="form-control" value="">
|
|
<input type="hidden" id="posisiin" class="form-control" value="">
|
|
<input type="text" autocomplete="off" class="form-control" name="nama_bprynew" id="nama_bprynew" placeholder="Nama Pembiayaan" required>
|
|
<input type="decimal" autocomplete="off" class="form-control" name="nilai_bprynew" id="nilai_bprynew" placeholder="Nilai Biaya" required>
|
|
<element id="submitSimpan"><button type="submit" onclick="simpanBpry();" class="btn btn-success"><strong>Simpan Data</strong> <i class="fa fa-flash"></i></button></element>
|
|
<element hidden="hidden" id="submitUbah"><button type="submit" onclick="ubahBpry();" class="btn btn-warning"><strong>Ubah Data</strong> <i class="fa fa-flash"></i></button></element>
|
|
</section>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<table class="table table-bordered table-striped mb-none">
|
|
<thead>
|
|
<th class="center default">No</th>
|
|
<th class="default">Nama</th>
|
|
<th class="text-right">Nilai</th>
|
|
<th class="center default">PILIHAN</th>
|
|
</thead>
|
|
<tbody id="isiTabelBpry"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="modalProses" class="modal fade">
|
|
<div class="modal-dialog">
|
|
<?= form_open('Menu/PR_Proses_Sub1_C3_DataRekapKuartal', array('id' => 'formproyek'), array('method' => 'PR_Proses_Sub1_C3_DataRekapKuartal')); ?>
|
|
<div class="modal-content">
|
|
<header class="panel-heading">
|
|
<h2 class="panel-title"><strong>Proses Data</strong></h2>
|
|
</header>
|
|
<div class="panel-body">
|
|
<div class="modal-wrapper">
|
|
<div class="modal-text">
|
|
<input type="hidden" name="id_rqpro" id="id_rqpro" value="<?=$id_rq?>" class="form-control">
|
|
<h4>Apakah ingin proses 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-dark"><strong>Proses</strong> <i class="fa fa-arrow-down"></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>
|
|
$('#table1').dataTable( {
|
|
"paging": false
|
|
} );
|
|
|
|
function ubahData(id_spr, id_so) {
|
|
document.getElementById("id_spred").value = id_spr;
|
|
document.getElementById("id_soed").disabled = true;
|
|
document.getElementById("id_soed").value = null;
|
|
$('#id_soed').select2().select2('val', null);
|
|
document.getElementById("id_soed").innerHTML = "";
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: {
|
|
id_so : id_so
|
|
},
|
|
url: '<?= base_url('') ?>index.php/Menu/PR_Ambil_Sub1_DataSoProyek',
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
var listData = response.data;
|
|
var isiMaster = document.getElementById('id_soed');
|
|
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="" selected>Pilih So Pengganti</option>';
|
|
for (var i = 0; i < listData.length; i++) {
|
|
if (listData[i]['PO_SO']=="") {
|
|
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="' + listData[i]['ID_SO'] + '">' + listData[i]['KODE_SO'] + ' | ' + listData[i]['TANGGAL'] + ' | ' + listData[i]['NILAI'] + '</option>';
|
|
} else {
|
|
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="' + listData[i]['ID_SO'] + '">' + listData[i]['KODE_SO'] + ' | ' + listData[i]['TANGGAL'] + ' | ' + listData[i]['NILAI'] + ' [' + listData[i]['PO_SO'] + ']</option>';
|
|
}
|
|
}
|
|
$('#id_soed').val(null).trigger('change');
|
|
document.getElementById("id_soed").disabled = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
function hapusData(id_spr) {
|
|
document.getElementById("id_sprdel").value = id_spr;
|
|
}
|
|
|
|
function isiData(id) {
|
|
PNotify.removeAll();
|
|
$("#id_proyekin").val(id);
|
|
tampilkanData(id);
|
|
}
|
|
|
|
function tampilkanData(id) {
|
|
var hak = <?=$hak?>;
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: {
|
|
id_proyek : id,
|
|
},
|
|
url: '<?= base_url('') ?>index.php/Menu/PR_Ambil_Sub1_DataBiayaProyek',
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
var baris = '';
|
|
JUMLAHBPRY = response.total;
|
|
|
|
for (var i = 1; i <= JUMLAHBPRY; i++) {
|
|
var id_bpry = response.data[i - 1]['ID_BPRY'];
|
|
var nama = response.data[i - 1]['NAMA_BPRY'];
|
|
var nilai = response.data[i - 1]['NILAI'];
|
|
var nilai_bpry = response.data[i - 1]['NILAI_BPRY'];
|
|
|
|
baris += '<tr>';
|
|
baris += '<td class="center" style="vertical-align: middle;" >' + i + ' <element id="tampilkanIconCek' + i + '" hidden="hidden"><i class="fa fa-check" style="color:Green"></i></element></td>';
|
|
baris += '<td class="text-left" style="vertical-align: middle;"><b style="color:Blue">' + nama + '</b></td>';
|
|
baris += '<td class="text-right" style="vertical-align: middle;"><b style="color:FireBrick">' + nilai + '</b></td>';
|
|
if (i==response.total && hak==1) {
|
|
baris += '<td class="action center" style="vertical-align: middle;"><element id="tampilkanIconBan' + i + '" hidden="hidden"><button type="button" class="btn btn-xs btn-default text-danger" onclick="batalUbah(' + i + ')"><i class="fa fa-ban"></i></button></element><element id="ubahIcon' + i + '"><button type="button" onclick="ubahBpryData(' + id_bpry + ',' + i + ',' + nilai_bpry + ',`' + nama + '`)" class="btn btn-xs btn-warning"><i class="fa fa-pencil"></i></button> <button type="button" onclick="hapusBpry(' + id_bpry + ',' + id + ')" class="btn btn-xs btn-danger"><i class="fa fa-times"></i></button></element></td>';
|
|
} else {
|
|
baris += '<td></td>';
|
|
}
|
|
baris += '</tr>';
|
|
}
|
|
$('#isiTabelBpry').html(baris);
|
|
$('#kodeProyek').html(response.kodeProyek);
|
|
}
|
|
});
|
|
}
|
|
|
|
function resetIntervalAll() {
|
|
location.reload();
|
|
}
|
|
|
|
function simpanBpry() {
|
|
var id_rq = <?=$id_rq?>;
|
|
var id_proyek = document.getElementById("id_proyekin").value;
|
|
var nama_bpry = document.getElementById("nama_bprynew").value;
|
|
var nilai_bpry = document.getElementById("nilai_bprynew").value;
|
|
var status = 0;
|
|
|
|
PNotify.removeAll();
|
|
|
|
if (nama_bpry=="") {
|
|
notify("nama_null");
|
|
status++;
|
|
}
|
|
|
|
if (nilai_bpry=="") {
|
|
notify("biaya_null");
|
|
status++;
|
|
}
|
|
|
|
if (status == 0) {
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: {
|
|
id_proyek : id_proyek,
|
|
nama_bpry : nama_bpry,
|
|
nilai_bpry : nilai_bpry
|
|
},
|
|
url: '<?= base_url('') ?>index.php/Menu/PR_Simpan_Sub1_C3_DataBiayaProyek',
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
if (response.value == 2) {
|
|
notify("latest");
|
|
delayReload(1000,"<?= base_url() ?>index.php/Menu/PR_Sub1_Administrasi_3/"+id_rq);
|
|
} else if (response.value == 1) {
|
|
notify("success_add");
|
|
} else if (response.value == 0) {
|
|
notify("failed");
|
|
}
|
|
document.getElementById("nama_bprynew").value = null;
|
|
document.getElementById("nilai_bprynew").value = null;
|
|
tampilkanData(id_proyek);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function ubahBpryData(id_bpry, posisi, nilai_bpry, nama_bpry) {
|
|
$("#id_bpryin").val(id_bpry);
|
|
$("#posisiin").val(posisi);
|
|
document.getElementById("ubahIcon" + posisi).style.display = 'none';
|
|
document.getElementById("tampilkanIconCek" + posisi).style.display = 'block';
|
|
document.getElementById("tampilkanIconBan" + posisi).style.display = 'block';
|
|
document.getElementById("submitSimpan").style.display = 'none';
|
|
document.getElementById("submitUbah").style.display = 'block';
|
|
|
|
document.getElementById("nilai_bprynew").value = nilai_bpry;
|
|
document.getElementById("nama_bprynew").value = nama_bpry;
|
|
}
|
|
|
|
function ubahBpry() {
|
|
var id_rq = <?=$id_rq?>;
|
|
var id_proyek = document.getElementById("id_proyekin").value;
|
|
var id_bpry = document.getElementById("id_bpryin").value;
|
|
var posisi = document.getElementById("posisiin").value;
|
|
var nama_bpry = document.getElementById("nama_bprynew").value;
|
|
var nilai_bpry = document.getElementById("nilai_bprynew").value;
|
|
var status = 0;
|
|
|
|
PNotify.removeAll();
|
|
|
|
if (nama_bpry=="") {
|
|
notify("nama_null");
|
|
status++;
|
|
}
|
|
|
|
if (nilai_bpry=="") {
|
|
notify("biaya_null");
|
|
status++;
|
|
}
|
|
|
|
if (status == 0) {
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: {
|
|
id_proyek : id_proyek,
|
|
id_bpry : id_bpry,
|
|
nama_bpry : nama_bpry,
|
|
nilai_bpry : nilai_bpry,
|
|
},
|
|
url: '<?= base_url('') ?>index.php/Menu/PR_Ubah_Sub1_C3_DataBiayaProyek',
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
if (response.value == 3 || response.value == 2) {
|
|
notify("latest");
|
|
delayReload(1000,"<?= base_url() ?>index.php/Menu/PR_Sub1_Administrasi_3/"+id_rq);
|
|
} else if (response.value == 1) {
|
|
notify("success_ed");
|
|
} else if (response.value == 0) {
|
|
notify("failed");
|
|
}
|
|
|
|
document.getElementById("ubahIcon" + posisi).style.display = 'block';
|
|
document.getElementById("tampilkanIconCek" + posisi).style.display = 'none';
|
|
document.getElementById("tampilkanIconBan" + posisi).style.display = 'none';
|
|
document.getElementById("submitSimpan").style.display = 'block';
|
|
document.getElementById("submitUbah").style.display = 'none';
|
|
|
|
document.getElementById("nama_bprynew").value = null;
|
|
document.getElementById("nilai_bprynew").value = null;
|
|
|
|
tampilkanData(id_proyek);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function hapusBpry(id_bpry, id_proyek) {
|
|
var id_rq = <?=$id_rq?>;
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: {
|
|
id_bpry : id_bpry,
|
|
id_proyek : id_proyek,
|
|
},
|
|
url: '<?= base_url('') ?>index.php/Menu/PR_Hapus_Sub1_C3_DataBiayaProyek',
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
PNotify.removeAll();
|
|
if (response.value==1) {
|
|
notify("success_del");
|
|
} else if (response.value==2 || response.value==3) {
|
|
notify("latest");
|
|
delayReload(1000,"<?= base_url() ?>index.php/Menu/PR_Sub1_Administrasi_3/"+id_rq);
|
|
} else if (response.value==0) {
|
|
notify("failed");
|
|
}
|
|
|
|
document.getElementById("nama_bprynew").value = null;
|
|
document.getElementById("nilai_bprynew").value = null;
|
|
|
|
tampilkanData(id_proyek);
|
|
}
|
|
});
|
|
}
|
|
|
|
function batalUbah(posisi) {
|
|
document.getElementById("ubahIcon" + posisi).style.display = 'block';
|
|
document.getElementById("tampilkanIconCek" + posisi).style.display = 'none';
|
|
document.getElementById("tampilkanIconBan" + posisi).style.display = 'none';
|
|
document.getElementById("submitSimpan").style.display = 'block';
|
|
document.getElementById("submitUbah").style.display = 'none';
|
|
|
|
document.getElementById("nama_bprynew").value = null;
|
|
document.getElementById("nilai_bprynew").value = null;
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|