copy dari repo om Irfan
This commit is contained in:
@@ -0,0 +1,677 @@
|
||||
<!doctype html>
|
||||
<html class="fixed sidebar-left-collapsed">
|
||||
|
||||
<head>
|
||||
|
||||
<!-- Basic -->
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>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">
|
||||
|
||||
<header class="page-header">
|
||||
<h2><b>(Step 3) | Rekap Proyek | <b style="color:Yellow"><?=$kode_proyek?></b> | <b style="color:Chartreuse"><?=$nama_pelanggan?></b></b></h2>
|
||||
|
||||
<div class="right-wrapper pull-right">
|
||||
<ol class="breadcrumbs">
|
||||
<li><span><b style="color:Gold">Master Data </span></b></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">
|
||||
<?php if ($verse==1) { ?>
|
||||
<a href="<?php echo base_url('') ?>index.php/Menu/PR_Sub1_SalesProyek_1" class="text-dark"><b>Kembali </b><i class="fa fa-backward"></i></a>
|
||||
<?php } else if ($verse==3) { ?>
|
||||
<a href="<?php echo base_url('') ?>index.php/Menu/PR_Sub1_Pengawasan_1" class="text-dark"><b>Kembali </b><i class="fa fa-backward"></i></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<h2 class="panel-title"><b style="color:Coral">PROYEK <?=$nama_jpp?> | <b style="color:DarkSlateGray">[<?=$po_proyek?>]</b></b></h2>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered table-striped mb-none" id="table1">
|
||||
<thead>
|
||||
<th class="center default">No</th>
|
||||
<th class="default">Nama</th>
|
||||
<th class="text-right">Biaya Tambahan</th>
|
||||
<th class="text-right">GP Terakhir</th>
|
||||
<th class="default">List Nota</th>
|
||||
<th class="center default">Input Detail</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (is_array($rp) || is_object($rp)) {
|
||||
$no = 1;
|
||||
foreach ($rp as $key) { ?>
|
||||
<tr>
|
||||
<td class="center"><?= $no; ?></td>
|
||||
<td><b style="color:Black"><b style="color:SlateBlue">[Grup <?= $key['GRUP_ID']; ?>]</b> <?= $key['NAMA_PP']; ?></b><br><?= $key['AWALPP']; ?> s.d <?= $key['AKHIRPP']; ?></td>
|
||||
<td class="text-right"><b style="color:Chocolate"><?= $key['BITAM']; ?></b></td>
|
||||
<td class="text-right"><b style="color:SaddleBrown"><?= $key['GP']; ?></b></td>
|
||||
<td>
|
||||
<?php
|
||||
$nospr = 1;
|
||||
foreach ($key['SPR'] as $dat) { ?>
|
||||
<?= $nospr++; ?>. [<?= $dat['LUNAS']; ?>] <b style="color:DarkBlue"><?= $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 } ?>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<br>TOTAL : <b style="color:Tomato"><u><?= $key['NISO']; ?></u></b>
|
||||
</td>
|
||||
<td class="actions center">
|
||||
<?php if ($no==count($rp)) { ?>
|
||||
<div class="btn-group-vertical">
|
||||
<button type="button" data-toggle="modal" data-target="#modalIsiSpr" onclick="isiDataSpr('<?=$key['ID_RP']?>')" class="btn btn-xs btn-dark"><b>Sales Order</b> <i class="fa fa-reorder"></i></button>
|
||||
<?php if ($no>1) { ?>
|
||||
<button type="button" data-toggle="modal" data-target="#modalIsiBpry" onclick="isiDataBpry('<?=$key['ID_RP']?>')" class="btn btn-xs btn-success"><b>Biaya Proyek</b> <i class="fa fa-reorder"></i></button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $no++;
|
||||
}
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- end: page -->
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div id="modalIsiSpr" class="modal fade ui-front" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" style="width:90%">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><b>Isi Data | <b style="color:Red">SO Proyek</b></b>
|
||||
<br><a style="color:DarkOrchid" data-dismiss="modal" onclick="resetIntervalAll()"><u style="color:DarkViolet"><b>Keluar Menu</b> <i class="fa fa-sign-out"></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" name="id_rpin1" id="id_rpin1" class="form-control" value="">
|
||||
<input type="hidden" name="id_sprin" id="id_sprin" class="form-control" value="">
|
||||
<select data-plugin-selectTwo name="id_soin" id="id_soin" class="form-control populate"></select>
|
||||
<element id="submitSimpanSpr"><button type="submit" onclick="simpanSpr();" class="btn btn-success"><b>Simpan Data</b> <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">Status</th>
|
||||
<th class="default">Kode</th>
|
||||
<th class="text-right default">Nilai</th>
|
||||
<th class="default">Nomor PO</th>
|
||||
<th class="center default">PILIHAN</th>
|
||||
</thead>
|
||||
<tbody id="isiTabelSoProyek"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<div class="btn-group-vertical">
|
||||
<button type="submit" class="btn btn-default"><b style="color:Tomato">TOTAL <b id="notaTotal">0.00</b></b></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalIsiBpry" class="modal fade ui-front" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" style="width:70%">
|
||||
<header class="panel-heading">
|
||||
<h2 class="panel-title"><b>Isi Data | <b style="color:Red">Biaya Proyek</b></b>
|
||||
<br><a style="color:DarkOrchid" data-dismiss="modal" onclick="resetIntervalAll()"><u style="color:DarkViolet"><b>Keluar Menu</b> <i class="fa fa-sign-out"></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" name="id_rpin2" id="id_rpin2" class="form-control" value="">
|
||||
<input type="hidden" name="id_bpryin" id="id_bpryin" class="form-control" value="">
|
||||
<div class="input-group"><span class="input-group-addon">Rp</span><input autocomplete="off" class="form-control" type="text" name="nilai_bpryin" id="nilai_bpryin" oninput="cekNilai(1);" placeholder="Biaya Proyek" style="text-align:right;"/></div>
|
||||
<textarea autocomplete="off" class="form-control" cols="2" rows="3" name="nama_bpryin" id="nama_bpryin" placeholder="Keterangan Pembiayaan"></textarea>
|
||||
<element id="submitSimpanBpry"><button type="submit" onclick="simpanBpry();" class="btn btn-success"><b>Simpan Data</b> <i class="fa fa-flash"></i></button></element>
|
||||
<element hidden="hidden" id="submitUbahBpry"><button type="submit" onclick="ubahBpry();" class="btn btn-warning"><b>Ubah Data</b> <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 default">Nilai</th>
|
||||
<th class="center default">PILIHAN</th>
|
||||
</thead>
|
||||
<tbody id="isiTabelBiayaProyek"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<div class="btn-group-vertical">
|
||||
<button type="submit" class="btn btn-default"><b style="color:Tomato">TOTAL <b id="biayaTotal">0.00</b></b></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</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 cekNilai() {
|
||||
var nilaiNew = document.getElementById("nilai_bpryin").value;
|
||||
PNotify.removeAll();
|
||||
|
||||
var nilaiNew = nilaiNew.replace(/,/g,'.');
|
||||
|
||||
var cekNumber = isNaN(nilaiNew);
|
||||
if (cekNumber==true) {
|
||||
notify("not_number");
|
||||
document.getElementById("nilai_bpryin").value = null;
|
||||
}
|
||||
|
||||
if (nilaiNew<0 || nilaiNew=="") {
|
||||
notify("less_zero");
|
||||
document.getElementById("nilai_bpryin").value = null;
|
||||
}
|
||||
}
|
||||
|
||||
function resetIntervalAll() {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function isiDataSpr(id) {
|
||||
PNotify.removeAll();
|
||||
var JUMLAHSPR = "";
|
||||
|
||||
$("#id_rpin1").val(id);
|
||||
tampilkanDataSpr(id);
|
||||
}
|
||||
|
||||
function isiDataBpry(id) {
|
||||
PNotify.removeAll();
|
||||
var JUMLAHBPRY = "";
|
||||
|
||||
$("#id_rpin2").val(id);
|
||||
tampilkanDataBpry(id);
|
||||
}
|
||||
|
||||
function tampilkanDataSpr(id) {
|
||||
var id_proyek = <?=$id_proyek?>;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_rp : id,
|
||||
id_proyek : id_proyek,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Ambil_Sub1_A3_DataSoProyek',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
var baris = '';
|
||||
JUMLAHSPR = response.total;
|
||||
|
||||
if (JUMLAHSPR==0) {
|
||||
baris += '<tr>';
|
||||
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Blue">Data Kosong.</b></i></h5></td>';
|
||||
baris += '</tr>';
|
||||
$('#isiTabelSoProyek').html(baris);
|
||||
} else {
|
||||
for (var i = 1; i <= JUMLAHSPR; i++) {
|
||||
var id_spr = response.data[i - 1]['ID_SPR'];
|
||||
var lunas = response.data[i - 1]['LUNAS'];
|
||||
var so = response.data[i - 1]['KODE_SO'];
|
||||
var nilai = response.data[i - 1]['NILAI'];
|
||||
var po = response.data[i - 1]['PO_SO'];
|
||||
|
||||
baris += '<tr>';
|
||||
baris += '<input class="form-control input-sm " name="idsn' + i + '" id="idsn11' + i + '" type="hidden" value="' + id_spr + '" placeholder="-" >';
|
||||
baris += '<td class="center" style="vertical-align: middle;" >' + i + '</td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;" >' + lunas + '</td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;" ><b style="color:Black">' + so + '</b></td>';
|
||||
baris += '<td class="text-right" style="vertical-align: middle;" ><b style="color:Green">' + nilai + '</b></td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;" ><b style="color:Chocolate">' + po + '</b></td>';
|
||||
baris += '<td class="action center" style="vertical-align: middle;"><button type="button" onclick="hapusSpr(' + id_spr + ',' + id + ')" class="btn btn-xs btn-danger"><i class="fa fa-times"></i></button></td>';
|
||||
baris += '</tr>';
|
||||
}
|
||||
$('#isiTabelSoProyek').html(baris);
|
||||
}
|
||||
|
||||
document.getElementById("id_soin").value = null;
|
||||
document.getElementById("id_soin").innerHTML = "";
|
||||
$('#id_soin').select2().select2('val', null);
|
||||
var listData = response.sogp;
|
||||
var isiMaster = document.getElementById('id_soin');
|
||||
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="" selected>Pilih SO</option>';
|
||||
for (var i = 0; i < listData.length; i++) {
|
||||
isiMaster.innerHTML = isiMaster.innerHTML + '<option value="' + listData[i]['ID_SO'] + '">' + listData[i]['KODE_SO'] + ' | ' + listData[i]['TANGGAL'] + ' | ' + listData[i]['TOTAL'] + ' | ' + listData[i]['PO_SO'] + '</option>';
|
||||
}
|
||||
$('#id_soin').val(null).trigger('change');
|
||||
|
||||
$("#notaTotal").html(response.totSo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function tampilkanDataBpry(id) {
|
||||
var id_proyek = <?=$id_proyek?>;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_rp : id,
|
||||
id_proyek : id_proyek,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Ambil_Sub1_A3_DataBiayaProyek',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
var baris = '';
|
||||
JUMLAHBPRY = response.total;
|
||||
|
||||
if (JUMLAHBPRY==0) {
|
||||
baris += '<tr>';
|
||||
baris += '<td class="text-center" colspan="9"><h5><i><b style="color:Blue">Data Kosong.</b></i></h5></td>';
|
||||
baris += '</tr>';
|
||||
$('#isiTabelBiayaProyek').html(baris);
|
||||
} else {
|
||||
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 nilaiBpry = response.data[i - 1]['NILAI_BPRY'];
|
||||
var nilai = response.data[i - 1]['NILAI'];
|
||||
|
||||
baris += '<tr>';
|
||||
baris += '<input class="form-control input-sm " name="idsn' + i + '" id="idsn12' + i + '" type="hidden" value="' + id_bpry + '" placeholder="-" >';
|
||||
baris += '<td class="text-right" style="vertical-align: middle;" >' + i + ' <element id="tampilkanIconCek' + i + '" hidden="hidden"><i class="fa fa-check" style="color:Blue"></i></element></td>';
|
||||
baris += '<td class="text-left" style="vertical-align: middle;" >' + nama + '</td>';
|
||||
baris += '<td class="text-right" style="vertical-align: middle;" ><b style="color:Green">' + nilai + '</b></td>';
|
||||
baris += '<td class="action center" style="vertical-align: middle;"><element id="tampilkanIconBan' + i + '" hidden="hidden"><button type="button" class="btn btn-xs btn-danger" onclick="batalUbah(' + i + ')"><i class="fa fa-ban"></i></button></element><element id="ubahIcon' + i + '"><button type="button" onclick="ubahBpryData(' + id_bpry + ',' + id + ',' + i + ',`' + nama + '`,' + nilaiBpry + ')" 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>';
|
||||
baris += '</tr>';
|
||||
}
|
||||
$('#isiTabelBiayaProyek').html(baris);
|
||||
}
|
||||
|
||||
document.getElementById("nilai_bpryin").value = null;
|
||||
document.getElementById("nama_bpryin").value = null;
|
||||
|
||||
$("#biayaTotal").html(response.totBiaya);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function simpanSpr() {
|
||||
var id_rp = document.getElementById("id_rpin1").value;
|
||||
var id_so = document.getElementById("id_soin").value;
|
||||
var id_proyek = <?=$id_proyek?>;
|
||||
var status = 0;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (id_so=="") {
|
||||
notify("soid_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_rp : id_rp,
|
||||
id_so : id_so,
|
||||
id_proyek : id_proyek,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Simpan_Sub1_A3_DataSoProyekSewa',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.value == 5) {
|
||||
notify("not_valid");
|
||||
delayReload(2000,"<?= base_url() ?>index.php/Menu/PR_Sub1_SalesProyek_1");
|
||||
} else if (response.value == 4 || response.value == 3) {
|
||||
notify("latest");
|
||||
} else if (response.value == 2) {
|
||||
notify("spr_used");
|
||||
} else if (response.value == 1) {
|
||||
notify("success_add");
|
||||
} else if (response.value == 0) {
|
||||
notify("failed");
|
||||
}
|
||||
tampilkanDataSpr(id_rp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function simpanBpry() {
|
||||
var id_rp = document.getElementById("id_rpin2").value;
|
||||
var nama_bpry = document.getElementById("nama_bpryin").value;
|
||||
var nilai_bpry = document.getElementById("nilai_bpryin").value;
|
||||
var id_proyek = <?=$id_proyek?>;
|
||||
var status = 0;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (nama_bpry=="") {
|
||||
notify("nama_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (nilai_bpry<0 || nilai_bpry=="") {
|
||||
notify("less_zero");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_rp : id_rp,
|
||||
id_proyek : id_proyek,
|
||||
nama_bpry : nama_bpry,
|
||||
nilai_bpry : nilai_bpry,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Simpan_Sub1_A3_DataBiayaProyekSewa',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.value == 3) {
|
||||
notify("not_valid");
|
||||
delayReload(2000,"<?= base_url() ?>index.php/Menu/PR_Sub1_SalesProyek_1");
|
||||
} else if (response.value == 2) {
|
||||
notify("latest");
|
||||
} else if (response.value == 1) {
|
||||
notify("success_add");
|
||||
} else if (response.value == 0) {
|
||||
notify("failed");
|
||||
}
|
||||
tampilkanDataBpry(id_rp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function ubahBpry() {
|
||||
var id_rp = document.getElementById("id_rpin2").value;
|
||||
var id_bpry = document.getElementById("id_bpryin").value;
|
||||
var nama_bpry = document.getElementById("nama_bpryin").value;
|
||||
var nilai_bpry = document.getElementById("nilai_bpryin").value;
|
||||
var id_proyek = <?=$id_proyek?>;
|
||||
var status = 0;
|
||||
|
||||
PNotify.removeAll();
|
||||
|
||||
if (nama_bpry=="") {
|
||||
notify("nama_null");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (nilai_bpry<0 || nilai_bpry=="") {
|
||||
notify("less_zero");
|
||||
status++;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_rp : id_rp,
|
||||
id_bpry : id_bpry,
|
||||
id_proyek : id_proyek,
|
||||
nama_bpry : nama_bpry,
|
||||
nilai_bpry : nilai_bpry,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Ubah_Sub1_A3_DataBiayaProyekSewa',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.value == 4) {
|
||||
notify("not_valid");
|
||||
delayReload(2000,"<?= base_url() ?>index.php/Menu/PR_Sub1_SalesProyek_1");
|
||||
} else if (response.value == 3 || response.value == 2) {
|
||||
notify("latest");
|
||||
} else if (response.value == 1) {
|
||||
notify("success_ed");
|
||||
} else if (response.value == 0) {
|
||||
notify("failed");
|
||||
}
|
||||
|
||||
for (var i = 1; i <= JUMLAHBPRY; i++) {
|
||||
document.getElementById("ubahIcon" + i).style.display = 'block';
|
||||
document.getElementById("tampilkanIconCek" + i).style.display = 'none';
|
||||
document.getElementById("tampilkanIconBan" + i).style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById("submitSimpanBpry").style.display = 'block';
|
||||
document.getElementById("submitUbahBpry").style.display = 'none';
|
||||
|
||||
tampilkanDataBpry(id_rp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hapusSpr(id_spr, id_rp) {
|
||||
PNotify.removeAll();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_spr : id_spr,
|
||||
id_rp : id_rp,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Hapus_Sub1_A3_DataSoProyekSewa',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_del");
|
||||
} else if (response.value==2) {
|
||||
notify("latest");
|
||||
} else if (response.value==3) {
|
||||
notify("not_valid");
|
||||
delayReload(2000,"<?= base_url() ?>index.php/Menu/PR_Sub1_SalesProyek_1");
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
tampilkanDataSpr(id_rp);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hapusBpry(id_bpry, id_rp) {
|
||||
PNotify.removeAll();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_bpry : id_bpry,
|
||||
id_rp : id_rp,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/PR_Hapus_Sub1_A3_DataBiayaProyekSewa',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.value==1) {
|
||||
notify("success_del");
|
||||
} else if (response.value==2) {
|
||||
notify("latest");
|
||||
} else if (response.value==3) {
|
||||
notify("not_valid");
|
||||
delayReload(2000,"<?= base_url() ?>index.php/Menu/PR_Sub1_SalesProyek_1");
|
||||
} else if (response.value==0) {
|
||||
notify("failed");
|
||||
}
|
||||
tampilkanDataBpry(id_rp);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function batalUbah(posisi) {
|
||||
for (var i = 1; i <= JUMLAHBPRY; i++) {
|
||||
document.getElementById("ubahIcon" + i).style.display = 'block';
|
||||
}
|
||||
|
||||
document.getElementById("tampilkanIconCek" + posisi).style.display = 'none';
|
||||
document.getElementById("tampilkanIconBan" + posisi).style.display = 'none';
|
||||
document.getElementById("submitSimpanBpry").style.display = 'block';
|
||||
document.getElementById("submitUbahBpry").style.display = 'none';
|
||||
|
||||
document.getElementById("nilai_bpryin").value = null;
|
||||
document.getElementById("nama_bpryin").value = null;
|
||||
}
|
||||
|
||||
function ubahBpryData(id_bpry, id_rp, posisi, nama_bpry, nilai_bpry) {
|
||||
$("#id_bpryin").val(id_bpry);
|
||||
|
||||
for (var i = 1; i <= JUMLAHBPRY; i++) {
|
||||
document.getElementById("ubahIcon" + i).style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById("tampilkanIconCek" + posisi).style.display = 'block';
|
||||
document.getElementById("tampilkanIconBan" + posisi).style.display = 'block';
|
||||
document.getElementById("submitSimpanBpry").style.display = 'none';
|
||||
document.getElementById("submitUbahBpry").style.display = 'block';
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
id_bpry : id_bpry,
|
||||
},
|
||||
url: '<?= base_url('') ?>index.php/Menu/GE_AmbilData_PilihBiayaProyek',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
document.getElementById("nama_bpryin").value = response.nama_bpry;
|
||||
document.getElementById("nilai_bpryin").value = response.nilai_bpry;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user