D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
reports.php
back
Copy
<?php include "../include/config.php"; $query = sprintf("SELECT username,usercenter,proname,typecheck,datecheck,workweek,weeknotavil,intid,intname,respid,respname,mobileno,checkername,checkdesignation,region,fwcenter,typecheckuser,tookplace,capipapi,duration,agematchdate,gendermatchdate,incomematchdate,seclsmmatchdate,mobmatchdate,incmatchdate,rhrsammatchdate,undercriteria,quesfir,ansfir,qusanscheckf,quessecond,anssecond,qusanschecks,questhird,ansthird,qusanscheckth,quesfourth,ansfourth,qusanscheckfor,quesfive,ansfive,qusanscheckfiv,quessix,anssix,qusanschecksix,quesseven,ansseven,qusanscheckseven,queseight,anseight,qusanscheckeight,quesnine,ansnine,qusanschecknine,questen,ansten,qusanscheckten,queseleven,anseleven,qusanscheckeleven,questwleve,anstwleve,qusanschecktwelev,questhirteen,ansthirteen,qusanscheckthir,quesforteen,ansforteen,qusanscheckfort,quesfifteen,ansfifteen,qusanscheckfif,quessixteen,anssixteen,qusanschecksixteen,remarkcheck1,remarkcheck2,remarkcheck3,remarkcheck14 from qcservey order by id desc limit 4000"); $result = mysql_query($query) or die(mysql_error()); /* * send response headers to the browser * following headers instruct the browser to treat the data as a csv file called export.csv */ header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=qcservey.csv'); /* * output header row (if atleast one row exists) */ $row = mysql_fetch_assoc($result); if ($row) { echocsv(array_keys($row)); } /* * output data rows (if atleast one row exists) */ while ($row) { echocsv($row); $row = mysql_fetch_assoc($result); } /* * echo the input array as csv data maintaining consistency with most CSV implementations * - uses double-quotes as enclosure when necessary * - uses double double-quotes to escape double-quotes * - uses CRLF as a line separator */ function echocsv($fields) { $separator = ''; foreach ($fields as $field) { if (preg_match('/\\r|\\n|,|"/', $field)) { $field = '"' . str_replace('"', '""', $field) . '"'; } echo $separator . $field; $separator = ','; } echo "\r\n"; } ?>