Jump to content


rdroguett

Member Since 22 Jun 2012
Offline Last Active Jan 28 2019 12:33 PM
-----

Posts I've Made

In Topic: Issue whith export and print buttons

25 January 2019 - 02:59 PM

The data is lost, when your press the print or export button. I dont have any solutions when i send in get or post method.

In Topic: Error Export Data

25 January 2019 - 02:55 PM

Similar conflict

https://www.groceryc...979#entry148979

In Topic: Issue whith export and print buttons

25 January 2019 - 02:54 PM

I have a some problem. The post data lost when i press export or print action

In Topic: Error Export Data

25 January 2019 - 08:19 AM

the only way work export data in my controller is use a hard value example

 

NOT WORK

    public function report_sales_for_code(){

        $ide_company    =   $this->session->userdata['logged_in']['ide_company'];
        $ide_user       =   $this->session->userdata['logged_in']['ide_user'];

        //$date_start     =   $this->input->post('rvc_date_in', TRUE);
        //$date_end       =   $this->input->post('rvc_date_out', TRUE);

        $this->session->set_flashdata('in',$this->input->post('rvc_date_in', TRUE)); 
        $this->session->set_flashdata('out',$this->input->post('rvc_date_out', TRUE));         
        
        $date_start = $this->session->flashdata('in');
        $date_end   = $this->session->flashdata('out');
        
        $crud = new grocery_CRUD();   
        $crud->set_theme('bootstrap-v4');
        $crud->set_model('custom_query_model');
        $crud->set_table('e_order');
        //$crud->set_primary_key('CODE');  

        $crud->basic_model->set_query_str("
            SELECT
            a.ide_order,
            b.code as code,
            b.name as name,
            sum(b.qty) as qty
            FROM e_order a,  e_product b, e_invoice_order e, e_invoice f
            WHERE a.ide_order = b.ide_order
            AND e.ide_order = a.ide_order
            and f.ide_invoice = e.ide_invoice
            and a.ide_order_status = 2
            and DATE_FORMAT(a.date,'%Y-%m-%d') BETWEEN '$date_start' AND '$date_end'
            and a.ide_company = $ide_company
            and f.status = 'Habilitado'
            group by code
            order by b.code asc");

        $crud->set_subject('Reporte de ventas por codigo: '.date("d/m/Y", strtotime($date_start)).' hasta '.date("d/m/Y", strtotime($date_end)).'');
        $crud->display_as('name','Producto');
        $crud->display_as('code','Codigo');
        $crud->display_as('qty','Cantidad');     
        $crud->columns('code','name','qty');
        //$crud->unset_operations();
        $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); $crud->unset_read();
        $output = $crud->render();
        $this->_appservice_output($output);
    }

WORK

    public function report_sales_for_code(){

        $ide_company    =   $this->session->userdata['logged_in']['ide_company'];
        $ide_user       =   $this->session->userdata['logged_in']['ide_user'];   
        
        $date_start = '2019-01-01';
        $date_end   = '2019-01-01';
        
        $crud = new grocery_CRUD();   
        $crud->set_theme('bootstrap-v4');
        $crud->set_model('custom_query_model');
        $crud->set_table('e_order');
        //$crud->set_primary_key('CODE');  

        $crud->basic_model->set_query_str("
            SELECT
            a.ide_order,
            b.code as code,
            b.name as name,
            sum(b.qty) as qty
            FROM e_order a,  e_product b, e_invoice_order e, e_invoice f
            WHERE a.ide_order = b.ide_order
            AND e.ide_order = a.ide_order
            and f.ide_invoice = e.ide_invoice
            and a.ide_order_status = 2
            and DATE_FORMAT(a.date,'%Y-%m-%d') BETWEEN '$date_start' AND '$date_end'
            and a.ide_company = $ide_company
            and f.status = 'Habilitado'
            group by code
            order by b.code asc");

        $crud->set_subject('Reporte de ventas por codigo: '.date("d/m/Y", strtotime($date_start)).' hasta '.date("d/m/Y", strtotime($date_end)).'');
        $crud->display_as('name','Producto');
        $crud->display_as('code','Codigo');
        $crud->display_as('qty','Cantidad');     
        $crud->columns('code','name','qty');
        //$crud->unset_operations();
        $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); $crud->unset_read();
        $output = $crud->render();
        $this->_appservice_output($output);
    }

In Topic: Error Export Data

24 January 2019 - 06:30 PM

Where insert this

 

ini_set('display_errors', 'on');
error_reporting(E_ALL);

 

I put in index.php on the root folder but not work!