PHP Classes

File: datagrid.php

Recommend this page to a friend!
  Packages of haseeb   Data Grid Component   datagrid.php   Download  
File: datagrid.php
Role: Example script
Content type: text/plain
Description: datagrid example
Class: Data Grid Component
Display MySQL query results in HTML tables
Author: By
Last change: documentation
Date: 18 years ago
Size: 1,857 bytes
 

 

Contents

Class file image Download
<html>
<head>
<title>Datagrid Component</title>
<style type="text/css">
.tblContent
{
  border: 0px;
  color:#000000;
  font-family:Verdana, Arial, Helvetica, sans-serif;
  font-size:11px;
  font-weight:normal;
  text-decoration:none;
}  
.thContent
{
  border: 0px;
  color:#990000;
  font-family:Verdana, Arial, Helvetica, sans-serif;
  font-size:11px;
  font-weight:normal;
  text-decoration:none;

}
.link
{
   color:#333333;
   font-family:Arial, Helvetica, sans-serif;
   font-size:12px;
   font-weight:bold;
   text-decoration:none;
   padding-right:20px;
   
}
.link:hover
{
   color:#333333;
   font-family:Arial, Helvetica, sans-serif;
   font-size:12px;
   font-weight:bold;
   text-decoration:underline;
   padding-right:20px;
   
}
</style>
</head>
<body>
<?php
require("DBClient.php");
require("datagrid.inc.php");

  $server="server name"; // Replace the value here with your server name
  $user="user name";     // Replace the value here with your db username
  $pass="password";      // Replace the value here with your db password
  $db="database name";   // Replace the value here with your database name
  
  $limit=5; //can change to desired number of records per page
  $width="50%"; //Can Change table width here 
  $height="100%"; // Can Change table height here
  $tblClass="tblContent"; // Can Change table class name here
  $tblHeadClass="thContent"; // Can Change table heading row class name here
  $navLinkClass="link";  //Can Change navigation (eg: Next, Back) class name here
  
  
  $dbClient=new DBClient($server,$user,$pass,$db);
  $queryResult=$dbClient->query("put your query without limit in query");
  
  $grid=new DataGrid($width,$height,$limit,$queryResult,$tblClass,$tblHeadClass,$navLinkClass);   
  $grid->DisplayGrid();
  
?>
</body>
</html>