<?php
include_once 'includes/processes.php';
$Process = new Login_Process;
$pageLink = basename($_SERVER['REQUEST_URI']);
$Process->check_status($pageLink);
$assetData = $Process->getAssetInfo($_GET['asset_id']);

$assetLocation = $Process->getLocationInfo($assetData->user_location);
$locationName = $assetLocation->location_name;

?> 
  
  
	<div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3 class="modal-title"><i class="fa fa-ticket"></i> View Asset</h3>
    </div>
	  <form action="asset.php" method="post">
	  <input type="hidden" name="asset_id" value="<?php echo $assetData->asset_id;  ?>" />
		<div class="modal-body">
			<div class="row">
			
				<div class="col-sm-12">
				
					<table class="table table-striped table-bordered table-hover">
						<tbody>
							<tr>
								<td>Asset User.</td>
								<td><?php echo $assetData->asset_user;  ?></td>
							</tr>
							<tr>
								<td>User Designation</td>
								<td><?php echo $assetData->designation;  ?></td>
							</tr>
							<tr>
								<td>Location</td>
								<td>
									<?php echo $locationName; ?>
								</td>
							</tr>
							<tr>
								<td>Device</td>
								<td>
									<?php 
										$deviceData = $Process->getDeviceInfo($assetData->device_id);
										echo $deviceData->device_name;
									?>
								</td>
							</tr>
							<tr>
								<td>Brand</td>
								<td>
									<?php 
										$brandData = $Process->getBrandInfo($assetData->brand_id);
										echo $brandData->brand_name;
									?>
								</td>
							</tr>
							<tr>
								<td>Brand</td>
								<td><?php echo $assetData->model_product_no;  ?></td>
							</tr>
							<tr>
								<td>Asset Tag</td>
								<td><?php echo $assetData->asset_tag;  ?></td>
							</tr>
							<tr>
								<td>Tagging No</td>
								<td><?php echo $assetData->tagging_no;  ?></td>
							</tr>
							<tr>
								<td>Date Requested</td>
								<td><?php echo $assetData->date_requested;  ?></td>
							</tr>
							<tr>
								<td>Date Received</td>
								<td><?php echo $assetData->date_received;  ?></td>
							</tr>
							<tr>
								<td>Date Issued</td>
								<td><?php echo $assetData->date_issued;  ?></td>
							</tr>
							<tr>
								<td>Status</td>
								<td><?php echo $assetData->asset_status;  ?></td>
							</tr>
							<tr>
								<td>Remarks</td>
								<td><?php echo $assetData->remarks;  ?></td>
							</tr>
							<tr>
								<td>Registered by</td>
								<td>
									<?php 
										$userData = $Process->getUserInfo($assetData->userid);
										echo $userData->firstname . " " . $userData->lastname;
									?>
								</td>
							</tr>
						</tbody>
					</table>
					
				</div>
			</div>			
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-xs btn-danger" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
		</div>
	  </form>
    </div><!-- /.modal-content -->