table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"'; $table->setHeader(array(__('Module Name'), ''.__('Read').'', ''.__('Write').'')); $table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; // initial row count $row = 1; $row_class = 'alterCell2'; // database list $module_query = $dbs->query("SELECT * FROM mst_module AS m"); while ($module_data = $module_query->fetch_assoc()) { // alternate the row color if ($row_class == 'alterCell2') { $row_class = 'alterCell'; } else { $row_class = 'alterCell2'; } $read_checked = ''; $write_checked = ''; if (isset($priv_data[$module_data['module_id']]['r']) AND $priv_data[$module_data['module_id']]['r'] == 1) { $read_checked = 'checked'; } if (isset($priv_data[$module_data['module_id']]['w']) AND $priv_data[$module_data['module_id']]['w'] == 1) { $read_checked = 'checked'; $write_checked = 'checked'; } $chbox_read = ''; $chbox_write = ''; $table->appendTableRow(array(__( ucwords(str_replace('_', ' ', $module_data['module_name'])) ), $chbox_read, $chbox_write)); $table->setCellAttr($row, 0, 'valign="top" class="'.$row_class.'" style="font-weight: bold;"'); $table->setCellAttr($row, 1, 'valign="top" class="'.$row_class.'" style="width: 5%;"'); $table->setCellAttr($row, 2, 'valign="top" class="'.$row_class.'" style="width: 5%;"'); $row++; } echo $table->printTable(); ob_start(); ?>