<?php
//require_once("header.php");
if($_POST["submit"] && isset($_POST["fname"]) && isset($_POST["phoneno"]) && isset($_POST["ward"]) && isset($_POST["street"]) && isset($_POST["district"]) && isset($_POST["region"]))

{ 
   $district= $_POST['district'];
   $ward= $_POST['ward'];
   $region= $_POST['region'];
	 $fname= $_POST['fname'];
	 $phoneno=$_POST['phoneno'];  
	 $street=$_POST['street'];   
   //$tin=$_POST['tin'];
   $rg=Date("Ymdhis").substr(10,2);
   $reg=md5(substr($rg,1,11));
   $regdate=Date("Y-m-d");
  //CHECKING ENDS HERE
  require_once "labClass.php";
  $con = new labClass();
  $g=$con->getThisExist($phoneno);
  if($g->rowCount()<=0){
  $con->addCustomer($fname,$phoneno,$street,$ward,$district,$region);
                ?>
                <h5 class="text-success">Successfull registered!..</h5>
                <?php
                 $on_off=0;
                $row=$con->updatePermit($on_off);
                require_once "pharmcusRg.php";
                 
          
   }else{
        ?>
                <h5 class="text-danger">The customer exist!!..</h5>
                <?php 
    require_once "pharmcusRg.php";
    }
 
}



?>