About Datagrid Component
------------------------------
Introduction
-------------
This datagrid component will make life easier for a php programmer by means of generating datagrid on the fly by supplying a few inputs to the datagrid method like width, height, no of records per page, etc
System Requirements
-------------------------
1. Php > 5
2. Mysql
3. Apache 2.0
4. OS - Any
Methods
----------
In this component the main class is "datagrid.inc.php" which has the following methods listed below:
1.DataGrid($w,$h,$lmt,$qResult,$class,$thClass,$linkClass) // Class Constructor
2.DisplayGrid()
3.GridData($result,$rec_limit)
1. DataGrid($w,$h,$lmt,$qResult,$class,$thClass,$linkClass) // Class Constructor
----------------------------------------------------------------------------------------
This method is the Datagrid class constructor which consists of the following parameters which has to be initialised during class object initialisation.
1.$w - Grid Width
2.$h - Grid height
3.$lmt - Specifies how many records per page
4.$qResult - This is the mysql query result which has to be passed
5.$class - This parameter takes the class name for the grid
6.$thClass - This parameter takes the class name for the grid heading row
7.$linkClass - This paramter takes the class name for the navigation links (eg: next, back)
2.DisplayGrid()
----------------
This method will invoke the GridData($result,$rec_limit) method.
3.GridData($result,$rec_limit)
----------------------------------
This is the method which most of the grid display functionality. It takes two parameters one the query result and other the limit ie records per page.
Note
------
DBClient.php
--------------
DBClient.php class is the one which takes care of the db connection and query execution so this class has to be added.
This class can be used individually for interacting with mysql database. This class supports php version greater than 5
Example:
----------
datagrid.php can be taken as the example for this class.
|