home/abhiramc/public_html/acts.service/export.employee.php000064400000002345150211522700020004 0ustar00 getConnection(); if(isset($_POST['export'])){ // initialize object $empexpo = new employee($db); // read employee attendance will be here // query employee attendance $empexpo->ts_brid = $_POST['offidexpo']; $stmtexpo = $empexpo->emp_read(); $numexpo = $stmtexpo->rowCount(); $setdata .= "EMP LIST FOR DISTRIBUTION OF CARD\n"; $setdata .= "EMP ID\tEMP NAME\n"; if($numexpo>0){ while ($rowexpo = $stmtexpo->fetch(PDO::FETCH_ASSOC)){ // set up a row for each record $value = '"' . $rowexpo["empid"] . '"' . "\t"; $value = $value . '"' .$rowexpo["empname"] . '"' . "\n"; $setdata .= $value; } } // if there are no records in the database, display an alert message else { echo "No results to display!"; } header('Content-Type: application/xls'); header('Content-Disposition: attachment; filename=Employee-barcode-list.xls'); echo $setdata; } ?>