 
 
 <div class="container mt-3" style="width:100%;">
<div id="disR"></div>
 <div  class="mt-4 p-5 bg-white text-dark rounded">
  <h6>Item registration:</h6> 
     
    <div class="row">
    <div class="col" >
      <label for="iname">Name:</label>  
      <input type="text" class="form-control" id="iname" style="width:100%; height:35px; border-radius:12px; " placeholder="Item name" name="iname" required>
      <sup class="text-danger" id="in"> </sup>
    </div>
     
    <div class="col" >
      <label for="icat">Category:</label>  
      <input type="text" class="form-control" id="icat" style="width:100%; height:35px; border-radius:12px; " placeholder="Category" name="icat" required>
      <sup class="text-danger" id="ic"> </sup>
    </div>
    
  
   
 <div class="col" >
      <label for="ipprice">Purchase:</label>  
      <input type="number" class="form-control" id="ipprice" style="width:100%; height:35px; border-radius:12px; " placeholder="Purchase price" name="ipprice" required>
      <sup class="text-danger" id="ip"> </sup>
    </div>
 </div>
<div class="row">
<div class="col" >
      <label for="isprice">Sales:</label>  
      <input type="number" class="form-control" id="isprice" style="width:100%; height:35px; border-radius:12px; " placeholder="Sales price" name="isprice" required>
      <sup class="text-danger" id="is"> </sup>
    </div>
    <div class="col"> 
      <label for="iQty">Qty:</label> 
      <input style="width:100%; height:35px; border-radius:12px;"  type="number" class="form-control"   id="iQty" placeholder="Item Qty" name="iQty" required>
     <sup class="text-danger" id="q"> </sup>
    </div>
     <div class="col"> 
      <label for="expd">Expired:</label> 
      <input style="width:100%; height:35px; border-radius:12px;"  type="date" class="form-control"   id="expd" placeholder="Expired" name="expd" required>
     <sup class="text-danger" id="ex"> </sup>
    </div>
    </div>
  <table class="table" border="0"><tr><td width="80%" align="right"> 
   
  <button type="submit" class="btn btn-primary" id="submit" value="Submit" name="submit"  style="height:60px;" onclick="saveData()">Submit</button>
</td>
</tr>
</table>
<!--SEARCH BOX-->
   <div class="row">
    <div class="col">
      <h6>Add item quantity here:</h6>  
      <input type="text" onkeyup ="submision()" class="form-control" id="tname" style="width:100%; height:40px; border-radius:12px;" placeholder="Test name" name="tname" required>  
    </div>
</div> 
</div>

<!-- SEARCH BOX END-->

</div>

 </div>
 <div id="dispR">
   
 <?php
   //require_once "labToolkitListOp.php";
   ?>
   
 </div>
 
  
   
      

 

 <script>

  function submision(){
    
    var searchValue=$('#tname').val();

    
 ;
    $('#dispR').empty();
    $.post('pharItemSearch.php',{searchValue:searchValue},function(data){
      $('#dispR').html(data);

    });
  }
 

 
 function saveData(){ 
var ecc=0; 
var iname =document.getElementById('iname').value; 
$.trim(iname);
var icat =document.getElementById('icat').value; 
$.trim(icat);
var ipprice =document.getElementById('ipprice').value; 
$.trim(ipprice);
var isprice =document.getElementById('isprice').value; 
$.trim(isprice);
var expd =document.getElementById('expd').value; 
$.trim(expd);
var iQty =document.getElementById('iQty').value; 
 
var submit =document.getElementById('submit').value; 
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(icat==""){ 

         ecc++;
         document.getElementById('ic').innerHTML="Category is required!..";

            }
else{
document.getElementById('ic').innerHTML="";
    }
if(ipprice==""){ 

         ecc++;
         document.getElementById('ip').innerHTML="Purchase price is required!..";

            }
else{
document.getElementById('ip').innerHTML="";
    }
if(isprice==""){ 

         ecc++;
         document.getElementById('is').innerHTML="Sales price is required!..";

            }
else{
document.getElementById('is').innerHTML="";
    }
if(expd==""){ 

         ecc++;
         document.getElementById('ex').innerHTML="Expire date is required!..";

            }
else{
document.getElementById('ex').innerHTML="";
    }
if(iQty==""){ 
         ecc++;
         document.getElementById('q').innerHTML="Quantity is required!..";

            }
else{
document.getElementById('q').innerHTML="";
    }
     
if(iname==""){ 

         ecc++;
         document.getElementById('in').innerHTML="Item name is required!..";

             }
else{

document.getElementById('in').innerHTML="";
    }
  
    if(ecc==0)
    { 
        $.post("pharItemRfPro.php",
          {submit:submit,iname:iname,iQty:iQty,expd:expd,icat:icat,isprice:isprice,ipprice:ipprice},
          function(data){
      $('#disR').html(data).show();

    });
    }
 
} 
 
 
</script>
 