0byt3m1n1
Path:
C:
/
BACKUPS
/
IDCARD-backup
/
id Code
/
[
Home
]
File: excel.php
<?php include("db_connect.php"); $output = ''; if (isset($_POST["export_excel"])) { $sql="SELECT * FROM employees ORDER BY id ASC"; $result= mysqli_query($db, $sql); if(mysqli_num_rows($result)>0) { $output .= ' <table class ="table" > <tr> <th>ID</th> <th>Name</th> <th>Designation</th> <th>Division</th> <th>E-mail</th> <th>Project Code</th> <th>PI</th> <th>Blood group</th> <th>Phone</th> <th>Mobile</th> <th>DOB</th> <th>Valid From</th> <th>Valid To</th> <th>Address</th> </tr> '; while($row = mysqli_fetch_array($result)) { $output .= ' <tr> <td>' .$row["id"]. '</td> <td>' .$row["first_name"].' '.$row["last_name"]. '</td> <td>' .$row["designation"]. '</td> <td>' .$row["division"]. '</td> <td>' .$row["mail_id"]. '</td> <td>' .$row["project_code"]. '</td> <td>' .$row["principal_investigator"]. '</td> <td>' .$row["blood_group"]. '</td> <td>' .$row["phone"]. '</td> <td>' .$row["mobile"]. '</td> <td>' .$row["dob"]. '</td> <td>' .$row["valid_from"]. '</td> <td>' .$row["valid_to"]. '</td> <td>' .$row["address"]. '</td> </tr> '; } $output .= '</table>'; ob_end_clean(); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment;filename=ID- CARD.xls"); echo $output; } } ?>