예제 #1
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.pelunasan.php';
    //include '../../model/class.pelunasan.php';
    $pelunasan = new pelunasan();
    switch ($_POST['apa']) {
        case "get-penjualan-tempo":
            $collect = array();
            if ($query = $pelunasan->get_penjualan_belum_lunas_all()) {
                while ($rs = $query->fetch_array()) {
                    $detail = array();
                    array_push($detail, $rs["tgl_tempo"]);
                    array_push($detail, $rs["id"]);
                    array_push($detail, $rs["no_nota"]);
                    array_push($detail, $rs["tgl"]);
                    array_push($detail, $rs["nama_konsumen"]);
                    array_push($detail, $rs["nama_barang"]);
                    array_push($detail, $rs["jml"]);
                    array_push($detail, "Rp " . number_format($rs["harga_jual"], 0, ".", ","));
                    array_push($detail, "Rp " . number_format($rs["total_jual"], 0, ".", ","));
                    array_push($detail, "<button type='button' class='btn btn-sm btn-primary' id='btn-show-bayar' data-id='" . $rs["id"] . "' data-bayar='" . $rs["total_jual"] . "'> \n\t\t\t\t\t\t\t<i class='fa fa-shopping-cart'></i></button>");
                    array_push($collect, $detail);
                    unset($detail);
                }
            }
            echo json_encode(array("aaData" => $collect));
            break;
        case "get-bank":
            $bank = new bank();
            if ($query = $bank->get_bank()) {