예제 #1
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     //find the group
     $this->layout = '//layouts/group';
     $group = Group::model()->findByPk($id);
     $this->group = $group;
     //find all groupProduct that belong to that group
     $model = new GroupProduct('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['GroupProduct'])) {
         $model->attributes = $_GET['GroupProduct'];
     }
     $this->render('view', array('model' => $model, 'group' => $group));
 }
예제 #2
0
 public function actionEventGroupProduct($id)
 {
     $this->layout = '//layouts/eventDetail';
     $this->eventDetail_model = Event::model()->with(array('GroupProductsCount', 'JoinedGroups'))->findByPk($id);
     if ($this->eventDetail_model == null) {
         throw new CHttpException(404, 'The specified Event cannot be found.');
     }
     $model = new GroupProduct('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['GroupProduct'])) {
         $model->attributes = $_GET['GroupProduct'];
     }
     $this->render('eventGroupProduct', array('dataprovider' => $model->getOnlyEventData($id)));
 }
예제 #3
0
 public function actionFollowingGroup()
 {
     $user = User::model()->findByPk(Yii::app()->user->id);
     if ($user == null) {
         throw new CHttpException(404, 'The specified user cannot be found.');
     }
     $model = new GroupProduct('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['GroupProduct'])) {
         $model->attributes = $_GET['GroupProduct'];
     }
     $this->render('followingGroup', array('model' => $model, 'user' => $user));
 }
예제 #4
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $this->layout = '//layouts/admin';
     $model = new GroupProduct('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['GroupProduct'])) {
         $model->attributes = $_GET['GroupProduct'];
     }
     $this->render('admin', array('model' => $model));
 }