<?php
 include template("header"); ;echo '<div id="menu2"><a href="#">小菜单</a></div>
<div id="data">
    <h2>销售排行</h2>
    <table>
        <thead><tr><td>产品排行</td><td>供货商排行</td><td>代理排行</td></tr></thead>
        <tbody>
            <tr>
                <td rowspan="3" width="33%">
                    <table class="analysis">
                        <thead><tr><th>序号</th><th>款号</th><th>吊牌价</th><th>销售数量</th></tr></thead>
                        <tbody>
                            '; if(is_array($item_sale_rank)){foreach($item_sale_rank AS $index=>$one) { ;echo '                            <tr><td>'; echo ++$index;;echo '</td>
                                <td>'; echo $one['item_number']; ;echo '</td>
                                <td>'; echo $one['origin']; ;echo '</td>
                                <td>'; echo $one['q']; ;echo '</td>
                            </tr>
                            '; }};echo '                        </tbody>
                    </table>
                </td>
                <td rowspan="3" width="33%">
                    <table class="analysis">
                        <thead><tr><th>序号</th><th>用户名</th><th>真实名</th><th>销售额</th><th>销售数量</th></tr></thead>
                        <tbody>
                            '; if(is_array($user_rank)){foreach($user_rank AS $index=>$one) { ;echo '                            <tr><td>'; echo ++$index;;echo '</td>
                                <td>'; echo $one['username']; ;echo '</td>
                                <td>'; echo $one['realname']; ;echo '</td>
                                <td>'; echo $one['o']; ;echo '</td>
                                <td>'; echo $one['q']; ;echo '</td>
                            </tr>
                            '; }};echo '                        </tbody>
                    </table>
                </td>
                <td width="34%">
                    <table class="analysis">
                        <thead><tr><th>序号</th><th>供货商</th><th>渠道</th><th>销售额</th><th>销售数量</th></tr></thead>
                        <tbody>
                            '; if(is_array($provider_rank)){foreach($provider_rank AS $index=>$one) { ;echo '                            <tr><td>'; echo ++$index;;echo '</td>
                                <td>'; echo $one['name']; ;echo '</td>
                                <td>'; echo $one['channel']; ;echo '</td>
                                <td>'; echo $one['o']; ;echo '</td>
                                <td>'; echo $one['q']; ;echo '</td>
                            </tr>
                            '; }};echo '                        </tbody>
                    </table>
                </td>
            </tr>
            <tr><th>统计汇总</th></tr>
            <tr><td>财务总收入：'; echo $total[0]['money'];;echo '&nbsp;&nbsp;财务总支出：'; echo $total[1]['money'];;echo '<br />
                    收支差：'; echo $total[0]['money']-$total[1]['money'];;echo '&nbsp;&nbsp;用户余额：'; echo $total[2]['money'];;echo '                </td></tr>
        </tbody>
    </table>
</div>
<div id="fm">
    <h2>标题</h2>
    <form id="login-user-form" method="post" action="/account/login.php" class="validator">
    </form>
</div>
<div id="op">
    <h2>操作部分</h2>
</div>
<div id="help">help</div>
'; include template("footer"); ?>
