<?php
include("../php_con.php");

require("../PHPExcel/PHPExcel.php");
$excel= new PHPExcel();

$excel->setActiveSheetIndex()
->setCellValue("A1","catogary_id")
->setCellValue("B1","catogary_text");

$excel->getActiveSheet()->getStyle('A1:C1')->getFont()->setBold(true);

$row_count=2;
$list_qury=mysqli_query($connation,"SELECT * FROM catogary_list ORDER BY catogary_id");
while($list_resalt=mysqli_fetch_assoc($list_qury)){
	
$excel->setActiveSheetIndex()
->setCellValue("A".$row_count,$list_resalt['catogary_id'])
->setCellValue("B".$row_count,$list_resalt['catogary_text']);
$row_count++;
		
}




header('content-Type:Application.openxmlformats-officedocument.spreadsheetml.sheet');
header('content-Disposition:attachment; filename="category _list_'.date("Ymd").'.xlsx"');
header('cache-Control: max-age=0');

	
$file=PHPExcel_IOFactory::CreateWriter($excel,'Excel2007');
$file->save('php://output');
?>