Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tableDeposit($params=""){
- global $s, $inp, $par, $arrTitle, $arrParameter, $menuAccess;
- $text.="
- <table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" class=\"stdtable stdtablequick\">
- <thead>
- <tr>
- <th ".$width.$array[0].">No.</th>
- <th ".$width.$array[1].">Tanggal</th>
- <th ".$width.$array[3].">Uraian</th>
- <th ".$width.$array[2].">Kredit</th>
- <th ".$width.$array[2].">Debet</th>
- <th ".$width.$array[2].">Saldo</th>";
- if ($params=="lihat") {
- $text.="<th ".$width.$array[0].">Status</th>";
- if (isset($menuAccess[$s]["edit"]) || isset($menuAccess[$s]["delete"]))
- $text.="<th ".$width.$array[1].">Kontrol</th>";
- }
- $text.="
- </tr>
- </thead>
- <tbody>";
- $filter = "where t1.jumlahDeposit != '0' AND idBA='$par[idBA]'";
- if (!empty($par[tgl1]) AND !empty($par[tgl2]))
- $filter .=" AND t1.tglDeposit between '".setTanggal($par[tgl1])."' AND '".setTanggal($par[tgl2])."'";
- $sql = "SELECT t1.* FROM dta_deposit t1 $filter";
- $res = db($sql);
- $no = 0;
- $kredit = "";
- $debet = "";
- $status = "";
- while ($r = mysql_fetch_array($res)) {
- $tipe = $r['katDeposit'];
- if($tipe == 'Debet'){
- $debet = $r['jumlahDeposit'];
- $kredit = '0';
- } else {
- $debet = '0';
- $kredit = $r['jumlahDeposit'];
- }
- switch ($r[statusDeposit]) {
- case '1':
- $status = "<img src=\"styles/images/t.png\" title='Diterima'>";
- break;
- case '2':
- $status = "<img src=\"styles/images/p.png\" title='Pending'>";
- break;
- default:
- $status = "<img src=\"styles/images/p.png\" title='Pending'>";
- break;
- }
- $saldo += $kredit - $debet ;
- $no++;
- if ($params == 'lihat') {
- $array = array('20','50','90','150');
- $width = "width=";
- $kontrol = "<th ".$width.$array[1].">Kontrol</th>";
- }elseif($params == "cetak"){
- $array = "";
- $width = "";
- $kontrol = "";
- }
- $text.="
- <tr>
- <td ".$width.$array[0].">$no.</td>
- <td ".$width.$array[1]." style=\"text-align:center;\">".getTanggal($r[tglDeposit])."</td>
- <td ".$width.$array[3].">$r[ketDeposit]</td>
- <td ".$width.$array[2]." style=\"text-align:right;\">".getAngka($kredit)."</td>
- <td ".$width.$array[2]." style=\"text-align:right;\">".getAngka($debet)."</td>
- <td ".$width.$array[2]." style=\"text-align:right;\">".getAngka($saldo)."</td>";
- if ($params=="lihat") {
- $text.="
- <td ".$width.$array[0]." style=\"text-align:center;\">".$status."</td>
- <td ".$width.$array[1]." style=\"text-align:center;\">";
- if (isset($menuAccess[$s]["edit"]))
- $text.="<a href=\"#\" onclick=\"openBox('popup.php?par[mode]=formDeposit&par[idDeposit]=$r[idDeposit]" . getPar($par, "mode,tgl1,tgl2") . "',800,360);\" title=\"Edit Data\" class=\"edit\"><span>Edit</span></a>";
- if (isset($menuAccess[$s]["delete"]))
- $text.="<a href=\"?par[mode]=deleteDeposit&par[idDeposit]=$r[idDeposit]" . getPar($par, "mode,idDeposit") . "\" onclick=\"return confirm('are you sure to delete data ?');\" title=\"Delete Data\" class=\"delete\"><span>Delete</span></a>";
- $text.="
- </td>";
- }
- $text.="
- </tr>";
- }
- $text.="
- </tbody>
- </table>
- ";
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement