$table->setId('listing'); $table->build(); $odd = TRUE; foreach ($res as $item) { if (!$titles) { $tr = new Th(); $names = array_keys(get_object_vars($item)); foreach ($names as $title) { $tr->add($title); } $tr->build(); $titles = TRUE; } $tr = new Tr(); if ($odd) { $tr->setGlobalClass('even'); $odd = FALSE; } else { $tr->setGlobalClass('odd'); $odd = TRUE; } foreach ($item as $data) { // display odd characters $tr->add(htmlentities($data)); } $tr->build(); } unset($table); } $body->line('</div>'); include_once './inc/footer.php';
$res = $tps->fetchAll(); if (!$res) { $body->line('no queries found.'); } else { $table = new Table(); $table->setClas('result'); $table->build(); $th = new Th(); $th->add('database'); $th->add('date - time'); $th->add('query (click to copy in execution field)'); $th->build(); foreach ($res as $item) { $tr = new Tr(); if ($item['fine'] == 0) { $tr->setGlobalClass('query_error'); $tr->add($item['db']); $tr->add($item['datum']); $tr->add(str_repeat(" ", 2) . $item['qs']); } else { $tr->add($item['db']); $tr->add($item['datum']); $tr->add('<div class="qs"> <a href="#" onClick="PSA.to_text(\'' . str_replace('"', "&&", str_replace("'", "##", trim(str_replace("\r\n", " ", $item['qs'])))) . '\');">' . nl2br($item['qs']) . '</a></div>'); } $tr->build(); } unset($table); } unset($psa);