php-reports icon indicating copy to clipboard operation
php-reports copied to clipboard

Data for sample reports

Open valepu opened this issue 9 years ago • 8 comments

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.

valepu avatar Jul 07 '15 08:07 valepu

Bumping this question... I agree with valepu. I too am wondering this and currently reverse-searching to try and find.

Starfish777 avatar Jul 14 '15 15:07 Starfish777

Let me know if you find anything!

valepu avatar Jul 14 '15 15:07 valepu

Absolutlely valepu, you know I will!

Starfish777 avatar Jul 14 '15 16:07 Starfish777

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.

Starfish777 avatar Jul 15 '15 19:07 Starfish777

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.

Starfish777 avatar Jul 22 '15 18:07 Starfish777

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

valepu avatar Jul 23 '15 07:07 valepu

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');

charlesverge avatar Apr 02 '16 19:04 charlesverge

I've created a pull request with this data in it at #219

charlesverge avatar Apr 02 '16 20:04 charlesverge