$name_obj = 'Khách lẻ'; } if (intval($type_bill) == 1) { $table = 'bill_out'; $type = 'Nhà cung cấp'; $bill_id = 'bio_id'; $day_creat = 'bio_start_time'; $total_money = 'bio_total_money'; $date = 'Ngày tạo'; $id = 'sup_id'; $id_object = 'bio_supplier_id'; $table_object = 'suppliers'; $name_object = 'sup_name'; $name_obj = 'Nhà cung cấp ngoài'; } $list = new dataGrid($bill_id, 10); $list->add($bill_id, 'Số HĐ'); $list->add('', $type); $list->add('', $date); $list->add('', 'Tổng tiền'); $list->add('', 'Ghi chú'); // tổng số hóa đơn trong thùng rác $count_bill_trash = new db_count('SELECT count(*) as count FROM trash WHERE 1 ' . $list->sqlSearch() . ' AND tra_table = "' . $table . '" '); $total = $count_bill_trash->total; unset($count_bill_trash); $db_list_bill_trash = new db_query('SELECT * FROM trash WHERE tra_table = "' . $table . '" ' . $list->limit($total));
</div> <div class="clear"></div> </div>'; $bottom_left_column .= $bottom_conten_left_column; $bottom_left_column .= '</div>'; //end bottom left $bottom_right_control .= '<span class="control-btn deactivate control-bill-in"><i class="fa fa-print"></i> In phiếu thanh toán</span>'; $bottom_right_control .= '<div class="show_number_bill"> <span>Hiển thị: </span> <select class="form-control"> <option value="5">5 lần thanh toán gần đây</option> <option value="10">10 lần thanh toán gần đây</option> <option value="15">15 lần thanh toán gần đây</option> </select> </div>'; $list = new dataGrid('fin_id', $limit_financies); $list->add('fin_id', 'Số phiếu', 'string', 1); $list->add('fin_updated_time', 'Ngày thanh toán'); $list->add('fin_money', 'Số tiền'); $list->add('fin_pay_type', 'Trả bằng'); $list->add('fin_note', 'Ghi chú'); // lấy ra tổng số hóa đơn nhap đã được trả $cout_financies_bill_out = new db_query('SELECT * FROM ' . $financies . $join_table . ' WHERE 1 ' . $list->sqlSearch() . ' AND fin_cat_id = 32' . $And_id); $total = mysqli_num_rows($cout_financies_bill_out->result); unset($cout_financies_bill_out); // kiểm tra có tồn tại request ajax biến limit if ($isAjaxRequest && $limit != 0) { $total = $limit; }
<?php require_once 'inc_security.php'; //Phần hiển thị //Khởi tạo $top_control = ''; $content_column = ''; $footer_control = ''; $id_field = "bii_id"; $bg_table = "bill_in"; #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('', 'Thời gian'); $list->add('', 'Bàn'); $list->add('', 'Số HĐ'); $list->add('', 'Cộng trước giảm'); $list->add('', 'Giảm'); $list->add('', 'Phí DV'); $list->add('', 'VAT'); $list->add('', 'Tổng tiền'); $list->add('', 'Tiền mặt'); $list->add('', 'Thẻ'); $list->add('', 'Ghi nợ'); /* Lấy các thông tin bắn ajax về*/ $start_date = convertDateTime(getValue('start_date', 'str', 'POST', ''), '0:0:0'); $end_date = convertDateTime(getValue('end_date', 'str', 'POST', ''), '0:0:0') + 86400 - 1; $store_id = getValue('store_id', 'int', 'POST', 0); $admin_id = getValue('admin_id', 'int', 'POST', 0); $start_today = convertDateTime(time(), '0:0:0'); // bắt đầu trong ngày từ 00 $end_today = convertDateTime(time(), '0:0:0') + 86400 - 1;
<?php require_once 'inc_security.php'; //Phần hiển thị //Khởi tạo $top_control = ''; $content_column = ''; $footer_control = ''; $id_field = "log_id"; $bg_table = "logs_session"; #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('', 'Người dùng'); $list->add('', 'Giờ đăng nhập'); $list->add('', 'Tổng thu'); $list->add('', 'Tiền mặt'); $list->add('', 'Thẻ'); $list->add('', 'Tổng chi'); $list->add('', 'Tiền mặt'); $list->add('', 'Thẻ'); /* Lấy các thông tin bắn ajax về*/ $start_date = convertDateTime(getValue('start_date', 'str', 'POST', ''), '0:0:0'); $end_date = convertDateTime(getValue('end_date', 'str', 'POST', ''), '0:0:0') + 86400 - 1; $admin_id = getValue('admin_id', 'int', 'POST', 0); $start_today = convertDateTime(time(), '0:0:0'); // bắt đầu trong ngày từ 00 $end_today = convertDateTime(time(), '0:0:0') + 86400 - 1; // kết thúc ngày if ($isAjaxRequest) { if ($start_date) { $sql_search .= ' AND log_time_in >= ' . $start_date;
//Lấy ra list kho hàng $list_store = array(); $db_query_store = new db_query("SELECT * FROM categories_multi WHERE cat_type = 'stores'"); $list_store = array(); while ($row = mysqli_fetch_assoc($db_query_store->result)) { $list_store[$row['cat_id']] = $row['cat_name']; } unset($db_query_store); //khai báo các phần hiển thị $footer_control = ''; $content_column = ''; $content_column .= ' <div id="mindow-listing-inventory">'; //Danh sách phiếu kiểm kê $listing_menu = ''; $list = new dataGrid('tra_id', 100, '#mindow-listing-product'); $list->add('tra_record_id', 'Số phiếu', 'string', 1, 0, 'Số phiếu'); $list->add('', 'Nhân viên kiểm kê'); $list->add('', 'Ngày kiểm kê'); $list->add('', 'Kho kiểm kê'); $list->add('', 'Người tạo'); $search_sql = ' AND tra_table = "inventory"'; // đếm số lượng phiếu kiểm kê trong thùng rác $db_count = new db_count('SELECT count(*) as count FROM trash WHERE 1' . $list->sqlSearch() . $search_sql . ''); $total = $db_count->total; unset($db_count); // lấy ra số lượng các phiếu kiểm kê trong thùng rác $db_listing = new db_query('SELECT * FROM trash
} ?> <li data-cat="trash"> <label class="section_name"><b><i class="fa fa-trash fa-fw"></i> Thùng rác (<?php echo $trash_count; ?> )</b></label> </li> </ul> <?php $left_column = ob_get_contents(); ob_clean(); //Khối bên phải, hiển thị list customer tương ứng $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('cus_id', 'Mã hệ thống'); $list->add('cus_code', 'Mã có sẵn'); $list->add('cus_name', 'Tên khách hàng', 'string', 1, 1); $list->add('cus_address', 'Địa chỉ'); $list->add('cus_phone', 'Điện thoại'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); // request ajax load categories customer name $cat_id = getValue('cat_id', 'int', 'POST', 0); if ($cat_id && $isAjaxRequest) { $db_extra = 'AND ' . $bg_table . '.' . $cat_field . ' = ' . $cat_id . ' ';
$num_clicks = $r['raws'] + $r['uniques'] + $r['signups'] + $r['sales_number']; } mysql_data_seek($rs_stats, 0); switch ($flag) { case 0: echo sprintf("%d clickout(s) there. %d click(s) in stats there.\n", $num_clickouts, $num_clicks); break; case 1: if ($num_clickouts < $num_clicks) { $abn++; echo sprintf("abnormal: %d clickout(s) there. %d click(s) in stats there.\n", $num_clickouts, $num_clicks); } break; case 2: if ($num_clickouts < $num_clicks) { $abn++; echo sprintf("abnormal: %d clickout(s) there. %d click(s) in stats there.\n", $num_clickouts, $num_clicks); /* * then we show the deatils below */ include_once 'datagrid.class.php'; $grid_clickouts = new dataGrid($rs_clickouts, "", array(0 => "companyid", 1 => "officename", 2 => "agentid", 3 => "username", 4 => "clicktime", 5 => "ny_clicktime", 6 => "fromip", 7 => "referer", 8 => "siteid", 9 => "sitename", 10 => "typeid", 11 => "typename", 12 => "url"), '', '', '#cccddd', 600); $grid_clicks = new dataGrid($rs_stats, "", array(0 => "trxtime", 1 => "companyid", 2 => "officename", 3 => "agentid", 4 => "username", 5 => "siteid", 6 => "sitename", 7 => "typeid", 8 => "typename", 9 => "price", 10 => "earning", 11 => "raws", 12 => "uniques", 13 => "chargebacks", 14 => "signups", 15 => "frauds", 16 => "sales_number", 17 => "net", 18 => "payouts", 19 => "earnings"), '', '', '#dddeee', 800); $grid_clickouts->create(); $grid_clicks->create(); echo "\n"; } break; } } echo "(abnormal)" . $abn . "/(total)" . count($agent_sites) . "\n";
<td class="text-right"><b>' . number_format($vat) . '</b></td> </tr></table>'; $phuphi .= '<table cellpadding="0" cellspacing="0" border="0" class="total-tr">'; $phuphi .= '<tr> <td>Tổng tiền:</td> <td class="text-right"><b>' . number_format($totalAll_) . '</b></td> </tr>'; $phuphi .= '<tr> <td class="border-bot">Thanh toán:</td> <td class="text-right border-bot total-bill-money"><b>' . number_format($tong_thanhtoan) . ' ' . DEFAULT_MONEY_UNIT . '</b></td> </tr></table></div>'; } // if (trim($position) == 'right' || trim($position) == 'bill_out') { $title_detail_left = 'Danh sách mặt hàng nhập vào hóa đơn'; $list = new dataGrid('bid_pro_id', 10); $list->add('bid_pro_id', 'Mã hàng'); $list->add('pro_name', 'Tên sản phẩm'); $list->add('uni_name', 'ĐVT'); $list->add('bid_pro_number', 'SL'); $list->add('bid_pro_price', 'Đơn giá'); $list->add('', 'Thành tiền'); // xem chi tiet hoa don nhap tu trang index if (trim($position) == 'right') { $db_count = new db_count('SELECT count(*) as count FROM bill_out_detail WHERE 1 ' . $list->sqlSearch() . ' AND bid_bill_id = ' . $data_record_id . ' '); $total = $db_count->total; unset($db_count); // danh sach san pham nhap trong hoa don
?> )</b></label> </li> </ul> <?php $left_column = ob_get_contents(); ob_clean(); //Khối trung tam, hiển thị list menus tương ứng $center_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); $center_control .= '<form action="" method="post" enctype="multipart/form-data" id="update-menu" name="update_menu">'; $center_control .= '<label for="file-menu" class="control-btn"><i class="fa fa-download"></i> Cập nhật thực đơn</label>'; $center_control .= '<input id="file-menu" type="file" name="import_menu" class="file_menu" onchange="updateMenu()"/>'; $center_control .= '<button type="submit" id="submit_form"></button>'; $center_control .= '</form>'; #Bắt đầu với datagrid $list = new dataGrid($id_field, 3000); $list->add('men_id', 'Mã'); $list->add('men_name', 'Tên thực đơn', 'string', 1, 1); $list->add('men_unit_id', 'Đơn vị tính', 'string', 0, 0); $list->add('men_price', 'Giá bán'); $list->add('', 'SL tồn'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $cat_id = getValue('cat_id', 'int', 'POST', 0); if ($cat_id && $isAjaxRequest) { $db_extra_left_join = ' LEFT JOIN ' . $cat_table . ' ON ' . $cat_field . ' = cat_id '; $db_extra_and = 'AND ' . $cat_field . ' = ' . $cat_id;
$trash_btn = getPermissionValue('trash'); // dem ban ghi trong thung rac $db_count = new db_count('SELECT count(*) as count FROM trash WHERE tra_table = "' . $bg_table . '"'); $trash_count = $db_count->total; unset($db_count); if ($add_btn || $edit_btn || $trash_btn) { $left_control .= '<div class="modal-control"> <span class="control-btn control-btn-add" onclick="addPromo()"><i class="fa fa-file-o"></i> Thêm mới</span> <span class="control-btn control-btn-edit deactivate"><i class="fa fa-edit"></i> Sửa</span> <span class="control-btn control-btn-trash deactivate"><i class="fa fa-trash"></i> Xóa</span> <span class="control-btn control-btn-recover" onclick="list_trash(\'out\')"><i class="fa fa-recycle"></i> Thùng rác (' . $trash_count . ')</span> </div>'; } $right_control = list_admin_control_button(0, 0, 0, 1); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('pms_agency_id', 'Cửa hàng'); $list->add('pms_name', 'Tên chiến dịch'); $list->add('pms_start_time', 'Thòi gian bắt đầu'); $list->add('pms_end_time', 'Thời gian kết thúc'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); // select agencies $array_agencies = array(); $db_query_agen = new db_query('SELECT * FROM agencies'); while ($row = mysqli_fetch_assoc($db_query_agen->result)) { $array_agencies[$row['age_id']] = $row['age_name'];
} ?> <li data-cat="trash"> <label class="section_name"><b><i class="fa fa-trash fa-fw"></i> Thùng rác (<?php echo $trash_count; ?> )</b></label> </li> </ul> <?php $left_column = ob_get_contents(); ob_clean(); //Khối bên phải, hiển thị list user tương ứng $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $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 . ' ASC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $right_column .= $list->showHeader($total_row); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) {
$data_module = 'report_fund'; //left column $left_column .= '<p class="select-title">Thu ngân:</p>'; $left_column .= '<select name="type-report" class="bill-date form-control adm-user-report">'; $left_column .= '<option value="-1">--- Tất cả thu ngân</option>'; // lay ra list thu ngan $db_adm_users = new db_query("SELECT adm_id, adm_name FROM admin_users"); while ($data_adm_use = mysqli_fetch_assoc($db_adm_users->result)) { $left_column .= '<option value="' . $data_adm_use['adm_id'] . '">' . $data_adm_use['adm_name'] . '</option>'; } unset($db_users); $left_column .= '</select>'; // right column $id_financial = 'fin_id'; $bg_financial = 'financial'; $list = new dataGrid($id_financial, 3000); $list->add('', 'Thời gian'); $list->add('', 'Số HĐ'); $list->add('', 'Chi phí'); $list->add('', 'Tiền mặt'); $list->add('', 'Thẻ'); $from_date = getValue('from_date', 'str', 'POST', ''); $to_date = getValue('to_date', 'str', 'POST', ''); $adm_user_report = getValue('adm_user_report', 'int', 'POST', 0); $And = ''; $array_return = array(); $time_order_field = 'fin_updated_time'; if ($isAjaxRequest) { if ($from_date != '') { $from_date = convertDateTime($from_date, '0:0:0'); $And .= ' AND ' . $time_order_field . ' >= ' . $from_date;
$left_column .= '<span class="search-report"><i class="fa fa-search"></i></span>'; $left_column .= '<div class="clear"></div>'; $left_column .= '<p class="select-title">Thu ngân:</p>'; $left_column .= '<select name="type-report" class="bill-date form-control adm-user-report">'; $left_column .= '<option value="-1">--- Tất cả thu ngân</option>'; // lay ra thu ngan $db_admin_users = new db_query("SELECT adm_id, adm_name FROM admin_users"); while ($data_adm_user = mysqli_fetch_assoc($db_admin_users->result)) { $left_column .= '<option value="' . $data_adm_user['adm_id'] . '">' . $data_adm_user['adm_name'] . '</option>'; } unset($db_admin_users); $left_column .= '</select>'; // right column $id_field_i = 'bii_id'; $bg_table_i = 'bill_in'; $list = new dataGrid($id_field_i, 3000); $list->add('', 'Thời gian'); $list->add('', 'Số HĐ'); $list->add('', 'Doanh thu'); $list->add('', 'Trung bình'); $And = ''; $array_return = array(); if ($isAjaxRequest) { if ($type_bill == 0) { $time_order_field = 'bii_start_time'; } else { $time_order_field = 'bii_end_time'; } if ($from_date != '') { $from_date = convertDateTime($from_date, '0:0:0'); $And .= ' AND ' . $time_order_field . ' >= ' . $from_date;
<?php require_once 'inc_security.php'; #some config $new_cat_id = array(); $db_query = new db_query('SELECT * FROM categories'); while ($row = mysqli_fetch_assoc($db_query->result)) { $new_cat_id[$row['cat_id']] = $row['cat_name']; } #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('new_id', 'ID', 'string', 1, 1); $list->add('new_title', 'Tiêu đề tin', 'string', 1, 1); $list->add('new_picture', 'Picture', 'string', 1, 0); $list->add('new_date', 'Ngày public', 'date', 1); $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
$db_count = new db_count('SELECT count(*) AS count FROM products WHERE pro_cat_id = ' . $row['cat_id']); $pro_count = $db_count->total; unset($db_count); $pro_cat_id[$row['cat_id']] = $row['cat_name'] . ' (' . $pro_count . ')'; } unset($db_query); $left_column = ''; $right_column = ''; $left_column .= ' <div class="text-center section-title">Danh sách mặt hàng</div> <div id="mindow-listing-product">'; /* Phần hiển thị danh sách mặt hàng */ $listing_menu = ''; $list = new dataGrid('pro_id', 30, '#mindow-listing-product'); $list->add('pro_name', 'Tên mặt hàng', 'string', 1, 0); $list->add('', 'ĐVT'); $list->addSearch('', 'pro_cat_id', 'array', $pro_cat_id, getValue('pro_cat_id')); /* Câu lệnh SQL đếm bản ghi Câu lệnh điều kiện hiển thị các bản ghi */ $sql_search = ''; $search_cat_id = getValue('pro_cat_id'); if ($search_cat_id) { $sql_search .= ' AND pro_cat_id = ' . $search_cat_id . ' '; } $db_count = new db_count('SELECT count(*) AS count FROM products WHERE 1 ' . $list->sqlSearch() . $sql_search);
function listRecord() { global $id_field; global $bg_table; global $cat_field; $cat_id = getValue('cat_id', 'str', 'POST', 0); $html = ''; $class_context_menu = 'menu-normal'; #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); /*code something*/ $list->add('', 'Tên cửa hàng'); $list->add('', 'Điện thoại'); switch ($cat_id) { case 'all': $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 . ' ASC ' . $list->limit($total)); $array_row = $db_listing->resultArray(); unset($db_listing); break; case 'trash': $class_context_menu = 'menu-trash'; $db_count = new db_count('SELECT count(*) as count FROM trash WHERE tra_table = "' . $bg_table . '"'); $total = $db_count->total; unset($db_count); $array_row = trash_list($bg_table); $list->limit($total); break; default: $cat_id = (int) $cat_id; $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' AND ' . $cat_field . ' = ' . $cat_id); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' AND ' . $cat_field . ' = ' . $cat_id . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' ASC ' . $list->limit($total)); $array_row = $db_listing->resultArray(); unset($db_listing); break; } $total_row = count($array_row); $html .= $list->showHeader($total_row); $i = 0; foreach ($array_row as $row) { $i++; $html .= $list->start_tr($i, $row[$id_field], 'class="' . $class_context_menu . ' record-item" onclick="active_record(' . $row[$id_field] . ')" data-record_id="' . $row[$id_field] . '"'); /*code something */ $html .= '<td>' . $row['sed_name'] . '</td>'; $html .= '<td class="right">' . $row['sed_phone'] . '</td>'; $html .= $list->end_tr(); } $html .= $list->showFooter(); echo $html; }
$ana_sec_id = array(); $db_query = new db_query('SELECT sec_id,sec_name FROM sections WHERE sec_parent_id = 0'); while ($row = mysqli_fetch_assoc($db_query->result)) { $ana_sec_id[$row['sec_id']] = $row['sec_name']; $db_child = new db_query('SELECT * FROM sections WHERE sec_parent_id = ' . $row['sec_id'] . ' ORDER BY sec_id ASC'); while ($row_child = mysqli_fetch_assoc($db_child->result)) { $ana_sec_id[$row_child['sec_id']] = ' - ' . $row_child['sec_name']; } } unset($db_query); #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('ana_title', 'Title', 'string', 1, 1); $list->add('ana_alt', 'Alt text', 'string', 1, 1); $list->add('ana_sec_id', 'Bộ phận', 'array', 1, 0); $list->add('ana_sex', 'Sex', 'array', 1, 0); $list->add('ana_type', 'Type', 'array', 1, 0); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' LEFT JOIN sections ON sec_id = ana_sec_id
} ?> <li data-cat="trash"> <label class="section_name"><b><i class="fa fa-trash fa-fw"></i> Thùng rác (<?php echo $trash_count; ?> )</b></label> </li> </ul> <?php $left_column = ob_get_contents(); ob_clean(); //Khối bên phải, hiển thị list user tương ứng $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('use_id', 'Mã hệ thống'); $list->add('use_code', 'Mã có sẵn'); $list->add('use_name', 'Tên nhân viên', 'string', 1, 1); $list->add('use_address', 'Địa chỉ'); $list->add('use_phone', 'Điện thoại'); $list->add('use_note', 'Ghi chú'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $cat_id = getValue('cat_id', 'int', 'POST', 0); if ($cat_id && $isAjaxRequest) { $db_extra_left_join = ' LEFT JOIN ' . $cat_table . ' ON ' . $cat_field . ' = cat_id ';
$left_column .= $table_left_column; $left_column .= '</div>'; //phần hóa đơn nhập onclick="showDetail({\'obj\':\'.content-bill-detail\',\'position\':\'right\'})" $right_control .= '<span class="info control-btn deactivate control-detail"><i class="fa fa-list-alt"></i> Chi tiết</span>'; // ra các nút điều khiển thêm sửa xóa cài đặt làm mới.... $right_control .= list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); // lấy ra tổng số hóa đơn nhập hàng trong bảng thùng rác (trash) $sql = new db_query("SELECT * FROM trash WHERE tra_table = 'bill_out'"); $count = mysqli_num_rows($sql->result); unset($sql); $right_control .= '<div class="control-table-listing top_right_control"> <span class="control-btn deactivate control-bill-in"><i class="fa fa-print"></i> In HĐ</span> <span class="control-btn"><i class="fa fa-cog"></i> Cài đặt</span> <span class="control-btn control-list-trash"><i class="fa fa-recycle"></i> Thùng rác (' . $count . ')</span> </div>'; $list_right = new dataGrid($id_field_o, 3000); $list_right->add($id_field_o, 'Số HĐ', 'string', 1); $list_right->add('bio_supplier_id', 'Nhà cung cấp'); $list_right->add('bio_start_time', 'Ngày nhập'); $list_right->add('bio_total_money', 'Tổng tiền'); // ton tai request ajax loc hoa don nhap $type_bill_fillter = ' AND bio_start_time '; if ($isAjaxRequest && isset($_POST['id_brand'])) { $id_brand = getValue('id_brand', 'int', 'POST', 0); $time_start = convertDateTime(getValue('time_start', 'str', 'POST', ''), '0:0:0'); $time_end = convertDateTime(getValue('time_end', 'str', 'POST', ''), '23:59:59'); if ($id_brand) { $and_bio_sup_id .= ' AND bio_supplier_id = ' . intval($id_brand); } // loc theo id nha cung cap if ($time_start) {
<?php require_once 'inc_security.php'; #some config $adv_position = $array_position; #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('adv_name', 'Tên QC', 'string', 1, 0); $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 . '
<?php require_once 'inc_security.php'; #some config #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * tham số đầu tiên là form name gửi lên server để cần sắp xếp hoặc search thì get về xử lý * tham số thứ 2 là label -> tên của cột * tham số thứ 3 là kiểu cột : có các kiểu string, edit, delete, checkbox, mặc định là kiểu string * tham số thứ 4 là is_search : có cho sắp xếp hay ko, tham số thứ 5 là is_sort có cho tạo khung tìm kiếm theo trường hay ko */ $list->add('cit_name', 'Tên thành phố', 'string', 1, 1); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); //$list->addSearch() $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() . '
<html> <head> <title>Sample code</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php include "datagrid.class.php"; // $link = mysql_connect($host, $user, $pass); mysql_select_db($dbName, $link); $users = mysql_query("SELECT userID, username, password, email, tel, fax FROM users"); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // signature : dataGrid($dataSource, $dataKeyField, $fieldsToShow, $nextPage, $nextPageLable, $rowColor, $width) // $dataSource=$users; // $dataKeyField(Promary key)="userID"; // $fieldsToShow(Array of columns names)=array(0=>"username", 1=>"webSite", 2=>"password", 3=>"email"); // it means that just username, password and email columns will be shown in the grid. // $nextPage(Page you want to do some action on selected row element.)=activateUsers.php; // $nextPageLable(Label to be shown in dataGrid)="Activate this User"; // $rowColor="#eeeeee"; // $width="600";Pixels ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $g = new dataGrid($dataSource, "userID", array(0 => "username", 1 => "webSite", 2 => "password", 3 => "email"), "activateUsers.php", "Activate this User", "#eeeeee", "600"); $g->create(); //Shown the grid. ?> </body> </html>
require_once 'inc_security.php'; #some config $sec_type = $array_type; $sec_body_system = $array_he_co_quan; $db_query = new db_query('SELECT sec_id,sec_name FROM sections WHERE sec_parent_id = 0'); while ($row = mysqli_fetch_assoc($db_query->result)) { $sec_parent_id[$row['sec_id']] = $row['sec_name']; } unset($db_query); #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('', ''); $list->add('sec_name', 'Tên bộ phận', 'string', 1, 1); $list->add('sec_parent_id', 'Nhóm bộ phận', 'array', 1, 0); $list->add('sec_type', 'Loại', 'array', 1, 0); $list->add('sec_body_system', 'Hệ cơ quan', 'array', 1, 0); $list->add('', 'Mô tả'); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . '
<?php require_once 'inc_security.php'; #some config $cat_type = $array_type; #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('', 'Ảnh danh mục'); $list->add('cat_name', 'Tên danh mục', 'string', 1, 0); $list->add('cat_title', 'Tiêu đề danh mục', 'string', 1, 0); $list->add('cat_type', 'Loại danh mục', 'string', 1, 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() . '
//Khối bên phải, hiển thị list user tương ứng $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); //thêm các control khác //control nhập hàng, yêu cầu quyền mới cho hiển thị if (getPermissionValue('NHAP_HANG')) { $right_control .= '<div class="pull-left"> <span class="control-btn" onclick="importProduct()"><i class="fa fa-download"></i> Nhập hàng</span> </div>'; } //list kho hàng $list_stores = array(); foreach (category_type('stores') as $store) { $list_stores[$store['cat_id']] = $store['cat_name']; } #Bắt đầu với datagrid $list = new dataGrid($id_field, 3000, '#listing-product'); $list->add('pro_id', 'Mã hàng', 'string', 0, 1); $list->add('pro_code', 'Mã có sẵn', 'string', 0, 1); $list->add('pro_name', 'Tên hàng', 'string', 1, 1); $list->add('pro_unit_id', 'Đơn vị tính'); $list->add('pro_instock', 'Tồn tối thiểu'); $list->add('pro_quantity', 'Tồn kho'); $store_id = getValue('store_id', 'int', 'GET', $configuration['con_default_store']); $list->addSearch('Kho hàng', 'store_id', 'array', $list_stores, getValue('store_id', 'int', 'GET', $store_id)); $sql_search = ''; $sql_search .= ' AND store_id = ' . $store_id . ' '; //Request with ajax if ($isAjaxRequest) { $cat_id = getValue('cat_id', 'int', 'POST', 0); if ($cat_id) { $sql_search .= ' AND pro_cat_id = ' . $cat_id;
} ?> <li data-cat="trash"> <label class="section_name"><b><i class="fa fa-trash fa-fw"></i> Thùng rác (<?php echo $trash_count; ?> )</b></label> </li> </ul> <?php $left_column = ob_get_contents(); ob_clean(); //Khối bên phải, hiển thị list nhà cung cấp tương ứng $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); $list->add('', 'Tên NCC'); $list->add('', 'Số ĐT'); $list->add('', 'Địa chỉ'); $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 . ' ASC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result);
<?php require_once 'inc_security.php'; if (!isset($_GET['id'])) { die; } $record_id = getValue('id', 'int', 'GET', 0); $content_column = ''; $footer_control = ''; $list = new dataGrid($record_id, 1); $list->add('', 'Số HĐ'); $list->add('', 'Ngày ghi nợ'); $list->add('', 'Tổng ghi nợ'); $list->add('', 'Thanh toán'); $db_financies = new db_query('SELECT * FROM financial WHERE fin_id = ' . $record_id . ' ORDER BY ' . $list->sqlSort() . ' fin_id ASC ' . $list->limit(1)); if ($data_financial = mysqli_fetch_assoc($db_financies->result)) { //số tiền thanh toán $thanhtoan = $data_financial['fin_money']; // nếu fin cat id là thanh toán công nợ khách hàng thì select bảng bill in lấy ra ngày nợ túc là ngày tạo hóa đơn nợ if ($data_financial['fin_cat_id'] == 33) { $db_bill = new db_query('SELECT * FROM bill_in WHERE bii_id = ' . $data_financial['fin_billcode']); if ($data_bill = mysqli_fetch_assoc($db_bill->result)) { $ngay_no = $data_bill['bii_end_time']; $bill_id = $data_bill['bii_id']; $so_no = $data_bill['bii_money_debit'] + $data_financial['fin_money']; } } elseif ($data_financial['fin_cat_id'] == 32) { $db_bill = new db_query('SELECT * FROM bill_out WHERE bio_id = ' . $data_financial['fin_billcode']);
$men_cat_id = array('' => 'Tất cả (' . $all_count . ')'); $db_query = new db_query('SELECT * FROM categories_multi WHERE cat_type = "menus"'); while ($row = mysqli_fetch_assoc($db_query->result)) { //đếm số thực đơn trong cate này $db_count = new db_count('SELECT count(*) AS count FROM menus WHERE men_cat_id = ' . $row['cat_id']); $men_count = $db_count->total; unset($db_count); $men_cat_id[$row['cat_id']] = $row['cat_name'] . ' (' . $men_count . ')'; } $left_column = ''; $right_column = ''; $left_column .= ' <div id="mindow-listing-menu">'; //Danh sách mặt hàng $listing_menu = ''; $list = new dataGrid('men_id', 100, '#mindow-listing-menu'); $list->add('men_name', 'Tên thực đơn', 'string', 1, 0); $list->add('', 'ĐVT'); $list->addSearch('', 'men_cat_id', 'array', $men_cat_id, getValue('men_cat_id')); $sql_search = ''; $search_cat_id = getValue('men_cat_id', 'int', 'GET', 0); if ($search_cat_id) { $sql_search .= ' AND men_cat_id = ' . $search_cat_id . ' '; } // dem ban ghi trong menu $db_count = new db_count('SELECT count(*) AS count FROM menus WHERE 1 ' . $list->sqlSearch() . $sql_search); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT *
<?php require_once 'inc_security.php'; #some config #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('dic_key', 'Nội dung', 'string', 1, 0); $list->add('dic_translate_en', 'Bản dịch', 'string'); $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);
//Mô tả $left_column .= '<td>' . $row['cat_name'] . '</td>'; //số tiền $left_column .= '<td class="text-right" width="80">' . format_number($row['fin_money']) . '</td>'; $left_column .= $list->end_tr(); } $left_column .= $list->showFooter(); //Khối bên phải, hiển thị danh sách phiếu chi $right_control = list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); //Thêm nút cài đặt và thùng rác bên phải của danh sách $right_control .= '<div class="control-table-listing top_right_control pull-right"> <span class="control-btn"><i class="fa fa-cog"></i> Cài đặt</span> <span class="control-btn control-list-trash" onclick="list_trash(\'out\')"><i class="fa fa-recycle"></i> Thùng rác</span> </div>'; #Bắt đầu với datagrid $list = new dataGrid($id_field, 3000); $list->add('', 'Ngày chi'); $list->add('', 'Số phiếu'); $list->add('', 'Người nhận'); $list->add('', 'Diễn giải'); $list->add('', 'Số tiền'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' LEFT JOIN categories_multi ON cat_id = fin_cat_id WHERE 1 ' . $list->sqlSearch() . $sql_phieuchi . $sql_date_out . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' LEFT JOIN categories_multi ON cat_id = fin_cat_id