Example #1
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();*/
 }
Example #2
0
echo $form->labelEx($model, 'pesaje');
?>
		<?php 
echo $form->checkBox($model, 'pesaje');
?>
		<?php 
echo $form->error($model, 'pesaje');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'hcodcanal');
?>
		<?php 
$datos = CHtml::listData(Canales::model()->findAll(array('order' => 'canal')), 'codcanal', 'canal');
echo $form->DropDownList($model, 'hcodcanal', $datos, array('empty' => '--Llene el canal --'));
?>
		<?php 
echo $form->error($model, 'hcodcanal');
?>
	</div>


	
	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Grabar');
?>
	</div>
Example #3
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 Canales the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Canales::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }