Documentation
- PDF Documentation (Spanish) - 54.8 KBytes
Mini HowTo
FBGrid class use
To use simply add the following includes:
include("grid.php");
include("util.php");
To insert a grid, create a instance of the grid as follows:
$myGrid = new grid ($host, $username, $password, $table);
Where:
$host: name of the database to consult width format ip:path_to_bd\bd_name.fdb
$username: username
$password: password
$table: name of the table
Example
Editing Employee table from Firebird Database example.
$pathImagen = '../images/';
$host = '127.0.0.1:C:\Archivos de programa\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB';
//$host = '192.168.1.150:C:\Archivos de programa\Firebird\Firebird_2_0\examples\empbuild\EMPLOYEE.FDB';
$username = 'SYSDBA';
$password = 'masterkey';
//Create instance
$miGrilla= new grid($host,$username,$password,'PROJECT');
//Path where are used images
$miGrilla->rutaImagenes($pathImagen);
//If debug is needed, uncomment next line
//$miGrilla->debuger();
//Difine table title
$miGrilla->titulo('Proyects');
//Define titles of columns
$miGrilla->encabezados(array('Proyect ID','Proyect Name','Proyect Description','Team Leader','Product'));
//Define table fields that are not visible
$miGrilla->camposNoVisibles(array('PROJ_DESC'));
//Number of records in page
$miGrilla->paginador(20);
//Define autofilters
$miGrilla->autofiltro('TEAM_LEADER');
//Define ComboBox. Must be foreign key
$miGrilla->campoLookUp('TEAM_LEADER',"LAST_NAME || ', ' || FIRST_NAME");
//Define order by default
$miGrilla->campoOrden('PROJ_NAME',1);
//Filds hints
$miGrilla->hints('PRODUCT',"Must be: 'software', 'hardware', 'other', 'N/A'");
//Filter that make WHERE in table
$miGrilla->filtro("PRODUCT IN ('software', 'hardware')",
"Software and Hardware Products");
//Finaly show grid
$miGrilla->mostrar();