예제 #1
0
 public function actionView($id, $view_id)
 {
     if (!($model = ContestEntry::model()->with(array('contest', 'contest.fields', 'items', 'contest.fields.multi' => array('index' => 'id')))->findByPk($view_id))) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $this->render('view', array('model' => $model));
 }
예제 #2
0
파일: detail.php 프로젝트: kostya1017/our
        echo Yii::t('contestModule.common', 'Le formulaire de participation sera accessible à partir du') . Helper::formatDate($contest->start_date, "reg") . Yii::t('contestModule.common', 'à') . substr($contest->start_date, 11, 5);
        ?>
.</p>
		
		<?php 
    } elseif ($contest->max_participation !== null && ContestEntry::model()->countByAttributes(array('contest_id' => $contest->id)) >= $contest->max_participation) {
        // Max. participation has been reached.
        ?>
		
		<p class="alert alert-danger"><?php 
        echo Yii::t('contestModule.common', 'Le nombre maximum de participations a été atteint pour ce concours');
        ?>
.</p>
		
		<?php 
    } elseif (!$contest->multiple_entries && ContestEntry::model()->countByAttributes(array('contest_id' => $contest->id, 'ip' => $_SERVER['REMOTE_ADDR'])) > 0) {
        ?>
		
		<p class="alert alert-danger"><?php 
        echo Yii::t('contestModule.common', 'Vous ne pouvez participer plus d’une fois à ce concours/sondage');
        ?>
.</p>
		
		<?php 
    } else {
        $form = $this->beginWidget('CActiveForm', array('id' => 'contest-form', 'enableAjaxValidation' => false, 'errorMessageCssClass' => 'alert alert-danger', 'action' => array('detail', 'n' => $contest->title_url, '#' => 'contest-form'), 'htmlOptions' => array('enctype' => 'multipart/form-data')));
        ?>
			
			<p class="text-small"><span class="required">*</span> = <?php 
        echo Yii::t('common', 'champs obligatoires');
        ?>