Exemple #1
0
 public function setting()
 {
     $errors = $this->errors;
     //实例化Model
     $adminModel = new AdminModel();
     $adminId = $_SESSION['admin']['adminId'];
     $blogerInfo = $this->getBlogerInfo($adminId);
     if ($_POST) {
         $pdata = $_POST;
         if ($pdata['files']) {
             $pdata['face'] = '/asset/upload/' . $pdata['files'];
         }
         unset($pdata['files']);
         if ($pdata['password'] != NULL) {
             $pdata['password'] = md5($pdata['password']);
         } else {
             unset($pdata['password']);
         }
         $row = $adminModel->updateAdminInfo($adminId, $pdata);
         if ($row) {
             $result['code'] = 0;
             $result['message'] = $errors[0];
         } else {
             $result['code'] = '013';
             $result['message'] = $errors['013'];
         }
         echo json_encode($result);
         exit;
     }
     //$personalInfo = $_GET['personalInfo'];
     //$row = $adminModel->updatePersonalInfo($adminId,$personalInfo);
     $this->assign('blogerInfo', $blogerInfo);
     $this->display();
 }