<?php
 
 
//require_once("header.php");
 
if( isset($_POST["recID"]) && isset($_POST["cname"])  && isset($_POST["depo"]) && isset($_POST["depon"])  && isset($_POST["sdate"])  &&   isset($_POST["user"]))

{  
	 $cname= $_POST['cname'];
	 $depo=$_POST['depo'];  
	 $depon=$_POST['depon'];
	 $bal=$depo+$depon;
     $user=$_POST['user'];
     $sdate=$_POST['sdate'];    
     $recID=$_POST['recID'];
     ///$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();
     $pOpt="CASH";
     $con->updateAddDp($bal,$recID);
     $con->addDepo($recID,$cname,$depon,$sdate,$user);
                ?>
                <small class="text-success">Successfull!..</small>
                <?php
          //require_once "empRegForm.php";
               ///////////////////////////////////////
          $tPrice=$_POST['depon'];
          $e= $con->getMuamalaCash($pOpt,$sdate);
          if($e->rowCount()>0)
           {
          $nn=$e->fetch();
          $tPrice= $tPrice+$nn['amount'];
          $r= $con->updateToDayCash($tPrice,$pOpt,$sdate);
              if($Qr->rowCount()>0)
               {
                ///$rQc= $con->miamala($pOpt,$user,$tPrice,$sdate);
              ?>
                <h6 class="text-success">Save!..</h6>
              <?php
               }
               else{
                  ?>
                  <h6 class="text-danger">Transaction update failed!..</h6>
                 <?php
                   }
               
               ////////////////////////////////////////
          }
          else{
            echo "All field required!..";
          }
   
 


}

?>