/**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = HistorialNotasEnfermeria::model()->findByPk($_GET['id']);
     if (isset($_POST['HistorialNotasEnfermeria'])) {
         $model = HistorialNotasEnfermeria::model()->findByPk($_GET['id']);
         $model->observaciones = $_POST['HistorialNotasEnfermeria']['observaciones'];
         if ($model->save()) {
             $detalleP = HistorialNotasEnfermeriaDetalles::model()->findAll("historial_notas_enfermeria_id = {$model->id}");
             foreach ($detalleP as $detalle_P) {
                 $detalle_P->delete();
             }
             //Los detalles de la Compra
             for ($i = 0; $i <= $_POST['variable']; $i++) {
                 if (isset($_POST['nota_' . $i])) {
                     $detalleC = new HistorialNotasEnfermeriaDetalles();
                     $detalleC->historial_notas_enfermeria_id = $model->id;
                     $detalleC->fecha = Yii::app()->dateformatter->format("yyyy-MM-dd", $_POST['fecha_' . $i]);
                     $detalleC->hora = $_POST['hora_' . $i];
                     $detalleC->nota = $_POST['nota_' . $i];
                     $detalleC->save();
                 }
             }
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     // $model=$this->loadModel($id);
     // // Uncomment the following line if AJAX validation is needed
     // // $this->performAjaxValidation($model);
     // if(isset($_POST['HistorialNotasEnfermeria']))
     // {
     // 	$model->attributes=$_POST['HistorialNotasEnfermeria'];
     // 	if($model->save())
     // 		$this->redirect(array('view','id'=>$model->id));
     // }
     $this->render('update', array('model' => $model));
 }
<div class="form">

<?php 
if (isset($_GET['idPaciente'])) {
    $elPaciente = $_GET['idPaciente'];
} else {
    $elPaciente = "0";
}
if (isset($_GET['idCita'])) {
    $laCita = $_GET['idCita'];
} else {
    $laCita = "0";
}
$elPaciente = $model->paciente_id;
$paciente = Paciente::model()->find("id={$elPaciente}");
$registros = HistorialNotasEnfermeriaDetalles::model()->findAll("historial_notas_enfermeria_id = {$model->id}");
?>


<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'historial-notas-enfermeria-form', 'htmlOptions' => array('onsubmit' => "onEnviar()"), 'enableAjaxValidation' => false));
?>


	<?php 
echo $form->errorSummary($model);
$datosPaciente = Paciente::model()->find("id={$elPaciente}");
?>
<div class="row">
		<h4 class="text-center">Datos de Paciente</h4>
		<div class="span1"></div>
예제 #3
0
<?php

//Detalles
$idCita = $_GET['id'];
$historialNotas = HistorialNotasEnfermeria::model()->find("cita_id = {$idCita}");
$detalleNotas = HistorialNotasEnfermeriaDetalles::model()->findAll("historial_notas_enfermeria_id = {$historialNotas->id}");
//$elnumero = $laFactura->factura->numero;
?>

			<style type="text/css">
			p{
				margin: 2px 0px;
			}
				
			</style>

<body>
<div style="background-image: url(images/membrete_varios.jpg); background-repeat: no-repeat; height:100%; width:100%; padding:0px 0px 0px 40px;">			
<!-- <div style="height:175px"></div> -->
<div style="padding:170px 0px 0px 0px;">

<table>
	<tr>
		<td><p><b>N°: </b><?php 
echo $historialNotas->id;
?>
</p></td>
	</tr>
	<tr>
		<td width="400"><p><b>NOMBRE: </b><?php 
echo $historialNotas->paciente->nombreCompleto;