<?php if($this->ermsg !='')
{
?><div class="full_container cwrap">
     <div class="ml-alert-1-info m1-info-set">
				<div class="style-1-icon info"></div>
				No data found.
	</div>
</div>
<?php 
}
else
{

	
$baseUrl = $this->serverUrl().$this->baseUrl();
$data = $this->data; 

?>


   
    <div class="clearfix"></div>
	<div class="ml-alert-1-success" id="demo_success_msg" style="display:none;"><span class="style-1-icon success"></span></div>
	<div id='expense_forward' class='ml-alert-1-success'  style='display:none;'><div id='expense_forward_msg'></div></div>

    <div class="cardsgrid">
        <div class="cards clearfix rcds">
            <div class="col-main">
                <div class="expview_status">
                    <div class="expvs_col vrdln">
                        <h3><?php echo $data[0]['expense_name']; ?></h3>
                        <div class="expvs_price"><?php echo $data[0]['currencycode']; ?>-<?php echo $data[0]['expense_amount']; ?></div>
                    </div>
                    <div class="expvs_col vrdln pd">
                        <p>Status : <span class="expvsgrn"><?php echo ucfirst  ($data[0]['status']); ?></span></p>
						<?php if(!empty($data[0]['trip_name'])){?>
                        <p>Trip : Trip to <a href='<?php echo BASE_URL.'expenses/trips/view/id/'.$data[0]['trip_id'];?>'><?php echo $data[0]['trip_name']; ?></a> <?php if($data[0]['from_date']!='' && $data[0]['to_date']!=''){?><em>On:<?php echo sapp_Global::change_date($data[0]['from_date'],'view');?> to <?php echo sapp_Global::change_date($data[0]['to_date'],'view');?></em><?php }?> </p>
						<?php } ?>
                    </div>
                    <div class="expvs_col pd">
                        <p>Category : <span class="expvsred"><?php echo $data[0]['expense_category_name']; ?></span></p>
                    </div>
                </div>
                <div class="expview_details">
                    <table class="table table-striped">
                        <tbody>
                            <tr>
                                <td class="expvd_head">Expense #</td>
                                <td class="expvd_text"><?php echo $data[0]['expense_name']; ?></td>
                                <td class="expvd_head">Client</td>
                                <td class="expvd_text"><?php echo $data[0]['client_name']; ?></td>
                            </tr>
                            <tr>
                                <td class="expvd_head">Project</td>
                                <td class="expvd_text"><?php echo $data[0]['project_name']; ?></td>
                                <td class="expvd_head">Reimbursable</td>
                                <td class="expvd_text"><?php echo $data[0]['is_reimbursable']; ?></td>
                            </tr>
                            <tr>
                                <td class="expvd_head">Exchange Rate</td>
                                <td class="expvd_text"><?php echo $data[0]['expense_conversion_rate']; ?></td>
                                <td class="expvd_head">Payment Mode</td>
                                <td class="expvd_text"><?php echo $data[0]['payment_method_name']; ?></td>
                            </tr>
                            <tr>
                                <td class="expvd_head">Payment Ref #</td>
                                <td colspan="3" class="expvd_text"><?php echo $data[0]['expense_payment_ref_no']; ?></td>
                            </tr>
                            <tr>
                                <td class="expvd_head">Advance</td>
                                <td colspan="3" class="expvd_advnc"><span> <?php echo $this->currency .'  '.$data[0]['advance_amount']; ?></span> </td>
                            </tr>
                            <tr>
                                <td class="expvd_head">Description</td>
                                <td colspan="3" class="expvd_desc"><?php echo $data[0]['description']; ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
				
				
				<div class="view_history">
                    <h4>History</h4>
                    <ul>
						<?php if(count($this->expense_hostory)>0) {
							foreach($this->expense_hostory as $history)
							{ ?>
								<li>
									<span class="hd"><?php echo sapp_Global::change_date($history['createddate'],'view');?></span>
									<span class="ht">Expense</span>
									<span class="hs"><?php echo ucfirst($history['history']);?></span>
									<span class="hb">.- <?php echo $history['userfullname'];?></span>
								</li>
						<?php	}
							
						}?>
                    </ul>
                </div>
				
				
            </div>
			
  <div class="col-right">
                <div class="action_btns">
                    <ul>                        						                     
                        <li><a href='<?php echo BASE_URL.'expenses/expenses/downloadexpensepdf/id/'.$data[0]['id'];?>' data-activates='addbtn' class="actbtn_nrml"><i class="fa fa-share-square-o" aria-hidden="true"></i> Export expense</a></li>
						<span class="divider_new"></span>
						<?php 
						if($this->loginuserId == $data[0]['manager_id'] && $data[0]['status']=='submitted')
						{
							?>
							 <li id="forward_li"><a href="javascript:reportingManagerList('<?php echo $data[0]['id']; ?>','<?php echo $data[0]['manager_id']; ?>','<?php echo $data[0]['createdby'];?>');" class="actbtn_nrml"><i class="fa fa-share"></i> Forward</a></li>
							<?php
						}
						?>
						<?php if($data[0]['status']=='submitted') { ?>
                        <span class="divider_new"></span>
						<li><a onclick="expenseStatus('approved','<?php echo $data[0]['id']; ?>','<?php echo  $data[0]['trip_id'];?>');" class="actbtn_btn"><i class="fa fa-check"></i>Approve</a></li>
                        <span class="divider_new"></span>
						<li><a onclick="expenseStatus('rejected','<?php echo $data[0]['id']; ?>','<?php echo  $data[0]['trip_id'];?>');" class="actbtn_btn ab_reject"><i class="fa fa-times"></i> Reject</a></li>
						<?php } ?>	
					
                        
                    </ul>
                </div>
				
                <div class="file_dwn">
				
				<?php if(count($this->data)>0) {
				
	             foreach($this->data as $datares){
					if($datares['receipt_name']!='')
					{
	              ?>

                    <img src="<?php echo EXPENSES_MEDIA_PATH; ?>images/file_icon.png" alt="" />
                    <p class="file_name"><?php echo $datares['receipt_name'];?></p>
					<a onClick="downloadreceipt('<?php echo $name=$datares['receipt_filename'];?>');" class="file_dwn_btn"><i class="glyphicon glyphicon-cloud-download"></i> Download</a>
					
			<?php } ?>  
			<?php } ?>  
			<?php } ?>
			
                </div>
    </div>
        </div>
    </div>
			<?php	}	?> 
			
<div id="idManagers" style="display:none">

    <div id="idManagersContent">
        
    </div>
</div>

	
	

<style>
	.col-main {width: 55%}
	/*.col-right {width: 40%;}*/
	.action_btns {float: left;}
</style>