Hello
I am creating a table with HTML/Table.php by getting the data from an array.
On the end of each row I would like to add an update link.
I know that $formout->display(); will not work so I was wondering if someone could help me change the code below to the Renderer future.
Thank you
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/QuickHtml.php';
$formout = new HTML_QuickForm();
$formout->addElement('hidden','uid',$this->uid);
//Something like this I am thinking
foreach ($datalocaltime as $k => $v){
$formout->addElement('hidden','mysqlid',$datamysql[$k][id]);
}
$formout->addElement('submit','checkout','Check out');
if ($formout->validate()) {
$formout->process('check');
$formout->display();
} else {
$formout->display();
}
require_once 'HTML/Table.php';
$tableB = new HTML_Table("border=0 cellpadding=1 cellspacing=2 width=450");
$tableB->addRow($colHeaders);
$headerStyle = "bgcolor=#CCCCCC nowrap";
$colHeaders = array("No","Subject", "Check in time", "Checked in by", "Check out time", "Checked out by","Check out");
$tableB->addRow($colHeaders, $headerStyle, "TH");
foreach ($datalocaltime as $k => $v){
$tableB->addRow(array($k,$v));
}
$altRow = array('bgcolor' => '#CCCCCC');
$headerStyle = "bgcolor=#CCCCCC nowrap";
$row1Style = "bgcolor=#CCCCCC align=center";
$row2Style = array ("bgcolor" => "#FFFFFF", "align"=>"center");
$tableB->setRowType(0,"TH");
$tableB->altRowAttributes(1,$row1Style,$row2Style);
$tableB->updateColAttributes(2,"align=center");
echo $tableB->toHtml();