<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class captainwisesale extends MY_Controller {

    function __construct() {
        parent::__construct();
    }

    public function index() {
//         $data['categories'] = $this->_getProdCategories();
        $this->load->view('settings/header');
        $this->load->view('sales/captainwisesale_view',null);
        $this->load->view('settings/footer');
    }
//waiter or  tariff report
    function getcaptainwisesale() {
         $this->load->model('sales/captainwisesale_model');

         $datefrom = $this->input->post('datefrom');
         $dateto = $this->input->post('dateto');
         $property = $this->input->post('property');
         $this->load->model('sales/captainwisesale_model');
     //  var_dump($property);

        echo $this->captainwisesale_model->getcaptainwisesale($datefrom,$dateto, $property);
//         $var= $this->salesmanreport_model->getsalesmansname($datefrom,$dateto);
//         var_dump($var);

    }


    function exportcsv()
{


        $file="captainwisesale.csv";
            header("Content-Disposition: attachment; filename=" . urlencode($file));
            header("Content-Type: application/force-download");
            header("Content-Type: application/octet-stream");
            header("Content-Type: application/download");
            header("Content-Description: File Transfer");
            header("Content-type: application/csv");
            header("Pragma: no-cache");
            header("Expires: 0");

            $export= $this->input->post('exportdata');


$this->load->helper('download');
force_download($file, $export);
}


}






