* @author Tomas Mudrunka
*/
class HTML {
- function row($row,$type=false) {
+ function row($row,$type=false,$class=false) {
$html = '';
+ $class = $class ? $class=" class='$class' " : '';
if($type) $html.="<$type>";
- $html.='<tr>';
+ $html.="<tr$class>";
$td = $type == 'thead' ? 'th' : 'td';
foreach($row as $var) {
if(trim($var) == '') $var = ' ';
return $html;
}
- function table(&$table, $params='border=1') {
+ function table(&$table, $parity_class=array('tr_odd','tr_even'), $params='border=1') {
$html="<table $params>";
$header=true;
+ $even=false;
foreach($table as $row) {
if($header) {
$html.=$this->row(array_keys($row),'thead');
$header=false;
}
- $html.=$this->row($row);
+ $class = $parity_class ? $parity_class[$even] : false;
+ $html.=$this->row($row,false,$class);
+ $even = !$even;
}
$html.='</table>';
return $html;
table { background-color: orange; border: orange; }
a, a img { text-decoration:none; color: darkblue; border:none; }
li a, a:hover { text-decoration:underline; }
+.tr_even td { background-color: lemonchiffon; }
.menu li {
float: left;
$assistants=array();
foreach(scandir(DIR_ASSISTANTS) as $item) {
if($item == '.' || $item == '..') continue;
- $item = preg_replace('/\.inc\.php$/','',$item);
- $assistants[$item] = "assistant/$item";
+ $item = preg_replace('/\.inc\.php$/','',$item,-1,$count);
+ if($count) $assistants[$item] = "assistant/$item";
}
$tables=array('item','model','category','producer','vendor','room','status');
}
function render_item_table($table,$class=false) {
+ if(empty($table)) return '<h3>'.T('holy primordial emptiness is all you can find here...').'</h3><br />';
$this->table_add_images($table);
if($class) $this->table_add_relations($table,$class);
$this->table_add_barcodes($table);