i need to generate some demo data.

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
a.tawila
Posts: 1
Joined: Wed Apr 02, 2008 2:28 am

i need to generate some demo data.

Post by a.tawila »

Hi All,

i need to install some demo data for timetrex on my server, to use it in making a demo on the system.
though i can't use the online demo because there will be no internet connection in the dome place, beside i use a version that don't have all the functionality of the current online version.

i found a "DemoData" class, but can't make use of it.
so i need your help either to explain a way to use this "DemoData" class, or kindly provide me with some script to fill the DB with the demo data.

timetrex v1.6.6
OS windows vista Business edition
using XAMPP v1.6.3a
Apache v2.2.4
MySQL v5.1.22-rc-community
PHP v5.2.3

Thank you very much.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Add demo_mode to your timetrex.ini.php file under the [other] section:
[other]
demo_mode = TRUE
Create a demo directory in your TimeTrex directory, and create a file called: demo_data.php inside it with the following contents:

Code: Select all

<?php
require_once( dirname(__FILE__) . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'includes'. DIRECTORY_SEPARATOR .'global.inc.php');
require_once( dirname(__FILE__) . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'includes'. DIRECTORY_SEPARATOR .'CLI.inc.php');

Debug::setBufferOutput(FALSE);
Debug::setEnable(FALSE);
Debug::setVerbosity(0);

if ( DEMO_MODE == TRUE ) {
        Debug::Text('Generating Data...', __FILE__, __LINE__, __METHOD__,10);

        $dd = new DemoData();
        //$dd->setUserNamePostFix( rand(1000,9999) );
        $dd->setUserNamePostFix( 1 );
        $dd->generateData();

} else {
        echo "DEMO MODE IS NOT ENABLED!<br>\n";
}

Debug::Display();
?>
Execute this script by running: php demo_data.php, let it run for a few minutes (could take up to 15 minutes to run), then login to TimeTrex with the following information:

Username: demoadmin1
Password: demo

You can only run this script once, before you have to change:

Code: Select all

$dd->setUserNamePostFix( 1 );
If you change the "1" to a "2", that will create a new "Demo Company" with the login information:

Username: demoadmin2
Password: demo

All usernames have to be unique, which is why you can only run the script once per "UserNamePostFix" setting.

Keep in mind this is advanced functionality and is not supported unless you are a member of our partner program.
Locked