kppnadministration /verak/inserting_satkerpot.php

Language PHP Lines 131
MD5 Hash 85636c2388ac15a6b2f9b0a73371dddc Estimated Cost $2,585 (why?)
Repository https://bitbucket.org/metamorph/kppnadministration.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
require "koneksi.php";
include "fungsi_rp.php";

$jumldata	= $_POST['jumldata'];
$Akun			= $_POST['akun'];

echo '<table cellpadding="1" cellspacing="1" border="1" align="center" valign="middle" width="80%">
		<tr align="middle" valign="middle">
		<th width="5%" height="50" align="center" valign="middle"  nowrap="nowrap">No.</th>
		<th width="10%" height="50" align="center" valign="middle"  nowrap="nowrap">Satker</th>
		<th width="10%" height="50" align="center" valign="middle"  nowrap="nowrap">No.SPM</th>	
		<th width="15%" height="50" align="center" valign="middle"  nowrap="nowrap">Tgl.SP2D</th>
		<th width="10%" height="50" align="center" valign="middle"  nowrap="nowrap">No.SP2D</th>
		<th width="10%" height="50" align="center" valign="middle"  nowrap="nowrap">Satkerb</th>
		<th width="10%" height="50" align="center" valign="middle"  nowrap="nowrap">Akun</th>
		<th width="20%" height="50" align="center" valign="middle"  nowrap="nowrap">Jumlah</th>
		</tr>
		</table>';
					
//looping sejumlah banyaknya data
for($i = 1; $i <= $jumldata; $i++) {	

	$satker	= $_POST['kdsatker'.$i];
	$nospm	= $_POST['nospm'.$i];
	$nosp2d	= $_POST['nosp2d'.$i];
	$satkerb	= $_POST['kdsatkerb'.$i];
	$kpp		= $_POST['kpp'.$i];
	
//Akun 411
	if($Akun=='411'){
		

		$updatePjk	= mysql_query("UPDATE m_spmmap SET kdsatkerb='$kpp' WHERE nosp2d='$nosp2d' AND kdsatkerb=''");	
		
		$query		= mysql_query("SELECT kdsatker,nospm,tgsp2d,nosp2d,kdsatkerb,kdakun,nilmap FROM m_spmmap WHERE kdsatker='$satker' AND nospm='$nospm' AND LEFT(kdakun,3)='$Akun'");
		while($r 	= mysql_fetch_array($query)) {
			
			$satker	= $r['kdsatker'];
			$nospm	= $r['nospm'];
			$Tgsp2d	= $r['tgsp2d'];
			$tgsp2d	= tgl($Tgsp2d);
			$nosp2d	= $r['nosp2d'];
			$satkerb	= $r['kdsatkerb'];
			$akun		= $r['kdakun'];
			$Nilmap	= $r['nilmap'];
			$nilmap	= bil($Nilmap); 
		
	echo "<table cellpadding='1' cellspacing='1' border='1' align='center' width='80%'>
			<tr align='middle'>
				<td width='5%' align='middle'>$i</td>
				<td width='10%' align='middle'>$satker</td>
				<td width='10%' align='middle'>$nospm</td>
				<td width='15%' align='middle'>$tgsp2d</td>
				<td width='10%' align='middle'>$nosp2d</td>
				<td width='10%' align='middle'>$satkerb</td>
				<td width='10%' align='middle'>$akun</td>
				<td width='20%' align='right'>$nilmap</td>";
				}
	echo "</tr>
			</table>";
			}
		
//Akun 423,511,581,815
	elseif($Akun=='423' || $Akun=='511' || $Akun=='581' || $Akun=='815') {
		
		$updatePNBP	= mysql_query("UPDATE m_spmmap SET kdsatkerb='$satker' WHERE nosp2d='$nosp2d' AND kdsatkerb=''");
		
		$qPNBP		= mysql_query("SELECT kdsatker,nospm,tgsp2d,nosp2d,kdsatkerb,kdakun,nilmap FROM m_spmmap WHERE kdsatker='$satker' AND nospm='$nospm' AND LEFT(kdakun,3)='$Akun'");
		while($rPNBP= mysql_fetch_array($qPNBP)) {
			$satker	= $rPNBP['kdsatker'];
			$nospm	= $rPNBP['nospm'];
			$Tgsp2d	= $rPNBP['tgsp2d'];
			$tgsp2d	= tgl($Tgsp2d);
			$nosp2d	= $rPNBP['nosp2d'];
			$satkerb	= $rPNBP['kdsatkerb'];
			$akun		= $rPNBP['kdakun'];
			$Nilmap	= $rPNBP['nilmap'];
			$nilmap	= bil($Nilmap); 
			
	echo "<table cellpadding='1' cellspacing='1' border='1' align='center' width='80%'>
			<tr align='middle'>
				<td width='5%' align='middle'>$i</td>
				<td width='10%' align='middle'>$satker</td>
				<td width='10%' align='middle'>$nospm</td>
				<td width='15%' align='middle'>$tgsp2d</td>
				<td width='10%' align='middle'>$nosp2d</td>
				<td width='10%' align='middle'>$satkerb</td>
				<td width='10%' align='middle'>$akun</td>
				<td width='20%' align='right'>$nilmap</td>";
				}
	echo "</tr>
			</table>";
	}
	
//Akun 811
	elseif($Akun=='811') {
		
		$updatePfk	= mysql_query("UPDATE m_spmmap SET kdsatkerb='987361' WHERE nosp2d='$nosp2d' AND kdsatkerb=''");
		
		$qPfk		= mysql_query("SELECT kdsatker,nospm,tgsp2d,nosp2d,kdsatkerb,kdakun,nilmap FROM m_spmmap WHERE kdsatker='$satker' AND nospm='$nospm' AND LEFT(kdakun,3)='$Akun'");
		while($rPfk= mysql_fetch_array($qPfk)) {
			$satker	= $rPfk['kdsatker'];
			$nospm	= $rPfk['nospm'];
			$Tgsp2d	= $rPfk['tgsp2d'];
			$tgsp2d	= tgl($Tgsp2d);
			$nosp2d	= $rPfk['nosp2d'];
			$satkerb	= $rPfk['kdsatkerb'];
			$akun		= $rPfk['kdakun'];
			$Nilmap	= $rPfk['nilmap'];
			$nilmap	= bil($Nilmap); 
			
	echo "<table cellpadding='1' cellspacing='1' border='1' align='center' width='80%'>
			<tr align='middle'>
				<td width='5%' align='middle'>$i</td>
				<td width='10%' align='middle'>$satker</td>
				<td width='10%' align='middle'>$nospm</td>
				<td width='15%' align='middle'>$tgsp2d</td>
				<td width='10%' align='middle'>$nosp2d</td>
				<td width='10%' align='middle'>$satkerb</td>
				<td width='10%' align='middle'>$akun</td>
				<td width='20%' align='right'>$nilmap</td>";
				}
	echo "</tr>
			</table>";
	}
}
mysql_close($link);
echo '<br />
<center><input type="button" name="button" value="Kembali" onclick="history.go(-2)" /></center>';
?>
Back to Top