<?php if (!defined('THINK_PATH')) exit(); $JSARR['min12']=THEME_PATH."/common/js/goods/export.js"; ?>
<!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/';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 w_auto col-sm-12">
	<div class="col-lg-12">
		<div class="mt15">
			<ul class="nav nav-tabs" role="tablist">
				<li role="presentation" class="active">
					<a href="<?php echo U('Member/index');?>">会员画像</a>
				</li>
			</ul>
			<div class="cont_hanchao pd15 tab-content" id="myTabContent">
				<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>
					</ul>
				</div>
				<div class="present  tab-pane fade active in" id="group_common">
					<form name="searchform" action="/admin.php?s=/member/member_portrait" method="POST" id="myform" >
						<div class="toolbars-hanchao mt15 clearfix">
							<div>
								<?php echo L('MEMBER');?>：
								<input name="keyword" type="text" class="form-control width1" placeholder="<?php echo L('ID');?>/<?php echo L('NAME');?>" size="25" value="<?php echo I('keyword');?>" />
								<?php echo L('MOBILE');?>：
								<input name="mobile" type="text" class="form-control width1" placeholder="<?php echo L('MOBILE');?>号" size="25" value="<?php echo I('mobile');?>" />
								<?php echo L('MEMBER_RANK');?> ：
								<select name="rank_id" class="form-control width2">
                                    <option value="0"><?php echo L('PLEASE_SELECT_RANK');?></option>
                                        <?php if(is_array($groupData)): $i = 0; $__LIST__ = $groupData;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo (isset($key)?$key:''); ?>" <?php if(isset($_REQUEST['rank_id']) && ($key) == $_REQUEST['rank_id']): ?>selected="selected"<?php endif; ?>
                                            ><?php echo (isset($vo)?$vo:''); ?>
                                        </option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
							</div>
							<div>
								<button class="btn btn-primary" type="submit"><?php echo L('SEARCH');?></button>
								<span class="btn btn-primary" onclick="show_label()">标签</span>
							</div>
						</div>
					</form>
					<form id="myform1" 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="60" align="center"><?php echo orderurl('LAN_ID','id');;?></th><!--glyphicon glyphicon-open升序-->
									<th width="100"><?php echo L('HEAD_IMG');?></th>
									<th width="120"><?php echo orderurl('会员名称','username');;?></th>
									<th width="120"><?php echo orderurl('手机号','mobile');;?></th>
									<th width="90"><?php echo orderurl('LAN_MEMBER_RANK','rank_id');;?></th>
									<th width="150"><?php echo orderurl('注册时间','reg_time');;?></th>
									<th width="50"><?php echo orderurl('LAN_STATUS','status');;?></th>
									<th width="180"><?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 title="<?php echo (isset($val["id"])?$val["id"]:''); ?>"><?php echo (isset($val["id"])?$val["id"]:''); ?></td>
										<td title="会员头像">
										<?php if($val['header_img']): ?><img src="<?php echo (isset($val["header_img"])?$val["header_img"]:''); ?>" style="width:41.5px;height:41.5px;" />
										<?php else: ?><img src="/Public/images/user-header.png" style="width:35%;" /><?php endif; ?>
										</td>
										<td title="<?php echo (show_user_name($val["id"])); ?>"><?php echo (show_user_name($val["id"])); ?></td>
										<td title="<?php echo (isset($val["card_sn"])?$val["card_sn"]:''); ?>"><?php echo (isset($val["mobile"])?$val["mobile"]:''); ?></td>
										<td title="<?php echo (idtoname($val["rank_id"],'MemberRank')); ?>"><?php echo (idtoname($val["rank_id"],'MemberRank')); ?></td>
										<td title="<?php echo (isset($val["card_sn"])?$val["card_sn"]:''); ?>"><?php echo (time_format($val["reg_time"])); ?></td>
										<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>
                                        <td title="<?php echo L('ACCOUNT_CHANGE');?> <?php echo L('EDIT');?> <?php echo L('DELETE');?>">
											<a href="<?php echo U('Member/huaxiang',array('uid'=>$val['id']));?>">会员画像</a>
										</td>
									</tr><?php endforeach; endif; else: echo "" ;endif; ?>
							</tbody>
						</table>
					</form>
					<nav class="pages_hanchao" id="pages">
						<?php echo (isset($_page)?$_page:''); ?>
					</nav>
				</div>
				<div id="div_label" style="display:none;">
					<div class="dialog-main-label weedialog">
						<div class="dialog-header">
							<div class="dialog-title">会员标签</div>
							<div class="dialog-close" onclick="show_close()"></div>
						</div>
						<ul class="tag-list">
							<?php if(is_array($label_list)): $i = 0; $__LIST__ = $label_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><li onclick="btn_delete(this,<?php echo (isset($val["id"])?$val["id"]:''); ?>)"><?php echo (isset($val["name"])?$val["name"]:''); ?><span><img src="<?php echo (TPL_PATH); ?>/common/images/wrong-icon3.png" /></span></li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="blank10"></div>
<script>
	$(document).ready(function(){
	  var move=false; //声明一个变量并赋初值为false，用来标识div是否可以拖动，为true标识可以拖动。
	  var _x,_y; //声明两个变量，用来存储鼠标指针在div中按下的位置距离div左边缘和上边缘的距离。
	  $(".dialog-header").mousedown(function(e){
	    move=true; //将move设置为true，这说明div是可以拖动的。
	    _x=e.pageX-parseInt($(".dialog-main-label").css("left")); //获取鼠标指针距离div左侧的距离。
	    _y=e.pageY-parseInt($(".dialog-main-label").css("top")); //获取鼠标指针距离div上册的距离。
	  });
	  $(document).mousemove(function(e){
	    if(move){
	      var x=e.pageX-_x;//控件左上角到屏幕左上角的相对位置
	      var y=e.pageY-_y;
	      $(".dialog-main-label").css({"top":y,"left":x}); //设置left和top属性值
	    }
	  }).mouseup(function(){
	    move=false; //鼠标松开，将moe的值设置为false
	  });
	})
	function show_label(){
		$('#div_label').show();return;
	}
	function show_close(){
		$('#div_label').hide();return;
	}
	function btn_delete(obj,id){
		$.showConfirm('你确定要删除吗？',function(){
			var query = new Object();
			query.label_id = id;
			$.ajax({
				url: APP + "Member/sub_delete.html",
				data: query,
				type: "post",
				dataType: "json",
				success: function (ret) {
					if (ret.status == 1) {
						$(obj).remove();
					}else{
						$.showSuccess(ret.msg);return;
					}
				}
			});
		},'hc');
	}
</script>
</body>
</html>