Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Jurnal_report extends CI_Controller
- {
- function __construct() {
- parent::__construct();
- $this->load->model('reports_model');
- $this->load->model('workorder_model');
- $this->load->model('log_model');
- $this->load->model('Warehouses_products_model');
- $this->load->model('Sales_model');
- $this->load->model('sales_return_model');
- $this->load->model('Customer_model');
- $this->load->model('Supplier_model');
- }
- public function sales_list(){
- $data['data'] = $this->Sales_model->getSales2()->get()->result();
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_list',$data);
- }
- public function sales_customer(){
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_customer',$data);
- }
- public function sales_customer_filter(){
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_customer',$data);
- }
- public function sales_by_products(){
- $data['data'] = $this->Sales_model->getSalesByProduct();
- $data['product'] = $this->Sales_model->getProducts2();
- $this->load->view('jurnal_report/sales_by_products',$data);
- }
- public function customer_balance(){
- $data['data'] = $this->Customer_model->get_sales_customer();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/customer_balance',$data);
- }
- public function customer_balance_filter(){
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['data'] = $this->Customer_model->get_sales_customer_filter($awal,$akhir);
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/customer_balance',$data);
- }
- public function sales_by_product_report()
- {
- $product_id = $this->input->post('product');
- $start_date = $this->input->post('start_date');
- $end_date = $this->input->post('end_date');
- if($this->input->post('submit') == "Submit"){
- $data = $this->Sales_model->getSalesByProduct($product_id,$start_date,$end_date);
- $data['product'] = $this->Sales_model->getProducts2();
- $this->load->view('jurnal_report/sales_by_products',$data);
- }
- }
- public function purchase_list(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['data'] = $this->reports_model->getPurchase($filter);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $this->load->view('jurnal_report/purchase_list',$data);
- }
- public function purchase_list_filter(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['data'] = $this->reports_model->getPurchase_filter($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- $this->load->view('jurnal_report/purchase_list',$data);
- }
- public function purchase_by_vendor(){
- $data['data'] = $this->Supplier_model->purchase_by_vendor();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/purchase_by_vendor',$data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement