function lap_perpanjang() { $n = 0; $data = array(); $datax = array(); $no_spb = $_POST['no_spb']; $data['ae'] = $this->Admin_model->is_oto('spb/perpanjang', 'e'); $data = $this->Admin_model->show_list('spb', "where jt_spb <now() order by left(no_spb,5),year(tgl_spb)"); foreach ($data->result() as $row) { $n++; echo "\n<tr class='xx' id='" . $row->no_spb . "' align='center'>\r\n\t\t\t\t <td class='kotak' align='left'>" . $row->id_barang . "</td>\t\r\n\t\t\t\t <td class='kotak' align='left'>" . substr($row->no_spb, 0, 5) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='left'>" . ShortTgl($row->tgl_spb, true) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='left'>" . $row->nama_spb . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format($row->taksir_spb, 2) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format($row->nilai_spb, 2) . "</td>\t\r\n\t\t\t\t <td class='kotak'>" . $row->jw_spb . "</td>\t\r\n\t\t\t\t <td class='kotak'>" . TglfromSql($row->jt_spb) . "</td>\r\n\t\t\t\t <td id='c-1' class='kotak'>" . perpanjang($row->no_spb, 1, true) . "</td>\t\r\n\t\t\t\t <td id='c-2' class='kotak'>" . perpanjang($row->no_spb, 2, true) . "</td>\t\r\n\t\t\t\t <td id='c-3' class='kotak'>" . perpanjang($row->no_spb, 3, true) . "</td>\t\r\n\t\t\t\t <td id='c-4' class='kotak'>" . perpanjang($row->no_spb, 4, true) . "</td>\t\r\n\t\t\t\t <td id='c-5' class='kotak'>" . perpanjang($row->no_spb, 5, true) . "</td>\t\r\n\t\t\t\t <td id='c-6' class='kotak'>" . perpanjang($row->no_spb, 6, true) . "</td>\t\r\n\t\t\t\t <td id='c-7' class='kotak'>" . perpanjang($row->no_spb, 7, true) . "</td>\t\r\n\t\t\t\t <td id='c-8' class='kotak'>" . perpanjang($row->no_spb, 8, true) . "</td>\t\r\n\t\t\t\t <td id='c-9' class='kotak'>" . perpanjang($row->no_spb, 9, true) . "</td>\t\r\n\t\t\t\t <td id='c-10' class='kotak'>" . perpanjang($row->no_spb, 10, true) . "</td>\t\r\n\t\t\t\t </tr>\n"; } //$datax['pp_ke']=rdb('perpanjang_spb','pp_ke','pp_ke',"where no_spb='".$row->no_spb."'"); //echo json_encode($datax); }
function lap_perpanjang() { $n = 0; $data = array(); $datax = array(); $no_spb = $_POST['no_spb']; $data['ae'] = $this->Admin_model->is_oto('lelang/list_lelang', 'e'); $data = $this->Admin_model->show_list('perpanjang_spb', "where pp_stat='N' group by no_spb order by no_spb", 'distinct(no_spb) as no_spb,pp_ke,sum(pp_bayar) as ppbayar'); if ($data->num_rows > 0) { foreach ($data->result() as $row) { $n++; $pp_ke = $this->Admin_model->show_single_field("lelang", "pp_stat", "where no_spb='" . $row->no_spb . "'"); $pp_ke == '' ? $gb = 'checkout.gif' : ($gb = '44.png'); $pp_ke == '' ? $grb = 'D' : ($grb = ''); echo "\n<tr class='xx' id='" . $row->no_spb . "' align='center'>\r\n\t\t\t\t <td class='kotak' align='left'>" . rdb('spb', 'id_barang', 'id_barang', "where no_spb='" . $row->no_spb . "'") . "</td>\t\r\n\t\t\t\t <td class='kotak' align='center'>" . substr($row->no_spb, 0, 5) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='left'>" . ShortTgl(rdb('spb', 'tgl_spb', 'tgl_spb', "where no_spb='" . $row->no_spb . "'"), true) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='left'>" . rdb('spb', 'nama_spb', 'nama_spb', "where no_spb='" . $row->no_spb . "'") . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format(rdb('spb', 'taksir_spb', 'taksir_spb', "where no_spb='" . $row->no_spb . "'"), 2) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format(rdb('spb', 'nilai_spb', 'nilai_spb', "where no_spb='" . $row->no_spb . "'"), 2) . "</td>\t\r\n\t\t\t\t <td class='kotak'>" . $row->pp_ke . " x</td>\t\r\n\t\t\t\t <td class='kotak'>" . TglfromSql(getNextDays(rdb('spb', 'tgl_spb', 'tgl_spb', "where no_spb='" . $row->no_spb . "'"), $row->pp_ke * 30)) . "</td>\r\n\t\t\t\t <td id='c-1-{$n}' class='kotak'><img src='" . base_url() . "asset/images/{$gb}' id='ck-{$n}' class='pros' onclick=\"upd_lelang('" . $row->no_spb . "','{$grb}');\"></td>"; echo " </tr>\n"; } } else { echo "Tidak ada barang yang akan di lelang"; } }
function pelunasan() { $n = 0; $data = array(); $datax = array(); $no_spb = $_POST['no_spb']; $data['ae'] = $this->Admin_model->is_oto('spb/lunas', 'e'); $data = $this->Admin_model->show_list('spb', "where no_spb='{$no_spb}' order by left(no_spb,5),year(tgl_spb)"); foreach ($data->result() as $row) { $n++; echo "\n<tr class='xx' id='" . $row->no_spb . "' align='center'>\r\n\t\t\t\t <td class='kotak' align='left'>" . $row->id_barang . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format($row->taksir_spb, 2) . "</td>\t\r\n\t\t\t\t <td class='kotak' align='right'>" . number_format($row->nilai_spb, 2) . "</td>\t\r\n\t\t\t\t <td class='kotak'>" . $row->jw_spb . "</td>\t\r\n\t\t\t\t <td class='kotak'>" . TglfromSql($row->jt_spb) . "</td>\r\n\t\t\t\t <td id='c-1' class='kotak'>" . perpanjang($row->no_spb, 1, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-2' class='kotak'>" . perpanjang($row->no_spb, 2, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-3' class='kotak'>" . perpanjang($row->no_spb, 3, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-4' class='kotak'>" . perpanjang($row->no_spb, 4, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-5' class='kotak'>" . perpanjang($row->no_spb, 5, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-6' class='kotak'>" . perpanjang($row->no_spb, 6, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-7' class='kotak'>" . perpanjang($row->no_spb, 7, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-8' class='kotak'>" . perpanjang($row->no_spb, 8, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-9' class='kotak'>" . perpanjang($row->no_spb, 9, true, true) . "</td>\t\r\n\t\t\t\t <td id='c-10' class='kotak'>" . perpanjang($row->no_spb, 10, true, true) . "</td>\t\r\n\t\t\t\t </tr>\n"; } }