<?php
$test='
<table width="100%" border="0" cellspacing="1" >
<tr>
<td width="20%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="10%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="10%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="10%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="10%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="10%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="15%" class="body-table-heading-bg" style="color:#000000;">Test</td>
<td width="15%" class="body-table-heading-bg" style="color:#000000;">Test</td>
</tr>';
while($row=mysql_fetch_array($query))
{
$uid=$row['assigned_to'];
$t2=strtotime($row['creation_ts']);
$t1=strtotime($row['delta_ts']);
$diff = $t1 - $t2;
$hours = $diff / ( 60 * 60 );
$num=number_format($hours, 2, '.', '');
$test.='<tr >
<td width="20%" class="body-table-heading-bg">'.$row[short_desc].'</td>
<td width="10%" class="body-table-heading-bg">'.getProjectname($row[component_id]).'</td>
<td width="10%" class="body-table-heading-bg">'.$num.'</td>
<td width="10%" class="body-table-heading-bg">'.getUser($uid).'</td>
<td width="10%" class="body-table-heading-bg">';
if($row['bug_status']=="IN_PROGRESS")
{
$test.='<font color="red">'.$row[bug_status].'</font>';
}
else
{
if($row['bug_status']=="RESOLVED")
{
$test.='<font color="green">'.$row[bug_status].'</font>';
}
else
{
$test.='<font color="red">'.$row[bug_status].'</font>';
}
}
$test.='</td>
<td width="15%" class="body-table-heading-bg">'.$row[version].'</td>
<td width="15%" class="body-table-heading-bg">'.$row[creation_ts].'</td>
<td width="15%" class="body-table-heading-bg">'.$row[delta_ts].'</td>
</tr>';
}
echo $test;
$_SESSION['excel_data']=$test;
?>
<?php
session_start();
include("function.php");
$type=$_GET['type'];
$date=date('d-m-Y');
$filename=$type."USER_Report_".$_SESSION['type'].'_'.$date;
$file=$filename.".xls";
$excel_data1=$_SESSION['excel_data'];
$test=$excel_data1;
$data1.='<table align="center" style="border-collapse: collapse" width="100%">
<tr>
<td><strong>User Name</strong></td> <td><strong>Start Date(d-m-y)</strong></td><td><strong>End Date(d-m-y)</strong></td></tr>
<tr>
<td>'.getUser($_SESSION['userid']).'</td>
<td>'.changeDate($_SESSION['start']).'</td>
<td>'.changeDate($_SESSION['end']).'</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="8" nowrap="nowrap">'.$test.'</td>
</tr>
</table>';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file");
echo $data1;
?>
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Variables are important in every programming language — and it’s no different in PHP. Variables give developers the possibility of temp...
-
What? Hide the .php extension of your PHP files in the URL of your site address. Instead of: http://www.example.com/page.php Visitors to ...
-
Questions : 1 Who is the father of PHP ? Answers : 1 Rasmus Lerdorf is known as the father of PHP. Questions : 2 What is the...
-
Change Db settings here C:\xampp\htdocs\modx\core\xpdo\xpdo.class Line 2920 $this->config['dsn']= $dsn; $this->con...
-
<form action="" name="" method="post"> <p><b>user:</b> <input type="text...
-
Redirection is process of forwarding one URL to a different URL. There are three main kinds of redirects online; 301, 302 and meta refres...
-
Questions : 1 What is database or database management systems (DBMS)? and - What’s the difference between file and database? Can files...
-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script...
-
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Add More Elements...
No comments:
Post a Comment
Thank you for your Comment....