/** * Get CSV data * @param [type] $data_type [description] * @return [type] [description] */ public function getCsvData($data_type) { $app = \Cobalt\Container::fetch('app'); $data = array(); $export_ids = $app->input->get('ids'); switch ($data_type) { case "deals": $model = new Deal(); $data = $model->getDeals($export_ids); break; case "companies": $model = new Company(); $data = $model->getCompanies($export_ids); break; case "people": $model = new People(); $data = $model->getPeople($export_ids); break; case "sales_pipeline": $model = new Deal(); $data = $model->getReportDeals($export_ids); break; case "source_report": $model = new Deal(); $data = $model->getDeals($export_ids); break; case "roi_report": $model = new Source(); $data = $model->getRoiSources($export_ids); break; case "notes": $model = new Note(); $data = $model->getNotes(NULL, NULL, FALSE); break; case "custom_report": $model = new Report(); $data = $model->getCustomReportData($app->input->get('report_id')); break; } if (count($data)) { $header = array_keys((array) $data[0]); } return array('header' => $header, 'rows' => $data); }
public function _display_roi_report_filter() { //get sources for reports $sourceModel = new SourceModel(); $this->sources = $sourceModel->getRoiSources(); }
public function _display_roi_report() { //get sources for reports $sourceModel = new SourceModel(); $sources = $sourceModel->getRoiSources(); // Initialise state variables. $state = $sourceModel->getState(); //list view $roi_report_header = ViewHelper::getView('reports', 'roi_report_header', 'phtml', array('state' => $state)); $roi_report_list = ViewHelper::getView('reports', 'roi_report_filter', 'phtml', array('sources' => $sources)); $roi_report_footer = ViewHelper::getView('reports', 'roi_report_footer', 'phtml'); //assign rfs to view $this->roi_report_header = $roi_report_header; $this->roi_report_list = $roi_report_list; $this->roi_report_footer = $roi_report_footer; $this->state = $state; $this->sources = $sources; }