frm_05.php
186 lines
| 7.6 KiB
| text/x-php
|
PhpLexer
|
r0 | <?php | |
//*****Inicializacion de variables********************************************** | |||
$date_exam = ""; | |||
$arr_general = NULL; | |||
$habilitar = "0"; | |||
$habilitar_btn = ""; | |||
$campo_text = ""; | |||
//****************************************************************************** | |||
if (isset($lista_appl_test)){ | |||
$data_appltest = $lista_appl_test[0]; | |||
$date_exam = format_fecha($data_appltest->date); | |||
$habilitar = "1"; | |||
$habilitar_btn = "style='display:none'"; | |||
} | |||
if (isset($list_vitalSigns)){ | |||
$num_items = count($list_vitalSigns) - 1; | |||
for ($i=0; $i<=$num_items; $i++){ | |||
$data_vsigns = $list_vitalSigns[$i]; | |||
$iddm = $data_vsigns->iddm; | |||
$_valor = $data_vsigns->value; | |||
$arr_general["iddm_".$iddm]["value"] = $_valor; | |||
} | |||
} | |||
if (isset($list_physicalExam)){ | |||
$num_items = count($list_physicalExam) - 1; | |||
for ($i=0; $i<=$num_items; $i++){ | |||
$data_pexam = $list_physicalExam[$i]; | |||
$iddm = $data_pexam->iddm; | |||
$_valor = $data_pexam->status; | |||
$_description = $data_pexam->description; | |||
$arr_general["iddm_".$iddm]["value"] = $_valor; | |||
$arr_general["iddm_".$iddm]["description"] = $_description; | |||
} | |||
} | |||
//var_dump($arr_general); | |||
//****************************************************************************** | |||
function format_fecha($fecha){ | |||
//2011-02-19; | |||
$arr_fecha = explode("-",$fecha); | |||
$anno = $arr_fecha[0]; | |||
$mes = $arr_fecha[1]; | |||
$dia = $arr_fecha[2]; | |||
if ($mes == "01") $mes2 = "Jan"; | |||
if ($mes == "02") $mes2 = "Feb"; | |||
if ($mes == "03") $mes2 = "Mar"; | |||
if ($mes == "04") $mes2 = "Apr"; | |||
if ($mes == "05") $mes2 = "May"; | |||
if ($mes == "06") $mes2 = "Jun"; | |||
if ($mes == "07") $mes2 = "Jul"; | |||
if ($mes == "08") $mes2 = "Aug"; | |||
if ($mes == "09") $mes2 = "Set"; | |||
if ($mes == "10") $mes2 = "Oct"; | |||
if ($mes == "11") $mes2 = "Nov"; | |||
if ($mes == "12") $mes2 = "Dec"; | |||
return $dia."/".$mes2."/".$anno; | |||
} | |||
?> | |||
<script> | |||
$(function() { | |||
$( "#date_exam" ).datepicker({ | |||
showWeek: true, | |||
dateFormat: 'dd/M/yy', | |||
firstDay: 1 | |||
}); | |||
$("select").change(function(){ | |||
var idcbx = $(this).attr("id"); | |||
var div_text = "div"+idcbx; | |||
var cbx_valor = $(this).val(); // si es anormal->2 | |||
var txtarea_id = "text"+idcbx; | |||
if (idcbx!=""){ | |||
//alert(idcbx); | |||
if (cbx_valor==2) | |||
$("#"+div_text).html("<textarea name='"+txtarea_id+"' id='"+txtarea_id+"'></textarea>"); | |||
else | |||
$("#"+div_text).html(''); | |||
} | |||
}); | |||
}); | |||
</script> | |||
<div style="width:650px; margin:0 auto;"> | |||
<h1>Screening Vital Signs And Physical Exam (whitin 21 days of Dose 1) </h1> | |||
<form name="frm_screeningmedicalhistory" method="post" action="index.php"> | |||
<table id="" class="" style="" > | |||
<tbody> | |||
<tr> | |||
<td>Date</td> | |||
<td style="text-align:right;"><input type="text" id="date_exam" name="date_exam" value="<?php echo $date_exam ?>" /></td> | |||
</tr> | |||
</tbody> | |||
</table> | |||
<?php foreach($data_fields as $data_field){?> | |||
<table width="100%" id="" class="" style="padding-top: 10px" border="0"> | |||
<tbody> | |||
<?php | |||
$aux_cont = 0; | |||
//var_dump($data_field); die(); | |||
foreach ($data_field as $value_data) { | |||
?> | |||
<tr> | |||
<td><?php echo $value_data['name_field']; ?></td> | |||
<td> | |||
<?php | |||
//$name_campo= "datos[v_signs][value_".$value_data['iddm']."]"; | |||
if ($value_data['idcategory']==1) | |||
$name_campo= "datos[v_signs][value_".$value_data['iddm']."]"; | |||
if ($value_data['idcategory']==2) | |||
$name_campo= "datos[p_exam][value_".$value_data['iddm']."]"; | |||
if(!empty($value_data['options'])){ | |||
$options = $value_data['options']; | |||
$array_options = explode("/", $options); | |||
$id_cbx = ""; | |||
$divid_cbx = ""; | |||
if ($options=="Normal/Abnormal"){ | |||
//*************************************** | |||
//$aux_cont = $aux_cont + 1; | |||
$id_cbx = $value_data['iddm']; | |||
$divid_cbx = "div".$value_data['iddm']; | |||
$name_campo= "datos[p_exam][value_".$value_data['iddm']."]"; | |||
//**************************************** | |||
}else{ | |||
$value_data['idcategory']; | |||
if ($value_data['idcategory']==1) | |||
$name_campo= "datos[v_signs][value_".$value_data['iddm']."]"; | |||
if ($value_data['idcategory']==2) | |||
$name_campo= "datos[p_exam][value_".$value_data['iddm']."]"; | |||
} | |||
$html_option = ""; | |||
$select_ok = ""; | |||
$description = ""; | |||
for($i=0, $j=1; $i<count($array_options); $i++, $j++){ | |||
if (isset($arr_general["iddm_".$value_data['iddm']]["value"])){ | |||
$id_select = $arr_general["iddm_".$value_data['iddm']]["value"]; | |||
if ($id_select==$j) | |||
$valor_cbx= $array_options[$i]; | |||
else | |||
if ($options=="Normal/Abnormal"){ | |||
$valor_cbx = "normal"; | |||
}else $valor_cbx = ""; | |||
if (isset($arr_general["iddm_".$value_data['iddm']]["description"])) | |||
$description = "<textarea name='text".$value_data['iddm']."'>".$arr_general["iddm_".$value_data['iddm']]["description"]."</textarea>"; | |||
}else{ | |||
$id_select = ""; | |||
$valor_cbx = ""; | |||
$description = ""; | |||
} | |||
$html_option .= '<option value="'.$j.'">'.$array_options[$i].'</option>'; | |||
}// fin del for | |||
?> | |||
<?php if($habilitar==0){?> | |||
<select name="<?php echo $name_campo?>" id=<?php echo $id_cbx?> ><?php echo $html_option; ?></select> | |||
<?php }else{?> | |||
<input type="text" name="<?php echo $name_campo?>" id="<?php echo $id_cbx?>" value="<?php echo $valor_cbx?>" /> | |||
<br /> | |||
<?php echo $description ?> | |||
<?php }?> | |||
<div id=<?php echo $divid_cbx?> ></div> | |||
<?php }else{ | |||
if (isset($arr_general["iddm_".$value_data['iddm']]["value"])) | |||
$campo_text = $arr_general["iddm_".$value_data['iddm']]["value"]; | |||
else | |||
$campo_text = ""; | |||
?> | |||
<input type="text" name="<?php echo $name_campo?>" value="<?php echo $campo_text?>" /> | |||
<?php if(!empty($value_data['unit'])) echo $value_data['unit']; ?> | |||
<input type="hidden" name="datos[iddm_<?php echo $value_data['iddm']; ?>]" value="<?php echo $value_data['iddm']; ?>" /> | |||
<?php } ?> | |||
</td> | |||
</tr> | |||
<?php } ?> | |||
</tbody> | |||
</table> | |||
<?php } ?> | |||
<div <?php echo $habilitar_btn?>> | |||
<input type="submit" value="save" id="btn_save" name="btn_save"><input type="reset" value="clear" id="btn_clear" name="btn_clear"> | |||
</div> | |||
<input type="hidden" name="option" value="com_data" /> | |||
<input type="hidden" name="controller" value="Data" /> | |||
<input type="hidden" name="action" value="save" /> | |||
<input type="hidden" name="name_form" value="frm_05" /> | |||
<input type="hidden" name="num_form" value="5" /> | |||
<input type="hidden" name="title_form" value="5" /> | |||
</form> | |||
<br /> | |||
<hr /> | |||
<br /> | |||
</div> |