<?php 
if(!isset($_SESSION)) { 
  session_start(); 
  include('../includes/dbcon.php');
}
if(empty($_SESSION['rm_id'])):
header('Location:../index.php');
endif;


  $inv_no=0;

if (isset($_GET['inv_no'])) { 
  $inv_no= trim($_GET['inv_no']);
}  //// if is set


if (isset($_POST['inv_no'])) { 
$inv_no= trim($_POST['inv_no']);
}


if (!empty($inv_no)){

if ( mysqli_query($con,"delete from inv_temp_header where invd_id='$inv_no' ")or die(mysqli_error($con))) {     


if ( mysqli_query($con,"delete from inv_temp_detail where invd_id='$inv_no' ")or die(mysqli_error($con))) { 
         echo "<script>document.location='sri_new_inv.php'</script>"; 
      }

     // echo "<script>document.location='sri_new.php?trn_no=$inv_no '</script>"; 
    }





}