<?php // ob_start();
session_name('CAKEPHP'); session_start();
$PageSecurity = 1;
include('config.php');
//include('includes/session.inc');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');
//echo $_SESSION['task_report_sql'];
 $sql1=DB_query($_SESSION['task_report_sql'],$db);
?>
<div style="text-align: center"><h2><?php echo $s->getField('companies','CompanyId',$_SESSION['ACGCompanyId'],'CompanyName');  ?></h2></div>
<div style="text-align: center"><h3>Task Assignment Report</h3></div>
<table width="100%" border="1" style="border-collapse: collapse">
            <tr>
            <th>S.No</th>
            <th>Branch</th>
            <th>Task Date</th>
            <th>Task No</th>
            <th>Task Description</th>
            <th>Assign To</th>
            <th>Assign By</th>
            
        </tr>
        <?php $i=1;
        while($result=DB_fetch_assoc($sql1)) { ?>
        <tr>
            <td><?php echo $i; ?></td>
             <td><?php echo $s->getField('locations','loccode',$result['branch'],'locationname');  ?></td>
            <td><?php echo ConvertSQLDate($result['created']); ?></td>
            <td><?php echo $result['task_no'] ?></td>
             <td><?php echo $result['task_description'] ?></td>
             <td><?php echo $s->getField('www_users','id',$result['user_id'],'realname'); ?></td>
             <td><?php echo $s->getField('www_users','id',$result['created_by'],'realname'); ?></td>
        </tr>
        
        <?php $i++;} ?>
    </table>
    
<?php 
date_default_timezone_set('Asia/Kolkata');
$filename = "taskreport_".date('y-m-d h:i:s'); 
header("Content-Type: application/x-msdownload");	
header("Content-Disposition: attachment; filename=$filename.xls");
header("Pragma: no-cache");
header("Expires: 0");
?>