Hi ,All
As i have three file
payout.php
exceptionxlsx.php
waitscreen.php
In payout.php we use to upload the file and after submit buton one fancy box pop up with a button download discripant
it call the waitscree.php which open in a new tab by code
window.open('waitscreen.php','calculation','')
which has waitscreen image i.e below
<html>
<body onLoad="init()" style="position:absolute; width:100%; text-align:center; top:100px;">
<h2>Your Reguest is Processing</h2>
<div id="loading" style="position:absolute; width:100%; text-align:center;">
<img src="loading.gif" border=0/></div>
<meta HTTP-EQUIV="refresh" content="1;URL=exceptionxlsx.php"/>
</html>
as the code suggested it again call the exceptionxlsx.php which process and give the zip file for download the code of exceptionxlsx.php is given below
session_start();
$exceptionxlsx_array = array();
$exceptionxlsx_array = $_SESSION['exceptionxlsx_array'];
include("impfun.php");
require ('dbconfig.php');
include("pdf.php");
$objimp = new impfun;
if(!empty($exceptionxlsx_array)){
$exception_filename = 'admin/OccurException/existexception.xlsx';
$objimp->makexlsxfile($exceptionxlsx_array,$exception_filename);
$filename = $_SERVER["DOCUMENT_ROOT"]."/bi_tracker/admin/OccurException/";
$objimp->Zip($filename, './OccurException.zip');
$filename='OccurException.zip';
$objimp->truncate();
$objimp->delete_file();
//ob_end_clean();
//ob_end_flush();
//ob_flush();
//header_remove();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".$filename);
header( "Content-Description: File Transfer");
readfile($_SERVER["DOCUMENT_ROOT"]."/bi_tracker/OccurException.zip");
unlink($_SERVER["DOCUMENT_ROOT"]."/bi_tracker/OccurException.zip");
echo "<script>window.close()</script>";
}
after the file download I want to close the new open tab But it didn't close what i am missing please let me know .....
although the file is available for download