-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample1.php
More file actions
49 lines (36 loc) · 1020 Bytes
/
Example1.php
File metadata and controls
49 lines (36 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require "Data_Table.php";
$table = new Data_Table();
$headers = array();
$headers["Name"] = "Name";
$headers["Phone"] = "Phone #";
$headers["Email"] = "Email Address";
$headers["Website"] = "Web Address";
$table->addHeader($headers);
$data = array();
$data["Name"] = "Thomas";
$data["Phone"] = "3304018393";
$data["Email"] = "teynon1@gmail.com";
$data["Website"] = "http://www.thomaseynon.com";
$table->addRow($data);
$data = array();
$data["Name"] = "Andy";
$data["Phone"] = "2223334444";
$data["Email"] = "andy@blah.com";
$table->addRow($data);
$data = array();
$data["Name"] = "George";
$data["Phone"] = "2123334444";
$data["Email"] = "ageorge@blah.com";
$table->addRow($data);
echo $table->generate();
$table->sort("Name");
//echo "<pre>" . print_r($table, true) . "</pre>";
echo $table->generate();
echo "<hr />";
$table->rsort("Name");
echo $table->generate();
echo "<hr />";
$table->sort("Name");
$table->headerRepeat = 2;
echo $table->generate();