$return_action = vtlib_purify($_REQUEST['return_action']); } else { $return_action = 'ListProfiles'; } //Retreiving the vtiger_tabs permission array $tab_perr_result = $adb->pquery("select * from vtiger_profile2tab where profileid=?", array($profileid)); $act_perr_result = $adb->pquery("select * from vtiger_profile2standardpermissions where profileid=?", array($profileid)); $act_utility_result = $adb->pquery("select * from vtiger_profile2utility where profileid=?", array($profileid)); $num_tab_per = $adb->num_rows($tab_perr_result); $num_act_per = $adb->num_rows($act_perr_result); $num_act_util_per = $adb->num_rows($act_utility_result); //Updating vtiger_profile2global permissons vtiger_table $view_all_req = $_REQUEST['view_all']; $view_all = getPermissionValue($view_all_req); $edit_all_req = $_REQUEST['edit_all']; $edit_all = getPermissionValue($edit_all_req); $update_query = "update vtiger_profile2globalpermissions set globalactionpermission=? where globalactionid=1 and profileid=?"; $adb->pquery($update_query, array($view_all, $profileid)); $update_query = "update vtiger_profile2globalpermissions set globalactionpermission=? where globalactionid=2 and profileid=?"; $adb->pquery($update_query, array($edit_all, $profileid)); //profile2tab permissions for ($i = 0; $i < $num_tab_per; $i++) { $tab_id = $adb->query_result($tab_perr_result, $i, "tabid"); $request_var = $tab_id . '_tab'; if ($tab_id != 3 && $tab_id != 16) { $permission = $_REQUEST[$request_var]; if ($permission == 'on') { $permission_value = 0; } else { $permission_value = 1; }
require_once 'inc_security.php'; // khai báo biến $left_control = ''; $right_control = ''; $footer_control = ''; $left_column = ''; $right_column = ''; $context_menu = ''; $cus_name = ''; $left_column_title = 'danh sách hóa đơn bán hàng'; $right_column_title = 'danh sách hóa đơn nhập hàng'; $setting_column = ''; $add_btn = 0; $edit_btn = 0; $trash_btn = getPermissionValue('trash'); $list_quantity = array(); // phần hiển thị khi mới truy cập vào trang hóa đơn $left_control .= '<span class="info control-btn deactivate control-detail"><i class="fa fa-list-alt"></i> Chi tiết</span>'; $left_control .= list_admin_control_button($add_btn, $edit_btn, $trash_btn, 1); // lấy ra tổng số hóa đơn bán trong bảng thùng rác (trash) $sql = new db_query("SELECT * FROM trash WHERE tra_table = 'bill_in'"); $count = mysqli_num_rows($sql->result); unset($sql); $left_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 = new dataGrid($id_field_i, 3000); $list->add($id_field_i, 'Số HĐ', 'string', 1);
?> <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); //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');
$db_query = new db_query('SELECT * FROM sections LEFT JOIN service_desks ON sec_service_desk = sed_id WHERE sed_agency_id = ' . $age_id); while ($row = mysqli_fetch_assoc($db_query->result)) { //select ra các bàn trong section này $db_desk = new db_query('SELECT * FROM desks WHERE des_sec_id = ' . $row['sec_id']); while ($row_desk = mysqli_fetch_assoc($db_desk->result)) { $row_desk['full_name'] = $row['sec_name'] . ' - ' . $row_desk['des_name']; //Nếu bàn này có trong list active thì thêm active vào $row_desk['active'] = in_array($row_desk['des_id'], $desk_active_id); $row['list_desk'][] = $row_desk; } unset($db_desk); $row['count'] = isset($row['list_desk']) ? count($row['list_desk']) : 0; $list_desk[] = $row; } $rainTpl = new RainTPL(); add_more_css('css/custom.css', $load_header); add_more_css('css/custom.css', $load_header, 'print'); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $rainTpl->assign('permission_print_order', getPermissionValue('IN_CHE_BIEN')); $rainTpl->assign('pay_type_cash', PAY_TYPE_CASH); $rainTpl->assign('pay_type_card', PAY_TYPE_CARD); $rainTpl->assign('listing_menu', $listing_menu); $rainTpl->assign('restaurant_info', $restaurant_info); $rainTpl->assign('list_desk', $list_desk); $rainTpl->assign('list_menu_json', json_encode($list_category_menu)); $rainTpl->draw('/v2/home/home');