Skip to content

Commit

Permalink
udpad
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangpatel committed May 1, 2016
1 parent 301266a commit 9324ae6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pdf/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@

if($_REQUEST['action'] == 'download_excel'){
$data = $model->getData();
header('Content-Type: application/csv');

header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename=receipts.csv');
header('Pragma: no-cache');
$csv = "Ref ID,Name,Ref Data, Total \n";
foreach($data as $d){
$csv .= (50000 + $d['id']). ',' . $d['full_name'].','.$d['ref_date'].',' . $d['total']. "\n";
$csv .= (50000 + $d['id']). ',"' . $d['full_name'].'",'.$d['ref_date'].',' . $d['total']. "\n";
}
echo $csv;
exit;
Expand Down

0 comments on commit 9324ae6

Please sign in to comment.