<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php
include('../include/session.php');

$saved_report_id = $_GET['saved_report_id'];

$saved_report_id = $_GET['saved_report_id'];
$table_name = $_SESSION['db_prefix']."_saved_sales_reports";
$read_query = "UPDATE $table_name SET read_done = 'yes' WHERE saved_report_id = '".$saved_report_id."' ";
execsql($read_query);

$table_name2 = $_SESSION['db_prefix']."_saved_sales_reports";
$report_query = "SELECT * FROM $table_name2 WHERE saved_report_id = '".$saved_report_id."' ";
$report_result = mySQL_query($report_query);
$report_num = mysql_num_rows($report_result);
$a1 = mysql_result($report_result, 0, "saved_report_date");
$a2 = mysql_result($report_result, 0, "saved_report_name");
$a3 = mysql_result($report_result, 0, "saved_report_text");
?>
<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>
<body>
<?php
include ("../navigation/header.php");
$page_name = "sales-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/sales_sidebar.php");
?>
<div class="main_frame">
  <div class="page_head_frame">
  <table width="809" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="385"><label class="label_page_head">Sales  report</label></td>
              <td width="253">&nbsp;</td>
              <td width="171" align="right">&nbsp;</td>
            </tr>
          </table>
        </div>
       
        <div class="page_middle_frame">
        

<div class="page_inside_frame" style="font-family:Arial, Helvetica, sans-serif; font-size:10px;">        
 
<table width="632" border='0'; >
           
           
            <tr>
              <th width="98" align="left" >Report name:</th>
              <th align="left" ><font size="+2"><?php echo $a2 ?></font></th>
              <th >&nbsp;</th>
            </tr>
           

            <tr>
              <td  style="padding-left:0px;" align="left">Report date :</td>
              <td width="456" align="left"><span style="padding-left:0px;"><a href="" onMouseOver="ddrivetip('', 250)"; onMouseOut="hideddrivetip()"><?php echo date("d-m-Y, h:i", strtotime($a1)) ?></a></span></td>
              <td width="62" align="left">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2" align="left"  style="padding-left:0px;"><?php echo $a3 ?></td>
              <td align="left">&nbsp;</td>
            </tr>
 

           
          </table>
          
        </div>
  
 </div> 
</div>
<?php include ('../navigation/side_bar.php'); ?>
</body>
<?php } else {
$_SESSION['denied_return'] = "sales/sales_main.php";	
include ("../navigation/sales_sidebar.php");?>
<body onload="accessdenied(); return false">
</body>
<?php }
?>
</html>