<?php
//These files required for phpEzyGrid
require_once ("../db.php");
require_once ("../phpezygrid.php");
//These we requore to take care of the demo stuff, like using a common header/footer etc
require_once ("../demohelper.php");
$theSQL = "select * from tinycrm";
//For this demo we want to actually add some settings. This is always done by using an array.
//Lets call the array $mySettings
//1. First specify that we want to filter columns
$mySettings['cols.filter'] = 'Y'; //Defaults to N if not specified
//2. Optionally, specify which column we want to sort by initially (when the gird is displayed for the first time)
$mySettings['initial.sort.col'] = 'surname';
//3. Now we must add EACH column we want to display. The format is: cols.map.dbname.NAME_OF_COLUMN_IN_DB = NAME_YOU_WANT_TO_SEE_IN_GRID
$mySettings['cols.map.dbname.firstname'] = 'Firstname';
$mySettings['cols.map.dbname.surname'] = 'Surname';
$mySettings['cols.map.dbname.memberStatus'] = 'Current Satus';
//4. Thats it, now construct the grid HTML. NOTE that we now pass through our settings in the second param (we did not do this in demo1)
$demo2Content = gpBuildHTML($theSQL,$mySettings);
//Now use our little helper to send to browser
demoEchoPage('Demo 2', $demo2Content);
?>