public function actionVerificarEmpresa($Activar) { date_default_timezone_set('America/Tegucigalpa'); $model = UsuarioEmpresa::model()->findByPk($Activar); // cargando el modelo $model->Activo = 1; // activando el usuario $model->FechaVerificacion = date('Y-m-d H:i:s'); // agregando fecha de verificación $model->VerificadoPor = Yii::app()->user->name; // agregando el nombre de usuario que lo verifico $model->save(); // salvando el modelo Yii::app()->user->setFlash("success", "<strong>Excelente! </strong>" . $model->NombreEmpresa . " ha sido verificada, se ha enviado un correo de bienvenida a " . $model->CorreoEmpresa . " ."); $this->redirect(Yii::app()->request->urlReferrer); }
/** * 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 $id the ID of the model to be loaded * @return UsuarioEmpresa the loaded model * @throws CHttpException */ public function loadModel($id) { $model = UsuarioEmpresa::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<div id ="usuariosEmpresasTab" class="profile-edit tab-pane fade"> <h2 class ="heading-md">Panel de Verificación de usuarios Empresariales</h2> <p>Abajo se encuentran nuevos usuarios de empresas ya creadas. UTILIZA LOS FILTROS para realizar búsquedas.</p> </br> <?php $this->widget('booster.widgets.TbExtendedGridView', array("id" => 'test4', 'type' => 'striped bordered', 'dataProvider' => $modelUsuarioEmpresa->BusquedaUsuariosEmpresaInactivos(), 'filter' => $modelUsuarioEmpresa, 'emptyText' => 'No se encontraron registros', 'columns' => array(array('name' => 'NombreCompleto', 'type' => 'raw', 'value' => 'CHtml::encode($data->NombreCompleto) '), array('name' => 'UsuarioEmpresa_IdUsuarioEmpresa', 'type' => 'raw', 'header' => 'Empresa', 'filter' => ContactoEmpresa::model()->EmpresasContactoEmpresaInactivos(), 'value' => 'CHtml::Link($data->usuarioEmpresa->NombreEmpresa)'), array('name' => 'TelefonoCelular', 'type' => 'raw', 'value' => 'CHtml::encode($data->TelefonoCelular)'), array('name' => 'PuestoEmpresa', 'type' => 'raw', 'value' => 'CHtml::encode($data->PuestoEmpresa)'), array('class' => 'CButtonColumn', 'template' => '{Email} ', 'header' => 'Email', 'htmlOptions' => array('encodeLabel' => false), 'buttons' => array('Email' => array('url' => 'Yii::app()->createUrl("UsuarioUnitec/EnviarCorreoEmpresa", array("CorreoEmpresa"=>$data->CorreoElectronico))', 'label' => ' <div class="row text-center"> <i class="fa fa-envelope" ></i> </div> ', 'options' => array('rel' => 'tooltip', 'data-toggle' => 'tooltip', 'title' => 'Enviar Correo Electrónico')))), array('class' => 'CButtonColumn', 'template' => '{Verificar} ', 'header' => 'Verificar', 'htmlOptions' => array('encodeLabel' => false), 'buttons' => array('Verificar' => array('url' => 'Yii::app()->createUrl("UsuarioUnitec/VerificarUsuarioEmpresa", array("Activar"=>$data->IdContactoEmpresa))', 'label' => ' <div class="row text-center"> <i class="fa fa-check-square-o" ></i> Verificar </div>', 'options' => array('rel' => 'tooltip', 'data-toggle' => 'tooltip', 'title' => 'Verificar Empresa', 'confirm' => '¿Seguro que desea verificar esta usuario?'))))))); ?> <!-- <?php $this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $modelUsuarioEmpresa->BusquedaUsuariosEmpresaInactivos(), 'filter' => $modelUsuarioEmpresa, 'htmlOptions' => array('class' => 'table-responsive'), 'columns' => array(array('name' => 'NombreCompleto', 'type' => 'raw', 'value' => 'CHtml::encode($data->NombreCompleto) '), array('name' => 'UsuarioEmpresa_IdUsuarioEmpresa', 'type' => 'raw', 'header' => 'Empresa', 'filter' => CHtml::listData(UsuarioEmpresa::model()->findAll(array('order' => 'NombreEmpresa')), 'IdUsuarioEmpresa', 'NombreEmpresa'), 'value' => 'CHtml::Link($data->usuarioEmpresa->NombreEmpresa)'), array('name' => 'TelefonoCelular', 'type' => 'raw', 'value' => 'CHtml::encode($data->TelefonoCelular)'), array('name' => 'PuestoEmpresa', 'type' => 'raw', 'value' => 'CHtml::encode($data->PuestoEmpresa)'), array('class' => 'CButtonColumn', 'template' => '{Email} ', 'header' => 'Email', 'htmlOptions' => array('encodeLabel' => false), 'buttons' => array('Email' => array('url' => 'Yii::app()->createUrl("UsuarioUnitec/EnviarCorreoEmpresa", array("CorreoEmpresa"=>$data->CorreoElectronico))', 'label' => ' <div class="row text-center"> <i class="fa fa-envelope" ></i> </div> ', 'options' => array('rel' => 'tooltip', 'data-toggle' => 'tooltip', 'title' => 'Enviar Correo Electrónico')))), array('class' => 'CButtonColumn', 'template' => '{Verificar} ', 'header' => 'Verificar', 'htmlOptions' => array('encodeLabel' => false), 'buttons' => array('Verificar' => array('url' => 'Yii::app()->createUrl("UsuarioUnitec/VerificarUsuarioEmpresa", array("Activar"=>$data->IdContactoEmpresa))', 'label' => ' <div class="row text-center"> <i class="fa fa-check-square-o" ></i> Verificar </div>', 'options' => array('rel' => 'tooltip', 'data-toggle' => 'tooltip', 'title' => 'Verificar Empresa', 'confirm' => '¿Seguro que desea verificar esta usuario?'))))))); ?> --> </div> <div id ="passwordTab" class="profile-edit tab-pane fade"> <h2 class ="heading-md">Panel de Verificación de Alumnos</h2> <p>Abajo se encuentran los alumnos de las carreras que tu asesoras. UTILIZA LOS FILTROS para realizar búsquedas.</p> </br> <?php $this->widget('booster.widgets.TbExtendedGridView', array("id" => 'PanelVerificacionAlumnos', 'type' => 'striped bordered', 'dataProvider' => $modelEstudiantes->BusquedaAlumnosInactivos(), 'filter' => $modelEstudiantes, 'emptyText' => 'No se encontraron registros', 'columns' => array(array('name' => 'Nombre', 'type' => 'raw', 'value' => 'CHtml::encode($data->NombreCompleto)'), array('name' => 'NumeroDeCuenta', 'type' => 'raw', 'value' => 'CHtml::encode($data->NumeroDeCuenta)'), array('name' => 'Carrera_IdCarrera', 'type' => 'raw', 'filter' => UsuarioUnitec::model()->CarrerasPorJefe(), 'value' => 'CHtml::encode($data->carrera->NombreCarrera)'), array('class' => 'CButtonColumn', 'template' => '{Verificar} ', 'header' => 'Verificar', 'htmlOptions' => array('encodeLabel' => false), 'buttons' => array('Verificar' => array('url' => 'Yii::app()->createUrl("UsuarioUnitec/VerificarAlumnos", array("Activar"=>$data->IdUsuarioEstudiante))', 'label' => ' <div class="row text-center"> <i class="fa fa-check-square-o" ></i> Verificar </div>', 'options' => array('rel' => 'tooltip', 'data-toggle' => 'tooltip', 'title' => 'Verificar Empresa', 'confirm' => '¿Seguro que desea verificar este alumno?')))))));