$list->add('adv_position', 'Vị trí', 'array', 1, 0); $list->add('adv_link', 'Đường dẫn', 'string', 1, 0); $list->add('', 'Ảnh', 'string', 1, 0); $list->add('', 'Active', 'string', 0, 0); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $array_td = array('<td>' . $row['adv_name'] . '</td>', '<td>' . $array_position[$row['adv_position']] . '</td>', '<td>' . $row['adv_link'] . '</td>', '<td><img src="' . get_picture_path($row['adv_image'], 'small') . '"/></td>', $list->showCheckbox('adv_active', $row['adv_active'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
$list->add('new_cat_id', 'Danh mục', 'array', 1, 1); $list->add('', 'Active'); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' LEFT JOIN categories ON cat_id = new_cat_id WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' LEFT JOIN categories ON cat_id = new_cat_id WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $array_td = array('<td class="center">' . $row[$id_field] . '</td>', '<td>' . $row['new_title'] . '</td>', '<td>' . $row['new_picture'] . '</td>', '<td>' . $row['new_date'] . ' - ' . date('d/m/Y H:i', $row['new_date']) . '</td>', '<td>' . $new_cat_id[$row['new_cat_id']] . '</td>', $list->showCheckbox('new_active', $row['new_active'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
} $cat_hoidap = implode(', ', $cat_hoidap); } else { $cat_hoidap = ''; } //lấy ra đối tượng $row_doi_tuong = $row['cdi_doi_tuong'] ? explode(',', $row['cdi_doi_tuong']) : array(); $cat_doi_tuong = array(); foreach ($row_doi_tuong as $dt_int) { $cat_doi_tuong[] = $array_doi_tuong[$dt_int]; } $cat_doi_tuong = implode(', ', $cat_doi_tuong); //lấy ra độ tuổi $row_do_tuoi = $row['cdi_do_tuoi'] ? explode(',', $row['cdi_do_tuoi']) : array(); $cat_do_tuoi = array(); foreach ($row_do_tuoi as $dt_int) { $cat_do_tuoi[] = $array_do_tuoi[$dt_int]; } $cat_do_tuoi = implode(', ', $cat_do_tuoi); //lấy ra bệnh theo mùa $row_theo_mua = $row['cdi_theo_mua'] ? explode(',', $row['cdi_theo_mua']) : array(); $cat_theo_mua = array(); foreach ($row_theo_mua as $dt_int) { $cat_theo_mua[] = $array_theo_mua[$dt_int]; } $cat_theo_mua = implode(', ', $cat_theo_mua); $array_td = array('<td class="center">' . $row['cdi_id'] . '</td>', '<td>' . $row['cdi_name'] . '</td>', '<td>' . (isset($array_he_co_quan[$row['cdi_body_system']]) ? $array_he_co_quan[$row['cdi_body_system']] : '') . '</td>', '<td style="max-width:200px;">' . $cat_hoidap . '</td>', '<td>' . $cat_doi_tuong . '</td>', '<td>' . $cat_do_tuoi . '</td>', '<td>' . $cat_theo_mua . '</td>', $list->showCheckbox('cdi_truyen_nhiem', $row['cdi_truyen_nhiem'], $row[$id_field]), $list->showCheckbox('cdi_popular', $row['cdi_popular'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
*/ $list->add('que_id', 'ID', 'string', 1, 1); $list->add('que_title', 'Tiêu đề', 'string', 1, 0); $list->add('', 'Status', 'string', 0, 0); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $array_td = array('<td class="center">' . $row[$id_field] . '</td>', '<td class="">' . $row['que_title'] . '</td>', $list->showCheckbox('que_status', $row['que_status'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
$total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; //Quận huyện tương ứng $db_district = new db_query('SELECT * FROM ' . $bg_table_district . ' WHERE dis_city_id = ' . $row['cit_id'] . ' ORDER BY dis_name ASC'); $array_district = array(); while ($row_d = mysqli_fetch_assoc($db_district->result)) { $array_district[$row_d['dis_id']] = $row_d['dis_name']; } unset($db_district); if (!$array_district) { $array_district = array('' => 'Chưa có'); } $array_td = array('<td>' . $row['cit_name'] . '</td>', '<td>' . form_dropdown('', $array_district) . '</td>', $list->showCheckbox('cit_tw', $row['cit_tw'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
?> </div> </div> </td> <td> <?php echo form_input('use_phone' . $row[$id_field], $row['use_phone'], 'class="span3" onkeyup="check_edit(\'record_' . $i . '\')"'); ?> </td> <td> <?php echo form_input('use_contact' . $row[$id_field], $row['use_contact'], 'class="span3" onkeyup="check_edit(\'record_' . $i . '\')"'); ?> </td> <?php echo $list->showCheckbox('use_active', $row['use_active'], $row[$id_field]); ?> <?php echo $list->showEdit($row[$id_field]); ?> <?php echo $list->showDelete($row[$id_field]); ?> <?php echo $list->end_tr(); ?> <?php } ?> <?php echo $list->showFooter();