Exemplo n.º 1
0
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->creadopor = Yii::app()->user->name;
         // $this->creadoel=Yii::app()->user->name;
         $this->codof = (string) (str_pad(Oficios::model()->count() + 1, 3, "0", STR_PAD_LEFT) + 300);
         //$this->cod_estado='01';
         //$this->c_salida='1';
     } else {
         //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares;
     }
     return parent::beforeSave();
 }
Exemplo n.º 2
0
 /**
  * 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 Oficios the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Oficios::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 3
0
echo $form->labelEx($model, 'cumple');
?>
        <?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'cumple', 'language' => Yii::app()->language == 'es' ? 'es' : null, 'options' => array('showAnim' => 'fold', 'showOn' => 'button', 'buttonText' => Yii::t('ui', '...'), 'dateFormat' => 'yy-mm-dd', 'changeYear' => true, 'yearRange' => '1950:2020'), 'htmlOptions' => array('style' => 'width:80px;vertical-align:top', 'readonly' => 'readonly')));
?>
        <?php 
echo $form->error($model, 'cumple');
?>
    </div>
    <div class="row">
        <?php 
echo $form->labelEx($model, 'codpuesto');
?>

        <?php 
$datos = CHtml::listData(Oficios::model()->findAll(array('order' => 'oficio')), 'codof', 'oficio');
echo $form->DropDownList($model, 'codpuesto', $datos, array('empty' => '--Seleccione un oficio --'));
?>



        <?php 
//echo $form->textField($model,'codpuesto',array('size'=>3,'maxlength'=>3));
?>
        <?php 
echo $form->error($model, 'codpuesto');
?>
    </div>

            <div class="row">
        <?php 
Exemplo n.º 4
0
 public function actiontransacciones()
 {
     /* $modelo1=new Canales;
     		$modelo2=new Oficios;
     		$modelo1->codcanal='893';
     		$modelo1->canal='CANAL 893';
     		$modelo2->codof='781';
     		$modelo2->oficio='EL CHUPE1';*/
     $transaccion = Yii::app()->db->beginTransaction();
     $karde = Alkardex::model()->findByPk(2178);
     $ofi = Oficios::model()->findByPk('312');
     $cana = Canales::model()->findByPk('893');
     $cana->canal = 'CANAL bb';
     $ofi->oficio = 'ESTIBADOR bb';
     $karde->cant = -8.888;
     $cana->save();
     $ofi->save();
     $karde->save();
     //sleep(20);
     $transaccion->rollback();
     /*$transaccion->connection->autoCommit=true;
     		$modelo2->save();
     		var_dump($transaccion->active);
     		$modelo1->save();*/
 }
Exemplo n.º 5
0
<?php

include '../../model/oficios/funcionesOficios.php';
if ($_POST) {
    //se obtienen los elementos del post como variables
    extract($_POST);
    //si en las variables obtenidas se encuentra la variable de accion continuamos con el caso de la accion recibida
    if (isset($accion) && !empty($accion)) {
        $insOficios = new Oficios();
        switch ($accion) {
            case "getInfoSol":
                $data = json_encode($insOficios->getInfoSol($idSol));
                echo $data;
                break;
            case "getInfoSolFtes":
                echo $insOficios->getInfoSolFtes($idSol);
                break;
            case "obtenerSolObra":
                echo json_encode($insOficios->getSolObra($idObra));
                break;
            case "getHistoricoSolicitudes":
                echo $insOficios->getHistSol($idObra, $idSol);
                break;
            case "guardarOficio":
                $res = $insOficios->guardarOficio($idSol, $idFte, $titular, $asunto, $ccp, $prefijo, $refer, $tat, $texto, $idObr, $ejercicio, $tipImpOfi);
                echo json_encode($res);
                break;
            case "obtenerInfoOfi":
                echo json_encode($insOficios->getInfoOficio($cveOfi));
                break;
            case "guardarFechaFirma":