PHP examples
Gantt chart

Do not run this file locally
Run it from your (local) web server where is installed your http server like IIS or Apache and PHP 4.x/5.x.

The PHP CGI or ISAPI service program must have write access to all files in folder /ExamplesGantt/Php/Database
To permit write access on Windows XP right click to file Database in My Computer, select Properties -> Security -> Users and set Full control to Allow. If you don't have Security item in Properties, run My Computer, in menu select Tools - > Folder options -> View and uncheck Use simple file sharing option.

All the examples use SQL database in text files (PHP Text DB). The PHP core files for txt database are located in /php-txt-db-api directory. The database is located in directory /Database where are stored tables as individual txt files.
For database access are used objects Database and Recordset defined in /Framework/IncDbTxt.php file. You can change database provider to other (odbc,ado,sqlite) by including other IncDb...php file and changing connection string when creating Database object.

To test MySQL database run the /ExamplesGantt/Php/MySqlUTF8.sql script in your MySql database engine.
MySQL must be in UTF8 encoding to store the characters correctly!
The SQL script can be run on database by: mysql.exe -uroot -p < MySqlUTF8.sql
Update paths or copy MySqlUTF8.sql to the MySQL /bin directory a run it here.
To use MySQL database in the PHP examples, modify the php example (e.g. Basic.php), the Database switching paragraph by:
require_once("../Framework/IncDbMySQL.php"); $db = new Database("TreeGridTest","root","your root password");


Example index

 
Gantt chart
How to download and upload Gantt chart in SQL database and in static XML file
Gantt Database Basic Demonstrates basic loading Gantt chart from and uploading changes to SQL database link
Gantt Database Tree Demonstrates creating Gantt chart tree from one SQL database table by grouping and uploading changes back link
Gantt File Demonstrates loading Gantt chart from static XML file and storing the complete changed file back to disk link
 
Run chart
How to download and upload Run chart in SQL database and in static XML file
Gantt Run Database Demonstrates basic loading Gantt Run chart from and uploading changes to SQL database link
Gantt Run File Demonstrates loading Gantt Run chart from static XML file and storing the complete changed file back to disk link


Gantt chart

Demonstrating TreeGrid Gantt chart, communication with database and static XML file.

Gantt Database Basic
Main file GanttBasicDB.html, support codes GanttBasicDef.xml as layout, GanttBasicDBData.php as data, GanttBasicDBUpload.php as upload
Data are in database table "GanttBasic".
Demonstrates loading data source for Gantt chart from SQL database and uploading changes back to the database.
Presents base Gantt chart features - Main bar, milestones and dependencies.

Gantt Database Tree
Main file GanttTreeDB.html, support codes GanttTreeDef.xml as layout, GanttTreeDBData.php as data, GanttTreeDBUpload.php as upload
Data are in database table "GanttTree".
Demonstrates creating Gantt chart tree from one SQL database table by grouping and uploading changes back.
The tree levels are stored in column L1 - L4 and these values are used for grouping by the same values. The example supports four levels, but can be easily extended.
Presents base Gantt chart features - Main bar, milestones and dependencies.

Gantt File Tree
Main file GanttTreeFile.html, support codes GanttTreeDef.xml as layout, GanttTreeData.xml as data source XML, GanttTreeFileUpload.php as upload
Demonstrates creating Gantt chart from static XML file and uploading changes back to this file.
It demonstrates also creating Gantt chart tree by grouping. The tree levels are stored in column L1 - L4 and these values are used for grouping by the same values. The example supports four levels, but can be easily extended.
Presents base Gantt chart features - Main bar, milestones and dependencies.

Run chart

Demonstrating TreeGrid Run chart, communication with database and static XML file.

Gantt Database Run
Main file RunDB.html, support codes RunDBDef.xml as layout, RunDBData.php as data, RunDBUpload.php as upload
Data are in database table "Run".
Demonstrates loading data source for Gantt Run chart from SQL database and uploading changes back to the database.
Presents all Gantt chart Run features - independent boxes, different text, color, tooltip, features and box adding, moving, copying, deleting, resizing.

Gantt File Run
Main file RunFile.html, support codes RunDef.xml as layout, RunData.xml as data source XML, RunFileUpload.php as upload
Demonstrates creating Gantt Run chart from static XML file and uploading changes back to this file.
Presents all Gantt chart Run features - independent boxes, different text, color, tooltip, features and box adding, moving, copying, deleting, resizing.