From dc0611958600584b7b2e730e59326726d3d787dc Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 6 Jul 2016 19:37:23 +0100 Subject: [PATCH] Move create_temp_table to Reports Controller constructor out of Model one --- application/controllers/Reports.php | 7 ++++++- application/models/reports/Report.php | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 788eb5a2e..7bb5b2ae1 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -21,8 +21,13 @@ class Reports extends Secure_Controller { redirect('no_access/reports/reports_' . $submodule_id); } - } + //Create our temp tables to work with the data in our report + $this->Sale->create_temp_table(); + $this->Receiving->create_temp_table(); + $this->Item->create_temp_table(); + } + $this->load->helper('report'); } diff --git a/application/models/reports/Report.php b/application/models/reports/Report.php index b450600c4..53d29f2e2 100644 --- a/application/models/reports/Report.php +++ b/application/models/reports/Report.php @@ -10,11 +10,6 @@ abstract class Report extends CI_Model $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate'); $this->output->set_header('Cache-Control: post-check=0, pre-check=0', FALSE); $this->output->set_header('Pragma: no-cache'); - - //Create our temp tables to work with the data in our report - $this->Sale->create_temp_table(); - $this->Receiving->create_temp_table(); - $this->Item->create_temp_table(); } //Returns the column names used for the report