HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/bs.kntsleep.com/system/admin/consult/consult.class.php
<?php
/*
 * Copyright (c) Huyin Information Technology Co., Ltd. All Rights Reserved.
 * BOSSCMS Content Management System (https://www.bosscms.net/)
 */
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('admin');

class consult extends admin
{
    public function nav()
    {
        global $G;
		return $this->permit(
			array(
				'consult' => array(
					'name' => '客服列表',
					'mold' => 'consult',
					'check' => 'RAMD'
				),
				'config' => array(
					'name' => '客服设置',
					'mold' => 'consult',
					'part' => 'config',
					'check' => 'RM'
				)
			)
		);
    }
	
	public function init()
	{
		global $G;
		$G['cover'] = $this->cover();
		$boss_cms = true;
		$G['navs1'] = self::nav();
		$G['navs1']['consult']['active'] = true;
		$data = page::consult();
		echo $this->theme('consult/consult', $data);
	}
	
	/* bosss c m s */
	public function modify()
	{
		global $G;
		$this->cover('consult','M');
		if(isset($G['post']['id'])){
			$error=array();
			foreach($G['post']['id'] as $id){
				if(isset($G['post']['sort'.$id])){
					$data = array('sort'=>$G['post']['sort'.$id]);
				}else if(isset($G['post']['display'.$id])){
					$data = array('display'=>$G['post']['display'.$id]);
				}
				if($data && !is_numeric(mysql::update($data,"consult","id='{$id}'"))){
					$error[]=$id;
				}
			}
			if($error){
				alert('ID为'.implode(',',$error).'修改失败');
			}else{
				alert('修改成功!', url::mpf('consult','consult','init'));
			}
		}else{
			alert('没有提交信息!');
		}
	}
	
	
	public function edit()
	{
		global $G;
		$G['cover'] = $this->cover('consult');
		$data = array();
		if(isset($G['get']['id'])){
			$data = mysql::select_one('*','consult',"id='{$G['get']['id']}'");
			$data["value{$data['type']}"] = $data["value"];
		}
		echo $this->theme('consult/edit', $data);
	}
	
	public function add()
	{	
		global $G;
		$this->cover('consult',$G['get']['id']?'M':'A');
		if(isset($G['post']['type'])){
			$data = array(
				'name'        => $G['post']['name'],
				'type'        => $G['post']['type'],
				'value'       => $G['post']["value{$G['post']['type']}"],
				'sort'        => $G['post']['sort'],
				'display'     => $G['post']['display']
			);
			if($id = $G['get']['id']){
				if($result = mysql::select_one('id','consult',"id='{$id}'")){
					mysql::update($data,"consult","id='{$id}'");
				}else{
					alert('没有内容');
				}
			}else{
				$id = mysql::insert($data,"consult");
			}
			alert('操作成功', url::mpf('consult','consult','edit',array('id'=>$id,'success'=>'ok')));
		}else{
			alert('没有提交信息!');
		}
	}
	
	
	
	 
	public function delete()
	{
		global $G;
		$this->cover('consult','D');
		if(isset($G['post']['url']) && isset($G['get']['id'])){
			$del = array();
			$arr = explode(',',$G['get']['id']);
			foreach($arr as $id){
				if(is_numeric($id)){
					$del[$id] = $id;
				}
			}
			if($del){
				$error=array();
				foreach($del as $id=>$name){
					if(is_numeric(mysql::delete("consult","id='{$id}'"))){
						
					}else{
						$error[]=$id;
					}
				}
				if($error){
					alert('ID为'.implode(',',$error).'删除失败');
				}else{
					alert('删除成功');
				}
			}else{
				alert('没有删除对象id!');
			}			
		}
		alert('没有提交信息!');
	}
}
?>