php-reports
php-reports copied to clipboard
Data for sample reports
Hi, I'd like to know where the data to build the database used for the sample reports (specifically the mysql reports) can be found.
Bumping this question... I agree with valepu. I too am wondering this and currently reverse-searching to try and find.
Let me know if you find anything!
Absolutlely valepu, you know I will!
Hi valepu. I'm still looking for the where the content for the PHP is coming from. But in the meantime, I had to go into workbench and create a new database with 10 tables that I populated. I called the database, "test". So I then went into the /config/config.php and changed the settings to point to the database on my localhost
'mysql'=>array(
'host'=>'localhost',
'user'=>'root',
'pass'=>'passwordName',
'database'=>'test'
),
Then I used the examples from the WIKI to create an SQL file (that I put into my "reports" directory as suggested by the WiKI tutorial) that would pull everything from a certain table: https://github.com/jdorn/php-reports/wiki/Tutorial
I am still working on getting things working the way I want, but for now, the report does populate.
I hope this helps for now. I'm still looking for the origin of the PHP data/content that populates for timezones, hopefully someone else can also chime in.
The PHP pulldown choice example is coming from the timezones_multiple.php file in the Sample_reports/php/ directory. I think it's populating from the PHP object DateTimeZone::listAbbreviations(); This is a pre-populated Object from what I understand, much like Javascript's date/year object.
http://php.net/manual/en/datetimezone.listabbreviations.php
Not sure if this helps.
Thanks! It does help (though i'm on a break on my project these days). Too bad the MySQL report origin seems like a mistery
This is the sample data I created
CREATE TABLE `orders` (
`order_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`customer_fname` varchar(100) DEFAULT NULL,
`customer_lname` varchar(100) DEFAULT NULL,
`customer_id` int(11) DEFAULT NULL,
`grand_total` float DEFAULT NULL,
`status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `orders` VALUES (1,'2016-04-02 19:50:53','first1','last',1,100,'paid'),(2,'2016-04-01 19:50:53','first2','last',2,110,'paid'),(3,'2016-03-30 19:50:53','first3','last',3,120,'paid'),(4,'2016-03-28 19:50:53','first1','last',1,130,'paid'),(5,'2016-03-23 19:50:54','first2','last',2,200,'paid');
I've created a pull request with this data in it at #219