<?php 
  echo @$_GET['msg'];
  session_start();
  if(isset($_SESSION['userId'])){ 
  	if(isset($_POST['chkvno'])){
  		require 'connection.php';
  		extract($_POST);
  		
  		$vno= $_POST['chkvno'];
  	$qry="DELETE from chicksinout where vno='$vno'";
  	  $run = mysqli_query($connect, $qry) or die(mysqli_error($connect));

      $qry1="DELETE from stockledger where vno='$vno' and invoiceno='Chk-SL'";
      $run1 = mysqli_query($connect, $qry1) or die(mysqli_error($connect));

$qry2="DELETE from stockledger where vno='$vno' and invoiceno='Chk-PR'";
      $run2 = mysqli_query($connect, $qry2) or die(mysqli_error($connect));

$qry3="DELETE from ledger where vno='$vno' and entrytype='Chk-PR'";
      $run3 = mysqli_query($connect, $qry3) or die(mysqli_error($connect));


$qry3="DELETE from ledger where vno='$vno' and entrytype='Chk-SL'";
      $run3 = mysqli_query($connect, $qry3) or die(mysqli_error($connect));

if($qry){
echo "Voucher Deleted...";

}
}
  

    if(isset($_POST['accdvno'])){
      require 'connection.php';
      extract($_POST);
      
      $vno= $_POST['accdvno'];
    $qry="DELETE from accreg where accid='$vno'";
      $run = mysqli_query($connect, $qry) or die(mysqli_error($connect));

 if($qry){
echo "Account Deleted...";

}
}

}