// digunakan untuk convert php ke html $out = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SISTER::Keu - Jurnal Umum ' . $mnu . '</title> </head>'; $ju_no = isset($_GET['ju_noS']) ? filter($_GET['ju_noS']) : ''; $ju_uraian = isset($_GET['ju_uraianS']) ? filter($_GET['ju_uraianS']) : ''; $s1 = 'SELECT * FROM keu_transaksi WHERE detjenistrans IN (' . $jenis2 . ') AND (nomer like "%' . $ju_no . '%" OR nobukti like "%' . $ju_no . '%" ) AND uraian like "%' . $ju_uraian . '%" AND tanggal between "' . tgl_indo6($_GET['tgl1TB']) . '" AND "' . tgl_indo6($_GET['tgl2TB']) . '" ORDER BY replid DESC'; // print_r($s1);exit(); $e1 = mysql_query($s1); $n1 = mysql_num_rows($e1); $out .= '<body> <table width="100%"> <tr> <td width="40 %"> <img width="100" src="../../images/logo.png" alt="" /> </td> <td> <b>Jurnal Umum</b> </td> </tr>
</tr> </thead> <tbody class="fg-black">'; $s3 = 'SELECT j.nominal, t.tanggal, t.uraian, t.replid idTransaksi FROM keu_jurnal j JOIN keu_transaksi t ON t.replid = j.transaksi WHERE j.detilrekening = ' . $r['replid'] . ' AND j.jenisrekening ="k" AND t.tanggal BETWEEN "' . tgl_indo6($_GET['tgl1']) . '" AND "' . tgl_indo6($_GET['tgl2']) . '" ORDER BY t.tanggal ASC'; $e3 = mysql_query($s3); $keluarTot = 0; if (mysql_num_rows($e3) <= 0) { $out .= '<tr> <td colspan="4" align="center">data kosong</td> </tr>'; } else { while ($r3 = mysql_fetch_assoc($e3)) { $keluarTot += $r3['nominal']; $out .= '<tr> <td width="10%">' . tgl_indo5($r3['tanggal']) . '</td> <td width="20%">' . getNoKwitansi($r3['idTransaksi']) . '</td> <td width="30%">' . $r3['uraian'] . '</td>
'totaset' =>number_format($r['totaset']) )); break; } break; // head info ------------------------------------------------------------------ // add / edit ----------------------------------------------------------------- case 'simpan': switch ($_POST['subaksi']) { case 'ju': $s = $tb.' set nomer = "'.$_POST['ju_nomerTB'].'", nobukti = "'.filter($_POST['ju_nobuktiTB']).'", uraian = "'.filter($_POST['ju_uraianTB']).'", tanggal = "'.tgl_indo6($_POST['ju_tanggalTB']).'"'; $s = isset($_POST['replid'])?'UPDATE '.$s.' WHERE replid='.$_POST['replid']:'INSERT INTO '.$s; var_dump($s);exit(); // $e = mysql_query($s); // $id =mysql_insert_id(); // if(!$e){ // $stat='gagal_'.mysql_error(); // }else{ if(isset($_POST['ju_rekTB'])){ // var_dump(count($_POST['ju_rekTB'])); // var_dump($_POST['ju_rekTB']); // $s2 = 'keu_jurnal set transaksi = '.$id.', // rek = '.$_POST['ju_rekTB'].', // debet = '.$_POST['ju_debetTB'].', // kredit = '.$_POST['ju_kreditTB']; // $s2 = isset($_POST['replid'])?'UPDATE '.$s.' WHERE replid='.$_POST['replid']:'INSERT INTO '.$s;
<title>SISTER::Keu - Neraca Saldo</title> </head>'; // table content $kode = isset($_GET['ns_kodeS']) ? $_GET['ns_kodeS'] : ''; $nama = isset($_GET['ns_namaS']) ? filter($_GET['ns_namaS']) : ''; // -- CONCAT(dr.kode," - ",dr.nama)detilrekening, $s = ' SELECT j.detilrekening replid, dr.kode, dr.nama, getSaldoRekeningByTgl(j.detilrekening,"2015-11-01","2016-11-01")saldoRekening FROM keu_jurnal j JOIN keu_detilrekening dr on dr.replid = j.detilrekening JOIN keu_transaksi t on t.replid = j.transaksi WHERE t.tanggal BETWEEN "' . tgl_indo6($_GET['tgl1']) . '" and "' . tgl_indo6($_GET['tgl2']) . '" GROUP BY j.detilrekening ORDER BY dr.kode asc,dr.nama asc'; $e = mysql_query($s) or die(mysql_error()); $n = mysql_num_rows($e); $out .= '<body> <table width="100%"> <tr> <td width="39%"> <img width="100" src="../../images/logo.png" alt="" /> </td> <td> <b>Laporan Neraca Saldo</b> </td> </tr> </table>';
<td colspan=9 ><span style="color:red;text-align:center;"> ... data tidak ditemukan...</span></td></tr>'; } #link paging $out .= '<tr class="info"><td colspan=9>' . $obj->anchors . '</td></tr>'; $out .= '<tr class="info"><td colspan=9>' . $obj->total . '</td></tr>'; break; // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- case 'simpan': $s = $tb . ' set departemen = "' . filter($_POST['departemenH']) . '", tahunajaran = "' . filter($_POST['tahunajaranTB']) . '", tglmulai = "' . tgl_indo6($_POST['tglmulaiTB']) . '", tglakhir = "' . tgl_indo6($_POST['tglakhirTB']) . '", keterangan = "' . filter($_POST['keteranganTB']) . '"'; if (!isset($_POST['replid'])) { //add if (mysql_num_rows(mysql_query('SELECT * from ' . $tb)) > 0) { $s1 = 'UPDATE ' . $tb . ' set aktif="0" where departemen=' . $_POST['departemenH']; $e1 = mysql_query($s1); } $s2 = 'INSERT INTO ' . $s . ' ,aktif = "1"'; } else { //edit $s2 = 'UPDATE ' . $s . ' WHERE replid=' . $_POST['replid']; } $e2 = mysql_query($s2); if (!$e2) { $stat = 'gagal menyimpan';
#kosong $out .= '<tr align="center"> <td colspan=9 ><span style="color:red;text-align:center;"> ... data tidak ditemukan...</span></td></tr>'; } #link paging $out .= '<tr class="info"><td colspan=9>' . $obj->anchors . '</td></tr>'; $out .= '<tr class="info"><td colspan=9>' . $obj->total . '</td></tr>'; break; // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- case 'simpan': $s = 'UPDATE ' . $tb . ' set tglMulai = "' . tgl_indo6($_POST['tglMulaiTB']) . '", tglSelesai = "' . tgl_indo6($_POST['tglSelesaiTB']) . '" WHERE replid=' . $_POST['replid']; $e = mysql_query($s); $stat = !$e ? 'gagal menyimpan' : 'sukses'; $out = json_encode(array('status' => $stat)); break; // add / edit ----------------------------------------------------------------- // delete ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- // delete ----------------------------------------------------------------- case 'hapus': $d = mysql_fetch_assoc(mysql_query('SELECT * from ' . $tb . ' where replid=' . $_POST['replid'])); $s = 'DELETE from ' . $tb . ' WHERE replid=' . $_POST['replid']; $e = mysql_query($s); $stat = $e ? 'sukses' : 'gagal'; $out = json_encode(array('status' => $stat, 'terhapus' => $d['semester']));
$r = mysql_fetch_assoc($e); $stat = !$e ? 'gagal' : 'sukses'; $out = json_encode(array('status' => $stat, 'data' => array('urut' => $r['barang'], 'lokasi' => $r['lokasi'], 'grup' => $r['grup'], 'tempat' => $r['tempat'], 'katalog' => $r['katalog'], 'barang' => $r['barang'], 'barkode' => $r['barkode']))); break; // generate barcode ----------------------------------------------------------- // cmbbuku besar ----------------------------------------------------------------- // generate barcode ----------------------------------------------------------- // cmbbuku besar ----------------------------------------------------------------- case 'cmbbukubesar': $s = ' SELECT j.detilrekening replid, CONCAT(dr.kode," - ",dr.nama)detilrekening FROM keu_jurnal j JOIN keu_detilrekening dr on dr.replid = j.detilrekening JOIN keu_transaksi t on t.replid = j.transaksi WHERE t.tanggal BETWEEN "' . tgl_indo6($_POST['tgl1']) . '" and "' . tgl_indo6($_POST['tgl2']) . '" GROUP BY j.detilrekening ORDER BY dr.kode asc,dr.nama asc'; // pr($s); $e = mysql_query($s); $n = mysql_num_rows($e); $ar = $dt = array(); if (!$e) { //error $ar = array('status' => 'error'); } else { if ($n == 0) { // kosong $ar = array('status' => 'kosong'); } else { // ada data
#link paging $out.= '<tr class="info"><td colspan=9>'.$obj->anchors.'</td></tr>'; $out.='<tr class="info"><td colspan=9>'.$obj->total.'</td></tr>'; break; // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- case 'simpan': // pr($_POST); // 1. simpan aktivitas $totNominal = 0; $c = count($_POST['idTR']); $itemArr = $_POST['idTR']; $s1 = $tb.' SET tanggal1 ="'.tgl_indo6($_POST['tanggal1TB']).'", tanggal2 ="'.tgl_indo6($_POST['tanggal2TB']).'", tgltagihan ="'.tgl_indo6($_POST['tgltagihanTB']).'", aktivitas ="'.filter($_POST['aktivitasTB']).'", lokasi ='.$_POST['lokasiH'].', anggarantahunan ='.$_POST['detilanggaranH'].', keterangan ="'.filter($_POST['keteranganTB']).'"'; $s = (isset($_POST['replid']) AND $_POST['replid']!='')?'UPDATE '.$s1.' WHERE replid='.$_POST['replid']:'INSERT INTO '.$s1; $e = mysql_query($s); $id = (isset($_POST['replid']) AND $_POST['replid']!='')?$_POST['replid']:mysql_insert_id(); if(!$e) $stat='gagal_insert_aktivitas'; else{ // 2.a hapus item detail aktivitas (jika ada) $stat22 = true; if(isset($_POST['idDelTR']) AND $_POST['idDelTR']!=''){ $ss2 = 'DELETE FROM '.$tb3.' WHERE replid IN ('.$_POST['idDelTR'].')'; $ee2 = mysql_query($ss2); $stat22 = !$ee2?false:true;
// out_come // 1. simpan transaksi $totNominal = 0; $rekArr = $_POST[$sub . '_idTR']; $stat1 = $stat2 = $stat3 = true; // var_dump($rekArr);exit(); foreach ($rekArr as $i => $v) { $nom = intval(getuang($_POST[$sub . '_nominal' . $v . 'TB'])); // $jenis = $_POST[$sub.'_jenis'.$v.'TB']; $s1 = 'keu_transaksi SET tahunbuku =' . getTahunBuku('replid') . ', rekkas =' . $_POST['rekkasH'] . ', uraian ="' . $_POST[$sub . '_uraian' . $v . 'TB'] . '", rekitem =' . $_POST[$sub . '_rek' . $v . 'H'] . ', nominal =' . $nom . ', nomer ="' . getNoTrans2($sub) . '", tanggal ="' . tgl_indo6($_POST['tanggalTB']) . '", detjenistrans =' . getDetJenisTrans('replid', 'kode', $_POST['detjenistransH']) . ', detilanggaran =' . $_POST['detilanggaranH'] . ', nobukti ="' . $_POST['nobuktiTB'] . '"'; $s = (isset($_POST['idformH']) and $_POST['idformH'] != '') ? 'UPDATE ' . $s1 . ' WHERE replid=' . $_POST['idformH'] : 'INSERT INTO ' . $s1; $e = mysql_query($s); $idx = mysql_insert_id(); $id = ($idx != '' or !empty($idx)) ? $idx : $_POST['idformH']; // $id = (mysql_insert_id()!='' OR !empty(mysql_insert_id()))?mysql_insert_id():$_POST['idformH']; // 2. simpan jurnal umum if (!$e) { $stat1 = false; } else { // jurnal debit & kredit $sjd = ' keu_jurnal SET rek =' . $_POST['rekkasH'] . ',nominal =' . $nom . ',jenis="k"'; $sjk = ' keu_jurnal SET rek =' . $_POST[$sub . '_rek' . $v . 'H'] . ',nominal =' . $nom . ',jenis="d"';
$stat22 = !$ee2 ? false : true; } // 2.b simpan detail aktivitas (wajib) $stat2 = $stat2 = true; $nomDebit = $nomKredit = 0; if (!$stat22) { $stat = 'gagal_delete_detail_aktivitas'; } else { // tidak ada hapus detail aktivitas OR sukses hapus $xx = ''; foreach ($itemArr as $i => $v) { $item = getuang($_POST['item_' . $v . 'TB']); $jumlah = $_POST['jumlah_' . $v . 'TB']; $biaya = isset($_POST['biaya_' . $v . 'TB']) ? 'biaya=' . getuang($_POST['biaya_' . $v . 'TB']) . ',' : ''; $tglbayar = isset($_POST['tglbayar_' . $v . 'TB']) ? tgl_indo6($_POST['tglbayar_' . $v . 'TB']) : '0000-00-00'; $tgllunas = isset($_POST['tgllunas_' . $v . 'TB']) ? tgl_indo6($_POST['tgllunas_' . $v . 'TB']) : '0000-00-00'; $s = $tb3 . ' SET aktivitas=' . $id . ', ' . $biaya . ' jumlah =' . $jumlah . ', tglbayar ="' . $tglbayar . '", tgllunas ="' . $tgllunas . '"'; if ($_POST['mode' . $v . 'H'] == 'edit') { //edit $s2 = 'UPDATE ' . $s . ' WHERE replid=' . $_POST['iditem_' . $v . 'H']; } else { // add $s2 = 'INSERT INTO ' . $s; } $xx .= $s2; $e2 = mysql_query($s2); $stat2 = !$e2 ? false : true;
$pre = 'INSERT INTO '; $w =''; $f = 'siswa='.($_POST['idformTB']!=''?$_POST['idformTB']:$siswaSV['id']).','; } $namasaudara = isset($_POST['namasaudara'.$v.'TB'])?$_POST['namasaudara'.$v.'TB']:''; $jkelaminsaudara = isset($_POST['jkelaminsaudara'.$v.'TB'])?$_POST['jkelaminsaudara'.$v.'TB']:''; $tempatlahirsaudara = isset($_POST['tempatlahirsaudara'.$v.'TB'])?$_POST['tempatlahirsaudara'.$v.'TB']:''; $tanggallahirsaudara = isset($_POST['tanggallahirsaudara'.$v.'TB'])?$_POST['tanggallahirsaudara'.$v.'TB']:''; $sekolahsaudara = isset($_POST['sekolahsaudara'.$v.'TB'])?$_POST['sekolahsaudara'.$v.'TB']:''; $gradesaudara = isset($_POST['gradesaudara'.$v.'TB'])?$_POST['gradesaudara'.$v.'TB']:''; $siswasaudaraS = $pre.$tb6.' SET '.$f.' namasaudara ="'.$namasaudara.'", jkelaminsaudara ="'.$jkelaminsaudara.'", tempatlahirsaudara ="'.$tempatlahirsaudara.'", tanggallahirsaudara ="'.tgl_indo6($tanggallahirsaudara).'", sekolahsaudara ="'.$sekolahsaudara.'", gradesaudara ="'.$gradesaudara.'" '.$w; $siswasaudaraE =mysql_query($siswasaudaraS); $siswasaudaraStat =!$siswasaudaraE?false:true; } }// end of : saudara siswa ---- if(!$siswasaudaraStat){ $stat='gagal_insert_update_wali_murid'; }else{ $stat='sukses'; } } } }
} #link paging $out .= '<tr class="info"><td colspan=9>' . $obj->anchors . '</td></tr>'; $out .= '<tr class="info"><td colspan=9>' . $obj->total . '</td></tr>'; break; // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- // view ----------------------------------------------------------------- // add / edit ----------------------------------------------------------------- case 'simpan': $s = $tb . ' set siswa = "' . filter($_POST['siswaH']) . '", tgl = curdate(), karyawan =' . $_SESSION['id_loginS'] . ', nomom = "' . filter($_POST['nomomTB']) . '", tglmom = "' . tgl_indo6(filter($_POST['tglmomTB'])) . '"'; $s1 = isset($_POST['replid']) ? 'UPDATE ' . $s . ' WHERE replid=' . $_POST['replid'] : 'INSERT INTO ' . $s; $e1 = mysql_query($s1); $id = isset($_POST['replid']) && $_POST['replid'] == '' ? $_POST['replid'] : mysql_insert_id(); if (!$e1) { $stat = 'gagal_simpan_pemutihan'; } else { $stat2 = true; foreach ($_POST['biaya'] as $i => $v) { $ss = 'INSERT INTO keu_subpemutihanpenerimaansiswa SET pemutihanpenerimaansiswa =' . $id . ', siswabiaya =' . $v; $e2 = mysql_query($ss); $stat2 = !$e2 ? false : true; } $stat = !$stat2 ? 'gagal_simpan_sub' : 'sukses';
ketkesehatan = "'.filter($_POST['catatan_kesehatanTB']).'" '.(isset($_POST['file'])?', photo= "'.$_POST['file'].'"':''); // var_dump($siswa);exit(); $ayah = $tb_ayah.' set nama = "'.filter($_POST['ayahTB']).'", warga = "'.filter($_POST['kebangsaan_ayahTB']).'", tmplahir = "'.filter($_POST['tempatlahir_ayahTB']).'", '.(($_POST['tgllahir_ayahTB']=='' || $_POST['tgllahir_ayahTB']=='00 0000')?'':'tgllahir ="'.tgl_indo6(filter($_POST['tgllahir_ayahTB'])).'",').' pekerjaan = "'.filter($_POST['pekerjaan_ayahTB']).'", telpon = "'.filter($_POST['telpayahTB']).'", pinbb = "'.filter($_POST['pinbb_ayahTB']).'", email = "'.filter($_POST['email_ayahTB']).'" '; $ibu = $tb_ibu.' set nama = "'.filter($_POST['ibuTB']).'", tmplahir = "'.filter($_POST['tempatlahir_ibuTB']).'", '.(($_POST['tgllahir_ibuTB']=='' || $_POST['tgllahir_ibuTB']=='00 0000')?'':'tgllahir ="'.tgl_indo6(filter($_POST['tgllahir_ibuTB'])).'",').' warga = "'.filter($_POST['kebangsaan_ibuTB']).'", pekerjaan = "'.filter($_POST['pekerjaan_ibuTB']).'", telpon = "'.filter($_POST['telpibuTB']).'", pinbb = "'.filter($_POST['pinbb_ibuTB']).'", email = "'.filter($_POST['email_ibuTB']).'" '; $kontakdarurat = $tb_kontakdarurat.' set nama = "'.filter($_POST['nama_kontakTB']).'", hubungan = "'.filter($_POST['hubunganTB']).'", telpon = "'.filter($_POST['nomorTB']).'" '; $keluarga = $tb_keluarga.' set kakek_nama = "'.filter($_POST['kakekTB']).'", nenek_nama = "'.filter($_POST['nenekTB']).'" '; if (!isset($_POST['replid'])){ //add $tipex ='add'; $sqsiswa = 'INSERT INTO '.$siswa;