/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $fecha = date("YmdHis"); if ($fecha < Yii::app()->params->fecha_termino) { $puede_subir = Videos::soloUnVideo(); $usuario = Usuarios::model()->findByPk(Yii::app()->user->id_usuario); if ($puede_subir) { $adulto = $usuario->edad > 17 ? '1' : '0'; $this->render('create', array('material' => 'videos', 'usuario' => Yii::app()->user->id_usuario, 'fecha' => date("Y-m-d_His_"))); } else { throw new CHttpException(NULL, "Lo sentimos pero solo se permite subir un video"); } } else { throw new CHttpException(NULL, "El tiempo para registrar tus videos ha terminado. Para más información consulta la convocatoria."); } }