<?php
if($_POST["agentid"] && $_POST["iname"] && $_POST["icat"] && $_POST["ipprice"] && $_POST["isprice"] &&  $_POST["expd"])
{ 
    $agentid= $_POST['agentid'];
    $isprice= $_POST['isprice'];
    $ipprice= $_POST['ipprice'];
    $icat= $_POST['icat'];
	$iname= $_POST['iname'];
    $iQty= 0;
    $expd= $_POST['expd']; 
  //CHECKING ENDS HER
  require_once"labClass.php";
  $con=new labClass();
  $Q= $con->getThisAgItem($iname,$agentid);
  if($Q->rowCount()<=0)
    {
   $rQ= $con->itemRegAg($agentid,$iname,$icat,$ipprice,$isprice,$iQty,$expd);
   
   if($rQ->rowCount()>0)
      {
      ?>
      <h6 class="text-success">Save!..</h6>
      <?php
       }
       }
  else{
       ?>
        <h6 class="text-danger">Similar item exist!..</h6>
       <?php
       }
       }
  else{
       ?>
       <h6 class="text-danger">All field required!..</h6>
       <?php
       }
?>