예제 #1
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.penjualan.php';
    $penjualan = new penjualan();
    switch ($_POST['apa']) {
        case "get-request":
            $collect = array();
            if ($query = $penjualan->runQuery("SELECT `request_hapus`.*, `karyawan`.`nama` FROM `request_hapus` \n\t\t\t\tINNER JOIN `karyawan` ON(`request_hapus`.`id_karyawan` = `karyawan`.`id`) WHERE `jenis` = '1' \n\t\t\t\tAND `is_proses` = '0' AND `request_hapus`.`hapus` = '0';")) {
                while ($rs = $query->fetch_array()) {
                    $detail = array();
                    array_push($detail, $rs["tgl"]);
                    array_push($detail, $rs["nama"]);
                    array_push($detail, $rs["id_hapus"]);
                    array_push($detail, $rs["keterangan"]);
                    array_push($detail, "<button class='btn btn-sm btn-primary' id='btn-cek' data-id='" . $rs['id_hapus'] . "'>\n\t\t\t\t\t\t\t<i class='fa fa-search'></i></button>\n\t\t\t\t\t\t\t<button class='btn btn-sm btn-danger' id='btn-hapus-req' data-id='" . $rs['id'] . "'>\n\t\t\t\t\t\t\t<i class='fa fa-trash-o'></i></button>");
                    array_push($collect, $detail);
                    unset($detail);
                }
            }
            echo json_encode(array("aaData" => $collect));
            break;
        case "get-penjualan":
            $collect = array();
            if (isset($_POST['id']) && $_POST['id'] != "") {
                $qJual = "SELECT `penjualan`.*, `barang`.`nama` AS `nama_barang`, `konsumen`.`nama` AS `nama_konsumen`, \n\t\t\t\t\t\t\t`penjualan_acc_gudang`.`acc_gudang`, `pelunasan`.`id_bank`, `pelunasan`.`id_bank` AS `idbanklunas` FROM `penjualan`\n\t\t\t\t\t\t\tINNER JOIN `barang` ON (`penjualan`.`id_barang` = `barang`.`id`) \n\t\t\t\t\t\t\tINNER JOIN `konsumen` ON (`penjualan`.`id_konsumen` = `konsumen`.`id`) \n\t\t\t\t\t\t\tINNER JOIN `penjualan_acc_gudang` ON (`penjualan`.`id` = `penjualan_acc_gudang`.`id_penjualan`) \n\t\t\t\t\t\t\tLEFT JOIN `pelunasan` ON (`penjualan`.`id` = `pelunasan`.`id_penjualan`) \n\t\t\t\t\t\t\tWHERE `penjualan`.`id` = '" . $_POST['id'] . "';";
                if ($query = $penjualan->runQuery($qJual)) {
                    while ($rs = $query->fetch_array()) {
                        $detail = array();
                        array_push($detail, $rs["id"]);
                        array_push($detail, $rs["no_nota"]);
예제 #2
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.penjualan.php';
    $penjualan = new penjualan();
    switch ($_POST['apa']) {
        case "get-penjualan":
            $collect = array();
            if (isset($_POST['tgl']) && $_POST['tgl'] != "" && isset($_POST['jenis']) && $_POST['jenis'] != "") {
                if ($_POST['jenis'] == '1') {
                    $qJual = "SELECT `penjualan`.`id`, `penjualan`.`no_nota`, `penjualan`.`jml`, `penjualan`.`total_bayar`,\n\t\t\t\t\t\t\t\t`barang`.`id` AS `id_barang`, `barang`.`nama` AS `nama_barang`, `konsumen`.`nama` AS `nama_konsumen` \n\t\t\t\t\t\t\t\tFROM `penjualan` \n\t\t\t\t\t\t\t\tINNER JOIN `barang` ON (`penjualan`.`id_barang` = `barang`.`id`) \n\t\t\t\t\t\t\t\tINNER JOIN `konsumen` ON (`penjualan`.`id_konsumen` = `konsumen`.`id`) \n\t\t\t\t\t\t\t\tWHERE `penjualan`.`tgl` = '" . $_POST['tgl'] . "' AND `penjualan`.`jenis` = '1' AND `penjualan`.`no_bukti` = '';";
                } else {
                    $qJual = "SELECT `pelunasan`.`id`, `penjualan`.`no_nota`, `penjualan`.`jml`, `pelunasan`.`total_bayar`,\n\t\t\t\t\t\t\t\t`barang`.`id` AS `id_barang`, `barang`.`nama` AS `nama_barang`, `konsumen`.`nama` AS `nama_konsumen` \n\t\t\t\t\t\t\t\tFROM `pelunasan` \n\t\t\t\t\t\t\t\tINNER JOIN `penjualan` ON (`pelunasan`.`id_penjualan` = `penjualan`.`id`) \n\t\t\t\t\t\t\t\tINNER JOIN `barang` ON (`penjualan`.`id_barang` = `barang`.`id`) \n\t\t\t\t\t\t\t\tINNER JOIN `konsumen` ON (`penjualan`.`id_konsumen` = `konsumen`.`id`) \n\t\t\t\t\t\t\t\tWHERE `pelunasan`.`tgl` = '" . $_POST['tgl'] . "' AND `pelunasan`.`jenis` = '1' AND `pelunasan`.`no_bukti` = '';";
                }
                if ($query = $penjualan->runQuery($qJual)) {
                    while ($rs = $query->fetch_array()) {
                        $detail = array();
                        array_push($detail, $rs["id"]);
                        array_push($detail, $rs["no_nota"]);
                        array_push($detail, $rs["nama_konsumen"]);
                        array_push($detail, $rs["nama_barang"]);
                        array_push($detail, $rs["jml"]);
                        array_push($detail, "<button class='btn btn-sm btn-primary' id='btn-show-setor' data-id='" . $rs['id'] . "' \n\t\t\t\t\t\t\t\t\t\tdata-total='" . $rs['total_bayar'] . "' data-idbarang='" . $rs['id_barang'] . "'>\n\t\t\t\t\t\t\t\t\t\t<i class='fa fa-mail-forward'></i></button>");
                        array_push($collect, $detail);
                        unset($detail);
                    }
                }
            }
            echo json_encode(array("aaData" => $collect));
            break;
        case "get-bank":
예제 #3
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.penjualan.php';
    $penjualan = new penjualan();
    switch ($_POST['apa']) {
        case "get-penjualan":
            $collect = array();
            $qJual = "SELECT `penjualan_acc_gudang`.`id_penjualan`, `penjualan`.`tgl`, `penjualan`.`no_nota`, `penjualan`.`jml`, `barang`.`id` AS \n\t\t\t\t\t\t`id_barang`, `barang`.`nama` AS `nama_barang`, `konsumen`.`nama` AS `nama_konsumen`, \n\t\t\t\t\t\t`penjualan_acc_gudang`.`acc_gudang` FROM `penjualan_acc_gudang` \n\t\t\t\t\t\tINNER JOIN `penjualan` ON (`penjualan_acc_gudang`.`id_penjualan` = `penjualan`.`id`) \n\t\t\t\t\t\tINNER JOIN `barang` ON (`penjualan`.`id_barang` = `barang`.`id`) \n\t\t\t\t\t\tINNER JOIN `konsumen` ON (`penjualan`.`id_konsumen` = `konsumen`.`id`) \n\t\t\t\t\t\tWHERE `penjualan_acc_gudang`.`acc_gudang` IS NULL;";
            if ($query = $penjualan->runQuery($qJual)) {
                while ($rs = $query->fetch_array()) {
                    if ($rs['acc_gudang'] == null) {
                        $acc = "Belum";
                        $button = "<button class='btn btn-primary btn-sm' id='btn-acc' data-id='" . $rs['id_penjualan'] . "' \n\t\t\t\t\t\t\t\t\tdata-barang='" . $rs['id_barang'] . "' data-jml='" . $rs['jml'] . "'><i class='fa fa-check'></i></button>";
                    } else {
                        if ($rs['acc_gudang'] == "1") {
                            $acc = "Ya";
                            $button = "";
                        } else {
                            $acc = "Tidak";
                            $button = "";
                        }
                    }
                    $detail = array();
                    array_push($detail, $rs["id_penjualan"]);
                    array_push($detail, $rs["tgl"]);
                    array_push($detail, $rs["no_nota"]);
                    array_push($detail, $rs["nama_konsumen"]);
                    array_push($detail, $rs["nama_barang"]);
                    array_push($detail, $rs["jml"]);
                    array_push($detail, $acc);
예제 #4
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    include 'modules/model/class.penjualan.php';
    include 'modules/model/class.pemesanan.php';
    $penjualan = new penjualan();
    $pemesanan = new pemesanan();
    switch ($_POST['apa']) {
        // case "get-sales":
        // include 'modules/model/class.karyawan.php';
        // $karyawan = new karyawan();
        // if ($query = $karyawan->get_karyawan()) {
        // while ($rs = $query->fetch_array()) {
        // echo "<option value='".$rs['id']."'>".$rs['nama']."</option>";
        // }
        // }
        // break;
        // case "get-barang":
        // include 'modules/model/class.barang.php';
        // $barang = new barang();
        // if ($query = $barang->get_barang()) {
        // while ($rs = $query->fetch_array()) {
        // echo "<option value='".$rs['id']."' data-het='".$rs['het']."'>".$rs['nama']."</option>";
        // }
        // }
        // break;
        // case "get-konsumen":
        // $konsumen = new konsumen();
        // if ($query = $konsumen->get_konsumen()) {
        // while ($rs = $query->fetch_array()) {
        // echo "<option value='".$rs['id']."'>".$rs['nama']."</option>";