public function ActionGuarda_administrativo_estado_nuevo($id, $sede, $estado, $ausente, $tipdoc, $doc, $dane)
 {
     $model = DocenteDocumento::model()->find("idadministrativo=" . $id);
     if ($model == null) {
         $model = new DocenteDocumento();
         $model->idadministrativo = $id;
     }
     $model->CODIGO_DANE_SEDE = $sede;
     $model->estado = $estado;
     $model->situacion_administrativa_ausencia = $ausente;
     $model->TIPO_DOCUMENTO = $tipdoc;
     $model->NRO_DOCUMENTO = $doc;
     $model->CODIGO_DANE = $dane;
     $model->usuario_id = Yii::app()->user->getId();
     if ($model->save()) {
         echo "ok";
     } else {
         echo "Error al guardar";
     }
 }
 public function actionSaveStateDocenteNew($estado_id, $tipdoc, $doc, $dane, $idmatriculadocumento)
 {
     if (DocenteDocumento::model()->countByAttributes(array('NRO_DOCUMENTO' => $doc)) >= 1) {
         $action = "update";
     } else {
         $action = "create";
     }
     echo $action . "<br/>";
     switch ($action) {
         case 'create':
             $model = new DocenteDocumento();
             $model->docenteespejo_id = $idmatriculadocumento;
             $model->TIPO_DOCUMENTO = $tipdoc;
             $model->CODIGO_DANE_SEDE = $dane;
             $model->NRO_DOCUMENTO = $doc;
             $model->estado = $estado_id;
             $model->usuario_id = 1;
             $model->fecha_creacion = new CDbExpression('now()');
             if ($model->save()) {
                 echo "ok";
             } else {
                 echo "Error" . $model;
             }
             break;
         case 'update':
             $model = DocenteDocumento::model()->findByAttributes(array('NRO_DOCUMENTO' => $doc));
             $model->docenteespejo_id = $idmatriculadocumento;
             $model->TIPO_DOCUMENTO = $tipdoc;
             $model->CODIGO_DANE_SEDE = $dane;
             $model->NRO_DOCUMENTO = $doc;
             $model->estado = $estado_id;
             $model->usuario_id = 1;
             $model->fecha_actualizacion = new CDbExpression('now()');
             if ($model->save()) {
                 echo "ok";
             } else {
                 echo "Error";
             }
             break;
     }
 }
Example #3
0
<?php

$this->breadcrumbs = array(DocenteDocumento::label(2), Yii::t('app', 'Index'));
$this->menu = array(array('label' => Yii::t('app', 'Crear') . ' ' . DocenteDocumento::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Administrar') . ' ' . DocenteDocumento::label(2), 'url' => array('admin')));
?>

<h1><?php 
echo GxHtml::encode(DocenteDocumento::label(2));
?>
</h1>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));