���� 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/oladi/code/management/service/ |
<?php $CORE->page_title='Quản lý dịch vụ'; $type='list'; if(isset($CORE->input['type']) && $CORE->input['type']!=''){ $type=$CORE->input['type']; } switch ($type){ default: $pageNum = isset($_GET['pageNum']) ? intval($_GET['pageNum']) : 1; $pageSize = 20; $from = (($pageNum * $pageSize) - $pageSize); $t = $DB->fetch_row($DB->query("SELECT count(*) as total FROM tb_truyen")); $total = $t['total']; $totalPage = ceil($total / $pageSize); $query = $DB->query("SELECT * FROM tb_truyen ORDER BY time_post LIMIT $from, $pageSize"); while($row = $DB->fetch_row($query)){ $arr['items'][] =$row; } $arr['pagination']['totalItems'] = $total; $arr['pagination']['totalItemsPerPage'] = $pageSize; $arr['pagination']['currentPage'] = $pageNum; $arr['pagination']['totalPages'] = $totalPage; echo json_encode($arr); break; case 'chapter': $truyen_id = $CORE->input['truyen_id'] ?? 0; if($truyen_id>0) { $q_chuong = $DB->query("SELECT * FROM tb_chuong WHERE truyen_id='$truyen_id' ORDER BY chuong_pos ASC "); while ($r_chuong = $DB->fetch_row($q_chuong)) { $arr['items'][] = $r_chuong; } if(isset($arr)) { echo json_encode($arr); } } break; case 'image': $chuong_id = $CORE->input['chuong_id'] ?? 0; if($chuong_id>0) { $q_img = $DB->query("SELECT * FROM tb_chuong_img WHERE chuong_id='" . $chuong_id . "' ORDER BY chuong_img_pos ASC "); while($r_img = $DB->fetch_row($q_img)){ $arr['items'][] = $r_img; } if(isset($arr)) { echo json_encode($arr); } } break; case 'post_service_event': $f = $CORE->input['f']; if($f['service_event_end']!='' and strtotime($f['service_event_begin'])>strtotime($f['service_event_end'])){ exit('Sai thời gian bắt đầu và kết thúc'); } $service_begin = date('Y-m-d',strtotime($f['service_event_begin'])); $service_end = date('Y-m-d',strtotime($f['service_event_end'])); if($f['service_event_id']>0){ $DB->query("UPDATE tb_service_event SET service_id='".$f['service_id']."',service_event_donvitinh='".$f['service_event_donvitinh']."',service_event_soluong='".intval($f['service_event_soluong'])."' , service_event_dongia='".intval($f['service_event_dongia'])."',service_event_tax='".intval($f['service_event_tax'])."',service_event_discount='".intval($f['service_event_discount'])."', service_event_begin='".$service_begin."', service_event_end='".$service_end."', service_event_soluongweb='".$f['service_event_soluongweb']."',service_event_tenweb='".$f['service_event_tenweb']."',service_event_soluongbaiviet='".$f['service_event_soluongbaiviet']."',service_event_soluongsuabai='".$f['service_event_soluongsuabai']."',service_event_soluonglikebai='".intval($f['service_event_soluonglikebai'])."',service_event_soluonglikefanpage='".$f['service_event_soluonglikefanpage']."',service_event_thoihanhopdong='".$f['service_event_thoihanhopdong']."',service_event_tudonggiahan='".$f['service_event_tudonggiahan']."',service_event_covat='".$f['service_event_covat']."',service_event_sodotthanhtoan='".$f['service_event_sodotthanhtoan']."',service_event_thoigianthanhtoan='".$f['service_event_thoigianthanhtoan']."' ,service_event_manguon='".$f['service_event_manguon']."',service_event_thoigianthuchien='".$f['service_event_thoigianthuchien']."' WHERE service_event_id='".$f['service_event_id']."' "); $v_service_id = $f['service_id']; $v_service_event_id = $f['service_event_id']; }else{ $arr_insert = array('service_id'=>$f['service_id'],'service_event_donvitinh'=>$f['service_event_donvitinh'],'service_event_soluong'=>intval($f['service_event_soluong']),'service_event_dongia'=>intval($f['service_event_dongia']),'service_event_tax'=>intval($f['service_event_tax']),'service_event_discount'=>intval($f['service_event_discount']),'service_event_begin'=>$service_begin,'service_event_end'=>$service_end,'time_post'=>date('Y-m-d H:i:s'),'user_post'=>$ob_user->user_name, 'service_event_soluongweb'=>$f['service_event_soluongweb'],'service_event_tenweb'=>$f['service_event_tenweb'],'service_event_soluongbaiviet'=>$f['service_event_soluongbaiviet'],'service_event_soluongsuabai'=>$f['service_event_soluongsuabai'],'service_event_soluonglikebai'=>intval($f['service_event_soluonglikebai']),'service_event_soluonglikefanpage'=>intval($f['service_event_soluonglikefanpage']),'service_event_thoihanhopdong'=>$f['service_event_thoihanhopdong'],'service_event_tudonggiahan'=>$f['service_event_tudonggiahan'],'service_event_covat'=>$f['service_event_covat'],'service_event_sodotthanhtoan'=>$f['service_event_sodotthanhtoan'],'service_event_thoigianthanhtoan'=>$f['service_event_thoigianthanhtoan'] ,'service_event_manguon'=>$f['service_event_manguon'] ,'service_event_thoigianthuchien'=>$f['service_event_thoigianthuchien'] ); $v_service_id = $f['service_id']; $v_service_event_id=$DB->do_insert('tb_service_event',$arr_insert); } $print->refresh('?act=management&code=service&type=post&id='.$v_service_id); break; case 'delete_service_event': $v_service_event_id = 0; if(isset($CORE->input['service_event_id']) && $CORE->input['service_event_id']>0){ $v_service_event_id = $CORE->input['service_event_id']; $DB->query("DELETE FROM tb_service_event WHERE service_event_id='$v_service_event_id' "); } $print->refresh('?act=management&code=service&type=post&id='.$CORE->input['id'],'Đã xóa'); break; case 'delete_service': $v_service_id = 0; if(isset($CORE->input['id']) && $CORE->input['id']>0){ $v_service_id = $CORE->input['id']; $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_service_event WHERE service_id='$v_service_id'")); if($row_check){ $print->refresh('?act=management&code=service','Dịch vụ có quá trình sử dụng, không thể xóa!',5); } $DB->query("DELETE FROM tb_service WHERE service_id='$v_service_id' "); } $print->refresh('?act=management&code=service','Đã xóa'); break; } ?>