PHP Classes

File: example/index.php

Recommend this page to a friend!
  Classes of Daniele   Table Designer   example/index.php   Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: Example Index
Class: Table Designer
Display HTML table from array of data
Author: By
Last change: Added License on Example
Date: 14 years ago
Size: 2,520 bytes
 

Contents

Class file image Download
<?php
/*
 * tableDesigner - A class library to manage table using arrays
 * Copyright (C) 2010 Daniele Monti (monska13 [at] gmail.com)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * */
?>

<?php

echo "<style>\n#title{cursor:pointer;}\n.intestazione{font-weight:bold;}\n.td{border:1px solid black;text-align:center;padding:10px;}\n</style>\n\n";

$intestazione = array( "Logo" , "Col 1" , "Col 2" , "Col 3" );

$i = 0;

$data[$i]['Logo'] = "<img src=\"image/new.gif\" border=0 alt=\"NEW\" title=\"NEW\" />";
$data[$i]['Col 1'] = "Row".($i+1)." Col1";
$data[$i]['Col 2'] = "Row".($i+1)." Col2";
$data[$i]['Col 3'] = "Row".($i+1)." Col3";

$i++;
$data[$i]['Logo'] = "<img src=\"image/new.gif\" border=0 alt=\"NEW\" title=\"NEW\" />";
$data[$i]['Col 1'] = "Row".($i+1)." Col1";
$data[$i]['Col 2'] = "Row".($i+1)." Col2";
$data[$i]['Col 3'] = "Row".($i+1)." Col3";

$i++;
$data[$i]['Logo'] = "<img src=\"image/new.gif\" border=0 alt=\"NEW\" title=\"NEW\" />";
$data[$i]['Col 1'] = "Row".($i+1)." Col1";
$data[$i]['Col 2'] = "Row".($i+1)." Col2";
$data[$i]['Col 3'] = "Row".($i+1)." Col3";

$i++;
$data[$i]['Logo'] = "<img src=\"image/new.gif\" border=0 alt=\"NEW\" title=\"NEW\" />";
$data[$i]['Col 1'] = "Row".($i+1)." Col1";
$data[$i]['Col 2'] = "Row".($i+1)." Col2";
$data[$i]['Col 3'] = "Row".($i+1)." Col3";

$i++;
$data[$i]['Logo'] = "<img src=\"image/gplv3.png\" border=0 alt=\"NEW\" title=\"NEW\" />";
$data[$i]['Col 1'] = "This Software is";
$data[$i]['Col 2'] = "under GPL 3 License.";
$data[$i]['Col 3'] = "Daniele Monti - monska13 [at] gmail.com";

include(
"../tableDesigner.php");
$tb = new tableDesigner($intestazione,$data,"content","Click Me to toggle","title","intestazione","td","tr","table");

$tb->printTable();
$tb->enableJquery("js/jquery.js");

/* DEBUG */
echo "<br /><br /><br />\n";
$tb->printAllData();

?>