예제 #1
0
파일: laporan.php 프로젝트: laiello/ksu
 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);
 }
예제 #2
0
파일: lelang.php 프로젝트: laiello/ksu
 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";
     }
 }
예제 #3
0
function perpanjang($no_spb, $pp_ke = 1, $showtgl = false, $bayar = false)
{
    $jtspb = rdb('spb', 'tgl_spb', 'tgl_spb', "where no_spb='{$no_spb}'");
    $nextjtspb = getNextDays($jtspb, $pp_ke * 30);
    $nextjtspb2 = getNextDays($jtspb, ($pp_ke + 1) * 30);
    $bataslelang = getNextDays($nextjtspb, 13);
    $today = date('Y-m-d');
    $stat = rdb('perpanjang_spb', 'pp_ke', 'pp_ke', "where no_spb='" . $no_spb . "' and pp_ke='{$pp_ke}'");
    $action = rdb('perpanjang_spb', 'pp_stat', 'pp_stat', "where no_spb='" . $no_spb . "' and pp_ke='{$pp_ke}'");
    $bayare = $bayar == true && $pp_ke > 1 ? rdb('perpanjang_spb', 'pp_stat', 'pp_stat', "where no_spb='" . $no_spb . "' and pp_ke='" . ($pp_ke - 1) . "'") : '';
    $bunga = rdb('spb', 'taksir_spb', 'taksir_spb', "where no_spb='{$no_spb}'");
    $bunga = $bunga * 10 / 100;
    if ($stat == '') {
        if (compare_date($today, $bataslelang) == true && compare_date($today, $nextjtspb) == false) {
            return "<img class='aksi' src='" . base_url() . "/asset/images/icon-25.gif' width='20' height='20' title='Klik untuk process perpanjang' onclick=\"aksi_click('{$no_spb}','{$pp_ke}','{$bunga}')\";>";
        } else {
            return compare_date($nextjtspb2, $today) == false ? $bayar == true && $bayare == 'Y' || $pp_ke == '1' ? "<img src='" . base_url() . "/asset/images/checkout.gif' title='Click untuk transaksi bayar' onclick=\"aksi_click('{$no_spb}','{$pp_ke}','{$bunga}')\">" : false : "<img src='" . base_url() . "/asset/images/8.png' title='Tidak di perpanjang lanjut untuk process lelang'>";
        }
    } else {
        if ($action == 'Y') {
            return $showtgl == false ? "<img src='" . base_url() . "/asset/images/iconic.png' ondblclick=\"reset_upd('{$no_spb}','{$pp_ke}','');\" title='Telah di perpanjang " . $stat . " kali.\nTanggal Jatuh Tempo berikutnya :" . tglfromSql(getNextDays($jtspb, ($stat + 1) * 30)) . "'>" : ShortTgl($nextjtspb2);
        } else {
            if ($action == 'N') {
                return "<img src='" . base_url() . "/asset/images/8.png' ondblclick=\"reset_upd('{$no_spb}','{$pp_ke}','Y');\" title='Tidak di perpanjang lanjut untuk process lelang'>";
            } else {
                if ($action == 'L') {
                    return "<img src='" . base_url() . "/asset/images/bullet.png' title='Lunas'>";
                } else {
                    return false;
                }
            }
        }
    }
}