-
Notifications
You must be signed in to change notification settings - Fork 0
/
_proses_import_potongan.php
62 lines (58 loc) · 2.18 KB
/
_proses_import_potongan.php
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
<?php
// Author: Emanuel Setio Dewo
// 19 Sept 2006
function ProsesSekarang() {
//$arrPot = array('U'=>'5', 'S'=>'3');
$s = "select *
from _tagihan
where POTNGMSTAG > 0 or POTMBMSTAG > 0
order by NIMHSMSTAG";
$r = _query($s); $jml = _num_rows($r);
echo "<p>Data yg akan diproses: <font size=+1>$jml</font></p>";
echo "<ol>";
while ($w = _fetch_array($r)) {
$pot1 = number_format($w['POTNGMSTAG']);
$pot2 = number_format($w['POTMBMSTAG']);
echo "<li>$w[NIMHSMSTAG] » $pot1 » $pot2
</li>";
// ambil detail dari TRPTG
$sp = "select * from _potongan where NIMHSTRPTG='$w[NIMHSMSTAG]' ";
$rp = _query($sp);
echo "<ul>";
while ($wp = _fetch_array($rp)) {
$jmlpot = number_format($wp['NLPOTTRPTG']);
$bn = ($wp['JNPOTTRPTG'] == 'U')? 5 : 3;
$ada = GetaField('bipotmhsw',
"TahunID='$wp[THSMSTRPTG]'
and MhswID='$wp[NIMHSTRPTG]'
and TrxID=-1
and BIPOTNamaID", $bn, "BIPOTMhswID");
if (empty($ada)) {
$prc = "insert into bipotmhsw
(PMBMhswID, TrxID, MhswID, TahunID, BIPOTNamaID,
Jumlah, Besar, Dibayar, Catatan,
LoginBuat, TanggalBuat)
values (1, -1, '$wp[NIMHSTRPTG]', '$wp[THSMSTRPTG]', $bn,
1, $wp[NLPOTTRPTG]+0, $wp[NLPOTTRPTG], '$wp[KETR1TRPTG] $wp[KETR2TRPTG]',
'IMPORT-POT-20061', now())";
$rprc = _query($prc);
} else $prc = "(Sudah ada)";
echo "<li>$wp[JNPOTTRPTG] » $jmlpot $prc</li>";
}
echo "</ul>";
}
echo "</ol>";
}
function TanyaDulu() {
echo "<p>Script ini akan mengimport potongan dari tabel MSTAG dari program lama ke Sisfo Kampus.<br />
Harap diperhatikan bahwa tabel temporary <b>_tagihan</b> harus sudah terisi dari tabel MSTAG.<br />
Tekan tombol berikut ini untuk memulai proses:
<input type=button name='Proses' value='Proses Potongan' onClick=\"location='?gos=ProsesSekarang'\">";
}
// *** Main ***
$gos = (empty($_REQUEST['gos']))? "TanyaDulu" : $_REQUEST['gos'];
include_once "sisfokampus.php";
HeaderSisfoKampus("Import Potongan Dari MSTAG");
TampilkanJudul("Import Potongan Dari MSTAG");
$gos();
?>