');
////////////////////////////////////////
function plc_table_cell($cell) {
printf ('
%s | ',$cell);
}
////////////////////////////////////////
// table_id: 's id tag
// headers: an associative array "label"=>"type"
// column_sort: the column to sort on at load-time
// search_area : boolean
// pagesize: the initial pagination size
// pagesize_def: the page size when one clicks the pagesize reset button
// max_pages: the max number of pages to display in the paginator
function plc_table_start ($table_id, $headers, $column_sort,
$search_area=true,$max_pages="10",$pagesize="25",$pagesize_def="999") {
if ($search_area) {
plc_table_search_area($table_id,$pagesize,$pagesize_def);
}
plc_table_head($table_id,$headers,$column_sort,$max_pages,$pagesize);
}
function plc_table_end () {
plc_table_foot();
}
////////////////////
function plc_table_search_area ($table_id,$pagesize,$pagesize_def) {
$pagesize_text_id = $table_id . "_pagesize";
$search_text_id = $table_id . "_search";
$search_reset_id = $table_id . "_search_reset";
$search_and_id = $table_id . "_search_and";
print <<< EOF
EOF;
}
////////////////////////////////////////
function plc_table_head ($table_id,$headers,$column_sort,$max_pages,$pagesize) {
$paginator=$table_id."_paginator";
$classname="paginationcallback-".$paginator;
$classname.=" max-pages-" . $max_pages;
$classname.=" paginate-" . $pagesize;
print <<< EOF
EOF;
foreach ($headers as $label => $type) {
if ($type == "string") $type="";
if ($type == "int") $type="";
if ($type == "float") $type="";
$class="sortable";
if ( ! empty($type)) $class .= "-" . $type;
print '' . $label . " | \n";
}
print <<< EOF
EOF;
}
////////////////////////////////////////
function plc_table_foot () {
print <<< EOF
EOF;
}
////////////////////////////////////////
function plc_table_notes () {
print <<< EOF
Notes: Enter & or | in the search area to alternate between AND and OR search modes
Hold down the shift key to select multiple columns to sort
EOF;
}
?>