<?php echo $header; ?>
<div id="content"><?php echo $content_top; ?>
  <div id="breadcrumb">
  <div class="container">
    <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
    </div>

  </div>
</div>
<div id="group-content">
<div>
<div id="content"><?php echo $content_top; ?>
  
  <h1 class="title-category"><?php echo $heading_title; ?></h1>
  <?php if(isset($text_recover_data)){ ?>
  <table class="list">
    <thead>
      <tr>
        <td class="left"><?php echo $text_order_detail; ?></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="left" style="position:relative;">
          <div style="max-width: calc(96% - 40px);">
            <?php echo $text_recover_data ; ?>
            <br/>          
            <?php echo $text_recover_products ; ?>
            <br/>          
            <?php echo $text_order_total.$total; ?>            
          </div>
          <div class="right" style="position: absolute; right: 5px; bottom: 50%; transform: translate(0,50%);">            
            <a href="<?php echo $hrefrecover; ?>" title="<?php echo $button_recover; ?>" alt="<?php echo $button_recover; ?>" ><i class="fa fa-shopping-cart recover-list" aria-hidden="true"></i></a>      	
          </div>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
 
		<script>			
			function onAction(prodid, v1) {			 
				 var valor = $("input[name=quantity_"+prodid+"]").val();
				 
				if ((valor > 1) || (parseInt(v1, 10) == 1)){
					$("input[name=quantity_"+prodid+"]").val(parseInt( valor, 10 ) + parseInt(v1, 10));
				}			 				  
			};	
			
			function carrinhoAdd(prodid){	
			 var valor = $("input[name=quantity_"+prodid+"]").val();
			 addToCart(prodid, valor);			
			}
		</script>	
	
	<style>
	
	.t-medium{
		padding: 7px !important;
		background-color: #F6F6F6 !important;
	}
	
	</style>

	 <!-- TABLE -->
<?php foreach ($products as $product) { ?>
<table class="table table-action list">
  
  <thead>
    <tr>
    <th class="t-medium"><?php echo $column_name; ?></th>
    <th class="t-medium"><?php echo $column_model; ?></th>
	  <th class="t-medium"><?php echo $column_quantity; ?></th>
	  <th class="t-medium"><?php echo $column_price; ?></th>
	  <th class="t-medium right"><?php echo $column_repurchase; ?></th>	  
    </tr>
  </thead>
  
  <tbody>
    <tr>
	  <td class="fix"></td>	  
	  <td class="info_responsive"><b><?php echo $column_name; ?></b></td>
	  <td><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></td>      
	  <td class="info_responsive"><b><?php echo $column_model; ?></b></td>
	  <td><?php echo  $product['model']; ?></td>      
	  <td class="info_responsive"><b><?php echo $column_quantity; ?></b></td>
	  <td class="quantidade">		
			<input type="button" id="decrease_<?php echo $product['product_id']; ?>" value="-"  onclick="javascript:onAction('<?php echo $product['product_id']; ?>', -1, 'af');" style="width:20px; text-indent:0px;" />
			<input type="text" name="quantity_<?php echo $product['product_id']; ?>" style="width:35px;" size="2" value="<?php echo $product['quantity']; ?>" class="numeric">
			<input type="button" id="increase_<?php echo $product['product_id']; ?>" value="+" onclick="javascript:onAction('<?php echo $product['product_id']; ?>', 1, 'af');" style="width:20px; text-indent:0px;"/>											
	  </td>	  
	  <td class="info_responsive"><b><?php echo $column_price; ?></b></td>
	  <td class="preco"><?php echo $product['price']; ?></td>	  
	  <td class="info_responsive"><b><?php echo $column_repurchase; ?></b></td>
	  <td class="pedido-total right">
      <div style="margin:5px;">
        <a onclick="carrinhoAdd('<?php echo $product['product_id']; ?>');" title="<?php echo $button_recover_item; ?>" ><i class="fa fa-shopping-cart recover-list" aria-hidden="true"></i></a>      	      	 		    
      </div>     
	  </td>	  
	  <?php } ?>
	  </tr>	      
		<td class="fix-margin"></td>
  </tbody>
</table>
<?php }else{ ?>       
<!-- END TABLE -->
  <div class="content"><?php echo $text_empty_info; ?></div>  
  
<?php } ?>     
  <div class="buttons">
    <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
  </div>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?> 