예제 #1
0
 function get_member_kredit()
 {
     $data = array();
     $n = 0;
     $where = $_POST['status'] == '' ? '' : "where p.stat_pinjaman='" . $_POST['status'] . "'";
     $where = empty($_POST['cari']) ? $where : "where a.Nama like '" . $_POST['cari'] . "%'";
     $orderby = " order by " . $_POST['orderby'];
     $orderby .= empty($_POST['urutan']) ? '' : ' ' . $_POST['urutan'];
     //echo $where;
     $data = $this->member_model->get_data_pinjaman($where, $orderby);
     foreach ($data as $r) {
         $n++;
         echo tr() . td($n, 'center') . td($r->Nama . ' [ <i> ' . $r->Catatan . ' </i> ] - ' . $r->NIP) . td(number_format($r->Debet, 2), 'right') . td(number_format($r->Kredit, 2), 'right') . td(number_format($r->Saldo, 2), 'right') . td(tglfromSql($r->mulai_bayar), 'center') . td($r->Kredit == '0' ? img_aksi($r->ID . '-' . $r->Tahun, true, 'del') : '') . _tr();
     }
 }
예제 #2
0
 function data_pinjaman()
 {
     $data = array();
     $detail = array();
     $n = 0;
     $x = 0;
     $stat = '';
     $saldo = 0;
     $ID_Agt = $_POST['ID_Agt'];
     $data = $this->member_model->data_pinjaman($ID_Agt);
     if ($_POST['cBayar'] == 'par') {
         if (count($data) > 0) {
             foreach ($data as $r) {
                 $n++;
                 $x = 0;
                 echo "<tr class='list_genap' id='n-" . $r->ID . "'>\r\n\t\t\t\t\t\t<td class='kotak' colspan='2' nowrap ><b>{$n}.&nbsp;&nbsp; Tanggal : " . tglfromSql($r->Tanggal) . " - No. Faktur :" . rdb('inv_penjualan', 'Nomor', 'Nomor', "where NoUrut='" . $r->ID . "' and Tanggal='" . $r->Tanggal . "'") . "</b></td>\r\n\t\t\t\t\t\t<td class='kotak'  align='right'><b>" . number_format($r->jml_pinjaman, 2) . "</b></td>\r\n\t\t\t\t\t\t<td class='kotak'></td>\r\n\t\t\t\t\t\t<td class='kotak'></td>\r\n\t\t\t\t\t\t<td class='kotak' colspan='1' nowrap >" . $r->keterangan . "\r\n\t\t\t\t\t\t<input type='hidden' id='ID_Pinj' value='" . $r->ID . "'></td>\r\n\t\t\t\t\t\t</tr>";
                 $detail = $this->member_model->data_setoran($ID_Agt, $r->ID);
                 $stat = '';
                 foreach ($detail as $d) {
                     $x++;
                     $saldo = $r->jml_pinjaman - ($saldo + $d->Kredit);
                     echo "<tr class='xx'>\r\n\t\t\t\t\t\t\t<td class='kotak' align='center'>{$x}</td>\r\n\t\t\t\t\t\t\t<td class='kotak' >&nbsp;&nbsp;&bull;" . tglfromSql($d->Tanggal) . "</td>\r\n\t\t\t\t\t\t\t<td class='kotak'></td>\r\n\t\t\t\t\t\t\t<td class='kotak' align='right'>" . number_format($d->Kredit, 2) . "<input type='hidden' class='w70 angka' value='" . $d->Kredit . "'></td>\r\n\t\t\t\t\t\t\t<td class='kotak' align='right'>" . number_format($d->saldo, 2) . "</td>\r\n\t\t\t\t\t\t\t<td class='kotak' >\r\n\t\t\t\t\t\t\t\t<table width='100%' style='border-collapse:collapse'>\r\n\t\t\t\t\t\t\t\t<tr><td width='75%' id='r-" . $d->ID . "'>" . $d->keterangan . "</td>\r\n\t\t\t\t\t\t\t\t<td width='25%' align='right'>" . img_aksi($d->ID, true) . "</td>\r\n\t\t\t\t\t\t\t\t</tr></table>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>";
                     $stat = $d->saldo == 0 ? number_format($d->Kredit, 2) : '';
                 }
                 for ($i = 1; $i <= $r->lama_cicilan - $x; $i++) {
                     $i == $r->lama_cicilan ? $cil = $r->cicilan_end : ($cil = $r->cicilan);
                     //($stat=='')?$stat="<img src='".base_url()."asset/img/checkout.gif' id='g-".$i."' onclick=\"bayar($i);\"":$stat=$stat;
                     echo "<tr class='xx' id='r-" . $r->ID . "'>\r\n\t\t\t\t\t\t\t<td class='kotak' align='center'>&nbsp;</td>\r\n\t\t\t\t\t\t\t<td class='kotak' >Pembayaran Ke " . $r->lama_cicilan . "</td>\r\n\t\t\t\t\t\t\t<td class='kotak' align='right'>&nbsp;</td>\r\n\t\t\t\t\t\t\t<td class='kotak' align='right'>" . number_format($r->Saldo, 2) . "</td>\r\n\t\t\t\t\t\t\t<td class='kotak'  align='right' nowrap >";
                     echo $stat == '' ? "<img src='" . base_url() . "asset/img/checkout.gif' id='g-" . $r->ID . "' onclick=\"bayar('" . $r->ID . "','" . $r->Tahun . "');\">" : $stat;
                     echo "</td>\r\n\t\t\t\t\t\t\t<td class='kotak' align='right'>&nbsp;</td>\r\n\t\t\t\t\t\t\t</tr>";
                 }
             }
         } else {
             echo tr() . td('Tidak ada tagihan', 'kotak\' colspan=\'6') . _tr();
         }
     } else {
         $jml = 0;
         $kred = 0;
         $sal = 0;
         foreach ($data as $r) {
             $n++;
             echo tr('xx') . td("<b>{$n}. Tanggal : " . tglfromSql($r->Tanggal) . " - No. Faktur :" . rdb('inv_penjualan', 'Nomor', 'Nomor', "where NoUrut='" . $r->ID . "' and Tanggal='" . $r->Tanggal . "'"), 'left\' nowrap colspan=\'2') . td(number_format($r->jml_pinjaman, 2), 'right') . td(number_format($r->Kredit, 2), 'right') . td(number_format($r->Saldo, 2), 'right') . td($r->keterangan, 'left\' nowrap=\'nowrap') . _tr();
             $jml = $jml + $r->jml_pinjaman;
             $kred = $kred + $r->Kredit;
             $sal = $sal + $r->Saldo;
         }
         echo tr('xx  list_genap', "r-" . $r->ID_Agt) . td('<b>Total Tagihan</b>', 'right\' colspan=\'2') . td('<b>' . number_format($jml, 2) . '</b>', 'right') . td('<b>' . number_format($kred, 2) . '</b>', 'right') . td('<b>' . number_format($sal, 2) . '</b>', 'right') . td($sal != 0 ? "<img src='" . base_url() . "asset/img/checkout.gif' id='g-" . $r->ID_Agt . "' onclick=\"bayarAll('" . $r->ID_Agt . "','" . $r->Tahun . "');\">" : '<b>LUNAS</b>', 'center') . _tr();
     }
 }
예제 #3
0
파일: stock.php 프로젝트: asad345100/pos-ci
 function get_stock()
 {
     $data = array();
     $n = 0;
     $where = empty($_POST['kategori']) ? '' : "where im.ID_Kategori='" . $_POST['kategori'] . "' and ms.Stock<>'0'";
     $where .= empty($_POST['stat']) ? '' : " and Status='" . $_POST['stat'] . "' and ms.Stock!='0'";
     $orderby = empty($_POST['orderby']) ? '' : " order by " . str_replace('-', ',', $_POST['orderby']) . " ";
     $orderby .= empty($_POST['urutan']) ? '' : strtoupper($_POST['urutan']);
     $sesi = $this->session->userdata('menus');
     $edit_true = empty($_POST['edited']) ? '' : $_POST['edited'];
     $data = $this->report_model->stock_list($where, 'stock', $orderby);
     foreach ($data as $r) {
         $n++;
         echo tr() . td($n, 'center') . td(strtoupper($r->Kode)) . td(strtoupper($r->Nama_Barang)) . td(rdb('inv_barang_kategori', 'Kategori', 'Kategori', "where ID='" . $r->ID_Kategori . "'")) . td(number_format($r->stock, 2), 'right') . td(rdb('inv_barang_satuan', 'Satuan', 'Satuan', "where ID='" . $r->ID_Satuan . "'")) . td(number_format($r->harga_beli, 2), 'right') . td($r->Status);
         if ($sesi == 'SW52ZW50b3J5' && $edit_true != '') {
             echo td(img_aksi($r->ID . ':' . $r->batch), 'center');
         }
         echo _tr();
     }
 }
예제 #4
0
 function list_vendor()
 {
     $data = array();
     $n = 0;
     $nama = empty($_POST['nama']) ? $where = "where ID_Jenis='2'" : ($where = "where Nama like '%" . $_POST['nama'] . "%' and ID_Jenis='2'");
     $data = $this->Admin_model->show_list('mst_anggota', $where . ' order by Nama');
     foreach ($data as $row) {
         $n++;
         //tr('xx\' onClick="_show_detail(\''.$row->ID.'\');" attr=\'ax').
         $cek = rdb('inv_pembelian', 'ID_Pemasok', 'ID_Pemasok', "where ID_Pemasok='" . $row->ID . "'");
         echo tr() . td($n, 'center') . td($row->No_Agt, 'center') . td($row->Nama, 'xx\' onClick="_show_detail(\'' . $row->ID . '\',\'' . $row->Nama . '\');" attr=\'ax') . td($row->Alamat) . td($row->Kota) . td($row->Propinsi) . td($row->Telepon) . td($row->Faksimili) . td($cek == '' ? img_aksi($row->ID, true, 'del') : '', 'center') . _tr();
     }
 }
예제 #5
0
 function get_pemakaian()
 {
     $data = array();
     $n = 0;
     $dari = tglToSql($_POST['dari_tgl']);
     $sampai = empty($_POST['sampai_tgl']) ? $dari : tglToSql($_POST['sampai_tgl']);
     $where = empty($_POST['sampai_tgl']) ? "where Tanggal='" . $dari . "'" : "where Tanggal between '" . $dari . "' and '" . $sampai . "'";
     $where .= " and ID_Jenis='" . $_POST['id_jenis'] . "'";
     $where .= " order by Tanggal";
     $data = $this->Admin_model->show_list('z_inv_pemakaian', $where);
     foreach ($data as $r) {
         $n++;
         echo tr() . td($n, 'center') . td(tglfromSql($r->Tanggal), 'center') . td(rdb('inv_barang', 'Kode', 'Kode', "where ID='" . $r->ID_Barang . "'")) . td(rdb('inv_barang', 'Nama_Barang', 'Nama_Barang', "where ID='" . $r->ID_Barang . "'")) . td(rdb('inv_barang_satuan', 'Satuan', 'Satuan', "where ID='" . rdb('inv_barang', 'ID_Satuan', 'ID_Satuan', "where ID='" . $r->ID_Barang . "'") . "'")) . td(number_format($r->Jumlah, 2), 'right') . td(number_format($r->Harga, 2), 'right') . td(number_format($r->Jumlah * $r->Harga, 2), 'right') . td($r->Keterangan) . td(img_aksi($r->ID, true), 'center') . _tr();
     }
 }
예제 #6
0
 function jenis_list()
 {
     $data = array();
     $n = 0;
     $nTable = $_POST['tabel'];
     $orderby = 'order by ' . $_POST['orderby'];
     $data = $this->Admin_model->show_list($nTable, $orderby);
     foreach ($data as $r) {
         $n++;
         echo tr() . td($n, 'center') . td($r->{$_POST}['orderby']) . td(img_aksi($r->ID . '-' . $nTable, true, 'del'), 'center') . _tr();
     }
 }