APP_URL . 'manage';
        }
    }
    public function __construct()
    {
        $this->aconfig = new AConfig();
        $this->auser = new AUser();
        $this->mailer = new Mailer();
        $this->data['rootUrl'] = Doo::conf()->APP_URL;
    }
    function sysinfo()
    {
        if (isset($_POST['proname']) || isset($_POST['aemail'])) {
            if ($_POST['proname']) {
                $this->aconfig->proname = $_POST['proname'];
                $this->aconfig->update(array('where' => 'conid = 1'));
            }
            if ($_POST['aemail'] && filter_var($_POST['aemail'], FILTER_VALIDATE_EMAIL)) {
                $this->auser->aemail = $_POST['aemail'];
                $this->auser->update(array('where' => 'auid = 1'));
                $this->mailer->setEmails($_POST['aemail']);
                $this->mailer->seteTitle('管理员邮箱地址已修改');
                $this->mailer->setClientName($_SESSION['aname']);
                $signupConfigStr = '
管理员邮箱地址已修改
' . $_POST['aemail'] . '
';
                $this->mailer->setContent($signupConfigStr);
                $this->mailer->send_mail();
            }
            return Doo::conf()->APP_URL . 'manage/sys/info';
        }
        $this->data['proName'] = $this->aconfig->getOne(array('select' => 'proName', 'asArray' => TRUE))['proName'];
        $this->data['aemail'] = $this->auser->getOne(array('select' => 'aemail', 'asArray' => TRUE))['aemail'];
        $this->data['ver'] = DOO::conf()->ver;
        $this->data['aname'] = $_SESSION['aname'];
        $this->data['menu'] = 1;
        $this->render('admin-sysinfo', $this->data, TRUE);
    }
    function smsSwitch()
    {
        if (isset($_POST['switch'])) {
            if ($_POST['switch'] == 'off') {
                $this->aconfig->smsswitch = 0;
                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
                    exit(json_encode(array('switch' => 'off')));
            }
            if ($_POST['switch'] == 'on') {
                $this->aconfig->smsswitch = 1;
                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
                    exit(json_encode(array('switch' => 'on')));
            }
        }
        $this->data['smsSwitch'] = $this->aconfig->getOne(array('select' => 'smsswitch', 'asArray' => TRUE))['smsswitch'];
        $this->data['menu'] = 4;
        $this->render('admin-sms', $this->data, TRUE);
    }
}