ok

Mini Shell

Direktori : /home2/globaltriumphfou/public_html/admin_panel/
Upload File :
Current File : /home2/globaltriumphfou/public_html/admin_panel/excelreport.php

<?php
include "dbconn.php";
$reportname='DataDownload';
$query= base64_decode($_REQUEST['query']);
$result=mysqli_query($connection,$query);
$results=mysqli_query($connection,$query);
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$reportname.xls"); ?>
<?php
echo '<table width="100%" border="0" cellspacing="4" cellpadding="4" border="1" >
              <tr>';
				$fields=mysqli_fetch_fields($result);
				foreach ($fields as $field){
                echo '<td align="left" valign="middle" bgcolor="#000000"><font face="verdana" color="white">'.$field->name.'</font></td>';
				}
				mysqli_free_result($result);
              echo '</tr>';
			  while($rows=mysqli_fetch_assoc($results))
			  {
				  echo '<tr>';
				  $fields=mysqli_fetch_fields($results);
				  foreach ($fields as $field){
				  echo '<td align="left" valign="middle" bgcolor="#CCCCCC">'.$rows[$field->name].'</td>';
					}
			      echo '</tr>';
			  }
			  echo '</table>';
?>

Zerion Mini Shell 1.0