  
 <?php 
  ini_set('display_errors', 1);
     ini_set('display_startup_errors', 1);
     error_reporting(E_ALL);
 require_once "labClass.php";
 $con = new labClass();
   
 $pOpt="CASH"; 
 $sdate =  $_POST['sdate'];  // Current date
 echo $sdat = date('Y-m-d', strtotime("-1 days")); // 1 days ago
$cc=0;
 $s= $con->getMuamalaCheckByDt($pOpt,$sdat);
if($s->rowCount()>0)
           {
 $e= $con->getMuamalaCheckConf($pOpt,$sdat);
 if($e->rowCount()>0)
           {
            $cc=0;   
           }else{
            
            $cc++;
           }
           }
           else{
               $cc=0;
           }
         if($cc==0)
           {
  ?>
 
 
 <div class="container mt-3" style="width:100%;">
<div id="disR"></div>
 <div  class="mt-4 p-5 bg-white text-dark rounded">
<div class="row">
    <div class="col">
    Pay by:
<select class="form-control" name="pOpt" id="pOpt">
    <option value="">Select</option>
    <option value="CASH">CASH</option>
    <option value="M-PESA">M-PESA</option>
    <option value="AIRTEL MONEY">AIRTEL MONEY</option>
    <option value="TIGO PESA">TIGO PESA</option>
    <option value="HALO PESA">HALO PESA</option>
    <option value="NMB">NMB</option>
    <option value="CRDB">CRDB</option>  
    </select>
   
    </div>
      

     
    <div class="col">
     <label for="cname" class="form-label">Search/Sort by: Name:</label> 
      <input type="text" onkeyup ="submision()" class="form-control" id="tname" style="width:100%; height:35px; border-radius:12px;" placeholder="Test name" name="tname" required>  
    </div>
   </div>
 

<!-- SEARCH BOX END-->
  
 <div id="dispR">
   
 <?php
   //require_once "labToolkitListOp.php";
   ?>
   
 </div>
 <?php
           
               
           }
           else{
      
   
          ?> 
          <h3 class="text-danger">You have not confirmed the passed day sells</h3>
        <?php
    
           }
           
   ?>
  
   
      

 

 <script>
 
 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();

    });
    }
 
} 
 


  function submision(){
    
    var searchValue=$('#tname').val();
   
    $('#dispR').empty();
    $.post('pharItemSearchFsStff.php',{searchValue:searchValue},function(data){
      $('#dispR').html(data);

    });
    }
     
 
</script>
 