I am struggling to rearrange the column order in a bit of php that produces a list of rows. Ideally, I would like the checkbox at the beginning, perfection would be some way of adding different background colours to alternate rows:
========================================================
function showList() {
$list_id = (int) $_REQUEST['curr_list_id'];
$chk = new cquery();
$chk->set_query_sql("SELECT display FROM mailmachine_customfields_lists WHERE list_id = $list_id");
$chk->run_query();
if ($chk->num_of_rows() != 1) {
cbaseform::showList(true);
} else {
$foo = $chk->get_next_hash();
$e = '<tr class="rows">';
foreach (unserialize($foo['display']) as $k => $v) {
$e .= '<td valign="top" align="right" nowrap width="20%"><a href="{FILE}?sub_id={SUB_ID}&todo=edit">{'.strtoupper($k).'}</a></td>';
}
$e .= '<td valign="top" align="right" width="50px"><input TYPE="checkbox" NAME="select[]" Value="{SUB_ID}" {SELECT}></td></tr>';
parent::showList(true, $e, count(unserialize($foo['display'])) + 1);
}
}
========================================================
Any help appreciated!