<?php 	
	
    include_once('../../config.php');   	
	header('Content-type: text/csv');
	$date = $_SESSION['level-exportT'][0]['FetchDate']." Trading Report";
	header('Content-Disposition: attachment; filename=""'.$date.'".csv"');

	// do not cache the file
	header('Pragma: no-cache');
	header('Expires: 0');

	// create a file pointer connected to the output stream
	$file = fopen('php://output', 'w'); 
	// send the column headers
	fputcsv($file, array('Sr no','By', 'Name','Auto Withdraw','Received','Bank','Account', 'IFSC','Date'));//,'Profit'  
	// output each row of the data
	//foreach ($data as $row)
	foreach ($_SESSION['level-exportT'] as $dt)
	{
		fputcsv($file, $dt);
	}
		 
		 
?>		 