<?php defined('BASEPATH') OR exit('No direct script access allowed');?>
<!-- Customer js php -->
<script src="<?php echo base_url() ?>my-assets/js/admin_js/json/customer.js.php"></script>
<!-- Product invoice js -->
<script src="<?php echo base_url() ?>my-assets/js/admin_js/json/product_invoice.js.php"></script>
<!-- invoice js -->
<script src="<?php echo base_url() ?>my-assets/js/admin_js/invoice.js" type="text/javascript"></script>
<!-- page css -->
<link rel="stylesheet" href="<?php echo MOD_URL . 'dashboard/assets/css/order/add_order_form.css' ?>">

<!-- Add new order start -->
<div class="content-wrapper">
    <section class="content-header">
        <div class="header-icon">
            <i class="pe-7s-note2"></i>
        </div>
        <div class="header-title">
            <h1><?php echo display('order') ?></h1>
            <small><?php echo '運費計算系統'; ?></small>
            <ol class="breadcrumb">
                <li><a href="#"><i class="pe-7s-home"></i> <?php echo display('home') ?></a></li>
                <li><a href="#"><?php echo display('order') ?></a></li>
                <li class="active"><?php echo display('order') ?></li>
            </ol>
        </div>
    </section>

    <section class="content">
        <!-- Alert Message -->
        <?php
$message = $this->session->userdata('message');
if (isset($message)) {
	?>
            <div class="alert alert-info alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <?php echo $message ?>
            </div>
            <?php
$this->session->unset_userdata('message');
}
$error_message = $this->session->userdata('error_message');
if (isset($error_message)) {
	?>
            <div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <?php echo $error_message ?>
            </div>
            <?php
$this->session->unset_userdata('error_message');
}
?>



        <!-- transportation charge -->
        <div class="row" style="min-height: 800px;">
            <div class="col-sm-12">
                <div class="panel panel-bd lobidrag">
                    <div class="panel-heading">
                        <div class="panel-title">
                            <h4><?php echo '運費計算系統'; ?></h4>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-8" id="payment_from_1">
                             <!-- content -->
                                        <script type="text/javascript">

/* <![CDATA[ */

    var price=[];
    var shipping=[];
    var total=price+shipping;

    function calculateShipping(){


    if (price <= 25){
    shipping = (price + 1.5);
    }
    else {
    shipping = (price * 10 / 100);
    }
    if(document.getElementById("long").value== ""){
        alert("謮輸入長度cm");
    }
    else if(document.getElementById("width").value== ""){
        alert("謮輸入闊度cm");
    }
    else if(document.getElementById("height").value== ""){
        alert("謮輸入高度cm");
    }
    else if(document.getElementById("weight").value== ""){
        alert("謮輸入重量kg");
    }
    var fee = (document.getElementById("long").value *document.getElementById("width").value * document.getElementById("height").value * document.getElementById("weight").value ) *100 /10000000;


    document.getElementById("fee").value  = parseInt(fee);
}
/* ]]> */
</script>
                                        <form name ="calculate" action="" >
<p>輸入貨品資料</p>

<p>長(cm)<input type="text" name="long" id="long" ></p>
<p>闊(cm)<input type="text" name="width" id="width" ></p>
<p>高(cm)<input type="text" name="height"  id="height"></p>
<p>重量(kg)<input type="text" name="weight"  id="weight"></p>
<input type="button" name="button" value="提交" onClick="calculateShipping()" />
</form>
<br>
<br>
<p>運費HK$<input type="text" name="fee"  id="fee"></p>
                                        <!-- end content -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- end transportation charge -->


    </section>
</div>
<!-- Add Order End -->

