Beispiel #1
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.pelunasan.php';
    $pelunasan = new pelunasan();
    switch ($_POST['apa']) {
        case "get-bg":
            $collect = array();
            if (isset($_POST['tgl']) && $_POST['tgl'] != "") {
                if ($query = $pelunasan->get_bg_belum_ambil($_POST['tgl'], $_POST['tgl'])) {
                    while ($rs = $query->fetch_array()) {
                        $detail = array();
                        array_push($detail, $rs["nama"]);
                        array_push($detail, $rs["no_bukti"]);
                        array_push($detail, "Rp " . number_format($rs["total_bayar"], 0, ".", ","));
                        array_push($detail, "<button class='btn btn-sm btn-primary' id='btn-ambil' data-id='" . $rs['id'] . "' \n\t\t\t\t\t\t\tdata-tgl='" . $rs['tgl_bg'] . "' data-total='" . $rs['total_bayar'] . "' data-bank='" . $rs['id_bank'] . "' \n\t\t\t\t\t\t\tdata-bukti='" . $rs['no_bukti'] . "'><i class='fa fa-share'></i></button>");
                        array_push($collect, $detail);
                        unset($detail);
                    }
                }
            }
            echo json_encode(array("aaData" => $collect));
            break;
        case "ambil-bg":
            $arr = array();
            if (isset($_POST['id']) && $_POST['id'] != "" && isset($_POST['tgl']) && $_POST['tgl'] != "" && isset($_POST['total']) && $_POST['total'] != "" && isset($_POST['bank']) && $_POST['bank'] != "" && isset($_POST['bukti']) && $_POST['bukti'] != "") {
                if ($result = $pelunasan->ambil_bg($_POST['id'], $_POST['tgl'], $_POST['total'], $_POST['bank'], $_POST['bukti'], d_code($_SESSION['en-data']))) {
                    $arr['status'] = TRUE;
                    $arr['msg'] = "Data tersimpan..";
                } else {
                    $arr['status'] = FALSE;
Beispiel #2
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()) {