Exemplo n.º 1
0
             $arr['status'] = TRUE;
             $arr['msg'] = "Data tersimpan..";
         } else {
             $arr['status'] = FALSE;
             $arr['msg'] = "Gagal menyimpan..";
         }
     } else {
         $arr['status'] = FALSE;
         $arr['msg'] = "Harap isi data dengan lengkap..";
     }
     echo json_encode($arr);
     break;
 case "hapus-konsumen":
     $arr = array();
     if (isset($_POST['id']) && $_POST['id'] != "") {
         if ($result = $konsumen->hapus($_POST['id'])) {
             $arr['status'] = TRUE;
             $arr['msg'] = "Data terhapus..";
         } else {
             $arr['status'] = FALSE;
             $arr['msg'] = "Gagal menghapus..";
         }
     } else {
         $arr['status'] = FALSE;
         $arr['msg'] = "Harap isi data dengan lengkap..";
     }
     echo json_encode($arr);
     break;
 case "get-harga-jual":
     $collect = array();
     if ($query = $konsumen->get_konsumen()) {