Example #1
0
                    $s = 'SELECT * FROM ' . $tb . '  WHERE replid=' . $_POST['replid'];
                    // var_dump($s);exit();
                    $e = mysql_query($s);
                    $r = mysql_fetch_assoc($e);
                    $stat = $e ? 'sukses' : 'gagal';
                    if (!$e) {
                        $stat = 'gagal';
                    } else {
                        //sukses
                        $s2 = 'SELECT * FROM keu_jurnal WHERE transaksi =' . $_POST['replid'] . ' ORDER BY jenis ASC';
                        $e2 = mysql_query($s2);
                        $jurnalArr = array();
                        while ($r2 = mysql_fetch_assoc($e2)) {
                            $jurnalArr[] = array('idjurnal' => $r2['replid'], 'idrek' => $r2['rek'], 'rek' => getRekBy('nama', $r2['rek']), 'nominal' => setuang($r2['nominal']), 'jenis' => $r2['jenis']);
                        }
                        $transaksiArr = array('nomer' => $r['nomer'], 'nobukti' => $r['nobukti'], 'tanggal' => tgl_indo7($r['tanggal']), 'uraian' => $r['uraian'], 'jurnalArr' => $jurnalArr);
                        $stat = 'sukses';
                    }
                    $out = json_encode(array('status' => $stat, 'transaksiArr' => $transaksiArr));
                    break;
            }
            break;
            // ambiledit ------------------------------------------------------------------
            // generate barcode -----------------------------------------------------------
        // ambiledit ------------------------------------------------------------------
        // generate barcode -----------------------------------------------------------
        case 'kodegenerate':
            $s = 'SELECT
						tb1.lokasi,
						tb1.grup,
						tb1.tempat,
Example #2
0
										concat(dr.nama," - ",dr.nama)detilrekening,
										j.nominal,
										sr.nominal saldorekening
									FROM keu_jurnal j
										JOIN keu_detilrekening dr on dr.replid = j.detilrekening
										JOIN keu_saldorekening sr on sr.detilrekening = dr.replid
									WHERE j.transaksi =' . $_POST['replid'] . ' 
									GROUP BY dr.replid 
									ORDER BY j.jenisrekening ASC';
                        // pr($s2);
                        $e2 = mysql_query($s2);
                        $jurnalArr = array();
                        while ($r2 = mysql_fetch_assoc($e2)) {
                            $jurnalArr[] = array('idjurnal' => $r2['replid'], 'jenisrekening' => $r2['jenisrekening'], 'iddetilrekening' => $r2['iddetilrekening'], 'detilrekening' => $r2['detilrekening'], 'nominal' => setuang($r2['nominal']), 'saldorekening' => setuang($r2['saldorekening']));
                        }
                        $transaksiArr = array('idkwitansi' => $r['idkwitansi'], 'detjenistransaksi' => $r['detjenistransaksi'], 'nobukti' => $r['nobukti'], 'tanggal' => tgl_indo7($r['tanggal']), 'uraian' => $r['uraian'], 'jurnalArr' => $jurnalArr);
                        $stat = 'sukses';
                    }
                    $out = json_encode(array('status' => $stat, 'transaksiArr' => $transaksiArr));
                    break;
            }
            break;
            // ambiledit ------------------------------------------------------------------
            // generate barcode -----------------------------------------------------------
        // ambiledit ------------------------------------------------------------------
        // generate barcode -----------------------------------------------------------
        case 'kodegenerate':
            $s = 'SELECT
						tb1.lokasi,
						tb1.grup,
						tb1.tempat,
Example #3
0
                       <td width="20%">Debit</td>
                       <td width="20%">Kredit</td>
                     </tr>';
                 while ($r2 = mysql_fetch_assoc($e2)) {
                     $debit = $r2['rek'] == $r['rekkas'] ? $r['nominal'] : 0;
                     $kredit = $r2['rek'] == $r['rekitem'] ? $r['nominal'] : 0;
                     $tb2 .= '<tr>
                       <td>' . getRekening($r2['rek']) . '</td>
                       <td align="right">Rp. ' . number_format($debit) . ',-</td>
                       <td align="right">Rp. ' . number_format($kredit) . ',-</td>
                     </tr>';
                 }
                 $tb2 .= '</table>';
             }
             $out .= '<tr>
                   <td width="10%" valign="top">' . tgl_indo7($r['tanggal']) . '</td>
                   <td valign="top" width="15%">' . $r['nomer'] . '<br>' . getDetJenisTrans2($r['replid']) . '<br>' . $r['nobukti'] . '</td>
                   <td valign="top" width="30%">' . $r['uraian'] . '</td>
                   <td width="40%" valign="top">' . $tb2 . '</td>
                 </tr>';
         }
     }
     $out .= '</table>';
     $out .= '</table>';
 } else {
     $out .= '<table width="100%">
         <tr>
           <td width="30%">Departemen </td>
           <td width="30%">: ' . $dep . '</td>
           <td width="30%"></td>
         </tr>