���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/luckymerchan/code/management/staff/ |
<?php if(isset($CORE->input['submitbt'])){ $f = $CORE->input['f']; foreach ($f as $teacher_id => $val){ $arr_teacher[] = $teacher_id; $txt_module_id = implode(',',$val); $q_module = $DB->query("SELECT module_url FROM tb_module WHERE module_id IN (".$txt_module_id.") ORDER BY module_pos "); $txt_list_module = ''; while ($r_module = $DB->fetch_row($q_module)){ $txt_list_module .= $r_module['module_url'].'@'; } $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_staff_rule WHERE staff_id='$teacher_id' LIMIT 1 ")); if(!$row_check) { $arr_insert = array('staff_id' => $teacher_id, 'staff_rule_module' => $txt_list_module); $DB->do_insert('tb_staff_rule', $arr_insert); }else{ $DB->query("UPDATE tb_staff_rule SET staff_rule_module='$txt_list_module' WHERE staff_id='$teacher_id' "); } } $print->refresh('?act=management&code=staff&type=rule&list_id='.implode(',',$arr_teacher)); } $txt_list_teacher_list = (isset($CORE->input['list_id']) && $CORE->input['list_id']!='') ? $CORE->input['list_id'] : ''; if($txt_list_teacher_list==''){ $print->refresh('?act=management&code=staff','Xin chọn cbnv',5); } $txt_list_teacher_list = str_replace('@',',',$txt_list_teacher_list); $q_teacher = $DB->query("SELECT * FROM tb_staff WHERE staff_id IN (".$txt_list_teacher_list.") "); $txt_rule = ''; while ($r_teacher = $DB->fetch_row($q_teacher)){ $row_function = $DB->fetch_row($DB->query("SELECT * FROM tb_staff_function WHERE staff_function_id='".$r_teacher['staff_function']."' ")); $txt_rule .= '<tr class="bg-warning"><th><input type="checkbox" class="check_teacher_id" value="'.$r_teacher['staff_id'].'"></th><th class="text-success">'.$r_teacher['staff_fullname'].'</th><th>'.$row_function['staff_function_name'].'</th><th>'.$r_teacher['staff_email365'].'</th>'; $q_module_cat = $DB->query("SELECT * FROM tb_module_category ORDER BY module_category_pos "); while ($r_module_cat = $DB->fetch_row($q_module_cat)){ $txt_rule .= '<tr class="bg-info"><td><input type="checkbox" class="check_module_cat_id" value="'.$r_module_cat['module_category_id'].'"></td><td>'.html_entity_decode($r_module_cat['module_category_icon']).'</td><td>'.$r_module_cat['module_category_name'].'</td><td>'.$r_module_cat['module_category_ename'].'</td>'; $q_module = $DB->query("SELECT * FROM tb_module WHERE module_cat='".$r_module_cat['module_category_id']."' ORDER BY module_pos "); while ($r_module = $DB->fetch_row($q_module)){ $checked = ''; $row_check_module = $DB->fetch_row($DB->query("SELECT * FROM tb_staff_rule WHERE staff_rule_module LIKE '%".$r_module['module_url']."@%' AND staff_id='".$r_teacher['staff_id']."' ")); if($row_check_module){ $checked = ' checked'; } $txt_rule .= '<tr><td><input type="checkbox" class="check_teacher_id_'.$r_teacher['staff_id'].' check_module_cat_id_'.$r_module_cat['module_category_id'].'" name="f['.$r_teacher['staff_id'].'][]" value="'.$r_module['module_id'].'" '.$checked.'></td><td>'.html_entity_decode($r_module['module_name']).'</td><td>'.$r_module['module_ename'].'</td><td>'.$r_module['module_url'].'</td>'; } } } ?>