<link rel="stylesheet" href="css/font_awesome_animated.css">
<?php
include("include/db.conn.php");
include("include/admin.class.php");
include("include/conf.class.php");
$cartCore->get_headder();
if(isset($_GET['invoice_id']))
{
	$INVOICE_ID=$cartCore->md5_base64_decode($_GET['invoice_id']);
	$fetch_order_detail=mysql_fetch_assoc($cartCore->get_invoice_details_by_invoice_id($INVOICE_ID));
	
?>

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                
              </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2><small></small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

<section class="content invoice">
                      <!-- title row -->
                      <div class="row">
                        <div class="col-xs-12 invoice-header">
                          <h1>
                                          <i class="fa fa-file-text"></i> Invoice.
                                          <small class="pull-right">Date: <?=$fetch_order_detail['DATE_TIME'];?></small>
                                      </h1>
                        </div>
                        <!-- /.col -->
                      </div>
                      <!-- info row -->
                      <div class="row invoice-info">
                        <div class="col-sm-4 invoice-col">
                          From
                          <?=$fetch_order_detail['COMPANY_DETAIL']?>
                        </div>
                        <!-- /.col -->
                        <div class="col-sm-4 invoice-col">
                          To
                          <address>
                                          <strong><?=$fetch_order_detail['BILLING_FULL_NAME']?></strong>
                                          <br><?=$fetch_order_detail['BILLING_ADDRESS']?>
                                          <br><?=$fetch_order_detail['BILLING_COUNTRY']?>
                                          <br>Phone: <?=$fetch_order_detail['BILLING_TELEPHONE']?>
                                          <br>Email: <?=$fetch_order_detail['BILLING_EMAIL']?>
                                      </address>
                        </div>
                        <!-- /.col -->
                        <div class="col-sm-4 invoice-col">
                          <b>Invoice #<?=$INVOICE_ID?></b>
                          <br>
                          <br>
                          <b>Order ID:</b> 4F3S8J
                          <br>
                          <b>Payment Due:</b> 2/22/2014
                          <br>
                          <b>Account:</b> 968-34567
                        </div>
                        <!-- /.col -->
                      </div>
                      <!-- /.row -->

                      <!-- Table row -->
                      <div class="row">
                        <div class="col-xs-12 table">
                          <table class="table table-striped">
                            <thead>
                              <tr>
                              <th>Product</th>
                                <th>Price</th>
                                <th>Qty</th>
                                <th>Subtotal</th>
                              </tr>
                            </thead>
                            <tbody>
                             <?=$cartAdminMain->get_customer_order_view($fetch_order_detail['ORDER_ID'],$fetch_order_detail['CURRENCY']);?>
                             
                            </tbody>
                          </table>
                        </div>
                        <!-- /.col -->
                      </div>
                      <!-- /.row -->

                      <div class="row">
                        <!-- accepted payments column -->
                        <div class="col-xs-6">
                          <p class="lead">Payment Methods:</p>
                          <p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
                          <?php
						  if($fetch_order_detail['PAYMENT_METHOD']=='pp'){
						  ?>
                            <img src="images/visa.png" alt="Visa">
                          <img src="images/mastercard.png" alt="Mastercard">
                          <img src="images/american-express.png" alt="American Express">
                          <img src="images/paypal.png" alt="Paypal">
                          <?php
						  }
						  else if($fetch_order_detail['PAYMENT_METHOD']=='pd'){
							  echo 'Pay on Delivery';
						  }
						  else if($fetch_order_detail['PAYMENT_METHOD']=='bi'){
							  echo 'Bank Installment';
						  }
						  ?>
                          </p>
                        </div>
                        <!-- /.col -->
                        <div class="col-xs-6">
                          <p class="lead">Summary</p>
                          <div class="table-responsive">
                            <table class="table">
                              <tbody>
                                <tr>
                                  <th style="width:50%">Subtotal:</th>
                                  <td><?=$fetch_order_detail['CURRENCY'].' '.$cartCore->total_calculation_by_invoice_id($INVOICE_ID)?></td>
                                </tr>
                                <tr>
                                  <th style="width:50%">Promo Code Status</th>
                                  <td><?=$fetch_order_detail['PROMO_STATUS']?></td>
                                </tr>
                                <tr>
                                  <th style="width:50%">Promo Deduction</th>
                                  <td><?=$fetch_order_detail['CURRENCY'].' '.$fetch_order_detail['PROMO_DEDUCTION']?></td>
                                </tr>
                                <tr>
                                  <th>Tax</th>
                                  <td><?=$fetch_order_detail['CURRENCY'].' '.$fetch_order_detail['TAX_AMOUNT']?></td>
                                </tr>
                                <tr>
                                  <th>Shipping:</th>
                                  <td><?=$fetch_order_detail['CURRENCY'].' '.$fetch_order_detail['SHIPPING_AMOUNT']?></td>
                                </tr>
                                <tr>
                                  <th>Total:</th>
                                  <td><?=$fetch_order_detail['CURRENCY'].' '.$fetch_order_detail['TOTAL']?></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                        </div>
                        <!-- /.col -->
                      </div>
                      <!-- /.row -->

                      <!-- this row will not appear when printing -->
                      <div id="hiddenwhenprint">
                      <div class="row no-print">
                        <div class="col-xs-12">
                          <button class="btn btn-default" onclick="window.print();"><i class="fa fa-print"></i> Print</button>
                        </div>
                      </div>
                      </div>
                    </section>

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        
        
        <?php 
		
		}?>
      </div>
    </div>
    

    <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
      <!-- Switchery -->
    <script src="../vendors/switchery/dist/switchery.min.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
     <!-- validator -->
    <script src="../vendors/validator/validator.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
    <!-- iCheck -->
    <script src="../vendors/iCheck/icheck.min.js"></script>
    
    <script src="js/classie.js"></script>
		<script>
			(function() {
				// trim polyfill : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
				if (!String.prototype.trim) {
					(function() {
						// Make sure we trim BOM and NBSP
						var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
						String.prototype.trim = function() {
							return this.replace(rtrim, '');
						};
					})();
				}

				[].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) {
					// in case the input is already filled..
					if( inputEl.value.trim() !== '' ) {
						classie.add( inputEl.parentNode, 'input--filled' );
					}

					// events:
					inputEl.addEventListener( 'focus', onInputFocus );
					inputEl.addEventListener( 'blur', onInputBlur );
				} );

				function onInputFocus( ev ) {
					classie.add( ev.target.parentNode, 'input--filled' );
				}

				function onInputBlur( ev ) {
					if( ev.target.value.trim() === '' ) {
						classie.remove( ev.target.parentNode, 'input--filled' );
					}
				}
			})();
		</script>

	
  </body>
</html>