PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Jacek Lukasiewicz   Bindable Simple Data Grid   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example use
Class: Bindable Simple Data Grid
Display and edit data on a table grid
Author: By
Last change:
Date: 11 years ago
Size: 1,200 bytes


Class file image Download
include 'data/Person.php';

<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>SimpleGrid Examlpes</title>
<link type="text/css" rel="stylesheet" media="screen" href="style.css" />

<div id="wrapper">
= new DataSource();
$employersGrid = new SimpleGrid("EmployersGrid");
$customersGrid = new SimpleGrid("CustomersGrid");
$employersGrid->setHeaders(array('ID', 'Employer', 'Age' ));
$customersGrid->setHeaders(array('ID', 'Customer', 'Age', 'Notes'));
$_POST)) {
    } else {
<form method="post">
    <h2>Read-only grid</h2>
    <?php echo $employersGrid->render(); ?>
    <h2>Editable grid</h2>
    <?php echo $customersGrid->render(); ?>
<input type="submit" value="Save..."/>