Esempio n. 1
0
 public function actionAdmin()
 {
     // Проверка прав
     if (!Webadmins::checkAccess('websettings_edit')) {
         throw new CHttpException(403, "У Вас недостаточно прав");
     }
     $model = new Logs('search');
     $model->unsetAttributes();
     if (isset($_GET['Logs'])) {
         $model->attributes = $_GET['Logs'];
     }
     if (isset($_POST['clearlog']) && Yii::app()->request->isAjaxRequest) {
         $this->layout = FALSE;
         $tr = Yii::app()->db->createCommand()->truncateTable('{{logs}}');
         exit("{$tr}");
     }
     $this->render('admin', array('model' => $model));
 }
Esempio n. 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Logs('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Logs'])) {
         $model->attributes = $_GET['Logs'];
     }
     $this->render('admin', array('model' => $model));
 }