Ejemplo n.º 1
0
 public function actionUser($username)
 {
     $userModel = User::model()->findByAttributes(array('username' => $username));
     if (!$userModel) {
         throw new CHttpException(404, "Agent/user doesn't exists");
     }
     /*get leads submitted by this user */
     $leadModel = new MainLeadModel();
     $leadModel->unsetAttributes();
     $leadModel->user_id = $userModel->id;
     $dataprovider = $leadModel->search();
     $this->render('user', compact('dataprovider', 'leadModel', 'userModel'));
 }
Ejemplo n.º 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new MainLeadModel('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['MainLeadModel'])) {
         $model->attributes = $_GET['MainLeadModel'];
     }
     $this->render('admin', array('model' => $model));
 }