<?php
if($_POST["code"] && $_POST["disease"]&& $_POST["patientID"] && $_POST["sdate"] && $_POST["user"]&& $_POST["sID"])
{  
  $code= $_POST['code'];
  $disease= $_POST['disease'];
  $sdate= $_POST['sdate'];
  $user= $_POST['user'];  
  $sID= $_POST['sID'];
  $patientID= $_POST['patientID'];
  //CHECKING ENDS HER
  require_once"labClass.php";
  $con=new labClass();
  $Q= $con->getThisCodeExist($patientID,$code,$disease,$sID,$sdate);
  ///print_r($Q->ErrorInfo());
 /// echo $sdate;
  if($Q->rowCount()<=0)
    {
   $rQ= $con->addCodeD($patientID,$code,$disease,$user,$sdate,$sID);
   if($rQ->rowCount()>0)
      {
      ?>
      <h6 class="text-success">Save!..</h6>
      <?php
       }
       }
  else{
       ?>
        <h6 class="text-danger">Similar code disease exist!..</h6>
       <?php
       }
       }
  else{
       ?>
       <h6 class="text-danger">All field required!..</h6>
       <?php
       }
?>