public function __construct($id, $module = null) { //$this->initAPI(); parent::__construct($id, $module); $this->initMenu(); $this->initAssets(); $this->url_referrer = Yii::app()->request->urlReferrer; $this->requests = SearchRequests::model()->getUserRequests(WebUser::Id(true)); $this->listings = ListingNames::model()->getUserLists(WebUser::Id()); if (!WebUser::isGuest()) { $user = WebUser::getModel(); $user->date_last_visit = time(); $user->save(); } }
/** * @param $user_id * @return SearchRequests[] */ public function getUserRequests($user_id) { $criteria = new CDbCriteria(); $criteria->compare('user_id', $user_id); $criteria->order = 'date_update DESC'; return SearchRequests::model()->findAll($criteria); }
<?php echo CHtml::activeLabelEx($model, 'auction_type_id'); ?> <?php $listing_types = array('All', 'Auction', 'BuyItNow', 'Classified', 'FixedPrice', 'StoreInventory'); //$listing_types = array_combine(array_keys($model->getAuctionTypes()), $listing_types); $listing_types = $model->getAuctionTypes(); echo CHtml::activeDropDownList($model, 'auction_type_id', $listing_types); ?> </div> <div class="span3"> <?php echo CHtml::activeLabelEx($model, 'condition'); ?> <?php $conditions = SearchRequests::model()->getItemsConditions(); echo CHtml::activeDropDownList($model, 'condition', $conditions); ?> </div> </td> </tr> <tr> <td> <table> <tbody> <tr> <td> <?php echo Yii::t('sniper_ebay', 'Min Price');
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded * @return SearchRequests */ public function loadModel($id) { $model = SearchRequests::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }