源码如下:
$t .= '<tr class=dataTableRow><td align="right" width="200">This Group Is Linked To The Following Channel </td><td>';
$t .= '<table width="100%" cellpadding="0" cellspacing="0">';
$i = 0;
$tepsql = tep_db_query("select channelid, title from channels order by title");
while ($res = tep_db_fetch_array($tepsql)) {
if ($i == 0) {
$t .= '<tr>';
}
$t .= '<td width="25"><input type="checkbox" name="channel[]" value="'.$res['channelid'].'"';
if ($info['groupid']) {
// Only on edit mode, and there is relationship in the table 'channel_group', this field is checked.
$tepsql2 = tep_db_query("select * from channel_group where groupid=".$info['groupid']." and channelid=".$res['channelid']);
if ($res2 = tep_db_fetch_array($tepsql2)) {
$t .= ' checked';
}
}
$t .= '> '.$res['title'].'</td>';
$i ++;
if ($i == 4) {
$t .= '</tr>';
$i = 0;
}
}
if ($i != 4) {
$t .= '</tr>';
}
$t .= '</table></td></tr>';