<?php 
header("Content-type:application/octet-stream");

header("Content-type: application/x-msdownload"); 
header("Content-Disposition: attachment; filename=excel_frequency_list.xls"); 
header("Pragma: no-cache"); 
header("Expires: 0"); 
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
?>
<?php

// include("excel_ohc_header.php");
include('includes/config/config.php');
include('includes/functions.php')
//include('pop_up_top.php');
?>

<body>
    <table width="100%">
        <tr>
            <div style="font-size: 12px">
                <td width="25%" align="left"> Run Date : <?php  echo date("d-M-Y"); ?></td>
                <td width="50%" align="center" style="font-size: 20px"><strong>Frequency List</strong></td>
                <td width="25%" align="center"> User : <?php  echo $username ?></td>

        </tr>
    </table>

    <table width="100%" border="1" cellspacing="0" cellpadding="0"
    style="font: Arial, Helvetica, sans-serif; font-size: XX-SMALL;">
    <?php
$ohc_type = $_SESSION['current_ohcttype'];
$sql_medical_examination = base64_decode($filterkey);
//echo $sql_medical_examination;
$results_medical_examination = mysqli_query($conn, $sql_medical_examination);
?>
    <style>
    td {
        font-size: 8px;
    }
    </style>
    <tr bgcolor="#eeeeee">
        <td width="3%">Sr.</td>
        <td width="7%">Medicine Frequency</td>
        <td width="10%">Description</td>
        <td width="10%">Daily Calculated Qty</td>
        <td width="10%">Display Order</td>
        <td width="10%">Status</td>
        <td width="10%">Is Default</td>
    </tr>

    <?php
$count = 0;

while ($row_medical_examination = mysqli_fetch_assoc($results_medical_examination)) {
    extract($row_medical_examination);
    if($row_medical_examination['active']==1){
        $status='Active';
    }else{
        $status='Inactive';
    }
    if($row_medical_examination['is_default']==1){
		$is_default='Yes';
	}else{
		$is_default='No';
	}
    ?>
    <?php

    $count = $count + 1;
    ?>



    <tr>

        <td><?php  echo $count?></td>
        <td><?php  echo $row_medical_examination['medicine_frequency']?></td>
        <td><?php  echo $row_medical_examination['frequency_description']?></td>
        <td><?php  echo $row_medical_examination['qty']?></td>
        <td><?php  echo $row_medical_examination['display_order']?></td>
        <td><?php  echo $status?></td>
        <td><?php  echo $is_default?></td>
    </tr>
    <?php
}
?>
</table>
</body>