示例#1
0
 public function deleteAction()
 {
     $authorization = Zend_Auth::getInstance();
     $identity = $authorization->getIdentity();
     if ($identity->user_type == "admin") {
         $id = $this->getRequest()->getParam('id');
         if ($id) {
             $model = new Application_Model_Courses();
             $model->deleteCourse($id);
         }
         $this->redirect("courses/list");
     } else {
         $this->redirect("cources/index");
     }
 }
示例#2
0
 public function deleteAction()
 {
     $id = $this->getRequest()->getParam('id');
     if ($id) {
         $model = new Application_Model_Courses();
         $this->view->courses = $model->deleteCourse($id);
     }
     $this->render('list');
 }