<link rel="stylesheet" href="css/font_awesome_animated.css">
<?php
include("access_cart.php");
include("include/admin.class.php");
include("include/conf.class.php");
$userinfo=$cartCore->get_user_info($CARTUSERNAME);
$cartCore->get_headder_customer();
$cartCore->view_welcome_customer($userinfo['FULL_NAME'],$userinfo['IMAGE']);
$cartCore->view_customer_sidebar($userinfo['USER_ID']);
$cartCore->view_credit($COMPANY_ID,$bk);
if(isset($_GET['invoice_id']) && $_SESSION['encrypt_invoice_id']==$_GET['invoice_id'])
{
	$INVOICE_ID=$cartCore->md5_base64_decode($_SESSION['encrypt_invoice_id']);
	$fetch_order_detail=mysql_fetch_assoc($cartCore->get_invoice_details_by_invoice_id($INVOICE_ID));
	
?>


        <!-- top navigation -->
        <div class="top_nav">
          <div class="nav_menu">
            <nav>
              <div class="nav toggle">
                <a id="menu_toggle"><i class="fa fa-bars"></i></a>
              </div>

              <ul class="nav navbar-nav navbar-right">
              
              
              <?=$cartCore->view_userprofile($userinfo['USER_ID'],$userinfo['USERNAME'],$userinfo['IMAGE'],$TOKEN_ID,$COMPANY_ID,$bk)?>

                <li role="presentation" class="dropdown">
                  <a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
                    <i class="fa fa-envelope-o"></i>
                    <span class="badge bg-green"><?=$cartAdminMain->getMessageCount($userinfo['USERNAME'])?></span>
                  </a>
                  <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
                  <?=$cartAdminMain->getUserMessage($userinfo['USERNAME'])?>
                    <li>
                      <div class="text-center">
                        <a href="message.php?token_id=<?=$TOKEN_ID?>&pid=<?=$cartCore->md5_base64_encode($userinfo['USERNAME'])?>">
                          <strong>See All Alerts</strong>
                          <i class="fa fa-angle-right"></i>
                        </a>
                      </div>
                    </li>
                  </ul>
                </li>
              </ul>
            </nav>
          </div>
        </div>
        <!-- /top navigation -->
        
        <?php 
		if(isset($_SESSION['CHECKOUT']) && $_SESSION['CHECKOUT']=="CHECKOUT")
		{ 
		?>

        <!-- 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>CheckOut <?=$_SESSION['GLOBAL_ID_FOR_TAX_SHIPPING']?><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: <?=$cartCore->view_current_date($_SESSION['GLOBAL_ID_FOR_TAX_SHIPPING']);?></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_step01($_SESSION['ITEM_ID'],$_SESSION['QUANTITY_VALUE'],$_SESSION['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><?=$_SESSION['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><?=$_SESSION['CURRENCY'].' '.$fetch_order_detail['PROMO_DEDUCTION']?></td>
                                </tr>
                                <tr>
                                  <th>Tax</th>
                                  <td><?=$_SESSION['CURRENCY'].' '.$fetch_order_detail['TAX_AMOUNT']?></td>
                                </tr>
                                <tr>
                                  <th>Shipping:</th>
                                  <td><?=$_SESSION['CURRENCY'].' '.$fetch_order_detail['SHIPPING_AMOUNT']?></td>
                                </tr>
                                <tr>
                                  <th>Total:</th>
                                  <td><?=$_SESSION['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>
                          <form action="payment_process.php?token_id=<?=$TOKEN_ID?>&invoice_id=<?=$INVOICE_ID?>" method="post">
                          <button class="btn btn-success pull-right" type="submit"><i class="fa fa-credit-card"></i> Submit Payment</button>
                          </form>
                        </div>
                      </div>
                      </div>
                    </section>

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        
         <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Terms and Condition</h4>
        </div>
        <div class="modal-body">
          <p>Some text in the modal.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
      
    </div>
  </div>
        <?php }
		
		}?>

        <!-- footer content --><?=$cartCore->get_footer();?>
        <!-- /footer content -->
      </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>