<?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/kindeditor/kindeditor.js"></script><link rel="stylesheet" type="text/css" href="/Application/Runtime/statics/b754295a473b8c5368ca8d05dc523681.css" /><script type="text/javascript" src="/Application/Runtime/statics/0b510f7ff4fd991a29f7764a8c68f2ac.js"></script><script type="text/javascript">$(function(){$("#myform").Validform({tiptype:3});})</script>
<form method="post" action="<?php echo U('update');?>" name="myform" id="myform">
    <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" 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>
                    <li><i>·</i>分红计算公式是：分红总金额/全部权重*个人权重。 </li>
                    <li><i>·</i>满足分红等级条件则获得权重100。 </li>
                </ul>
            </div>
            <div class="mt15"></div>
            <div class="present  tab-pane fade active in">
                <table class="table_hanchao_z mt15">
                    <tr>
                        <th rowspan="2">分红等级条件</th>
                        <td>
                        <span>
                            <select class="form-control" name="fh_level" >
                                <?php if(is_array($level)): $i = 0; $__LIST__ = $level;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option value="<?php echo (isset($key)?$key:''); ?>" <?php if($config['fh_level'] == $key): ?>selected="selected"<?php endif; ?> ><?php echo (isset($val)?$val:''); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                            </select>
                        </span>
                        <span class="glyphicon glyphicon-exclamation-sign"></span>此等级及以上等级可参与分红（含此等级）。
                            <div class="Validform_checktip"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="f_l">直推有&nbsp;&nbsp;
                            <select class="form-control" name="child_level" >
                                <?php if(is_array($level)): $i = 0; $__LIST__ = $level;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option value="<?php echo (isset($key)?$key:''); ?>" <?php if($config['child_level'] == $key): ?>selected="selected"<?php endif; ?> ><?php echo (isset($val)?$val:''); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                            </select>
                            </span>
                            <span class="ml5"><input type="text" name="child_level_num" id="child_level_num" value="<?php echo (isset($config["child_level_num"])?$config["child_level_num"]:''); ?>" class="dis_inline f_l form-control w100 ml10"> 人</span>
                            <span class="glyphicon glyphicon-exclamation-sign"></span>
                            下级有此等级及以上等级N人及N人以上可参与分红（含此等级，含N人）
                            <div class="Validform_checktip"></div>
                        </td>
                    </tr>
                </table>
                <table class="table table-hover table-striped table-hanchao mt15 table-bordered">
                    <thead>
                        <tr>
                            <th width="140">会员等级</th>
                            <th>等级权重</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(is_array($level)): $i = 0; $__LIST__ = $level;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                                <td><?php echo (isset($vo)?$vo:''); ?></td>
                                <?php if(($key) == "1"): ?><td><span style="text-align: center; padding-left: 10px;">——</span><span style="height: 30px; padding-left: 62px; line-height: 30px; color: #999;"><span class="glyphicon glyphicon-exclamation-sign"></span>此等级无额外加权</span></td>
                                    <input type="hidden" name="level_weight[1]" value="0">
                                <?php else: ?>
                                    <td><input type="text" name="level_weight[<?php echo (isset($key)?$key:''); ?>]" id="level_weight_<?php echo (isset($key)?$key:''); ?>" value="<?php echo (isset($item[$key]['level_weight'])?$item[$key]['level_weight']:''); ?>" class="form-control width10 h30 w50 pd0" style="text-align: center;" datatype="n"><span style="height: 30px; padding-left: 50px; line-height: 30px; color: #999;"><span class="glyphicon glyphicon-exclamation-sign"></span>等级额外加权<?php echo (isset($item[$key]['level_weight'])?$item[$key]['level_weight']:''); ?></span></td><?php endif; ?>
                            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </tbody>
                </table>
                <table class="table_hanchao_z mt15">
                    <?php if(empty($t_performance)): ?><thead>
                            <tr>
                                <td colspan="2" style="background: #EDF1F4;">团队业绩</td>
                            </tr>
                        </thead>
                        <tbody id="content_add">
                            <tr>
                                <td align="center"><a onclick="addRowg(this)" href="javascript:void(0)">[+]</a></td>
                                <td>
                                    <span class="f_l">
                                        <span class="f_l" style="height:34px; line-height:34px;">团队业绩达到</span><input type="text" name="t_money[0]" id="t_money[0]" value="" class="dis_inline f_l form-control w100 mr10 ml5">
                                        <span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span>
                                        <input type="text" name="t_money_weight[0]" id="t_money_weight[0]" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span>
                                    </span>
                                </td>
                                <input type="hidden" class="num" name="num" value="0">
                            </tr>
                        </tbody>
                    <?php else: ?>
                        <thead>
                            <tr>
                                <td colspan="2" style="background: #EDF1F4;">团队业绩</td>
                            </tr>
                        </thead>
                        <tbody id="content_add">
                            <?php if(is_array($t_performance)): $i = 0; $__LIST__ = $t_performance;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                                    <td align="center">
                                        <?php if(($key) == "0"): ?><a onclick="addRowg(this)" href="javascript:void(0)">[+]</a>
                                        <?php else: ?>
                                            <a onclick="delRowg(this)" href="javascript:void(0)">[-]</a><?php endif; ?>
                                    </td>
                                    <td>
                                        <span class="f_l">
                                            <span class="f_l" style="height:34px; line-height:34px;">团队业绩达到</span><input type="text" name="t_money[<?php echo (isset($key)?$key:''); ?>]" id="t_money_<?php echo (isset($key)?$key:''); ?>" value="<?php echo (isset($t_performance[$key]['t_money'])?$t_performance[$key]['t_money']:''); ?>" class="dis_inline f_l form-control w100 mr10 ml5">
                                            <span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span>
                                            <input type="text" name="t_money_weight[<?php echo (isset($key)?$key:''); ?>]" id="t_money_weight_<?php echo (isset($key)?$key:''); ?>" value="<?php echo (isset($t_performance[$key]['t_money_weight'])?$t_performance[$key]['t_money_weight']:''); ?>" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span>
                                        </span>
                                    </td>
                                    <input type="hidden" class="num" name="num" value="<?php echo (isset($key)?$key:''); ?>">
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody><?php endif; ?>
                </table>
                <table class="table_hanchao_z mt15">
                    <?php if(empty($g_performance)): ?><thead>
                            <tr>
                                <td colspan="2" style="background: #EDF1F4;">个人业绩</td>
                            </tr>
                        </thead>
                        <tbody id="content_add1">
                            <tr>
                                <td align="center"><a onclick="addRowg1(this)" href="javascript:void(0)">[+]</a></td>
                                <td>
                                    <span class="f_l">
                                        <span class="f_l" style="height:34px; line-height:34px;">个人业绩达到</span><input type="text" name="g_money[0]" id="g_money[0]" value="" class="dis_inline f_l form-control w100 mr10 ml5">
                                        <span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span>
                                        <input type="text" name="g_money_weight[0]" id="g_money_weight[0]" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span>
                                    </span>
                                </td>
                                <input type="hidden" class="gnum" name="gnum" value="0">
                            </tr>
                        </tbody>
                    <?php else: ?>
                        <thead>
                            <tr>
                                <td colspan="2" style="background: #EDF1F4;">个人业绩</td>
                            </tr>
                        </thead>
                        <tbody id="content_add1">
                            <?php if(is_array($g_performance)): $i = 0; $__LIST__ = $g_performance;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                                    <td align="center">
                                        <?php if(($key) == "0"): ?><a onclick="addRowg1(this)" href="javascript:void(0)">[+]</a>
                                        <?php else: ?>
                                            <a onclick="delRowg(this)" href="javascript:void(0)">[-]</a><?php endif; ?>
                                    </td>
                                    <td>
                                        <span class="f_l">
                                            <span class="f_l" style="height:34px; line-height:34px;">个人业绩达到</span><input type="text" name="g_money[<?php echo (isset($key)?$key:''); ?>]" id="g_money_<?php echo (isset($key)?$key:''); ?>" value="<?php echo (isset($g_performance[$key]['g_money'])?$g_performance[$key]['g_money']:''); ?>" class="dis_inline f_l form-control w100 mr10 ml5">
                                            <span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span>
                                            <input type="text" name="g_money_weight[<?php echo (isset($key)?$key:''); ?>]" id="g_money_weight_<?php echo (isset($key)?$key:''); ?>" value="<?php echo (isset($g_performance[$key]['g_money_weight'])?$g_performance[$key]['g_money_weight']:''); ?>" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span>
                                        </span>
                                    </td>
                                    <input type="hidden" class="gnum" name="gnum" value="<?php echo (isset($key)?$key:''); ?>">
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody><?php endif; ?>
                </table>
            </div>
        </div>
        <div class="btn_group_btm">
            <button type="submit" name="dosubmit" id="dosubmit" class="btn btn-primary"><?php echo L('SUBMIT');?></button>
            <button type="button" class="btn btn-warning" onclick="javascript:history.back(-1);"><?php echo L('GOBACK');?></button>
        </div>
    </div>
</form>
<script type="text/javascript">
//添加组合商品
function addRowg(obj){
    var num = $('#content_add tr').length - 1;
    alert(num);
    var values = parseInt($('#content_add .num').eq(num).val());
    // alert(num);alert(values);
    var nums = values + 1;
    html = '<tr><td align="center"><a onclick="delRowg(this)" href="javascript:void(0)">[-]</a></td><td><span class="f_l"><span class="f_l" style="height:34px; line-height:34px;">团队业绩达到</span><input type="text" name="t_money['+nums+']" id="t_money['+nums+']" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span><input type="text" name="t_money_weight['+nums+']" id="t_money_weight['+nums+']" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span></span></td><input type="hidden" class="num" name="num" value="'+nums+'"></tr>';

    $("#content_add").append(html);
}

function addRowg1(obj){
    var num = $('#content_add1 tr').length - 1;
    var values = parseInt($('#content_add1 .gnum').eq(num).val());
    var nums = values + 1;
    html = '<tr><td align="center"><a onclick="delRowg(this)" href="javascript:void(0)">[-]</a></td><td><span class="f_l"><span class="f_l" style="height:34px; line-height:34px;">个人业绩达到</span><input type="text" name="g_money['+nums+']" id="g_money['+nums+']" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">万，权重增加</span><input type="text" name="g_money_weight['+nums+']" id="g_money_weight['+nums+']" value="" class="dis_inline f_l form-control w100 mr10 ml5"><span class="f_l" style="height:34px; line-height:34px;">%</span></span></td><input type="hidden" class="gnum" name="gnum" value="'+nums+'"></tr>';

    $("#content_add1").append(html);
}
//删除组合商品
function delRowg(obj){
    $(obj).parent().parent().remove();
}
</script>
</body>
</html>