public function actiondeleteTE($id) { $model = TipoEmpresa::model()->findByPk($id); $model->tem_desabilitado = 1; $model->save(); $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('tipoempresa')); }
/** * 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 TipoEmpresa the loaded model * @throws CHttpException */ public function loadModel($id) { $model = TipoEmpresa::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function getMenuTipoEmpresa() { return CHtml::listData(TipoEmpresa::model()->findAll("Activo=?", array(1)), "IdTipoEmpresa", "NombreTipoEmpresa"); }
<?php $form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array('layout' => BsHtml::FORM_LAYOUT_HORIZONTAL, 'enableClientValidation' => true)); ?> <p class="help-block">Los campos con un <span class="required">*</span> son requeridos.</p> <?php echo $form->errorSummary($model); ?> <?php echo $form->textFieldControlGroup($model, 'emp_rut', array('maxlength' => 13, 'disabled' => Yii::app()->controller->action->id !== 'create')); ?> <?php echo $form->dropDownListControlGroup($model, 'tem_id', CHtml::listData(TipoEmpresa::model()->findAll('tem_desabilitado=0'), 'tem_id', 'tem_nombre'), array('empty' => 'Seleccione un tipo')); ?> <?php echo $form->dropDownListControlGroup($model, 'are_id', CHtml::listData(AreaOperativa::model()->findAll('are_desabilitado=0'), 'are_id', 'are_nombre'), array('empty' => 'Seleccione un Área')); ?> <?php echo $form->textFieldControlGroup($model, 'emp_nombre', array('maxlength' => 256)); ?> <?php echo $form->textFieldControlGroup($model, 'emp_direccion', array('maxlength' => 512)); ?> <?php echo $form->textFieldControlGroup($model, 'emp_fono', array('maxlength' => 64)); ?> <?php echo $form->textFieldControlGroup($model, 'emp_email', array('maxlength' => 256));
public function actionActualizarEstadoTipoEmpresa() { date_default_timezone_set('America/Tegucigalpa'); $Carrera = TipoEmpresa::model()->findByPk($_POST['pk']); $Carrera->Activo = $_POST['value']; $Carrera->ModificadoPor = Yii::app()->user->name; $Carrera->FechaModificacion = date('Y-m-d H:i:s'); $Carrera->Save(); }
public function gettem_nombre() { return TipoEmpresa::model()->findByPk($this->tem_id)->tem_nombre; }