<?php
  
 
if($_POST["user"] && $_POST["sdate"] && $_POST["sID"] && $_POST["ros"] && $_POST["patientID"] && $_POST["desC"])

{
   $patientID= $_POST['patientID'];
   $ros= $_POST['ros'];
   $desC= $_POST['desC'];
   $sdate= $_POST['sdate'];
   $user=$_POST['user'];      
   $sID=$_POST['sID'];
   
  //CHECKING ENDS HER
  require_once"labClass.php";
  $con=new labClass();
  $Q= $con->getThisPatientD($patientID);
  if($Q->rowCount()>0)
    {
     
     
     $TQ= $con->getThisROS($patientID,$ros,$sdate);
  if($TQ->rowCount()<=0)
    {
      $rQ= $con->pROS($sID,$sdate,$ros,$user, $desC,$patientID);

                if($rQ->rowCount()>0)
                {
                ?>
                <h6 class="text-success">Save!..</h6>
                <?php
                }
    }
  else{
       ?>
                <h6 class="text-danger">This ROS already exixt!..</h6>
       <?php
       }
    }
  else{
       ?>
                <h6 class="text-danger">Invalid patient ID!..</h6>
       <?php
       }
  
  }
?>