<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trip PDF</title>
</head>

<body>
<?php
$data = $this->data;
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family:Tahoma, Geneva, sans-serif; font-size:100%;">
  <tr>
    <td align="left" width="30%" style="color:#333333; font-size:14px;">
    <span style="font-size:24px;">Trip to <?php echo $data[0]['trip_name']; ?></span><br />
    <span style="font-size:14px; line-height:30px;">Total Expense</span><br />
    <span style="font-size:20px; line-height:20px;"><strong><?php echo $this->currency; ?>-<?php echo $this->total_amount; ?></strong></span>
    </td>
    <td align="left" width="70%" style="color:#333333; padding-left:30px; border-left:2px dotted #bfbfbf; font-size:14px;">
    
   <div style="line-height:24px;"><span>Status:</span>&nbsp;<span style="color:#1abc0a;"><?php echo $data[0]['status']; ?></span></div>
	
	
	
	<?php if($data[0]['from_date']!='' && $data[0]['to_date']!='') { ?>
                           
		<div style="line-height:24px;"><span style="color:#747474;">Duration:</span>&nbsp;<span><?php echo sapp_Global::change_date($data[0]['from_date'],'view');?> to <?php echo sapp_Global::change_date($data[0]['to_date'],'view');?></span></div>
	<?php } ?>
	
    <div style="line-height:24px;"><span style="color:#747474;">Submit to:</span>&nbsp;<span><strong><?php echo $this->report; ?></strong></span></div>
    </td>
  </tr>
</table>

<table width="100%" cellpadding="10" cellspacing="0" style="font-family:Tahoma, Geneva, sans-serif; font-size:14px; margin:30px 0; table-layout:fixed;">
  <tr bgcolor="#3498db">
    <th align="left" style="color:#ffffff;">Date</th>
    <th align="left" style="color:#ffffff;">Category</th>
    <th align="left" style="color:#ffffff;">Project</th>
    <th align="center" style="color:#ffffff;">Reimbursable</th>
    <th align="center" style="color:#ffffff;">Status</th>
    <th align="center" style="color:#ffffff;">Amount</th>
    <th align="center" style="color:#ffffff;">Application Amount</th>
  </tr>
	<?php 
	
	if(count($this->data)>0){
		$i=1;
		$reimbursable_amount=0;
		$non_reimbursable_amount=0;
		foreach($this->data as $dataexp){
		$isreimbursable='no';
			if($dataexp['is_reimbursable']==1)
				$isreimbursable = 'yes';
	?>
    <tr>
    <td align="left" style="border-bottom:1px solid #dcdee0;"><?php echo $dataexp['expense_date']; ?></td>
    <td align="left" style="border-bottom:1px solid #dcdee0;"><?php echo $dataexp['expense_category_name']; ?></td>
    <td align="left" style="border-bottom:1px solid #dcdee0;"><?php echo $dataexp['project_name']; ?></td>
    <td align="center" style="border-bottom:1px solid #dcdee0;"><?php echo $isreimbursable; ?></td>
    <td align="center" style="border-bottom:1px solid #dcdee0;"><?php echo $dataexp['status_expense']; ?></td>
    <td align="center" style="border-bottom:1px solid #dcdee0;"><?php echo $dataexp['currencycode']; ?>-<?php echo $dataexp['expense_amount']; ?></td>
    <td align="center" style="border-bottom:1px solid #dcdee0;"><?php echo $this->currency; ?>-<?php echo $dataexp['application_amount']; ?></td>
  </tr>
	<?php
				$i++;
				if($dataexp['is_reimbursable']==1)
				{
					$reimbursable_amount = $reimbursable_amount +$dataexp['application_amount'];
				}
				else
				{
					$non_reimbursable_amount = $non_reimbursable_amount+$dataexp['application_amount'];
				}
					$total_amount = $reimbursable_amount+$non_reimbursable_amount;
			} ?>  
		<?php 
		} 
	?>


  <tr>
  	<td colspan="7" align="right" style="padding:10px 0;">Reimbursable Amount&nbsp;&nbsp;&nbsp;<?php echo $reimbursable_amount;?></td>
  </tr>
    <tr>
  	<td colspan="7" align="right" style="padding:10px 0;">Non Reimbursable Amount&nbsp;&nbsp;&nbsp;<?php echo $non_reimbursable_amount;?></td>
  </tr>
      <tr style="background-color:#cccccc;">
  	<td colspan="7" align="right" >Total Expense&nbsp;&nbsp;&nbsp;<strong><?php echo $this->currency; ?>-<?php echo $total_amount;?></strong></td>
  </tr>
  
  
  
</table>






</body>
</html>
