Esempio n. 1
0
 public static function getALlAdminId()
 {
     $admins = Phanquyenquantri::model()->findAll();
     $adm = array();
     foreach ($admins as $admin) {
         array_push($adm, $admin->ma_qtv);
     }
     return $adm;
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     $this->_checkAccess('delete');
     Phanquyenquantri::model()->deleteAllByAttributes(array('ma_qtv' => $id));
     $this->loadModel($id)->delete();
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
     }
 }
Esempio n. 3
0
 /**
  * Specifies the access control rules.
  * This method is used by the 'accessControl' filter.
  * @return array access control rules
  */
 public function accessRules()
 {
     return array(array('allow', 'users' => Phanquyenquantri::getALlAdminByRole(Phanquyenquantri::CUSTOMER_NEWS_TYPE)), array('deny', 'users' => array('*')));
 }
Esempio n. 4
0
 /**
  * Specifies the access control rules.
  * This method is used by the 'accessControl' filter.
  * @return array access control rules
  */
 public function accessRules()
 {
     return array(array('allow', 'users' => Phanquyenquantri::getALlAdminId()), array('deny', 'users' => array('*')));
 }