<?php
 include template("header"); ;echo '<div id="menu2"><a href="'; echo WEB_ROOT; ;echo '/item/index.php">继续选购</a>&nbsp;&nbsp;<a href="'; echo WEB_ROOT; ;echo '/cart/clear.php">清空购物车</a></div>

<form id="cart_order_form" action="'; echo WEB_ROOT; ;echo '/order/index.php" method="post">
<div id="fm" style="">
    
        <h2>1 填写收货信息</h2>
        <table>
            <tr><td width="200">粘贴淘宝地址</td><td><textarea name="tbaddr" style="width:400px;height:50px" onchange="tbaddress()"></textarea></td></tr>
            <tr><td>收货地址</td>
                <td>
                    <SELECT name="province" onchange="show_express(this.value)">
                        <option selected value=_NULL_>请选择...</option>
                        <option value="北京">北京</option>
                        <option value="上海">上海</option>
                        <option value="天津">天津</option>
                        <option value="重庆">重庆</option>
                        <option value="安徽">安徽</option>
                        <option value="福建">福建</option>
                        <option value="甘肃">甘肃</option>
                        <option value="广东">广东</option>
                        <option value="广西">广西</option>
                        <option value="贵州">贵州</option>
                        <option value="海南">海南</option>
                        <option value="河北">河北</option>
                        <option value="河南">河南</option>
                        <option value="黑龙江">黑龙江</option>
                        <option value="湖北">湖北</option>
                        <option value="湖南">湖南</option>
                        <option value="吉林">吉林</option>
                        <option value="江苏">江苏</option>
                        <option value="江西">江西</option>
                        <option value="辽宁">辽宁</option>
                        <option value="内蒙古">内蒙古</option>
                        <option value="宁夏">宁夏</option>
                        <option value="青海">青海</option>
                        <option value="山东">山东</option>
                        <option value="山西">山西</option>
                        <option value="陕西">陕西</option>
                        <option value="四川">四川</option>
                        <option value="西藏">西藏</option>
                        <option value="新疆">新疆</option>
                        <option value="云南">云南</option>
                        <option value="浙江">浙江</option>
                        <option value="香港">香港</option>
                        <option value="澳门">澳门</option>
                        <option value="台湾">台湾</option></SELECT>
                    <input size="50" name="address" />&nbsp;&nbsp;<label>邮编：</label><input size="10" name="zipcode" />
                </td>
            </tr>
            <tr><td>收货人姓名：</td><td><input size="20" name="real_name" /></td></tr>
            <tr><td>手机：</td><td><input size="20" name="mobile" /></td></tr>
            <tr><td>固定电话：</td><td><input size="20" name="phone" /></td></tr>
            <tr><td>订单附言：</td><td><input size="65" name="remark" /></td></tr>
        </table>
</div>
<div id="data" style="">
    <h2>2 选择配送方式</h2>
    <div class="error">请先填写完整收货地址！</div>
    <table id="express" style="display:none">
        '; foreach($sum as $one){ ;echo '        <tr><td class="source" width="200">
                提供商：<span name="name">'; echo $one['name']; ;echo '</span><br />
                地区：<span name="province">'; echo $one['province']; ;echo '</span><br />
                渠道：<span name="channel">'; echo $one['channel']; ;echo '</span></td>
            <td class="express" id="src_'; echo $one['provider_id']; ;echo '">
                <span id="'; echo $one['provider_id']; ;echo '" name="'; echo $one['province']; ;echo '"></span>
            </td>
        </tr>
        '; } ;echo '    </table>
    <h2>3 确认所购产品</h2>
    <table border="0">
        <thead><tr><th>序号</th><th>款号</th><th>类别</th><th>尺码</th><th>数量</th><th>单重g</th><th>总重g</th><th>吊牌价</th><th>折扣</th><th>折扣价</th></tr></thead>
        '; if(is_array($cart)){foreach($cart AS $index=>$one) { ;echo '        '; if($one['provider_id']<>$provider_id) {
            $provider_id = $one['provider_id'];
            
            
            $sum_one = array_shift($sum);
        ;echo '        <tr class="provider">
            <td colspan="12">'; echo "提供商：".$sum_one['name']."&nbsp;&nbsp;渠道：".$sum_one['channel']."&nbsp;&nbsp;地区：".$sum_one['province']; ;echo '            <span id="provider_'; echo $provider_id; ;echo '">
                重量小计：<span name="sum_weight">'; echo $sum_one['sum_weight']; ;echo '</span>&nbsp;&nbsp;
                金额小计：<span name="sum_money">'; echo $sum_one['sum_money']; ;echo '</span>
                运费小计：<span name="sum_express"></span>
            </span></td>
        </tr>
        '; } ;echo '        <tr id="item_'; echo $one['id']; ;echo '" onmouseover="cart_item_over(\'item_'; echo $one['id']; ;echo '\')" onmouseout="cart_item_out(\'item_'; echo $one['id']; ;echo '\')">
            <td name="id">'; echo $one['id']; ;echo '</td>
            <td name="item_number">'; echo $one['item_number']; ;echo '</td>
            <td name="category_name">'; echo $one['category_name']; ;echo '</td>
            <td name="size">'; echo $one['size']; ;echo '</td>
            <td name="quantity">'; echo $one['quantity']; ;echo '</td>
            <td name="weight" id="item_'; echo $one['id']; ;echo '_weight">'; echo $one['weight']; ;echo '</td>
            <td name="weight_sum" id="item_'; echo $one['id']; ;echo '_weight_sum">'; echo $one['weight']*$one['quantity']; ;echo '</td>
            <td name="origin">'; echo $one['origin']; ;echo '</td>
            <td name="discount">'; echo $one['discount']; ;echo '</td>
            <td name="price">'; echo mceil($one['discount']*$one['origin']); ;echo '</td>
        </tr>
        '; }} ;echo '        <tr><td colspan="12" align="right">
                <h2 id="cart_sum">总重：<span id="cart_sum_weight">'; echo $sum1['sum_weight']; ;echo '</span>克&nbsp;&nbsp;
                    金额：<span id="cart_sum_money">'; echo $sum1['sum_money']; ;echo '</span><br />
                    运费：<span id="cart_sum_express">0</span><br />
                    总金额：<span id="cart_tsum_money"></span>
                </h2>
                '; echo $pagestring; ;echo '</td></tr>
    </table>
</div>
</form>
<div id="op">
    <h2>[&nbsp;<a href="javascript:cart_order()">确认下单</a>&nbsp;]</h2>
    <div>'; include template("express"); ;echo '</div>
</div>
<div id="help">help</div>
'; include template("footer"); ?>
