
    <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            <?php echo $lang['TITLE_LIST_ORDERS_CANCELED']; ?>
          </h1>
          
        </section>

       
       <section class="content">
          <div class="row">
            <div class="col-xs-12">
				
				<!-- ALERTS -->
				<?php if($_GET['y'] == '1') { ?>
				<div class="callout callout-success">
                    <h4><?php echo $lang['ALERT_ORDER_NEW']; ?></h4>
                    <p><?php echo $lang['ALERT_ORDER_NEW_TXT']; ?></p>
                  </div>
				<?php } ?>
				<?php if($_GET['y'] == '2') { ?>
				<div class="callout callout-success">
                    <h4><?php echo $lang['ALERT_ORDER_UPDATE']; ?></h4>
                    <p><?php echo $lang['ALERT_ORDER_UPDATE_TXT']; ?></p>
                  </div>
				<?php } ?>
				<?php if($_GET['y'] == '3') { ?>
				<div class="callout callout-success">
                    <h4><?php echo $lang['ALERT_ORDER_DELETE']; ?></h4>
                    <p><?php echo $lang['ALERT_ORDER_DELETE_TXT']; ?></p>
                  </div>
				<?php } ?>
				
              <div class="box">
				  
                <div class="box-header">                
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="tabela" class="table table-striped table-hover">
                    <thead>
                      <tr>
                        <th><?php echo $lang['ORDER_ID']; ?></th>
                        <th><?php echo $lang['CUSTOMER']; ?></th>
                        <th><?php echo $lang['ORDER_PAY']; ?></th>
                        <th><?php echo $lang['ORDER_TOTAL']; ?></th>
                        <th><?php echo $lang['ORDER_DATE']; ?></th>
                        <th><?php echo $lang['ACTIONS']; ?></th>
                      </tr>
                    </thead>
                    <tbody>
					<?php
 		  			$query = mysql_query("SELECT p.*, c.name AS name, c.email AS email FROM requests AS p INNER JOIN customers AS c ON p.customer = c.id WHERE p.status = 'N' ORDER BY p.id DESC");
 		  			while($result = mysql_fetch_array($query)){ 
					$ird = $result['id'];
					$q = mysql_query("SELECT SUM(amount * qtd) as amount FROM requests_tbl WHERE request = '$ird'");
 		  			$r = mysql_fetch_array($q);
					$total = $r["amount"];
					?>
		            <tr>
					
		            <td><?php echo $result['p_order']; ?><br><span class="label label-danger"><?php echo $lang['ORDER_CANCELED']; ?></span></td>
					<td><?php echo $result['name']; ?><br><small><?php echo $result['email']; ?></small></td>
					<td><?php echo $result['payment']; ?></td>
					<td><?php echo number_format($total,2,'.',''); ?></td>
					<td><?php if($lang['DATE_FORMAT'] == 'PT') { ?><?php echo data_br($result['date']); ?><?php } ?><?php if($lang['DATE_FORMAT'] == 'EN') { ?><?php echo data_en($result['date']); ?><?php } ?> <?php echo $result['hour']; ?></td>
			
					
					
		            <td width="120">
					<div class="btn-group">
                      <button type="button" class="btn btn-info btn-sm"><?php echo $lang['ACTIONS']; ?></button>
                      <button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
                        <span class="caret"></span>
                        <span class="sr-only">Toggle Dropdown</span>
                      </button>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="?mod=OrderInvoice&id=<?php echo base64_encode($result['id']); ?>"><?php echo $lang['BTN_VIEW']; ?></a></li>
                        <li><a href="?mod=OrderEdit&id=<?php echo base64_encode($result['id']); ?>&sx=N"><?php echo $lang['BTN_UPDATE']; ?></a></li>
                        <li class="divider"></li>
                        <li><a href="javascript:void(0);" onclick="javascript: if (confirm('<?php echo $lang['ALERT_BTN_DELETE']; ?>')) { window.location.href='?mod=Order&id=<?php echo base64_encode($result['id']); ?>&rft=N&action=delete' } else { void('') };"><?php echo $lang['BTN_DELETE']; ?></a></li>
                      </ul>
                    </div>
                    
                    </td>
                    
		            </tr>
					<?php } ?>
					
                    </tbody>
                    <tfoot>
                      <tr>
                        <th><?php echo $lang['ORDER_ID']; ?></th>
                        <th><?php echo $lang['CUSTOMER']; ?></th>
                        <th><?php echo $lang['ORDER_PAY']; ?></th>
                        <th><?php echo $lang['ORDER_TOTAL']; ?></th>
                        <th><?php echo $lang['ORDER_DATE']; ?></th>
                        <th><?php echo $lang['ACTIONS']; ?></th>
                      </tr>
                    </tfoot>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
       
           </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
       
       
        
        
      </div><!-- /.content-wrapper -->
   
   
   
   
