[eluser]robert.fulcher[/eluser]
rajneeshgobin,
Sorry for the delay in the post. You should be able to download the project. Then you can extract the items needed and place in your project. I have not setup a stand alone plugin before so I put up what people needed. I certainly could have done a better job.
The main components are
controller/createreportctlr.php
model/createreportmodel.php
third_party directory
views/* (All files in the views folder)
There are some routes in the the routes.php file that you will need.
$route['default_controller'] = "createreportctlr";
$route['selecttable'] = "createreportctlr/selecttable";
$route['edit-report/(:num)'] = "createreportctlr/editreport/$1";
$route['selecttable/(:num)'] = "createreportctlr/selecttable/$1";
$route['selectcolumn'] = "createreportctlr/selectcolumn";
$route['getTableColumn'] = 'createreportctlr/getTableColumn';
$route['setcondition'] = 'createreportctlr/setCondition';
$route['getexcelexport/(:num)'] = 'createreportctlr/getExcelExport/$1';
$route['removehistoryrecord'] = 'createreportctlr/removehistoryrecord';
and then there are some items for declaring the tables you want to show. you can put them in a separate config file or in the config.php. This line is used to select the tables you want someone to have the ability to report from. (Sample tables are in there).
$config['database_reports_tables'] = array('company'=>'Company','department'=>'Department','inventory'=>'Inventory');
There are some items that need cleaned up in the model. below is the sql you need which I forgot to put in the project.
CREATE TABLE IF NOT EXISTS `historyreportsfields` (
`pkHistoryReportsFieldID` int(11) NOT NULL AUTO_INCREMENT,
`fkReportHistoryID` int(11) NOT NULL,
`AllTablesName` text NOT NULL,
`SelectedTablesName` text NOT NULL,
`SelectedColumns` text NOT NULL,
`AllConditions` text NOT NULL,
`SelectedSortByColumnName` varchar(255) NOT NULL,
`SelectedSortOrder` varchar(255) NOT NULL,
`RecordsPerPage` int(11) NOT NULL,
`SaveReport` varchar(255) NOT NULL,
PRIMARY KEY (`pkHistoryReportsFieldID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
CREATE TABLE IF NOT EXISTS `reporthistory` (
`pkHistoryID` int(100) NOT NULL AUTO_INCREMENT,
`ReportName` varchar(255) NOT NULL,
`SqlQuery` text NOT NULL,
`DateCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`pkHistoryID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Sorry it really needs to be refined and cleaned up but I needed to crank something out fast....hope this helps.