  
 
 <div class="container mt-3" style="margin-top:2px;">
  <?php
  require_once"labClass.php";

  $con=new labClass();
  $patientID= $_POST['patientID'];
  $pn= $con->getThisPatientD($patientID);
if($pn->rowCount()>0){
   $n=$pn->fetch();
   $regDate= $_POST['sdate'];
   $sd= $con->getServID($patientID,$regDate);
      if($sd->rowCount()>0)
      {
        $g=$sd->fetch();
        $sID=$g['sID'];
     
      ?> 
      <input type="hidden" name="sID" id="sID" value="<?php echo $sID;?>">
   <small>PATIENT NAME:<h6 class="text-primary"><?php echo $n['fname']." ". $n['mname']." ".$n['lname'];?></h6></small>
   <div id="dispRc"></div>
    <table class="table" width="80%"> 
     <tr>
    <td height="120px">
    <small>Main complain:</small><br/>  
      <textarea  id="comp" style="height:120px; width:100%;"  name="comp" required></textarea>
      <sup class="text-danger" id="co"> </sup>
        
    
</td> 
</tr>
   <tr>
    <td height="120px">
    <small>HPI:</small><br/>  
      <textarea id="hpi" style="height:120px; width:100%;"  name="hpi" required></textarea>
       <sup class="text-danger" id="hp"> </sup> 
    
</td> 
</tr>
   <tr>
    <td height="120px">
    <small>General examination:</small><br/>  
      <textarea id="gExam" style="height:120px; width:100%;"  name="gExam" required></textarea>
        <sup class="text-danger" id="ge"> </sup>
    
</td> 
</tr>
<tr>
<td align="right">
  <div class="form-floating mb-3 mt-3"> 
  <button type="submit" class="btn btn-primary" id="submit" value="Submit" name="submit"  style="height:60px;" onclick="saveData()">Submit</button>

</td>
</tr>
 
<tr>
<td height="50px">
  <div id="dispRO"></div>
    <small>Review Other System(ROS):</small><br/>  
      <select id="ros" style="width:100%;"  name="ros" required>
         <option value="">Select </option> 
           <option value="GASTRO-INTESTINAL SYSTEM">GASTRO-INTESTINAL SYSTEM</option>
           <option value="CARDIOVASCULAR SYSTEM">CARDIOVASCULAR SYSTEM"</option>
           <option value="URINALY SYSTEM">URINALY SYSTEM</option>
           <option value="ENT SYSTEM">ENT SYSTEM</option>
           <option value="MUSCULOSKELETAL SYSTEM">MUSCULOSKELETAL SYSTEM</option>
           <option value="CENTRAL NERVES SYSTEM">CENTRAL NERVES SYSTEM</option>
           <option value="RESPIRATORY SYSTEM">RESPIRATORY SYSTEM</option>
    <?php
     /*$Q= $con->getDrTech();
     if ($Q->rowCount()>0) {
     $lb=$Q->fetchAll();
     foreach ($lb as $key => $l) {
      
      ?>
      <option value="<?php echo  $l["lname"].','.$l["fname"];?>"><?php echo  $l["lname"].','.$l["fname"]?></option> 
             <?php
            
           }
           }
 */
      ?>
      </select>
      <sup class="text-danger" id="ro"> </sup>  
</td> 
</tr>
<tr>
<td height="50px">
    <small>Description:</small><br/>  
      <input type="text" id="desC" style="height:40px; width:100%;"  name="desC" required/> 
      <sup class="text-danger" id="de"> </sup> 
</td> 
</tr>
<tr>
<td align="right">
  <div class="form-floating mb-3 mt-3"> 
  <button type="submit" class="btn btn-primary" id="submit" value="Submit" name="submit"  style="height:60px;" onclick="saveDataROS()">Submit</button>
</td>
</tr>
</table>
<?php 
 }
else{
         echo "Consultation fees required!..";
  }
}
else {
  echo "Invalid patientID!..";
}
?>
</div>
 
 

 <script>
 
function saveData(){ 
var ecc=0; 
var comp =document.getElementById('comp').value; 
$.trim(comp);
var submit =document.getElementById('submit').value;
var gExam =document.getElementById('gExam').value;
$.trim(gExam);
var sID =document.getElementById('sID').value;
$.trim(sID);
var hpi =document.getElementById('hpi').value;
$.trim(hpi); 
var user =document.getElementById('user').value;
$.trim(user);
var sdate =document.getElementById('sdate').value;
$.trim(sdate); 
var patientID =document.getElementById('pID').value;
$.trim(patientID);
var vN =/[\(A-Za-z)]/g; 

var nV =/[a-z\s]/i;
  var j=0,k=0, g=0,i=0;

                                                         //FIRST NAME VALIDATION
  
if(comp==""){ 

         ecc++;
             document.getElementById('co').innerHTML="Complain required!..";
 

               }
else{

document.getElementById('co').innerHTML="";
    }

if(patientID==""){ 

         ecc++;
             alert("Patient required!..");
 

            }
   
if(hpi==""){ 

         ecc++;
         document.getElementById('hp').innerHTML="HPI required!..";

           }
else{

document.getElementById('hp').innerHTML="";
    }
if(gExam==""){ 

         ecc++;
         document.getElementById('ge').innerHTML="General examination required!..";

           }
else{

document.getElementById('ge').innerHTML="";
    }
  
    if(ecc==0)
    { 
        $.post("complainRgFPro.php",
          {submit:submit,sID:sID,patientID:patientID,comp:comp,user:user,hpi:hpi,gExam:gExam,sdate:sdate},
          function(data){
      $('#dispRc').html(data).show(); 
      document.getElementById('gExam').value="";
      document.getElementById('hpi').value="";
      document.getElementById('comp').value=""; 
    });
    }
 
} 
 
 function saveDataROS(){ 
var ecc=0; 
var ros =document.getElementById('ros').value; 
$.trim(ros);
var submit =document.getElementById('submit').value;
var desC =document.getElementById('desC').value;
$.trim(desC);
var sID =document.getElementById('sID').value;
$.trim(sID);
  
var user =document.getElementById('user').value;
$.trim(user);
var sdate =document.getElementById('sdate').value;
$.trim(sdate); 
var patientID =document.getElementById('pID').value;
$.trim(patientID);
var vN =/[\(A-Za-z)]/g; 

var nV =/[a-z\s]/i;
  var j=0,k=0, g=0,i=0;

                                                         //FIRST NAME VALIDATION
  
if(ros==""){ 

         ecc++;
             document.getElementById('ro').innerHTML="ROS required!..";
 

               }
else{

document.getElementById('ro').innerHTML="";
    }

if(patientID==""){ 

         ecc++;
             alert("Patient required!..");
 

            }
   
if(desC==""){ 

         ecc++;
         document.getElementById('de').innerHTML="Missing description required!..";

           }
else{

document.getElementById('de').innerHTML="";
    }
 
  
    if(ecc==0)
    { 
        $.post("rosPro.php",
          {submit:submit,sID:sID,patientID:patientID,ros:ros,user:user,desC:desC,sdate:sdate},
          function(data){
      $('#dispRO').html(data).show(); 
      document.getElementById('ros').value="";
      document.getElementById('desC').value="";  
    });
    }
 
} 
 
</script>
 
