<?php  include('techsyn_header.php'); ?>

<!-- Main Content Container for side bar and body-->
<style>
input{

    margin-left: 20px;

}
input[type="radio"]:checked + label {
  color: #ff4c30;
}
</style>
<div class="main-container ace-save-state" id="main-container">

	<script type="text/javascript">

			try{ace.settings.loadState('main-container')}catch(e){}

		</script>

		<?php  include('techsyn_sidebar.php'); ?>

	<div class="main-content">

		<div class="main-content-inner">

			<div class="breadcrumbs ace-save-state" id="breadcrumbs">

				<ul class="breadcrumb">

					<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>

					</li>

					<li class="#">Patient Visit</li>
					<li class="active">Health Surveillance</li>

				</ul> 
				   
              <?php    $sql_patient_physical_parameters="select * from medical_examination where medical_exam_id='".$_REQUEST['medical_exam_id']."'"; 
                            $result_patient_physical_parameters= mysqli_query($conn,$sql_patient_physical_parameters);
                           $row_patient_physical_parameters= mysqli_fetch_assoc($result_patient_physical_parameters);											         
                            @extract($row_patient_physical_parameters);	
			
								
							?>




			</div>
			<div class="page-content">
				<div class="box box-primary"
					style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
					<div class="box-header with-border">
						<h3 class="box-title">PERIODIC MEDICAL EXAMINATION CARD</h3>
					</div>
					<div id="user-profile-2">
						<form class="form-horizontal" id="medical_examination_form"
							name="medical_examination_form" enctype="multipart/form-data" action="#"
							method="post">
							<div class="box-body">
								<div class="row">
									<div class="col-sm-12">
										<table class="table table-bordered">
											<tr>
											    <input type="hidden" style="height: 30px;" class="col-xs-4"
												 id="hiddenHighlighter" name="hiddenHighlighter" >
												<td><b> Height(cms)</b><input style="margin-left:20px" type="number" name="height" id="height" onchange="calculateBMI()" value="<?php  echo $height ?>"   onblur="colorValidation(this.id, this.value, 100, 250)";/></td>
												<td><b> Weight(kgs)</b><input style="margin-left:35px" type="number" name="weight" id="weight" onchange="calculateBMI()"  value="<?php  echo $weight ?>"   onblur="colorValidation(this.id, this.value, 30, 150)";/></td>
												<td colspan="2"><b >PULSE</b><input style="margin-left:115px" type="number" name="pulse" id="pulse" value="<?php  echo $pulse ?>"    onblur="colorValidation(this.id, this.value, 65, 80)";/></td>
												
											</tr>
											<tr>
												
												<td><b> BMI</b><input style="margin-left:70px" readonly type="number" name="bmi" id="bmi" value="<?php  echo $bmi ?>"   onblur="colorValidation(this.id, this.value, 19, 25)";/></td>
												<td></td>
												<td colspan="2"><b>BP</b><input style="margin-left:134px" type="text" name="bp" id="bp" value="<?php  echo $bp ?>"   onblur="colorBpValidation(this.id, this.value, 82, 122)";/>&nbsp;&nbsp;mm of Hg</td>
											</tr>
										    
											
											<tr>
												<td colspan="2"><b style="margin-left: 188px ">Vision</b></td>
												<td></td>
												
											</tr>
											
											
											<tr>
											 <td ></td>
												<td ><b style="margin-left:100px">RT.EYE</b><b style="margin-left:134px">LT.EYE</b></td>
												
												<td colspan="2" rowspan="4"><b>Findings of Chest Radiograph (done after every 03 year)
                                                   </b><br> <br><textarea  cols="50" rows="4"  style="margin-left:5px;" name="chest_radiograph" id="chest_radiograph"><?php  echo $chest_radiograph ?> </textarea></td>
												
											</tr>
											<tr>
											<td > <b>Distant Vision</b> </td>
												<td ><b>6/</b><input style="margin-left:3px" type="number" name="dis_without_right_eye" id="dis_without_right_eye"  value="<?php  echo $dis_without_right_eye ?>"   onblur="colorValidation(this.id, this.value, 3, 7)";/><b style="margin-left:20px">6/</b><input style="margin-left:2px" type="number" name="dis_without_left_eye" id="dis_without_left_eye"  value="<?php  echo $dis_without_left_eye ?>"  onblur="colorValidation(this.id, this.value, 3, 7)";/></td>
												
											</tr>
											<tr>
											    <td><b >Near Vision</b></td>
												<td ><b>N/</b><input style="margin-left:3px" type="number" name="near_without_right_eye" id="near_without_right_eye" value="<?php  echo $near_without_right_eye ?>"   onblur="colorValidation(this.id, this.value, 3, 7)";/><b style="margin-left:20px">N/</b><input style="margin-left:2px" type="number" name="near_without_left_eye" id="near_without_left_eye" value="<?php  echo $near_without_left_eye ?>"   onblur="colorValidation(this.id, this.value, 3, 7)";/></td>
													
											</tr>
											
											
											<td colspan="2" ></td>
											
												<tr>
											  <td colspan="2" ><b >COLOR VISION</b>
											   <?php  
											   if($color_vision!=null && $color_vision!=""){
											   	?>
											   	  <input style="margin-left: 214px"  type="radio" name="color_vision" id="color_vision"  <?php  if($color_vision=='NORMAL') echo "checked"; ?> value="NORMAL"  />&nbsp;&nbsp;NORMAL&nbsp;&nbsp; <input type="radio"  style="margin-left:75px" name="color_vision" id="color_vision"  <?php  if($color_vision=='DEFECTIVE') echo "checked"; ?> value="DEFECTIVE"  />&nbsp;&nbsp;<label>DEFECTIVE</label>&nbsp;&nbsp;
											   	
											  <?php  }else{?>
											   	  <input style="margin-left: 214px"  type="radio" name="color_vision" id="color_vision"  checked value="NORMAL"  />&nbsp;&nbsp;Normal&nbsp;&nbsp; <input type="radio"   style="margin-left:75px" name="color_vision" id="color_vision"  value="DEFECTIVE"/>&nbsp;&nbsp;<label>DEFECTIVE</label>&nbsp;&nbsp;
											   	
											  <?php  }
											  
											  ?>
											  </td>
												<td colspan="3" > <b>ECG Findings:</b><input style="margin-left:5px;width:60%;"  type="text" name="ecg_findings" id="ecg_findings"  value="<?php  echo $ecg_findings;?>" /></td>
											
											</tr>
											
											
										
											
										</table>
									</div>
								</div>	


							</div>
							
							<div class="box-body" style="margin-top: -120px;">
								<div class="row">
									<div class="col-sm-12">
										<table class="table table-bordered">
											
											
											<tr>
											<td colspan="3" align="center"><b style="font-weight: 800">RESULT OF SPIROMETRY Findings</b></td>
											</tr>
											<tr>
											<td><b>Parameters</b></td>
											<td><b>Performed Value</b></td>
											<td><b>Predicted Value</b></td>
											</tr>
												<tr>
											<td><b>Forced Vital Capacity (FVC)</b></td>
											<td><input style="" type="text" name="fvc_pre" id="fvc_pre"  value="<?php  echo $fvc_pre?>"  onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')"; /></td>
											<td><input style="" type="text" name="fvc_post" id="fvc_post"   value="<?php  echo $fvc_post?>"  onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')"; /></b></td>
											</tr>
												<tr>
											<td><b>Forced Expiratory Volume in 1 sec (FEV1)</b></td>
											<td><input style="" type="text" name="fev1_pre" id="fev1_pre"  onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')"; value="<?php  echo $fev1_pre?>" /></b></td>
											<td><input style="" type="text" name="fev1_post" id="fev1_post"  onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')";  value="<?php  echo $fev1_post?>" /></td>
											</tr>
												<tr>
											<td><b>FEV1/FVC</b></td>
											<td><input style="" type="text" name="fev1_fvc_pre" id="fev1_fvc_pre"   onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')"; value="<?php  echo $fev1_fvc_pre?>"/></td>
											<td><input style="" type="text" name="fev1_fvc_post" id="fev1_fvc_post"  onblur="colorTextValidation(this.id, this.value, 0, 'DEFECTIVE')";  value="<?php  echo $fev1_fvc_post?>"/></td>
											</tr>
												<tr>
											<td><b>Peak Expiratory Flow</b></td>
											<td><input  style="" type="text" name="peak_expiratory_flow_pre" id="peak_expiratory_flow_pre"  value="<?php  echo $peak_expiratory_flow_pre?>"/></td>
											<td><input  style="" type="text" name="peak_expiratory_flow_post" id="peak_expiratory_flow_post"   value="<?php  echo $peak_expiratory_flow_post?>"/></td>
											</tr>
											<tr>
											<td colspan="3" align="center"><b style="font-weight: 800">RESULT OF AUDIOMETRY FINDINGS</b></td>
											</tr>
											<tr>
											<td><b>Conduction Type </b></td>
											<td><b>Left Ear</b></td>
											<td><b>Right Ear</b></td>
											</tr>
												<tr>
											<td><b>Air Conduction</b></td>
											  <?php  
											   if($air_cond_left!=null && $air_cond_left!=""){
											   	?>
												<td>  <input  style="margin-left: 114px"  type="radio" name="air_cond_left" id="air_cond_left" value="NORMAL" <?php  if($air_cond_left=='NORMAL') echo "checked";?> />&nbsp;&nbsp;NORMAL&nbsp;&nbsp;<input  type="radio"  style="margin-left:75px" name="air_cond_left" id="air_cond_left" value="ABNORMAL" <?php  if($air_cond_left=='ABNORMAL') echo "checked";?>/>&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td> 
												 <?php  }else{?>
												<td> <input  style="margin-left: 114px"  type="radio" name="air_cond_left" id="air_cond_left" checked value="NORMAL"  />&nbsp;&nbsp;NORMAL&nbsp;&nbsp; <input  type="radio"  style="margin-left:75px" name="air_cond_left" id="air_cond_left" value="ABNORMAL" />&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td>
												 
												  <?php  }
											  
											  ?>
											  
											   <?php  
											   if($air_cond_right!=null && $air_cond_right!=""){
											   	?>
												<td>  <input  style="margin-left: 114px"  type="radio" name="air_cond_right" id="air_cond_right" value="NORMAL" <?php  if($air_cond_right=='NORMAL') echo "checked";?> />&nbsp;&nbsp;NORMAL&nbsp;&nbsp;<input  type="radio"  style="margin-left:75px" name="air_cond_right" id="air_cond_right" value="ABNORMAL" <?php  if($air_cond_right=='ABNORMAL') echo "checked";?>/>&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td> 
												 <?php  }else{?>
												<td> <input  style="margin-left: 114px"  type="radio" name="air_cond_right" id="air_cond_right" checked value="NORMAL"  />&nbsp;&nbsp;NORMAL&nbsp;&nbsp; <input  type="radio"  style="margin-left:75px" name="air_cond_right" id="air_cond_right" value="ABNORMAL" />&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td>
												 
												  <?php  }
											  
											  ?>
												
											
					
											</tr>
												<tr>
											<td><b>Bone Conduction</b></td>
											
											<?php  
											   if($bone_cond_left!=null && $bone_cond_left!=""){
											   	?>
												<td>  <input  style="margin-left: 114px"  type="radio" name="bone_cond_left" id="bone_cond_left" value="NORMAL" <?php  if($bone_cond_left=='NORMAL') echo "checked";?> />&nbsp;&nbsp;NORMAL&nbsp;&nbsp;<input  type="radio"  style="margin-left:75px" name="bone_cond_left" id="bone_cond_left" value="ABNORMAL" <?php  if($bone_cond_left=='ABNORMAL') echo "checked";?>/>&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td> 
												 <?php  }else{?>
												<td> <input  style="margin-left: 114px"  type="radio" name="bone_cond_left" id="bone_cond_left" checked value="NORMAL"  />&nbsp;&nbsp;NORMAL&nbsp;&nbsp; <input  type="radio"  style="margin-left:75px" name="bone_cond_left" id="bone_cond_left" value="ABNORMAL" />&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td>
												 
												  <?php  }
											  
											  ?>
											  
											  <?php  
											   if($bone_cond_right!=null && $bone_cond_right!=""){
											   	?>
												<td>  <input  style="margin-left: 114px"  type="radio" name="bone_cond_right" id="bone_cond_right" value="NORMAL" <?php  if($bone_cond_right=='NORMAL') echo "checked";?> />&nbsp;&nbsp;NORMAL&nbsp;&nbsp;<input  type="radio"  style="margin-left:75px" name="bone_cond_right" id="bone_cond_right" value="ABNORMAL" <?php  if($bone_cond_right=='ABNORMAL') echo "checked";?>/>&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td> 
												 <?php  }else{?>
												<td> <input  style="margin-left: 114px"  type="radio" name="bone_cond_right" id="bone_cond_right" checked value="NORMAL"  />&nbsp;&nbsp;NORMAL&nbsp;&nbsp; <input  type="radio"  style="margin-left:75px" name="bone_cond_right" id="bone_cond_right" value="ABNORMAL" />&nbsp;&nbsp;<label>ABNORMAL</label>&nbsp;&nbsp;</td>
												 
												  <?php  }
											  
											  ?>
												
											
										
											</tr>
											<tr>
												<td colspan="3" align="center"><b style="font-weight: 800">INVESTIGATIONS</b></td>
											</tr>
											
											<tr>
											<td colspan="3" align="center"><b style="">Blood Group</b>&nbsp;&nbsp;<select style="width:20%" name="blood_group" id="blood_group"><?php  echo generateOption("blood_group", "type","id",$blood_group); ?></select></td>
											</tr>
											<tr>
											<td><b> Hb </b><input  style="margin-left:48px" type="text" name="hb" id="hb" value="<?php  echo $hb ?>" /></td>
												<td><b> TLC</b><input  style="margin-left:71px" type="text" name="tlc" id="tlc"  value="<?php  echo $tlc ?>"/>
											<b style="margin-left:16px"> DLC-N</b><input  style="margin-left:107px" type="text" name="dlc_n" id="dlc_n" value="<?php  echo $dlc_n?>" />
												</br><b style="margin-left: 265px;margin-top: 39px;">DLC-L</b><input  style="margin-left:108px;margin-top: 10px;" type="text" name="dlc_l" id="dlc_l" value="<?php  echo $dlc_l?>" />
												</br><b style="margin-left: 265px;margin-top: 39px;">DLC-M</b><input  style="margin-left:106px;margin-top: 10px;" type="text" name="dlc_m" id="dlc_m" value="<?php  echo $dlc_m?>" />
												</br><b style="margin-left: 265px;margin-top: 39px;">DLC-E</b><input  style="margin-left:108px;margin-top: 10px;" type="text" name="dlc_e" id="dlc_e" value="<?php  echo $dlc_e?>" />
												</td>
												<td><b> VDRL</b><input  style="margin-left:58px" type="text" name="vdrl" id="vdrl" value="<?php  echo $vdrl ?>" /></td>
											</tr>
											<tr>
											<td><b>S. Urea</b><input  style="margin-left:20px" type="text" name="s_urea" id="s_urea" value="<?php  echo $s_urea ?>"/></td>
												<td><b>  S.Creatinine</b><input  style="margin-left:20px" type="text" name="s_creatinine" id="s_creatinine" value="<?php  echo $s_creatinine ?>" />
												<b style="margin-left:20px"> Blood Sugar</b><input  style="margin-left:50px" type="text" name="blood_sugar" id="blood_sugar" value="<?php  echo $blood_sugar ?>" /></td>
												<td><b> ESR</b><input  style="margin-left:65px" type="text" name="esr" id="esr"  value="<?php  echo $esr ?>"/></td>
											</tr>
											
											
											
											
											
											
											
										</table>
										<table class="table table-bordered">
										 <tr>
										 
											 	<td  > <b>Stool RE/ME</b></td>
											 	<td><textarea style="" rows="3" cols="50" name="stool_re_me" id="stool_re_me" ><?php  echo $stool_re_me ?></textarea></td>
												
											 	<td rowspan="2"> <b style="font-weight: 800">Urine RE/ME</b>
											 	 
											 	
											  <div style="padding-top: 28px;">
											   <b>Albumin</b>
											   	<input  style="margin-left:32px;width: 65%" type="text" name="albumin" id="albumin"  value="<?php  echo $albumin ?>" />
											  </div>
											  <div style="padding-top: 28px;">
											   <b>Sugar</b>
											   	<input  style="margin-left:46px;width: 65%" type="text" name="sugar" id="sugar"   value="<?php  echo $sugar ?>"/>
											  </div>
											 
											 
											  </td>
											</tr>
											
											
											<?php 
											   $query = "select * from employee_signature where emp_id='" . $_SESSION['logged_user_empid'] . "'  ";
											  //R echo $query;
											   if (! $result = @mysqli_query($conn,$query)) {
											   	die(mysqli_error($conn));
											   }else{
											   	$row = @mysqli_fetch_array($result);
											    @extract($row);
                                      
											   }
											?>
											<?php  if(isset($row['emp_sign']) && $row['emp_sign']!=null){?>
											<tr>
											<td><b>Signature Of Medical Assistant</b></br></br><input   type="radio" name="signature_medical_assistant" id="signature_medical_assistant" value="add" />&nbsp;&nbsp;Add <input  style="margin-left:40px"  type="radio" name="signature_medical_assistant" id="signature_medical_assistant" value="remove"  />&nbsp;&nbsp;Remove</td>
											<td colspan="2">
											 <span class="profile-picture" style="display:none" >
													
													<img class="editable img-responsive" id="avatar"
												src="data:<?php  echo $row['image_type']?>;base64,<?php  echo base64_encode( $row['emp_sign'] )?>"
												style="display: block; width: 180px; height: 50px;" />
													
											 </span>
											 </td>
											</tr>
											 <?php }?>	
											
											

											</table>
											<table class="table table-bordered">
											<?php include 'support_medical_document.php'?>
											</table>
									</div>
								</div>
							</div>				
							
								 <input  type="hidden" name="medical_exam_id" id="medical_exam_id" value="<?php  echo $_REQUEST['medical_exam_id']; ?>">
								<div class="box-footer" style="text-align: center">

								<button class="btn btn-primary" type="button" id="save_button"
									onclick="save_medical_examination()">

									<i class="ace-icon fa fa-save"></i> Save

								</button>
								<button class="btn btn-primary" type="button" id="update_button" style="display:none"
									onclick="save_medical_examination()">

									<i class="ace-icon fa fa-floppy"></i> Update

								</button>
								

								  
									<button class="btn btn-warning"  id="reset_button" type="reset" >

										<i class="ace-icon fa fa-undo"></i> Reset

									</button>

								   
									
									 <button class="btn btn-success" id="forward_button" onclick="save_medical_examination(this.id)" >

											<i class="ace-icon fa fa-save"></i>Save & Forward

									</button>
							</div>
						
						</form>
					</div>
				</div>



			</div>
		</div>
	</div>
	<?php include 'image_popup.php'?>
	<?php  include('techsyn_footer.php'); ?>
	<script>
		
function colorValidation(id, val, min, max){
        // ids = document.getElementById(id);
        // if (val <= min || val >= max){
        // ids.style.borderColor='tomato';
        // ids.style.color='tomato';
        // }else if(val<=max){
        // 	ids.style.borderColor='lightgrey';
        // ids.style.color='black';
        // }if(val=='') {
        // ids.style.backgroundColor='white';
        // }    
     }


	function colorBpValidation(id, value, min, max){
		// ids = document.getElementById(id);
		// regex = /\//;
		// values = value.split(regex);
		// if (values[0]>min || values[1]>max){
		// 	ids.style.borderColor = 'tomato';
		// 	ids.style.color='tomato';
		// } else if (values[0]<60 || values[1]<90){
		// 	ids.style.borderColor = 'tomato';
		// 	ids.style.color='tomato';
		// } else{
		// 	ids.style.borderColor='lightgrey';
  //       	ids.style.color='black';
		// }
	}


	 $("input").dblclick(function() {
  		dblClickcolorValidation(this);
  		// alert("hello there!"+this.name);

});
 $("textarea").dblclick(function() {
  		dblClickcolorValidation(this);
  		// alert("hello there!"+this.name);

}); $("select").dblclick(function() {
  		dblClickcolorValidation(this);
  		// alert("hello there!"+this.name);

});

	// creat new array to store values
	ids_value = new Array();
	hiddenHighlighter = document.getElementById('hiddenHighlighter');

	// double click color validaton array
	function dblClickcolorValidation(id){
        ids = id;
        ids_value = hiddenHighlighter.value.split(","); 
        // console.log("stored values:"+ids_value);
	       // get the hidden color validation input tag
        hiddenHighlighter = document.getElementById('hiddenHighlighter'); 
        if(ids.style.borderColor=='tomato' || ids.style.color=='tomato'){
        	ids.style.borderColor='lightgrey';
        	 ids.style.color='black';
        	 removeItemOnce(ids_value, ids.name);
        	 hiddenHighlighter.value = ids_value.join();
        	 // console.log(hiddenHighlighter.value);


        }else{	
        ids.style.borderColor='tomato';
        ids.style.color='tomato';
       		 ids_value.push(ids.name);
       		 console.log(ids_value);
        	 hiddenHighlighter.value = ids_value.join();
        	 // console.log(hiddenHighlighter.value);
        }
        // console.log(ids_value);
     }

function removeItemOnce(arr, value) {
 		var index = arr.indexOf(value);
 		if (index > -1) {
 		arr.splice(index, 1);
  		}
  		return arr;
	}

	$("input:radio[name=signature_medical_assistant]"). click(function(){
		 var signatue=$('input:radio[name=signature_medical_assistant]:checked').val();
		    if(signatue=='add'){
			    $(".profile-picture").show();
		    }else{
		    	$(".profile-picture").hide();
		    }
  
});            
function calculateBMI(){
		
		var height=$("#height").val();
		var weight=$("#weight").val();
		
		if(height!=null && height!='' && weight!=null && weight!=''){
			 height=parseFloat(height);
			 weight=parseFloat(weight);
			if(height!=0.0)
			var bmi=(weight/(height*height))*100*100;
			colorValidation('bmi', bmi, 20, 30);
			$("#bmi").val(bmi.toFixed(1));
		}
	}


	 /*$("#forward_button").on("click", function(){
		 $("#medical_examination_form").submit(function(e){
		        e.preventDefault();
		    });
	     		
		 
		 $("#save_button").hide();
		 BootstrapDialog.show({
	         title: 'Forward',
	         message: '<select class="form-control"  id="forward_status"  style="margin-left:100px;width:60%"><option value="" >Please Select Forward Option</option><option value="R" > Receptionist </option><option value="D" > Doctor </option></select>',
	         buttons: [{
	             label: 'OK',
	             action: function() {
	                 save_forward_status();
	                 $(".close").click();
	             }
	         }]
	     });

		

	 });*/

	   function save_forward_status(){

		   $.ajax({
	           url:'save_medical_examination.php',
	           type:'POST',
	           data:{forward_status:$("#forward_status").val(),medical_exam_id:$("#medical_exam_id").val()},
	           success:function(data){
	               BootstrapDialog.alert("Foward Status  Saved Successfully");
	           },
	           error:function(data){
	          	 BootstrapDialog.alert(" Error In Saving Foward Status ");
	           }
			      });

	   }
			

	function save_medical_examination(id){
		 $("#medical_examination_form").submit(function(e){
		        e.preventDefault();

		    });

		 	//alert(document.getElementById('hiddenHighlighter').value);
		
		 $.ajax({

             url:'save_medical_examination.php',
             type:'POST',
             data:$("#medical_examination_form").serialize(),
             success:function(data){
                 //BootstrapDialog.alert("Medical Examination Form Saved Successfully");
            	 BootstrapDialog.show({
        	         title: 'Information',
        	         message: 'Medical Examination Form Saved Successfully',
        	         buttons: [{
        	             label: 'OK',
        	             action: function() {
        	            	 $(".close").click();
        	                if(id=='forward_button'){
        	                	BootstrapDialog.show({
        	           	         title: 'Forward',
        	           	         message: '<select class="form-control"  id="forward_status"  style="margin-left:100px;width:60%"><option value="" >Please Select Forward Option</option><option value="R" > Receptionist </option></option><option value="D" > Doctor </option></select>',
        	           	         buttons: [{
        	           	             label: 'OK',
        	           	             action: function() {
        	           	                 save_forward_status();
        	           	                 $(".close").click();
        	           	             }
        	           	         }]
        	           	     });		

        	                }
        	             }
        	         }]
        	     });		
             },
             error:function(data){
            	 BootstrapDialog.alert(" Error In SavingMedical Examination Form");
             }
		      });
       
		
 
	} 


var highlightedFields="<?php  echo getFieldFromTable("highlighted_fields", "medical_examination_highlighted", "medical_exam_id", $_REQUEST['medical_exam_id'])?>"

console.log(highlightedFields);

	$(document).ready(function(){
		calculateBMI();
	    $("#hiddenHighlighter").val(highlightedFields);
	    highlightedFields = highlightedFields.split(",")
	    console.log(highlightedFields);
	    // console.log("length"+highlighted_fieldslds.length);
	    for(var i = 1; i<highlightedFields.length; i++){
	    	console.log("values:"+highlightedFields[i]);
	    	if(highlightedFields[i]!=""){
	    	ids =  $("[name='"+highlightedFields[i]+"']");
	    	ids.css("borderColor","tomato");
	    	ids.css("color","red");
			}

	    }

	  });
            	
	</script>