\Catalog

A Catalog is a class that manages tabular data.

It's original purpose was to receive an array of mysql rows that were retrieved using the association method.

Summary

Methods
Properties
Constants
__construct()
buildHTMLTable()
No public properties found
OPTION_REMOVE
OPTION_EDIT
OPTION_RESET
No protected methods found
No protected properties found
N/A
No private methods found
$tabularData
N/A

Constants

OPTION_REMOVE

OPTION_REMOVE

OPTION_EDIT

OPTION_EDIT

OPTION_RESET

OPTION_RESET

Properties

$tabularData

$tabularData : 

Type

Methods

__construct()

__construct(  $tabularData) 

Creates a new Catalog with the given tabular data.

Note: the tabular data is a compiled array of rows from a mysql result (at least this is the use for it)

Parameters

$tabularData

buildHTMLTable()

buildHTMLTable(  $headings,   $options,   $sortbyField = "",   $thumbsDirectory = "./",   $forceTextArr = NULL,   $pg_num = 1) 

Returns a string of a table for this catalog.

To be used for display purposes.

$showOptions is based on the display

e.g. usage: getTable(array('id:ID','code:Code','catnum:Category Number', 'gallery_number:Gallery Number'), CAT_OPTION_EDIT | CAT_OPTION_REMOVE);

Parameters

$headings

The headings pairs, e.g. array('id:ID','code:Code','catnum:Category Number', 'gallery_number:Gallery Number') The first value is the association in the array, the second value is the column title to display in the table.

$options

A list of options to use e.g. CAT_OPTION_EDIT | CAT_OPTION_REMOVE separated by |. Use zero if no options, but has image column.

$sortbyField
$thumbsDirectory

The directory where the thumbs are (if different than the page)

Sample usage:

print($cat->buildHTMLTable(array('image_name:Thumb','code:Code','catnum:Category Number', 'gallery_number:Gallery Number'), Catalog::OPTION_EDIT | Catalog::OPTION_REMOVE, 1, 'images_sm/'));

Resulting output from sample usage:

Thumb Code Category Number Gallery Number Options
Thumbnail Image 10988.00 M11991 0002-a S1 01 Edit  Remove  
Thumbnail Image 37920.00 M42988 0002-a S1 02 Edit  Remove  
$forceTextArr
$pg_num