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

	<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-trash-o"></i> Trash Item</h3>
      </div>
	  <form action="it-store.php" method="post">
	  <input type="hidden" name="item_id"  value="<?php echo $itemData->item_id; ?>">
		<div class="modal-body">
			<div class="row">
				<div class="col-sm-12">
					<?php if($itemData->stock_level>0): ?>
					<div class="alert alert-info"> Info: This Item cannot be deleted. Stock is more than 0</div>
					<?php else: ?>
					<div class="alert alert-danger"> Warning: Are sure you want to trash this item?</div>
					<?php endif; ?>
				</div> <!-- /.col -->					
			</div>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
			<?php if($itemData->stock_level==0): ?>
			<button type="submit" name="delete-item" class="btn btn-primary">Yes, trash item</button>
			<?php endif; ?>
		</div>
		</div>
	  </form>
