foreach ($dataShow as $key => $row) { $dataShow[$key]['jumlah'] = number_format($row['jumlah'], 2); $dataShow[$key]['noakun'] = $optAkun[$row['noakun']]; $dataShow[$key]['kodeorg'] = $optOrg[$row['kodeorg']]; #=====================tambahan ginting sebagai pembalance $str = "select sum(jumlah) as jumlah from " . $dbname . ".keu_kasbankdt \n where notransaksi='" . $data[$key]['notransaksi'] . "' \n and kodeorg='" . $data[$key]['kodeorg'] . "' \n and tipetransaksi='" . $data[$key]['tipetransaksi'] . "'\n and noakun2a='" . $data[$key]['noakun'] . "'"; $res = mysql_query($str); $bar = mysql_fetch_object($res); $balan = 0; $balan = $bar->jumlah; $balan = $balan - $row['jumlah']; #================================== $dataShow[$key]['balan'] = number_format($balan, 2); } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data, $dataShow); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); $tHeader->addAction('deleteData', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); $tHeader->addAction('postingData', 'Posting', 'images/' . $_SESSION['theme'] . "/posting.png"); $tHeader->_actions[2]->setAltImg('images/' . $_SESSION['theme'] . "/posted.png"); $tHeader->addAction('detailPDF', 'Print Voucher', 'images/' . $_SESSION['theme'] . "/pdf.jpg"); if (!in_array($_SESSION['empl']['kodejabatan'], $postJabatan) and $_SESSION['empl']['tipelokasitugas'] != 'HOLDING') { $tHeader->_actions[2]->_name = ''; } $tHeader->_actions[3]->addAttr('event'); $tHeader->pageSetting($param['page'], $totalRow, $param['shows']); $tHeader->addAction('tampilDetail', 'Print Data Detail', 'images/' . $_SESSION['theme'] . "/zoom.png"); $tHeader->_actions[4]->addAttr('event'); $tHeader->addAction('detailPDF2', 'Print Bukti Pembayaran', 'images/' . $_SESSION['theme'] . "/pdf.jpg"); $tHeader->_actions[5]->addAttr('event'); $tHeader->_switchException = array('detailPDF', 'detailPDF2', 'tampilDetail');
$whereKarRow = ""; } $optKarRow = makeOption($dbname, 'datakaryawan', 'karyawanid,namakaryawan', $whereKarRow, '0', true); # Data Show $dataShow = $data; foreach ($dataShow as $key => $row) { $dataShow[$key]['nikmandor'] = $optKarRow[$row['nikmandor']]; $dataShow[$key]['nikmandor1'] = $optKarRow[$row['nikmandor1']]; $dataShow[$key]['nikasisten'] = $optKarRow[$row['nikasisten']]; $dataShow[$key]['keranimuat'] = $optKarRow[$row['keranimuat']]; $dataShow[$key]['updateby'] = $optKarRow[$row['updateby']]; } # Posting --> Jabatan $postJabatan = getPostingJabatan('panen'); # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data, $dataShow); #$tHeader->addAction('showDetail','Detail','images/'.$_SESSION['theme']."/detail.png"); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); $tHeader->_actions[0]->addAttr($tipeVal); $tHeader->addAction('deleteData', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); #$tHeader->addAction('approveData','Approve','images/'.$_SESSION['theme']."/approve.png"); $tHeader->addAction('postingData', 'Posting', 'images/' . $_SESSION['theme'] . "/posting.png"); $tHeader->_actions[2]->setAltImg('images/' . $_SESSION['theme'] . "/posted.png"); if (!in_array($_SESSION['empl']['kodejabatan'], $postJabatan)) { $tHeader->_actions[2]->_name = ''; } $tHeader->addAction('detailPDF', 'Print Data Detail', 'images/' . $_SESSION['theme'] . "/pdf.jpg"); $tHeader->_actions[3]->addAttr('event'); $tHeader->_actions[3]->addAttr($tipeVal); $tHeader->addAction('detailData', 'Print Data Detail', 'images/' . $_SESSION['theme'] . "/zoom.png"); $tHeader->_actions[4]->addAttr('event');
} else { $whereSupp .= ",'" . $row['koderekanan'] . "'"; } } $whereSupp .= ")"; } else { $whereSupp = null; } $optSupp = makeOption($dbname, 'log_5supplier', 'supplierid,namasupplier', $whereSupp); # Data Show $dataShow = $data; foreach ($dataShow as $key => $row) { $dataShow[$key]['koderekanan'] = isset($optSupp[$row['koderekanan']]) ? $optSupp[$row['koderekanan']] : ''; } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data, $dataShow); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); #$tHeader->addAction('deleteData','Delete','images/'.$_SESSION['theme']."/delete.png"); #$tHeader->addAction('postingData','Posting','images/'.$_SESSION['theme']."/posting.png"); #$tHeader->_actions[1]->setAltImg('images/'.$_SESSION['theme']."/posted.png"); $tHeader->addAction('detailPDF', 'Print Data Detail', 'images/' . $_SESSION['theme'] . "/pdf.jpg"); $tHeader->_actions[1]->addAttr('event'); $tHeader->_switchException = array('detailPDF'); $tHeader->pageSetting($param['page'], $totalRow, $param['shows']); if (isset($param['where'])) { $tHeader->setWhere($arrWhere); } # View $tHeader->renderTable(); break; # Form Add Header
foreach ($data as $key => $row) { // Add Ppn if (isset($optDet[$row['noinvoice']])) { $row['nilaiinvoice'] += $optDet[$row['noinvoice']]; } if ($row['posting'] == 1) { $data[$key]['switched'] = true; } unset($data[$key]['posting']); $data[$key]['tanggal'] = tanggalnormal($row['tanggal']); $data[$key]['nilaiinvoice'] = number_format($row['nilaiinvoice'], 2); $data[$key]['updateby'] = $nama[$row['updateby']]; $data[$key]['postingby'] = isset($nama[$row['postingby']]) ? $nama[$row['postingby']] : '-'; } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); if ($_SESSION['empl']['tipelokasitugas'] == 'HOLDING' or $_SESSION['empl']['tipelokasitugas'] == 'KANWIL' or $_SESSION['empl']['kodejabatan'] == 117 or $_SESSION['empl']['kodejabatan'] == 119) { $tHeader->addAction('deleteData', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); } else { //hanya HO dan region yang boleh menghapus $tHeader->addAction('', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); } $tHeader->addAction('postingData', 'Posting', 'images/' . $_SESSION['theme'] . "/posting.png"); $tHeader->_actions[2]->setAltImg('images/' . $_SESSION['theme'] . "/posted.png"); $tHeader->addAction('detailPDF', 'Print Data Detail', 'images/' . $_SESSION['theme'] . "/pdf.jpg"); $tHeader->_actions[3]->addAttr('event'); $tHeader->pageSetting(1, $totalRow, 10); $tHeader->_switchException = array('detailPDF'); #=== Display View # Title & Control
$ctl[] = "<div align='center'><img class=delliconBig src=images/" . $_SESSION['theme'] . "/list.png title='" . $_SESSION['lang']['list'] . "' onclick=\"defaultList()\"><br><span align='center'>" . $_SESSION['lang']['list'] . "</span></div>"; # Search $ctl[] = "<fieldset><legend><b>" . $_SESSION['lang']['find'] . "</b></legend>" . makeElement('sNoTrans', 'label', $_SESSION['lang']['notransaksi']) . makeElement('sNoTrans', 'text', '') . makeElement('sFind', 'btn', $_SESSION['lang']['find'], array('onclick' => "searchTrans()")) . "</fieldset>"; #=== Table Aktivitas # Header $header = array('Nomor', 'Tanggal', 'Pabrik', 'Kode Tangki', 'Kuantitas CPO', 'Kuantitas PK'); # Content $cols = "notransaksi,tanggal,kodeorg,kodetangki,kuantitas,kernelquantity"; $query = selectQuery($dbname, 'pabrik_masukkeluartangki', $cols, "kodeorg='" . $_SESSION['empl']['lokasitugas'] . "'", "", false, 10, 1); $data = fetchData($query); $totalRow = getTotalRow($dbname, 'pabrik_masukkeluartangki'); foreach ($data as $key => $row) { $data[$key]['tanggal'] = tanggalnormal($row['tanggal']); } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); $tHeader->addAction('deleteData', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); //$tHeader->addAction('postingData','Posting','images/'.$_SESSION['theme']."/posting.png"); $tHeader->_actions[1]->setAltImg('images/' . $_SESSION['theme'] . "/posted.png"); $tHeader->pageSetting(1, $totalRow, 10); #echo "<pre>"; #print_r($tHeader); #=== Display View # Title & Control OPEN_BOX(); echo "<div align='center'><h3>" . $_SESSION['lang']['pabrikhasil'] . "</h3></div>"; echo "<div><table align='center'><tr>"; foreach ($ctl as $el) { echo "<td v-align='middle' style='min-width:100px'>" . $el . "</td>"; }
} else { $where .= null; } # Header $header = array($_SESSION['lang']['nomor'], $_SESSION['lang']['tanggal'], $_SESSION['lang']['pabrik'], $_SESSION['lang']['kodetangki'], 'Kuantitas CPO', 'Kuantitas PK'); # Content $cols = "notransaksi,tanggal,kodeorg,kodetangki,kuantitas,kernelquantity"; $query = selectQuery($dbname, 'pabrik_masukkeluartangki', $cols, $where, "", false, $param['shows'], $param['page']); // exit("error: ".$query); $data = fetchData($query); $totalRow = getTotalRow($dbname, 'pabrik_masukkeluartangki', $where); foreach ($data as $key => $row) { $data[$key]['tanggal'] = tanggalnormal($row['tanggal']); } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); $tHeader->addAction('deleteData', 'Delete', 'images/' . $_SESSION['theme'] . "/delete.png"); //$tHeader->addAction('postingData','Posting','images/'.$_SESSION['theme']."/posting.png"); $tHeader->_actions[1]->setAltImg('images/' . $_SESSION['theme'] . "/posted.png"); $tHeader->pageSetting($param['page'], $totalRow, $param['shows']); if (isset($param['where'])) { $tHeader->setWhere($arrWhere); } # View $tHeader->renderTable(); break; # Form Add Header # Form Add Header case 'showAdd': // View
#=== Table Aktivitas # Header $header = array($_SESSION['lang']['afdeling'], $_SESSION['lang']['blok'], $_SESSION['lang']['tanggal'], $_SESSION['lang']['bulan'], $_SESSION['lang']['tahun'], $_SESSION['lang']['jumlah'], $_SESSION['lang']['jumlahha'], $_SESSION['lang']['jumlahpremi'], $_SESSION['lang']['jumlahpokok']); # Content $optNamaOrg = makeOption($dbname, 'organisasi', 'kodeorganisasi,namaorganisasi'); $cols = "kodeorg,kodeblok,tanggal,bulan,tahun,jumlah,jumlahha,jumlahpremi,jumlahpokok"; $query = selectQuery($dbname, 'kebun_rencanapanen', $cols, "left(kodeorg,4)='" . $_SESSION['empl']['lokasitugas'] . "'", "", false, 10, 1); $data = fetchData($query); $totalRow = getTotalRow($dbname, 'kebun_rencanapanen'); foreach ($data as $key => $row) { $data[$key]['tanggal'] = tanggalnormal($row['tanggal']); $data[$key]['kodeorg'] = $optNamaOrg[$row['kodeorg']]; $data[$key]['kodeblok'] = $row['kodeblok']; } # Make Table $tHeader = new rTable('headTable', 'headTableBody', $header, $data); #$tHeader->addAction('showDetail','Detail','images/'.$_SESSION['theme']."/detail.png"); $tHeader->addAction('showEdit', 'Edit', 'images/' . $_SESSION['theme'] . "/edit.png"); //$tHeader->addAction('deleteData','Delete','images/'.$_SESSION['theme']."/delete.png"); #$tHeader->addAction('approveData','Approve','images/'.$_SESSION['theme']."/approve.png"); #$tHeader->addAction('postingData','Posting','images/'.$_SESSION['theme']."/posting.png"); #$tHeader->_actions[2]->setAltImg('images/'.$_SESSION['theme']."/posted.png"); $tHeader->pageSetting(1, $totalRow, 10); $tHeader->setWhere($whereContArr); #echo "<pre>"; #print_r($tHeader); #=== Display View # Title & Control OPEN_BOX(); echo "<div align='center'><h3>" . $_SESSION['lang']['sensusprod'] . "</h3></div>"; echo "<div><table align='center'><tr>";