<?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=/member_rank/';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; ?>
<div class="pad-lr-10 col-sm-12">
    <div class="mt15"></div>
    <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>二、信息应填写完整；</li>
            <li><i>·</i>三、商品价格折扣率(%)应为0~1之间的数字，商品价格折扣设置后，相应级别会员下单时将享受该折扣的金额优惠，如果不想设置折扣则将该值设置为0；</li>
            <!--<li><i>·</i>四、特殊会员组是需要会员交会员费的，这类会员等级与会员等级积分无关。</li>-->
            <li><i>·</i>在列表页上双击排序可快速修改，点击状态按钮可修改状态</li>
            <!-- <li><i>·</i>如要设置会员等级晋升方式，可前往会员列表->奖励配置处进行更改</li> -->
        </ul>
    </div>
    <div class="toolbars-hanchao mt15 clearfix">
        <div><a href="<?php echo U('add');?>" class="btn btn-primary">添加会员等级</a></div>
        <div><a href="<?php echo U('rank_info');?>" class="btn btn-primary">等级晋升说明</a></div>
        <!-- <button class="btn btn-primary" type="button" onclick="<?php echo U('info');?>"></button> -->
    </div>
	
<form id="myform" name="myform" action="<?php echo U('delete');?>" method="post">
        <table class="table table-hover table-striped table-hanchao mt15 table-bordered">
            <thead>
                <tr>
                    <th width="35"><input onclick="selectall('id[]');" class="check_box_c" type="checkbox" id="check_box" ></th>
                    <th width="60" align="center"><?php echo orderurl('LAN_ID','id');;?></th><!--glyphicon glyphicon-open升序-->

                    <th width="120"><?php echo orderurl('LAN_RANK_NAME','name');;?></th>
                    <th width="380">等级晋升条件</th>
                    <th width="130"><?php echo orderurl('LAN_GOODS_REBATE_RATE','goods_price');;?></th>
                    <th width="100"><?php echo orderurl('级别','sort');;?></th>
                    <th width="50"><?php echo orderurl('LAN_STATUS','status');;?></th>
                    <th width="100"><?php echo L('MANAGE');?></th>
                </tr>
            </thead>
            <tbody>
            <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                    <td><?php if($val["id"] != 1): ?><input value="<?php echo (isset($val["id"])?$val["id"]:''); ?>" name="id[]" type="checkbox" ><?php endif; ?>  </td>
                    <td><?php echo (isset($val["id"])?$val["id"]:''); ?></td>
                    <td><?php echo (isset($val["name"])?$val["name"]:''); ?></td>
                    <?php $info=unserialize($val['level_pro']); if($info['pro_type']==1&&$info['type_buy']==1){ $msg="购买指定商品满".$info['buy_money']."元"; } if($info['pro_type']==2){ $msg=''; if($info['one_buy']==1)$msg.="自己消费满".$info['one_buy_money']."元 "; if($info['zhi_buy']==1)$msg.="直接推荐人消费满".$info['zhi_buy_money']."元 "; if($info['jian_buy']==1)$msg.="下级消费满".$info['jian_buy_money']."元"; } if($info['pro_type']==3){ $msg=''; if($info['zhi_tui']==1){ $rank = idtoname($info['zhi_level'],'MemberRank','name'); $msg.="直接推荐".$rank.$info['zhi_level_num']."人 "; } if($info['jian_tui']==1){ $rank = idtoname($info['jian_level'],'MemberRank','name'); $msg.="间接推荐".$rank.$info['jian_level_num']."人 "; } if($info['all_tui']==1){ $rank = idtoname($info['all_level'],'MemberRank','name'); $msg.="下级推荐".$rank.$info['all_level_num']."人 "; } } ?>
                    <td><?php if($val["id"] == 1): ?>注册成功即为普通会员<?php else: echo (isset($msg)?$msg:''); endif; ?></td>
                    <td><?php echo (isset($val["goods_price"])?$val["goods_price"]:''); ?></td>
                    <td>级别<?php echo (isset($val["sort"])?$val["sort"]:''); ?></td>
                    <?php if($val["id"] == 1): ?><td><img src="/Public/images/status_1.gif" /></td><?php else: ?><td onclick="status(<?php echo (isset($val["id"])?$val["id"]:''); ?>,'status')" id="status_<?php echo (isset($val["id"])?$val["id"]:''); ?>"><img src="/Public/images/status_<?php echo (isset($val["status"])?$val["status"]:''); ?>.gif" /></td><?php endif; ?>
                    <td>
						
                        <a href="<?php echo U('edit',array('id'=>$val['id']));?>"><?php echo L('EDIT');?></a> 
						<?php if($val["id"] > 2): ?><a href="javascript:;" onclick="$.showConfirm('<?php echo L('SURE_DELETE');?>',function(){window.location.href='<?php echo U('delete',array('id'=>$val['id']));?>'},'hc')"><?php echo L('DELETE');?></a><?php endif; ?>
                    </td>
                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>

        <div class="btn_party mt15">
        	<label for="check_box" class="btn btn-default f_l"><?php echo (L("select_all")); ?>/<?php echo (L("cancel")); ?></label>
            <button type="button" class="btn btn-danger" onclick="$.showConfirm('<?php echo L('SURE_DELETE');?>',function(){$('#myform').submit();},'hc')"><?php echo L('ALL_DEL');?></button>

        </div>
</form>
        <nav class="pages_hanchao" id="pages">
            <?php echo (isset($_page)?$_page:''); ?>
        </nav>


    </div>

</div>
</body>
</html>