<?php 
$PageSecurity = 1;
session_name('CAKEPHP'); session_start();
ob_start();
$PageSecurity = 1;
include('config.php');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');
include('Account/fun-Trial.php');


?>
<title>Purchase Trial</title>
<style type="text/css"> 
/* CSS Document */
body{ margin:0px; padding:0px; font-size:10px; font-family: Arial, Helvetica, sans-serif;  font-weight:normal;}
h1,h2,h3,h4,h5,p{ margin:0px; padding:0px;}
p{ text-align:left;}
.wrapper{width: 1070px; background-color:#FFF; border:1px solid #000; margin: auto;}
.clr{clear:both;}
.div_first{width:1070px; border-bottom:#000000 1px solid; padding:5px 0px 5px 0px;}
.div_first .left{width:149px; float:left; text-align:center; 
border-right:#000 1px solid; height:105px; display:table-cell; vertical-align:middle;}
.div_first .right{width:910px; float:left; text-align:center;}
h2{font-size: 14px; font-weight:normal; font-family:"Times New Roman",Times,serif; margin:4px;
padding:0px; color:#000; text-transform: uppercase;}
h3{color: #000; font-family: "Times New Roman",Times,serif; font-size: 18px; 
 text-align: center; text-decoration: none; text-transform: uppercase; margin:0px; padding:0px; }
.div_second{width:1070px; border-bottom:#000000 1px solid;}

.brdr_btm{ border-bottom:#000 1px solid;}
.brdr_rgt{ border-right:#000 1px solid;}

.div_third{width:1070px; margin:auto;}
.div_third table tr td{font-size:11px; color:#000; font-family:Arial, Helvetica, sans-serif;  }

.div_third table tr td:empty:before{ content:" ";}




hr{ border-color: black;
 
    border-style: solid;
    border-width: 1px 0 0;
    height: 1px;}

.div_forth{width:1070px; margin:auto; border:#000 1px solid; border-top:none;}
.div_fifth{
  width:1070px;
  margin:auto;
  border-top:none;
}


table tr td:empty:before{ content:" ";}

.div_sixth {}
.f12{ font-family:Arial, Helvetica, sans-serif; font-weight: bold; color:#000; font-size:13px; line-height:16px;}
.f11{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:12px; line-height:16px;}
.f14{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:16px; line-height:24px;}
.border_top{border-top:#000 1px solid;}
.border_bottom{border-bottom:#000 1px solid;}
.upper{text-transform:uppercase;}
@media print {
     .wrapper{
        border:1px solid #000 !important;
    }
.div_first .right{width:910px;}
.f12{ font-family:Arial, Helvetica, sans-serif; font-weight: bold; color:#000; font-size:16px; line-height:16px;}
.f11{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:15px; line-height:16px;}
.f14{ font-family:Arial, Helvetica, sans-serif; color:#000; font-size:20px; line-height:24px;}
 h2{font-size: 18px; font-weight:normal; font-family:"Times New Roman",Times,serif; margin:0px;
padding:0px; color:#000; text-transform: uppercase;}
h3{color: #003399; font-family: "Times New Roman",Times,serif; font-size: 24px; margin:0px; padding:0px;  text-align: center; text-decoration: none; text-transform: uppercase;} 
}
.f121 {font-family:Arial, Helvetica, sans-serif; font-weight: bold; color:#000; font-size:13px; line-height:16px;}
.f121 {font-family:Arial, Helvetica, sans-serif; font-weight: bold; color:#000; font-size:16px; line-height:16px;}
</style>
<link rel="stylesheet" href="css/purchase_requision_print.css">
<div class="wrapper">
  

<div style="width:100%; color:#006699; font-size:16px; font-weight:900; padding:10px; text-align:center;">Extract Trial Purchase</div>

<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse;">
  <tr bgcolor="#CCCCCC" class="f12" height="25">
    <td align="left" valign="right">Ledger Name </td>
    <td align="left" valign="middle">Debit Amount </td>
    <td align="left" valign="middle">Credit Amount </td>
  </tr>
<?php  
$c_tot=0;
$d_tot=0;
if(!empty($_SESSION['data_pr_trial']))
{
foreach($_SESSION['data_pr_trial'] as $key=>$val)  
{ 
	?>
  <tr >
   <td align="left" valign="right"><?php echo $val['ledger']; ?></td>
   <td align="right" valign="right"><?php echo $TDR[]= $val['debit']; ?></td>
   <td align="right" valign="right"><?php echo $TCR[]=$val['credit']; ?></td> 
 
  </tr>
  
<?php } 
?>
 <tr>      
        <th style="text-align:right">Total</th>           
       <th align="right" ><?php echo array_sum($TDR); ?></th>
        <th align="right" ><?php echo array_sum($TCR); ?></th>
       
      </tr>
<?php } ?>

 
 
</table>
</div>
</div>
<?php
$header='';   
header("Content-type: application/x-msdownload"); 
header("Content-Disposition: attachment; filename=Extract-Trial-Purchase_Exl.xls"); 
header("Pragma: no-cache"); 
header("Expires: 0"); 
print "$header\n$data"; 
?>