<style>
    @media (min-width: 200px) {
        .Profile-container{
            padding:0px 0px;
        }
    }
    @media (min-width: 600px) {
        .Profile-container{
            padding:5% 5%;
        }
    }
    @media (min-width: 990px) and (max-width: 1799px) {
        .Profile-container{
            padding:0% 10%;
        }
    }

    @media (min-width: 1800px) {


        .Profile-container{
            padding:0px 15%;
        }
    }

    .Profile-order{

        background-color:#f6f6f6;
        padding:5px;
        border:1px solid #e0e0e0;
        position:relative;
        box-sizing: border-box;
        float:inherit;
        font-size:15px;
    }

    .Profile-title-xs{

        background-color:#D8FAFF;
        padding:10px;
        border:1px solid #e0e0e0;
        position:relative;
        box-sizing: border-box;
        float:inherit;
        font-size:15px;
        font-weight:bold
    }

    .Profile-info-xs{

        background-color:#f6f6f6;
        padding:10px;
        border:1px solid #e0e0e0;
        position:relative;
        box-sizing: border-box;
        float:inherit;
        font-size:15px;
    }


    .Profile{
        margin:20px 0px;
    }

    .Profile-list-xs{
        padding:0px 0px;
        margin-bottom:10px}

    .Profile-xs{
        margin:20px 0px;
        padding:0px 0px
    }


    .table-l{
        font-size:15px;
        width:40%;
        font-weight:bold
    }

    .table-mar{
        font-size:15px;
        width:60%;
    }

    .table-m{
        font-size:15px;
        width:40%;
    }

    .table-r{
        font-size:15px;
        width:40%;
    }

    .Profile-in-r{
        background:#FFFFFF;
        border:1px solid #e0e0e0;
        border-radius: 5px;
    }

    .rp-info{
        padding:20px 0px;
    }



    /*@media (min-width: 200px) {
    .btn-center{
            padding:20px 18%;
    }
    }
    @media (min-width: 600px) and (max-width: 990px) {
    .btn-center{
            padding:20px 37%;
    }
    }
    @media (min-width: 990px) and (max-width: 1799px) {
    .btn-center{
            padding:20px 42%;
    }
    }

    @media (min-width: 1800px) {

    .btn-center{
            padding:20px 45%;
    }
    }*/


</style>


<?php
if (isset($_SESSION["username"])) {
	$query = "select * from orders where username='" . mysqlSecurity($conn, $_SESSION["username"]) . "' and record='" . mysqlSecurity($conn, $_GET["order"]) . "' and `status` != 'delete';";
	$result = mysqli_query($conn, $query);
	$row = mysqli_fetch_assoc($result);

	if ($row["status"] == 'bank') {
		$status = '銀行轉賬';
		$status1 = '準備中';
		$status2 = '準備中';
	}
	if ($row["status"] == 'perpare') {
		$status = 'PayPal';
		$status1 = '準備中';
		$status2 = '準備中';
	}
	if ($row["status"] == 'doing') {
		$status = 'PayPal';
		$status1 = '已完成';
		$status2 = '準備中';
	}
	if ($row["status"] == 'bank doing') {
		$status = '銀行轉賬';
		$status1 = '已完成';
		$status2 = '準備中';
	}
	if ($row["status"] == 'bank done') {
		$status = 'PayPal';
		$status1 = '已完成';
		$status2 = '已有帳單';
	}
	if ($row["status"] == 'paypal done') {
		$status = '銀行轉賬';
		$status1 = '已完成';
		$status2 = '已有帳單';
	}

	echo '
  <div class="Profile-container" style="padding:0px 0px !important">

      <div  role="tabpanel" class="Profile-all col-lg-12 col-md-12 col-sm-12 col-xs-12" id="Profile"  style="padding:0px 0px">
      <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style=" padding:0px 0px">
                <div class="Profile col-lg-6 col-md-6 col-sm-12 hidden-xs">
  <strong><h1>訂單資訊</h1></strong>
                <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">

                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            訂單日期和時間
                            </td>
                            <td class="table-mar">
                            ' . $row["time"] . '
                            </td>

                        </tr>
                        </table>
               		</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            訂單編號
                            </td>
                            <td class="table-mar">
                            ' . $row["paypal id"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            用戶名稱
                            </td>
                            <td class="table-mar">
                            ' . $row["username"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            付款方式
                            </td>
                            <td class="table-mar">
                            ' . $status . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            付款狀態
                            </td>
                            <td class="table-mar">
                            ' . $status1 . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            送貨狀態
                            </td>
                            <td class="table-mar">
                            ' . $status2 . '
                            </td>

                        </tr>
                        </table>
                	</div>

                </div>
      </div>
                <div class="Profile-xs hidden-lg hidden-md hidden-sm col-xs-12">
  <strong><h1>訂單資訊</h1></strong>
                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                訂單日期和時間
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["time"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                訂單編號
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["paypal id"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                用戶名稱
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["username"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                付款方式
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $status . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                付款狀態
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $status1 . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                送貨狀態
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $status2 . '
                </div>
				</div>
                </div>


                </div>




                <div class="Profile col-lg-6 col-md-6 col-sm-12 hidden-xs">
  <strong><h1>訂貨人資料</h1></strong>
                <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">

                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            客戶名
                            </td>
                            <td class="table-mar">
                            ' . $row["customer Fname"] . '
                            </td>

                        </tr>
                        </table>
               		</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            客戶姓
                            </td>
                            <td class="table-mar">
                            ' . $row["customer Lname"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            客戶電郵
                            </td>
                            <td class="table-mar">
                            ' . $row["customer email"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            客戶電話
                            </td>
                            <td class="table-mar">
                            ' . $row["customer phone"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            帳單地址
                            </td>
                            <td class="table-mar">
                            ' . $row["customer address"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            公司名稱
                            </td>
                            <td class="table-mar">
                            ' . $row["company name"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                </div>

                <div class="Profile-xs hidden-lg hidden-md hidden-sm col-xs-12">
  <strong><h1>訂貨人資料</h1></strong>
                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                客戶名
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["customer Fname"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                客戶姓
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["customer Lname"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                客戶電郵
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["customer email"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                客戶電話
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["customer phone"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                帳單地址
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["customer address"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                公司名稱
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["company name"] . '
                </div>
				</div>
                </div>

                </div>


                <div class="Profile col-lg-6 col-md-6 col-sm-12 hidden-xs" style="float:right">
  <strong><h1>收件人資料</h1></strong>
                <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">

                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            收件人中文名字
                            </td>
                            <td class="table-mar">
                            ' . $row["recipient Fname"] . '
                            </td>

                        </tr>
                        </table>
               		</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            收件人中文姓氐
                            </td>
                            <td class="table-mar">
                            ' . $row["recipient Lname"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            收件人電郵
                            </td>
                            <td class="table-mar">
                            ' . $row["email"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            收件人電話
                            </td>
                            <td class="table-mar">
                            ' . $row["phone"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            收件人地址
                            </td>
                            <td class="table-mar">
                            ' . $row["address"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            送貨日期
                            </td>
                            <td class="table-mar">
                            ' . $row["delivery date"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            送貨時間
                            </td>
                            <td class="table-mar">
                            ' . $row["delivery time"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                    <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr>
                            <td class="table-l">
                            備註
                            </td>
                            <td class="table-mar">
                            ' . $row["remarks"] . '
                            </td>

                        </tr>
                        </table>
                	</div>

                </div>

                <div class="Profile-xs hidden-lg hidden-md hidden-sm col-xs-12">
  <strong><h1>參加人資料</h1></strong>
                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                參加人中文名字
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["recipient Fname"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
				參加人中文姓氐
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["recipient Lname"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                參加人電郵
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["email"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                參加人電話
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["phone"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                參加人地址
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["address"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                送貨日期
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["delivery date"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                送貨時間
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["delivery time"] . '
                </div>
				</div>
                </div>

                <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                備註
                </div>
				</div>
                <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div>
                ' . $row["remarks"] . '
                </div>
				</div>
                </div>


                </div>';

	//$sql = "select * from bought_item where paypal_id = '".$row["paypal id"]."' and username = '".$row["username"]."'";
	$sql = "select * from bought_item where paypal_id = '" . $row["paypal id"] . "'";
	$query = mysqli_query($conn, $sql);
	$delivery_fee_count = 0;
	if (mysqli_num_rows($query) > 0) {
		echo '
			<div class="Profile col-lg-12 col-md-12 col-sm-12 hidden-xs" style="float:right">
  				<strong><h1>訂單摘要</h1></strong>

                	<div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr class="OS-top"  style="font-weight:bold">
                            <td class="OS-top-pn col-lg-6 col-md-6 col-sm-6 col-xs-6">
                            產品名稱
                            </td>
                            <td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">
                            單價
                            </td>
                            <td class="OS-top-q  col-lg-2 col-md-2 col-sm-2 col-xs-2">
							數量
                            </td>
                            <td class="OS-top-s  col-lg-2 col-md-2 col-sm-2 col-xs-2">
                            小計
                        </tr>
                        </table>
               		</div>
					';
		while ($row2 = mysqli_fetch_assoc($query)) {
			echo '<div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12" style="background-color:#FBFBFB !important">
                    <table width="100%" bgcolor="#F1F1F1">';
			echo '<tr class="OS-top">';
			echo '<td class="OS-top-pn col-lg-6 col-md-6 col-sm-6 col-xs-6">';
			echo $row2["product_name"];
			echo "</td>";
			echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">';
			echo "HK$" . $row2["price"];
			echo "</td>";
			echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">';
			echo $row2["amount"];
			echo "</td>";
			$amount = $row2["amount"] * $row2["price"];
			echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">HK$' . $amount . "</td>";
			echo "</tr>";
			$delivery_fee_count = $delivery_fee_count + ($row2["amount"] * $row2["price"]);
			echo '                        </table>
               		</div>';
		}
		/* if($delivery_fee_count<=800){
			          $delivery_fee_count=$delivery_fee_count+48;
			          echo'<div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12" style="background-color:#FBFBFB !important">
			          <table width="100%" bgcolor="#F1F1F1">';
			          echo '<tr class="OS-top">';
			          echo '<td class="OS-top-pn col-lg-6 col-md-6 col-sm-6 col-xs-6">';
			          echo "運費2";
			          echo "</td>";
			          echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">';
			          echo "HK$48";
			          echo "</td>";
			          echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">';
			          echo "1";
			          echo "</td>";
			          echo '<td class="OS-top-up col-lg-2 col-md-2 col-sm-2 col-xs-2">HK$48</td>';
			          echo "</tr>";
			          echo '                        </table>
			          </div>';

		*/
		if ($row["coupon_code"] != NULL) {
			echo '<div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12" style="background-color:#FBFBFB !important">
                    <table width="100%" bgcolor="#F1F1F1">';
			echo '<tr class="OS-top"  style="font-weight:bold">';
			echo '<td>';
			echo "&nbsp;&nbsp;&nbsp;使用了贈券" . $row["coupon_name"];
			echo "</td>";
			echo "</tr>";
			echo '                        </table>
               		</div>';
		}
		echo '  <div class="Profile-order col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%">
                    	<tr class="OS-top"  style="font-weight:bold">
                            <td class="OS-top-pn col-lg-8 col-md-8 col-sm-8 col-xs-8">' . "總計</td>" . '                            <td class="OS-top-s  col-lg-4 col-md-4 col-sm-4 col-xs-4">' . "
HK$" . $delivery_fee_count . "</td>
				  </tr>";
		echo "</table></div></div>";
	}

//small order detail
	//$sql = "select * from bought_item where paypal_id = '".$row["paypal id"]."'  and username = '".$row["username"]."'";
	$sql = "select * from bought_item where paypal_id = '" . $row["paypal id"] . "'";
	$query = mysqli_query($conn, $sql);
	$delivery_fee_count = 0;
	if (mysqli_num_rows($query) > 0) {
		echo '
<div class="Profile-xs hidden-lg hidden-md hidden-sm col-xs-12">
	<strong><h1>訂單詳細</h1></strong>
    <div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-xs-7" style="padding:0px 0px">
            產品
            </div>
            <div class="col-xs-2" style="padding:0px 0px">
            數量
            </div>
            <div class="col-xs-3" style="padding:0px 0px; text-align:right">
            單價
            </div>
        </div>
					';
		while ($row2 = mysqli_fetch_assoc($query)) {
			echo '
        <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-xs-7" style="padding:0px 0px">
                ' . $row2["product_name"] . '
            </div>
            <div class="col-xs-2" style="padding:0px 0px">
                ' . $row2["amount"] . '
            </div>
				<div class="col-xs-3" style="padding:0px 0px; text-align:right">
                HK$' . $row2["price"] . '
            </div>
        </div>
';
		}
		if ($delivery_fee_count <= 800) {
			$delivery_fee_count = $delivery_fee_count + 48;
			echo '
				<div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="col-xs-7" style="padding:0px 0px">
				運費
				</div>
				<div class="col-xs-2" style="padding:0px 0px">
				1
				</div>
				<div class="col-xs-3" style="padding:0px 0px; text-align:right">
				HK$48
                </div>
                </div>
';
		}
		if ($row["coupon_code"] != NULL) {
			echo '<div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <table width="100%" bgcolor="#F1F1F1">';
			echo '<tr class="OS-top"  style="font-weight:bold">';
			echo '<td>';
			echo "&nbsp;&nbsp;&nbsp;使用了贈券" . $row["coupon_name"];
			echo "</td>";
			echo "</tr>";
			echo '</table>
               		</div>';
		}

		echo '</div>';

		echo '
<div class="Profile-list-xs col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align:right">
        <div class="Profile-title-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div>
            	總計
            </div>
        </div>
        <div class="Profile-info-xs col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div>
            	' . "HK$" . $delivery_fee_count . '
            </div>
        </div>
    </div>
';

		echo '</div>';
	}
//end

	echo "</div></div>";
}
?>

