<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="author" content="HANCHAO"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<?php $csscommon="/Public/bootstrap/css/bootstrap.min.css" ?>
<?php $csscommon.="|/Public/HanChaoUI/css/hanchaoui.css" ?>
<?php $CSSARR[]=THEME_PATH."/common/css/main.css" ?>
<?php $CSSARR[]="/Public/HanChaoUI/css/weebox.css" ?>
<link rel="stylesheet" href="<?php echo min_css($CSSARR,$csscommon);?>" media="all"/>
<?php $jscommon="/Public/script/jquery.min.js" ?>
<?php $jscommon.="|/Public/bootstrap/js/bootstrap.min.js" ?>
<?php $JSARR['min2']=THEME_PATH."/common/js/common.js" ?>
<?php $JSARR['min3']="/Public/HanChaoUI/js/weebox.js" ?>
<script language="javascript">var URL = '/admin.php?s=/share_bonus/';var THEME_COLOR = '';var ROOT_PATH = '/';var APP   =   '/admin.php?s=/';var CONTROLLER_NAME   =   '<?php echo (CONTROLLER_NAME); ?>';var THEME_PATH   =   '<?php echo (TPL_PATH); ?>/';</script>
<script type="text/javascript" src="<?php echo min_js($JSARR,$jscommon);?>"></script><!--[if IE]>
<link href="/Public/bootstrap/css/bootstrap.ie.css" rel="stylesheet" type="text/css"/>
 <script src="/Public/bootstrap/js/html5shiv.js"></script>
<![endif]-->
<script language="javascript">
$(function($){
    $(window.parent.document).find('#loading').hide();
    var topid='<?php echo ($_GET['topid']); ?>';
    var leftid='<?php echo ($_GET['leftid']); ?>';
    changemenu(topid,leftid);
});
function changemenu(topid,leftid){
    if(!topid && !leftid)return false;
    if(topid)parent._OPENleft(topid);
    if(leftid){
        $(window.parent.document).find('#_OPENright'+leftid).parent().prev().click();
        $(window.parent.document).find('#_OPENright'+leftid+' a').click();
    }
}
</script>
<title><?php echo (L("website_manage")); ?>Powered by hanchao</title>
</head>
<body><?php if(!empty($big_menu)): ?><div class="pad-lr-10 col-sm-12">
    <div class="btn-handle mt15">
   <?php if(is_array($big_menu)): foreach($big_menu as $k=>$vo): ?><a class="btn <?php if(!empty($menu_hover)): if(in_array(($k), is_array($menu_hover)?$menu_hover:explode(',',$menu_hover))): ?>btn-primary<?php else: ?>btn-default<?php endif; ?>                
   <?php else: ?>btn-primary<?php endif; ?>" href="<?php echo (isset($vo)?$vo:''); ?>"><?php echo (isset($k)?$k:''); ?></a>&nbsp;&nbsp;<?php endforeach; endif; ?>
    </div>
</div><?php endif; ?>
<script type="text/javascript" src="/Public/script/MyDate/WdatePicker.js"></script><link rel="stylesheet" type="text/css" href="/Application/Runtime/statics/8999a4c51e95f631f78fa62c32848b0f.css" /><script type="text/javascript" src="/Application/Runtime/statics/da4547ebabb36936d20998af40fc53ce.js"></script><script type="text/javascript">$(function(){$("#myform").Validform({tiptype:3});})</script>
<div class="pad-lr-10 col-sm-12">
    <div class="mt15">
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active">
                <a href="#group_common" data-toggle="tab">团队分红</a>
            </li>
        </ul>
    </div>
    <div class="cont_hanchao pd15 tab-content" id="group_common">
        <div class="prompt_div bg-info mt15" id="explanation">
            <p class="text-primary" id="checkZoom" ><i class="glyphicon glyphicon-bell mr5"></i>温馨提示<span id="explanationZoom" title="收起提示"></span></p>
            <ul>
                <li><i>·</i>指定时间段内的会员分红明细</li>
            </ul>
        </div>
        <?php if(!empty($list)): ?><form name="searchform" action="<?php echo U('share');?>" method="POST" >
        <?php else: ?>
            <form name="searchform" action="/admin.php?s=/share_bonus/index" method="POST" ><?php endif; ?>
                <div class="toolbars-hanchao mt15 clearfix">
                    <?php if(!empty($list)): ?><div>分红金额：<input name="money" value="<?php echo (isset($money)?$money:''); ?>" type="text" class="form-control w130" /></div>
                        <input type="hidden" name="start_time" value="<?php echo (isset($start_time)?$start_time:''); ?>">
                        <input type="hidden" name="end_time" value="<?php echo (isset($end_time)?$end_time:''); ?>">
                    <?php else: ?>
                        <div>下单时间：<input class="Wdate form-control w110" name="start_time" type="text" id="start_time" size="20" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'end_time\')}'})" value="<?php echo (isset($start_time)?$start_time:''); ?>"> - <input class="Wdate form-control w110" name="end_time" type="text" id="end_time" size="20" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'start_time\')}'})" value="<?php echo (isset($end_time)?$end_time:''); ?>"></div><?php endif; ?>
                    <div><button type="submit" class="btn btn-primary"><?php if(!empty($list)): ?>发放<?php else: ?>下一步<?php endif; ?></button></div>
                </div>
            </form>
        <?php if(!empty($list)): ?><table class="table table-hover table-hanchao mt15 table-bordered">
                <thead>
                <tr>
                    <th width="100">订单总数</th>
                    <th width="100">营业总额</th>
                    <th width="100">总利润</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><?php echo (isset($num)?$num:''); ?></td>
                    <td><?php echo (format_price($goodsmoney)); ?></td>
                    <td><?php echo (format_price($profit)); ?></td>
                </tr>
                </tbody>
            </table>
            <table class="table table-hover table-hanchao mt15 table-bordered">
                <thead>
                <tr>
                    <th width="60"><?php echo orderurl('LAN_ID','id');;?></th>
                    <th width="150"><?php echo orderurl('会员名称','uid');;?></th>
                    <th width="110"><?php echo orderurl('等级权重','rank_weight');;?></th>
                    <th width="160"><?php echo orderurl('团队业绩权重','t_weight');;?></th>
                    <th width="160"><?php echo orderurl('个人业绩权重','g_weight');;?></th>
                    <th width="110"><?php echo orderurl('总权重','user_weight');;?></th>
                    <th width="130"><?php echo orderurl('团队业绩','t_sellmoney');;?></th>
                    <th width="130"><?php echo orderurl('个人业绩','g_sellmoney');;?></th>
                </tr>
                </thead>
                <tbody>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($key+1); ?></td>
                            <td><?php echo (idtoname($vo["uid"],"Member",'username')); ?></td>
                            <td><?php echo (isset($vo["rank_weight"])?$vo["rank_weight"]:''); ?></td>
                            <td><?php echo (isset($vo["t_weight"])?$vo["t_weight"]:''); ?></td>
                            <td><?php echo (isset($vo["g_weight"])?$vo["g_weight"]:''); ?></td>
                            <td><?php echo (isset($vo["user_weight"])?$vo["user_weight"]:''); ?></td>
                            <td><?php echo (isset($vo["t_sellmoney"])?$vo["t_sellmoney"]:''); ?></td>
                            <td><?php echo (isset($vo["g_sellmoney"])?$vo["g_sellmoney"]:''); ?></td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table><?php endif; ?>
    </div>
</div>
<script type="text/javascript">
function share() {
    var money=$("input[name='money']").val();
    var start_time = $("input[name='start_time']").val();
    var end_time = $("input[name='end_time']").val();
    var query = new Object();
    query.money = money;
    query.start_time = start_time;
    query.end_time=end_time;
    var url = APP + "ShareBonus/share.html"
    $.ajax({
        url: url,
        data: query,
        type: "post",
        dataType: "json",
        success: function (obj) {
            if (obj.status) {
                $('#brand_id').html(obj.options);
                return false;
            } else {
                return false;
            }
        }
    });
}
</script>
</body>
</html>