<?php
include("common/connection.php");
login_check();

$Lead_Req_Id=$_REQUEST['Lid'];
$user_type_sql="select User_Type from user_master where User_Name='".$_SESSION['user']."'";
$user_type_query=mysqli_query($con,$user_type_sql);
$user_type=mysqli_fetch_array($user_type_query);
?>

<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Patient Assessment | Buurtzorg</title>
    <?php include("headerlink.php"); ?> 
    <link rel="stylesheet" href="css/pa.css">
    
     
    
    
    
    
    
    
    
    
    
     <link rel="stylesheet" href="css/form/all-type-forms.css">
    <!-- x-editor CSS
		============================================ -->
    <link rel="stylesheet" href="css/editor/select2.css">
    <link rel="stylesheet" href="css/editor/datetimepicker.css">
    <link rel="stylesheet" href="css/editor/bootstrap-editable.css">
    <link rel="stylesheet" href="css/editor/x-editor-style.css">

    
    <script>
	function unlock_form() {
	 
	$('#edit_c_form  input'). prop("disabled", false);
	//$('#not_editable  input'). prop("disabled", true);
	$('#edit_c_form  textarea'). prop("disabled", false);
	$('#edit_c_form  select'). prop("disabled", false);
	$('#update_btn').show();
	$('#edit_btn_1').hide();
	
 
	}
	</script>
    
    <script>
	function personaliz_label(per) {
	 
	
	 $('#ps').text(per);
	
	}
	
 
	</script> 
    <?php
	 $lead_basic_sql="select * from lead_master where Lead_ID='".$Lead_Req_Id."'";
	 $lead_basic_query=mysqli_query($con,$lead_basic_sql);
	 $lead_details=mysqli_fetch_array($lead_basic_query);
	?>   
    
    <script type="text/javascript">
	function ShowPersonalize()
	{
	   if(document.getElementById("personalize").checked==true)
	   {
	   
	      $('#personalize_div').show();
	   }
	   else
	   {
	      $('#personalize_div').hide();
	   }
	
	}
	</script> 
    
<script>
function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
    {
        return false;
    }
    else
    {
        return true;
    }
}

</script>    
</head>

<body>
    <!--[if lt IE 8]>
		<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
	<![endif]-->
    <!-- Start Left menu area -->
    
    
             
										<style>
                                        input { border:0 !important; border-bottom:1px solid #ccc !important; padding-left:0 !important; padding-top:0px !important;  padding-bottom:3px !important;  height:auto !important; } label { font-weight:normal !important; font-size:12px !important;} textarea {border:0 !important; border-bottom:1px solid #ccc !important; padding-left:0 !important; padding-top:3px !important;  padding-bottom:3px !important; text-transform:uppercase } 
                                        select { border:0 !important; border-bottom:1px solid #ccc !important; padding-left:0 !important; padding-top:0px !important;  padding-bottom:3px !important;  height:auto !important; } .panel-body {padding:0 !important; padding-top:10px !important;  } option, select {font-size:12px !important;  }
                                        </style>
    <?php include("left-menu.php"); ?>
    
    
    
    <!-- End Left menu area -->
    <!-- Start Welcome area -->
    <div class="all-content-wrapper">
        
        
       <?php include("header-menu.php"); ?> 
        
       
                                        	
        <!-- Static Table Start -->
        <div class="static-table-area">
        
       
        
        
        
            <div class="container-fluid">
                <div class="row">
                
                
                    
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" >
                         
                         
                         <div class="row" style="margin:0"> 
                         
                        <?php include 'progress.php' ?> 
                          
                          </div>
                         
                          
                         
                         
                         <div class="panel-group" id="accordion">
     
    <?php
if($_REQUEST['system_rev'])
  {
          $delEc="delete from patient_system_review_dtl where Lead_ID='".$_REQUEST['Lid']."'";
		  mysqli_query($con,$delEc);
		   
		   if(isset($_REQUEST['Genaral']))
		   {
		    foreach($_REQUEST['Genaral'] as $Genaral) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID, Review_Category,Problem)values('".$_REQUEST['Lid']."','Genaral','".$Genaral."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
		   
		   if(isset($_REQUEST['Psychiatric']))
		   {
		    foreach($_REQUEST['Psychiatric'] as $Psychiatric) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID, Review_Category,Problem)values('".$_REQUEST['Lid']."','Psychiatric','".$Psychiatric."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
		   if(isset($_REQUEST['Nervoussystem']))
		   {
		    foreach($_REQUEST['Nervoussystem'] as $Nervoussystem) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Nervous system','".$Nervoussystem."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			if(isset($_REQUEST['KidneyUrine']))
		   {
		    foreach($_REQUEST['KidneyUrine'] as $KidneyUrine) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Kidney','".$KidneyUrine."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
		  if(isset($_REQUEST['Ears']))
		   {
		    foreach($_REQUEST['Ears'] as $Ears) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Ears','".$Ears."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
		    if(isset($_REQUEST['Stomach']))
		   {
		    foreach($_REQUEST['Stomach'] as $Stomach) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Stomach and Intestines','".$Stomach."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			 if(isset($_REQUEST['HeartLungs']))
		   {
		    foreach($_REQUEST['HeartLungs'] as $HeartLungs) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Heart and Lungs','".$HeartLungs."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			 if(isset($_REQUEST['Throat']))
		   {
		    foreach($_REQUEST['Throat'] as $Throat) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Throat','".$Throat."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			 if(isset($_REQUEST['Eyes']))
		   {
		    foreach($_REQUEST['Eyes'] as $Eyes) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Eyes','".$Eyes."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			if(isset($_REQUEST['Skin']))
		   {
		    foreach($_REQUEST['Skin'] as $Skin) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Skin','".$Skin."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
		   
		   if(isset($_REQUEST['Muscle']))
		   {
		    foreach($_REQUEST['Muscle'] as $Muscle) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Muscle/Joints/Bones','".$Muscle."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
			
			if(isset($_REQUEST['Women']))
		   {
		    foreach($_REQUEST['Women'] as $Women) {
                $Sql_Add_Problem="insert into patient_system_review_dtl(Lead_ID,Review_Category, Problem)values('".$_REQUEST['Lid']."','Women only','".$Women."')";
				 mysqli_query($con,$Sql_Add_Problem);
              }
			}
		   
		   $Check_women_reproductive=Numrow_Chk($con,'women_reproductive_history','Lead_ID',$_REQUEST['Lid']);
		   if($Check_women_reproductive==0)
			{
				 $women_reproductive="insert into women_reproductive_history(Lead_ID,Age_Of_First_Period,Pregnancies, 	Miscarriage,Abortions,Reached_Menopause,Regular_Period)values('".$_REQUEST['Lid']."','".$_REQUEST['Age_Of_First_Period']."','".$_REQUEST['Pregnancies']."','".$_REQUEST['Miscarriage']."','".$_REQUEST['Abortions']."','".$_REQUEST['Reached_Menopause']."','".$_REQUEST['Regular_Period']."')";
			   mysqli_query($con,$women_reproductive);
		   
		   }
		   else
		   {
		   
		    $Up_reproductive="update women_reproductive_history set Age_Of_First_Period='".$_REQUEST['Age_Of_First_Period']."', Pregnancies='".$_REQUEST['Pregnancies']."',Miscarriage='".$_REQUEST['Miscarriage']."',Abortions='".$_REQUEST['Abortions']."',Reached_Menopause='".$_REQUEST['Reached_Menopause']."',Regular_Period='".$_REQUEST['Regular_Period']."' where Lead_ID='".$_REQUEST['Lid']."'";
			 mysqli_query($con,$Up_reproductive);
			}
			
		for ($i = 1; $i <= 4; $i++)
		 {
		     $AddictionName=$_REQUEST['AddictionName'.$i];
			 $Age_When=$_REQUEST['Age_When'.$i];
			 $How_Much_Use=$_REQUEST['How_Much_Use'.$i];
			 $How_Many_Year_Use=$_REQUEST['How_Many_Year_Use'.$i];
			 $Currently=$_REQUEST['Currently'.$i];
			 if($Age_When!='')
			 {
			     $Sql_Add_Medical="insert into patient_substance_dtl(Lead_ID, Addiction,Age_When,How_Much_Use,How_Many_Year_Use,Currently)values('".$_REQUEST['Lid']."','".$AddictionName."','".$Age_When."','".$How_Much_Use."','".$How_Many_Year_Use."','".$Currently."')";
				 mysqli_query($con,$Sql_Add_Medical);
			 }
		 }
}

 $FetchWomenRH=FetchData($con,'women_reproductive_history','Lead_ID',$_REQUEST['Lid']);
 ?>   
    
    <div class="panel panel-default" >
      <div class="panel-heading" >
        <h4 class="panel-title">
          <a>SYSTEMS REVIEW</a>
        </h4>
      </div>
      <div id="collapse2" class="panel-collapse collapse in">
        <div class="panel-body">
        <form method="post" id="form_s_2">
            
            
          <div class="col-sm-12 col-xs-12" style="font-size:15px; margin-bottom:8px">
            	 Have you had any of the following problems in past month ? 
           </div>  
            
                                           
  
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Genaral</label>
                
                <select name="Genaral[]" class="form-control" id="Genaral"  multiple>
                      <option value="" disabled  hidden >-- Select --</option>
                      <!--<option value="" selected >--xxas Select --</option>
                      <option value="" selected >--sds --</option>-->
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Genaral'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					    $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Genaral');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>"  <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                </select>
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Psychiatric</label>
                <select name="Psychiatric[]" class="form-control" id="Psychiatric"  multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Psychiatric'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Psychiatric');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>"  <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                 </select>
            </div>
           </div>
           
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Nervous system</label>
                <select name="Nervoussystem[]" class="form-control" id="Nervoussystem"  multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                     <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Nervous system'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					   $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Nervous system');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>"  <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                 </select>
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Kidney/Urine/Bladder</label>
                <select name="KidneyUrine[]" class="form-control" id="KidneyUrine"  multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Kidney'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					   $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Kidney');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                 </select>
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Ears</label>
                <select name="Ears[]" class="form-control" id="Ears"   multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                       <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Ears'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					   $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Ears');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                 </select>
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Stomach and Intestines</label>
                <select name="Stomach[]" class="form-control" id="Stomach"   multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Stomach and Intestines'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					   $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Stomach and Intestines');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>
                 </select>
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Muscle/Joints/Bones</label>
                <select name="Muscle[]" class="form-control" id="Muscle"   multiple>
                      <option value="" disabled  hidden >-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Muscle/Joints/Bones'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Muscle/Joints/Bones');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>   
                 </select>
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Women only</label>
                <select name="Women[]" class="form-control" id="Women"   multiple>
                      <option value="" disabled  hidden >-- Select --</option>
                     <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Women only'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Women only');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?> 
                 </select>
            </div>
           </div>
           
           
           
           
           <div class="col-sm-4 col-xs-12" >
           <div class="form-group">
                <label>Heart and Lungs</label>
                <select name="HeartLungs[]" class="form-control" id="HeartLungs"   multiple>
                      <option value="" disabled  hidden >-- Select --</option>
                     <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Heart and Lungs'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Heart and Lungs');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>  
                 </select>
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-4" >
           <div class="form-group">
                <label>Throat</label>
                <select name="Throat[]" class="form-control" id="Throat"   multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Throat'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Throat');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>"<?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?>  
                 </select>
            </div>
           </div>
           
           
           
           
           <div class="col-sm-4 col-xs-4" >
           <div class="form-group">
                <label>Eyes</label>
                <select name="Eyes[]" class="form-control" id="Eyes"   multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                     <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Eyes'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Eyes');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?> 
                 </select>
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-4" >
           <div class="form-group">
                <label>Skin</label>
                <select name="Skin[]" class="form-control" id="Skin"   multiple>
                      <option value="" disabled  hidden selected>-- Select --</option>
                      <?php
					  $sqlr="select Problem from patient_system_review_list_master where Review_Category='Skin'";
					  $rsr=mysqli_query($con,$sqlr);
					  while($RowProblem=mysqli_fetch_array($rsr))
					  {
					  $PatientProblem=Numrow_Chk($con,'patient_system_review_dtl','Lead_ID',$_REQUEST['Lid'],'Problem',$RowProblem['Problem'],'Review_Category','Skin');
					  ?>
                      <option value="<?php echo $RowProblem['Problem']; ?>" <?php if($PatientProblem>0){echo "selected";} ?>><?php echo $RowProblem['Problem']; ?></option>
                      <?php
					  }
					  ?> 
                 </select>
            </div>
           </div>
           
           
           <div class="col-sm-12 col-xs-12" style="font-size:15px; margin-bottom:8px; border-top:1px solid #ccc; padding-top:10px; margin-top:7px">
            	Women's Reproductive History
           </div> 
           
           
           
           
           
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Age of first period</label>
                <input name="Age_Of_First_Period" id="Age_Of_First_Period" type="tel"  class="form-control"   onKeyPress="return isNumberKey(event)"  value="<?php echo $FetchWomenRH['Age_Of_First_Period'] ?>">
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Pregnancies</label>
                <input name="Pregnancies" id="Pregnancies" type="tel"  class="form-control"   onKeyPress="return isNumberKey(event)"  value="<?php echo $FetchWomenRH['Pregnancies'] ?>">
            </div>
           </div>
           
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Miscarriages</label>
                <input name="Miscarriage" id="Miscarriage" type="tel"  class="form-control"   onKeyPress="return isNumberKey(event)"   value="<?php echo $FetchWomenRH['Miscarriage'] ?>">
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Abortions</label>
                <input name="Abortions" id="Abortions" type="tel"  class="form-control"    onKeyPress="return isNumberKey(event)" value="<?php echo $FetchWomenRH['Abortions'] ?>">
            </div>
           </div>
           
           
        
           
          <div class="col-sm-2 col-xs-6">
           <div class="form-group">
           <div>
                <label>Reached menopause</label></div>
                
               <label class="radio-inline">
                  <input name="Reached_Menopause" value="Yes" type="radio" <?php if($FetchWomenRH['Reached_Menopause']=="Yes"){ echo "checked";} ?>>Yes
                </label>
                <label class="radio-inline">
                  <input name="Reached_Menopause" value="No" type="radio" <?php if($FetchWomenRH['Reached_Menopause']=="No"){ echo "checked";} ?>>No
                </label> 
            </div>
           </div>
           
           
           
           <div class="col-sm-2 col-xs-6">
           <div class="form-group">
           <div>
                <label>Regular Periods</label></div>
                
               <label class="radio-inline">
                  <input name="Regular_Period" value="Yes" type="radio"  <?php if($FetchWomenRH['Regular_Period']=="Yes"){ echo "checked";} ?>>Yes
                </label>
                <label class="radio-inline">
                  <input name="Regular_Period" value="No" type="radio" <?php if($FetchWomenRH['Regular_Period']=="No"){ echo "checked";} ?>>No
                </label> 
            </div>
           </div>
           
           
              
           <div class="col-sm-12 col-xs-12" style="font-size:15px; margin-bottom:8px; border-top:1px solid #ccc; padding-top:10px; margin-top:7px">
            	Substance Use
           </div>
           <div class="col-sm-12" style="margin:0; padding:0">
           
         <?php
		  
         for ($i = 1; $i <= 4; $i++)
		 { 
		
		 $AddictionName = array("","Alcohol", "Smoking", "Cannabis", "Other");
		 
		 $FetchAddiction=FetchData($con,'patient_substance_dtl','Lead_ID',$_REQUEST['Lid'],'Addiction',$AddictionName[$i]);
		 ?>
            <div class="col-sm-4 col-xs-12" >
           <div class="form-group">
                <?php echo $i; ?>. <?php echo $AddictionName[$i]; ?>
            </div>
           </div>
           
           <input name="AddictionName<?php echo $i; ?>" id="AddictionName<?php echo $i; ?>" type="hidden"  value="<?php echo $AddictionName[$i]; ?>" class="form-control" >
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Age when</label>
                <input name="Age_When<?php echo $i; ?>" id="Age_When<?php echo $i; ?>" type="tel"  class="form-control" value="<?php  echo $FetchAddiction['Age_When']; ?>">
            </div>
           </div>
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How much & how often</label>
                <input name="How_Much_Use<?php echo $i; ?>" id="How_Much_Use<?php echo $i; ?>" type="tel"  class="form-control" value="<?php  echo $FetchAddiction['How_Much_Use']; ?>" >
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How many years</label>
                <input name="How_Many_Year_Use<?php echo $i; ?>" id="How_Many_Year_Use<?php echo $i; ?>" type="tel"  class="form-control" value="<?php  echo $FetchAddiction['How_Many_Year_Use']; ?>" >
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <div><label>Currently</label></div>
                <label class="radio-inline">
                  <input name="Currently<?php echo $i; ?>" value="Yes" type="radio" <?php if($FetchAddiction['Currently']=="Yes"){echo "checked";}?>>Yes
                </label>
                <label class="radio-inline">
                  <input name="Currently<?php echo $i; ?>" value="No" type="radio" <?php if($FetchAddiction['Currently']=="No"){echo "checked";}?>>No
                </label> 
            </div>
           </div>
           
           <?php
		   }
		   ?>
           
           
           
           
           
           
           
           <!--<div class="col-sm-4 col-xs-12" >
           <div class="form-group">
                2. Smoking 
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Age when</label>
                <input name="Agewhen" id="Agewhen" type="tel"  class="form-control" >
            </div>
           </div>
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How much & how often</label>
                <input name="often" id="often" type="tel"  class="form-control"  >
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How many years</label>
                <input name="years" id="years" type="tel"  class="form-control" >
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <div><label>Currently</label></div>
                <label class="radio-inline">
                  <input name="Currently" value="Yes" type="radio">Yes
                </label>
                <label class="radio-inline">
                  <input name="Currently" value="No" type="radio">No
                </label> 
            </div>
           </div>
           
           
           
           
           
           
           
           
           
           <div class="col-sm-4 col-xs-12" >
           <div class="form-group">
                3. Cannabis 
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Age when</label>
                <input name="Agewhen" id="Agewhen" type="tel"  class="form-control" >
            </div>
           </div>
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How much & how often</label>
                <input name="often" id="often" type="tel"  class="form-control"  >
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How many years</label>
                <input name="years" id="years" type="tel"  class="form-control" >
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <div><label>Currently</label></div>
                <label class="radio-inline">
                  <input name="Currently" value="Yes" type="radio">Yes
                </label>
                <label class="radio-inline">
                  <input name="Currently" value="No" type="radio">No
                </label> 
            </div>
           </div>
           
           
           
           
           
           
           
           
           <div class="col-sm-4 col-xs-12" >
           <div class="form-group">
                4. Other 
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>Age when</label>
                <input name="Agewhen" id="Agewhen" type="tel"  class="form-control" >
            </div>
           </div>
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How much & how often</label>
                <input name="often" id="often" type="tel"  class="form-control"  >
            </div>
           </div>
           
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <label>How many years</label>
                <input name="years" id="years" type="tel"  class="form-control" >
            </div>
           </div>
           
           
           <div class="col-sm-4 col-xs-6" >
           <div class="form-group">
                <div><label>Currently</label></div>
                <label class="radio-inline">
                  <input name="Currently" value="Yes" type="radio">Yes
                </label>
                <label class="radio-inline">
                  <input name="Currently" value="No" type="radio">No
                </label> 
            </div>
           </div>-->
           
           </div>
       
  
	<div class="col-sm-12 col-xs-12" style="margin:0; padding:0; ">
      <div class="col-sm-6 col-xs-6" style="">
       <div class="form-group"> 
             <a href="patient_assessment_4.php?Lid=<?php echo $_REQUEST['Lid']; ?>"><input type="button" class="btn  btn-primary" name="Patient_Info" value="Previous" style="margin-top:10px; float:left; padding-left:10px !important;  padding:5px 8px !important; margin-bottom:10px;"  ></a>
         </div>                                                       
      </div> 
      
      <div class="col-sm-6 col-xs-6">
       <div class="form-group"> 
             <input type="submit" class="btn  btn-primary" name="system_rev" value="Save and Next" style="margin-top:10px; float:right; padding-left:10px !important;  padding:5px 8px !important; margin-bottom:10px;"  >
         </div>                                                       
      </div> 
      </div>           
     </form>
        </div>
      </div>
    </div>
 

    
 
  </div> 
                         
                    </div> 
                    
                    
                 
                 
                              
                                      
                        </div>
                    </div>
                </div>
                
                
            </div>
        </div>
        <!-- Static Table End -->
        <div class="footer-copyright-area">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="footer-copy-right">
                            <p>Copyright © 2019. All rights reserved. </p>
                           
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

     <!-- jquery
		============================================ -->
     
       <script src="js/vendor/jquery-1.12.4.min.js"></script>
    <!-- bootstrap JS
		============================================ -->
    <script src="js/bootstrap.min.js"></script>
    <!-- wow JS
		============================================ -->
    <script src="js/wow.min.js"></script>
    <!-- price-slider JS
		============================================ -->
    <script src="js/jquery-price-slider.js"></script>
    <!-- meanmenu JS
		============================================ -->
    <script src="js/jquery.meanmenu.js"></script>
    <!-- owl.carousel JS
		============================================ -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- sticky JS
		============================================ -->
    <script src="js/jquery.sticky.js"></script>
    <!-- scrollUp JS
		============================================ -->
    <script src="js/jquery.scrollUp.min.js"></script>
    
    <script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/scrollbar/mCustomScrollbar-active.js"></script>

     
    
     <!--  editable JS
		============================================ -->
    <script src="js/editable/jquery.mockjax.js"></script>
    <script src="js/editable/mock-active.js"></script>
    <script src="js/editable/select2.js"></script>
    <script src="js/editable/moment.min.js"></script>
    <script src="js/editable/bootstrap-datetimepicker.js"></script>
    <script src="js/editable/bootstrap-editable.js"></script>
    <script src="js/editable/xediable-active.js"></script>
 	
    
    <!-- datepicker JS
		============================================ -->
    <script src="js/datepicker/jquery-ui.min.js"></script>
    <script src="js/datepicker/datepicker-active.js"></script>
    
    <!-- mCustomScrollbar JS
		============================================ -->
    <script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/scrollbar/mCustomScrollbar-active.js"></script>
    <!-- metisMenu JS
		============================================ -->
    <script src="js/metisMenu/metisMenu.min.js"></script>
    <script src="js/metisMenu/metisMenu-active.js"></script>
    <!-- peity JS
		============================================ -->
    <script src="js/peity/jquery.peity.min.js"></script>
    <script src="js/peity/peity-active.js"></script>
    <!-- sparkline JS
		============================================ -->
    <script src="js/sparkline/jquery.sparkline.min.js"></script>
    <script src="js/sparkline/sparkline-active.js"></script>
    <!-- tab JS
		============================================ -->
    <script src="js/tab.js"></script>
    <!-- plugins JS
		============================================ -->
    <script src="js/plugins.js"></script>
    <!-- main JS
		============================================ -->
    <script src="js/main.js"></script>
    <!-- tawk chat JS
		============================================ -->
    <script src="js/tawk-chat.js"></script>
   <!-- form validate JS
		============================================ -->
    <script src="js/form-validation/jquery.form.min.js"></script>
    <script src="js/form-validation/jquery.validate.min.js"></script>
    <script src="js/form-validation/form-active.js"></script>
    
    
    
    
   
      <script>
				function Reffered_opt_function() {
				 var Reffered_opt = $("#Reffered_Buurtzorg_From").val();
				 
				 //alert(Reffered_opt);
				 if(Reffered_opt=="Doctor") {
				 $("#Doctor_div").show(400);
					}
					
					if(Reffered_opt!="Doctor") {
				 $("#Doctor_div").hide(400);
					}
				}
				</script>   
    
    
    
    <script>
$(document).ready(function() {
   $("body").tooltip({ 
   	selector: '[data-toggle=tooltip]' 
	 });
});
 
</script> 
  
               
                                               <script>
 
$('button.call_btn_1').click(function() {
    //var text = $(this).text();
	var text = $(this).data('value_santanu');
	//alert(text)
	$('#hidden_call_box').val(text);
	$('#response').val(text);
    // do something with the text
});
												</script> 
                                                
                                                
                                                
                                                
       <!-- bootstrap-clockpicker -->
      <link rel="stylesheet" type="text/css" href="css/bootstrap-clockpicker.min.css">
    <script type="text/javascript" src="js/bootstrap-clockpicker.min.js"></script>


     



<script type="text/javascript">
$("form#form_s_1").validate({
          
      showErrors: function(errorMap, errorList) {
          // Clean up any tooltips for valid elements
          $.each(this.validElements(), function (index, element) {
              var $element = $(element);
              $element.data("title", "") // Clear the title - there is no error associated anymore
                  .removeClass("error")
                  .tooltip("destroy");
          });
          // Create new tooltips for invalid elements
          $.each(errorList, function (index, error) {
              var $element = $(error.element);

              $element.tooltip("destroy") // Destroy any pre-existing tooltip so we can repopulate with new tooltip content
                  .data("title", error.message)
                  .addClass("error")
                  .tooltip(); // Create a new tooltip based on the error messsage we just set in the title
          });
      },

     
	  
});

$("form#form_s_2").validate({
          
      showErrors: function(errorMap, errorList) {
          // Clean up any tooltips for valid elements
          $.each(this.validElements(), function (index, element) {
              var $element = $(element);
              $element.data("title", "") // Clear the title - there is no error associated anymore
                  .removeClass("error")
                  .tooltip("destroy");
          });
          // Create new tooltips for invalid elements
          $.each(errorList, function (index, error) {
              var $element = $(error.element);

              $element.tooltip("destroy") // Destroy any pre-existing tooltip so we can repopulate with new tooltip content
                  .data("title", error.message)
                  .addClass("error")
                  .tooltip(); // Create a new tooltip based on the error messsage we just set in the title
          });
      },

     
	  
});


$("form#form_s_3").validate({
          
      showErrors: function(errorMap, errorList) {
          // Clean up any tooltips for valid elements
          $.each(this.validElements(), function (index, element) {
              var $element = $(element);
              $element.data("title", "") // Clear the title - there is no error associated anymore
                  .removeClass("error")
                  .tooltip("destroy");
          });
          // Create new tooltips for invalid elements
          $.each(errorList, function (index, error) {
              var $element = $(error.element);

              $element.tooltip("destroy") // Destroy any pre-existing tooltip so we can repopulate with new tooltip content
                  .data("title", error.message)
                  .addClass("error")
                  .tooltip(); // Create a new tooltip based on the error messsage we just set in the title
          });
      },

     
	  
});
</script>                                          
                                                
                                                
 <!-- <script>
		CKEDITOR.replace( 'editor1', {
			height: 150,
			width: 700,
		} );
	</script> -->                                             
                                                
    
</body>

</html>