Esempio n. 1
0
 public function saveeditteam()
 {
     $DB = new TeamModel('team');
     if (!$DB->create()) {
         $this->error($DB->getError(), __URL__);
     } else {
         if (!empty($_FILES['pic']['name'])) {
             $module = "img";
             $path = date("Ymd");
             $pic = $this->_upload($module, $path);
             $img = $pic[0]['savepath'] . $pic[0]['savename'];
             $DB->pic = $img;
         }
         $query = $DB->save();
     }
     if ($query) {
         $this->success(L('EDITSUCCESS'), __URL__);
     } else {
         $this->error(L('EDITFAILURE'), __URL__);
     }
 }