/
cari_ass_kerugian.php
211 lines (188 loc) · 5.6 KB
/
cari_ass_kerugian.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php include 'collateral_script/session_head.php'; ?>
<?php include 'collateral_script/head.php'; ?>
<?php include 'collateral_script/db_function.php';?>
<?php include 'collateral_script/function.php';?>
<?php include 'collateral_script/list_dropdown.php';?>
<TITLE>PENDING POLIS ASS. KERUGIAN</TITLE>
<div style="margin:0px 50px;text-align: left;">
<form method=get action=cari_ass_kerugian.php>
<table>
<tr>
<td>Nama LNC</td>
<td><?=selectLNC("LNC") ?></td>
</tr>
<tr>
<td>Nama Asuransi Kerugian</td>
<td>
<?php echo selectnya("cari",$ListAsuransiKerugian,"b") ?>
</td>
</tr>
<tr>
<td>Hari Proses</td>
<td><?= inputnya("hariproses1","style='width:100px'")." s/d ".inputnya("hariproses2","style='width:100px'") ?> </td>
</tr>
</table>
<input type=radio name=pilih value=asuransi_kerugian checked>
Monitoring Penyelesaian Polis Asuransi Kerugian
<p class="style2">
<input type=submit name=oke value=Cari>
</p>
</form>
<div align="center">
<?php
$oke=$_GET['oke'];
if ($oke=='Cari'){
Include ("koneksi.php");
mysql_select_db("collateral_db");
//Langkah 1
$batas = 9999999;
$halaman = $_GET['halaman'];
if(empty($halaman)){
$posisi = 0;
$halaman = 1;
}
else{
$posisi=($halaman-1)* $batas;}
$warna1 = "#DBDBA6"; // baris genap berwarna tua
$warna2 = "#F2F2DF"; // baris ganjil berwarna muda
$warna = $warna1; // warna default
//Langkah 2
$nama =$_GET['NAMADEBITUR'];
$apl =$_GET['NOAPLIKASI'];
$pilih =$_GET['pilih'];
$cari =$_GET['cari'];
$lnc=$_GET['LNC'];
$sqlHariProsses="";
if(intval($_GET['hariproses1'])&&intval($_GET['hariproses2']))
{
$sqlHariProsses=" and DATEDIFF(now(),tgl_pk) >= ".$_GET['hariproses1']." and DATEDIFF(now(),tgl_pk) <= ".$_GET['hariproses2'];
}
$tampil= mysql_query("SELECT * FROM debitur WHERE $pilih LIKE '%$cari%' AND debitur.no_polis_ass_kerugian = 'PENDING' ".(($lnc=="all")?"":"AND LNC='$lnc'")." $sqlHariProsses ORDER BY debitur.tgl_pk ASC LIMIT $posisi,$batas");
$jumlah= mysql_num_rows($tampil);
if ($jumlah > 0) {
echo "<br><b>MONITORING PENYELESAIAN POLIS ASURANSI KERUGIAN</b><BR><br><table class='tblLookup' border='1px'>
<thead>
<tr>
<th >NO.</th>
<th width=20>NAMA LNC</th>
<th>NO. APLIKASI</th>
<th>NAMA DEBITUR</th>
<th widht=20>NO. REK. PINJAMAN</th>
<th>JENIS PRODUK</th>
<th>NILAI PERTANGGUNGAN</th>
<th>ASURANSI</th>
<th>PREMI</th>
<th>TGL. PK</th>
<th width=40>HARI PROSES</th>
<th width=65>STATUS</th>
<th>ACTION</th></th>
</tr></thead>";
$no=$posisi+1;
While ($r=mysql_fetch_array($tampil)){
if($warna == $warna1){
$warna = $warna2;
}
else{
$warna = $warna1;
}
//ngitung selisih tgl
$tgl1=$r['tgl_pk'];
$tgl2=date('Y-m-d');
// memecah tanggal untuk mendapatkan bagian tanggal, bulan dan tahun
// dari tanggal pertama
$pecah1 = explode("-", $tgl1);
$date1 = $pecah1[2];
$month1 = $pecah1[1];
$year1 = $pecah1[0];
// memecah tanggal untuk mendapatkan bagian tanggal, bulan dan tahun
// dari tanggal kedua
$pecah2 = explode("-", $tgl2);
$date2 = $pecah2[2];
$month2 = $pecah2[1];
$year2 = $pecah2[0];
// menghitung JDN dari masing-masing tanggal
$jd1 = GregorianToJD($month1, $date1, $year1);
$jd2 = GregorianToJD($month2, $date2, $year2);
// hitung selisih hari kedua tanggal
$selisih = $jd2 - $jd1;
$aaa = 30;
$bbb = $selisih > $aaa;
$ab = "IN PROGRESS";
$count = "PENDING";
$max = $r['nilai_pertanggungan_ass_kerugian'];
$nht = $r['premi_kerugian'];
$rupiah=number_format($max,0,',','.');
$rupiah1=number_format($nht,0,',','.');
$slsh=number_format($selisih,0,',','.');
if ($bbb==1){
$bbb=$count;
}
else{
$bbb = $ab;
}
if ($bbb=='PENDING'){
echo "
<tr bgcolor=$warna>
<td>$no</td>
<td align='center'>$r[LNC]</td>
<td align='right'>$r[NOAPLIKASI]</td>
<td>$r[NAMADEBITUR]</td>
<td align='right'>$r[no_rekg_pinjaman]</td>
<td align='center'>$r[produk]</td>
<td align='right'>$rupiah</td>
<td align='center'>$r[asuransi_kerugian]</td>
<td align='right'>$rupiah1</td>
<td align='center' width=70>$r[tgl_pk]</td>
<td align='right'>$slsh</td>
<td align='center' style='color:red'>$bbb</td>
<td align='center'><a href=edit_data_debitur.php?id=$r[no_rekg_pinjaman]>Edit
</td>
</tr>";
$no++;
}
else {
echo "
<tr bgcolor=$warna>
<td>$no</td>
<td align='center'>$r[LNC]</td>
<td align='right'>$r[NOAPLIKASI]</td>
<td>$r[NAMADEBITUR]</td>
<td align='right'>$r[no_rekg_pinjaman]</td>
<td align='center'>$r[produk]</td>
<td align='right'>$rupiah</td>
<td align='center'>$r[asuransi_kerugian]</td>
<td align='right'>$rupiah1</td>
<td align='center' width=70>$r[tgl_pk]</td>
<td align='right'>$slsh</td>
<td align='center'>$bbb</td>
<td align='center'><a href=edit_data_debitur.php?id=$r[no_rekg_pinjaman]>Edit
</td>
</tr>";
$no++;
}
}
echo "</table>";
//Langkah 3
$tampil2 = "SELECT * FROM debitur WHERE $pilih LIKE '%$cari%' AND debitur.no_polis_ass_kerugian = 'PENDING' ".(($lnc=="all")?"":"AND LNC='$lnc'")." $sqlHariProsses ORDER BY debitur.tgl_pk ASC";
$hasil2 = mysql_query($tampil2);
$jmldata = mysql_num_rows($hasil2);
$jmlhalaman = ceil($jmldata/$batas);
$jmldata = number_format($jmldata,0,',','.');
//echo "<br>Halaman : ";
//$file = "cari_ass_jiwa.php";
//for($i=1;$i<=$jmlhalaman;$i++)
// if ($i !=$halaman) {
//echo "<a href='$file?halaman=$i&$pilih=$cari&oke=$oke'>$i</A> | ";
//}
//else{
//echo "<b>$i</b> | ";
//}
echo "<p>Total Data <b>LNC $lnc</b> : <b>$jmldata</b> debitur yang ditanggung oleh Asuransi : <b>$cari</b></p>";
}
else{
echo "<b><p class=style1>Maaf, data <b>MONITORING PENYELESAIAN POLIS ASURANSI KERUGIAN</b> dari <b>LNC $lnc</b> yang anda cari tidak ada pada database !!!</b>";
}
}
?>
</div>
</div>