<? if (!defined('ROOT')) exit('Can\'t Access !'); include template('admin_header','admin'); ?>
<div id="right">
  <div class="right">
    <div style="width:auto;overflow-x:hidden;overflow-y:auto"> <? if($_GET['get']=='list') { ?>
      <div class="tags">
        <div id="tagstitle"> <a href="<?=Purl('admin_user')?>" <? if(!$_GET['groupid']) { ?>class="hover"<? } ?>><?=$getName?></a>
          <? if(is_array($this->channel)) { foreach($this->channel as $value) { ?>          <a href="<?=$value['url']?>" <? if($_GET['groupid']==$value['groupid']) { ?>class="hover"<? } ?>><?=$value['groupname']?></a>
          <? } } ?>        </div>
        <div id="tagscontent">
          <div id="con_one_1">
            <div class="table_td" style="margin-top:0;">
              <table border="0" cellspacing="2" cellpadding="4"  width="100%">
                <tbody>
                  <tr bgcolor="#ffffff">
                    <td class="left" width="100">请输入关键词</td>
                    <td>
                     <form method="get" action="">
                     <input type="hidden" name="mod" id="mod" value="admin" />
                     <input type="hidden" name="act" id="act" value="user" />
                     <input type="text" name="keywords" id="keywords" value="<?=$_GET['keywords']?>"  class='skey' style='width:200px;'/>    
                    <input type="submit" name="button" id="button" value="搜索会员" class='button'>           
                      <span class="tipser" id="usernametip">模糊搜索，可搜索 用户名 联系电话 真实姓名 所在区域 收款方式等等全局检索。</span>
                      </form>
                      </td>
                  </tr>
                </tbody>
              </table>
              <br />
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <thead>
                    <tr>
                      <th align="center">编号</th>
                      <th align="center">用户名</th>
                      <th align="center">用户组</th>
                      <th align="center">真实姓名</th>
                      <th align="center">联系电话</th>
                      <th align="center">电子邮箱</th> 
                      <th align="center">介绍人</th>
                      <th align="center">登录次数</th>
                      <th align="center">账号状态</th>
                      <th align="center">操作</th>
                    </tr>
                  </thead>
                  <? if(is_array($this->userlist)) { foreach($this->userlist as $value) { ?>                  <tbody>
                    <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td align="center"><?=$value['uid']?></td>
                      <td align="center"><?=$value['username']?></td>
                      <td align="center"><?=$value['groupname']?></td>
                      <td align="center" style="cursor:pointer;" onclick="idcard(<?=$value['uid']?>)" ><?=$value['truename']?>
                       <? if($value['idcard']) { ?>
               <img align="absmiddle" onmousemove="showpup('身份证：<?=$value['idcard']?>')" onmouseout='hidepup()' src="<?=$this->tempdir?>images/icoshenfen.gif" />                      <? } ?>
                      </td>
                      <td align="center"><?=$value['userphone']?>
                       <? if($value['mcheck']=='1') { ?>
                    <img align="absmiddle" style="cursor:pointer;" src="<?=$this->tempdir?>images/icotel.gif" />                       
                       <? } ?>
                      </td>
                      <td align="center"><?=$value['email']?>
                       <? if($value['echeck']=='1') { ?>
                    <img align="absmiddle" style="cursor:pointer;" src="<?=$this->tempdir?>images/icoemail.gif" />                       
                       <? } ?>
                      </td>
                      <td align="center"><?=$value['jsr']?></td>
                      <td align="center"><?=$value['loginnum']?>次</td>
                      <td align="center"><?=usercheck($value['status']); ?></td>
                      <td align="center">
                        <a href="javascript:editbank(<?=$value['uid']?>);">银行</a>
                        <a href="<?=$value['editurl']?>">编辑</a>
                        <a onclick="return remind();" href="<?=$value['delurl']?>">删除</a>
                      </td>
                    </tr>
                  </tbody>
                  <? } } ?>                </table>
                <div class="blank20"></div>
              <div class="page"><span><?=$this->pagetotal?>条记录/<?=$_GET['page'] ? $_GET['page'] : 1 ; ?>页</span><?=$this->showpage?></div>
              <div class="blank20"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="blank20"></div>
      <? } ?>     
      
      <? if($_GET['get']=='password') { ?>
      <div class="tags">
        <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
        <div id="tagscontent">
          <form method="post" name="form1" action="">
            <div>
              <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                <tbody>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">要为哪个用户重置</td>
                    <td><input type="text" name="username" style="width:150px;" id="username" value="<?=$_POST['username']?>" size="40" class="skey" onfocus='addClass("usernametip","tipser","请输入用户名");'/>
                      <span class="tipser" id="usernametip">请输入要重置密码的用户名</span></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">登录密码</td>
                    <td><input type="password" name="password" id="password" value="<?=$_POST['password']?>" class="skey" style="width:150px;" onfocus='addClass("passwordtip","tipser","登录密码，不修改请留空");'/>
                      <span class="tipser" id="passwordtip">登录密码，不修改请留空</span></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">提现密码</td>
                    <td><input type="password" name="repass" id="repass" value="<?=$_POST['repass']?>" class="skey" style="width:150px;" onfocus='addClass("repasstip","tipser","提现密码，不修改请留空");' />
                      <span class="tipser" id="repasstip">提现密码，不修改请留空</span></td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="blank20"></div>
 此为演示版，修改功能已经被阉割，需要请联系QQ2116198029购买。
          </form>
        </div>
      </div>
      <div class="blank20"></div>
      <script language="javascript">
var post = '<?=$this->repost?>';
var usernametip = '<?=$this->usernametip?>';
var passwordtip = '<?=$this->passwordtip?>';
var repasstip = '<?=$this->repasstip?>';
if(post==1){
  if(usernametip!=''){
    addClass("usernametip","tipsno",usernametip);
  }else{
    addClass("usernametip","tipsyes","&nbsp;");
  }
  if(passwordtip!=''){
    addClass("passwordtip","tipsno",passwordtip);
  }else{
    addClass("passwordtip","tipsyes","&nbsp;");
  }
  if(repasstip!=''){
    addClass("repasstip","tipsno",repasstip);
  }else{
    addClass("repasstip","tipsyes","&nbsp;");
  }
}
</script>
      <? } ?>
      
      
      
      <? if($_GET['get']=='clear') { ?>
      <div class="tags">
        <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
        <div id="tagscontent">
          <form method="post" name="form1" action="" onsubmit="return shifou()">
            <div>
              <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                <tbody>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">要清除哪个用户</td>
                    <td><input type="text" name="username" style="width:150px;" id="username" value="<?=$_POST['username']?>" size="40" class="skey" onfocus='addClass("usernametip","tipser","请输入用户名");'/>
                      <span class="tipser" id="usernametip">请输入要重置密码的用户名</span></td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="blank20"></div>
此为演示版，修改功能已经被阉割，需要请联系QQ2116198029购买。
          </form>
        </div>
      </div>
      <div class="blank20"></div>
<script language="javascript">
var post = '<?=$this->repost?>';
var usernametip = '<?=$this->usernametip?>';
if(post==1){
  if(usernametip!=''){
    addClass("usernametip","tipsno",usernametip);
  }else{
    addClass("usernametip","tipsyes","&nbsp;");
  }
}
</script>
      <? } ?>
      
      
      <? if($_GET['get']=='add'||$_GET['get']=='edit') { ?>
      <div class="tags">
        <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
        <div id="tagscontent">
          <form method="post" name="form1" action="">
            <div>
              <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                <tbody>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">用户名</td>
                    <td> <? if($_GET['get']=='add') { ?>
                      <input type="text" name="username" id="username" style="width:150px;" value="" class="skey" onblur="checkusername()"/>
                      <span class="tipser" id="usernametip">请输入要使用的用户名</span> <? } else { ?>
                      <?=$this->thisuser['username']?>
                      <? } ?> </td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">用户组</td>
                    <td><?=config::form('groupid',$this->thisuser['groupid'],'select',$this->usergrouplist,'style=\'width:100px\'');?></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">登录密码</td>
                    <td><input type="password" name="password" id="password" style="width:150px;" value="" class="skey" <? if($_GET['get']=='add') { ?>onblur="checkpassword()"<? } ?> />
                      <span <? if($_GET['get']=='edit') { ?>class="tipser"<? } ?> id="passwordtip"><? if($_GET['get']=='edit') { ?>不修改密码，请留空<? } ?></span></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">常用邮箱</td>
                    <td>
                    <input type="text" name="email" id="email" style="width:150px;" value="<?=$this->thisuser['email']?>" class="skey" onblur="checkemail()"  <? if($_GET['get']=='edit') { ?>disabled<? } ?>/>
                      <script language="javascript"> var oldemail = '<?=$this->thisuser['email']?>';</script>
                      <span id="emailtip"></span></td>
                  </tr>
                  
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">手机号码</td>
                    <td>
                    <input type="text" name="userphone" id="userphone" style="width:150px;" value="<?=$this->thisuser['userphone']?>" class="skey" <? if($_GET['get']=='edit') { ?>disabled<? } ?>/></td>
                  </tr>
                  
                  
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">所在区域</td>
                    <td><script type="text/javascript" src="<?=$this->appdir?>area.js"></script>
                      <select id="s_province" name="s_province">
                      </select>
                      &nbsp;&nbsp;
                      <select id="s_city" name="s_city" >
                      </select>
                      &nbsp;&nbsp;
                      <select id="s_county" name="s_county" onblur="checks_county()">
                      </select>
<script type="text/javascript">
var s=["s_province","s_city","s_county"];
<? if($_GET['get']=='edit') { ?>
var opt0 = ["<?=$this->thisuser['s_province']?>","<?=$this->thisuser['s_city']?>","<?=$this->thisuser['s_county']?>"];//初始值
<? } else { ?>
var opt0 = ["省份","地级市","市、县级市"];
<? } ?>
_init_area();    
</script>
                      <? if($_GET['get']=='edit') { ?><span id="s_countytip" class="tipser">如果要修改，请千万慎重</span><? } ?></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">用户状态</td>
                    <td><?=config::form('status',$this->thisuser['status'],'radio','[<1><已审核>][<0><未审核>]');?></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">消费总金额</td>
                    <td><input type="text" name="consume" id="consume" value="<?=$this->thisuser['consume']?>" class="skey" style='width:80px' disabled/>
                      元</td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">消费结余</td>
                    <td><input type="text" name="balance" id="balance" value="<?=$this->thisuser['balance']?>" class="skey" style='width:80px' disabled/>
                      元</td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">可提现金额</td>
                    <td><input type="text" name="keti" id="keti" value="<?=$this->thisuser['keti']?>" class="skey" style='width:80px' disabled/>
                      元</td>
                  </tr>
                  
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">总营业额</td>
                    <td><input type="text" name="yyze" id="yyze" value="<?=$this->thisuser['yyze']?>" class="skey" style='width:80px' disabled/>
                      元</td>
                  </tr>
                  
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">账号余额</td>
                    <td> <? if($_GET['get']=='add') { ?>
                      <input type="text" name="money" id="money" value="<?=$this->thisuser['money']?>" class="skey" style='width:80px'/>
                      元
                      <? } else { ?>
                      &nbsp;<?=$this->thisuser['money']?> 元 +
                      <input type="text" name="money" id="money" value="" class="skey" style='width:40px'/>
                      <span class="tipser">如果减少现金请用-，例如：-50</span> <? } ?> </td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">推荐人</td>
                    <td><input type="text" name="jsr" id="jsr" style="width:150px;" value="<?=$this->thisuser['jsr']?>" class="skey" <? if($_GET['get']=='edit') { ?>disabled<? } ?>/></td>
                  </tr>
                  
                </tbody>
              </table>
            </div>
            <div class="blank20"></div>
   此为演示版，修改功能已经被阉割，需要请联系QQ2116198029购买。
          </form>
        </div>
      </div>
      <div class="blank20"></div>
      <? } ?>
      
      <? if($_GET['get']=='groupadd'||$_GET['get']=='groupedit') { ?>
      <div class="tags">
        <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
        <div id="tagscontent">
          <form method="post" name="form1" action="">
            <div>
              <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                <tbody>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">用户组名称</td>
                    <td><?=config::form('groupname',$this->usergroup['groupname'],'input');?></td>
                  </tr>
                  <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td class="left">是否管理组</td>
                    <td><?=config::form('isadmin',$this->usergroup['isadmin'],'radio','[<1><是>][<0><否>]');?></span></td>
                  </tr>
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">会员组权限</td>
                      <td class="purviews" height="50" style="padding-left:15px;">
                      <p style="font-weight:bolder; color:#F00;">后台权限：</p>
                        <?=config::form('purviews',$this->usergroup['purviews'],'checkbox',$this->apurviewlist);?> 
                      <div style="clear:both;"></div>
                      <p style="font-weight:bolder; color:#F00;">前台权限：</p>                
                        <?=config::form('purviews',$this->usergroup['purviews'],'checkbox',$this->upurviewlist);?>
                      </td>
                    </tr>
                </tbody>
              </table>
            </div>
            <div class="blank20"></div>
         此为演示版，修改功能已经被阉割，需要请联系QQ2116198029购买。
          </form>
        </div>
      </div>
      <div class="blank20"></div>
      <? } ?>
      
      
      <? if($_GET['get']=='group') { ?>
      <div class="tags">
        <div id="tagscontent">
          <div id="con_one_1">
            <div class="table_td" style="margin-top:10px;">
              <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                <thead>
                  <tr>
                    <th align="center">编号</th>
                    <th align="center">用户组名称</th>
                    <th align="center">目前用户个数</th>
                    <th align="center">是否管理组</th>
                    <th align="center">是否系统分组</th>
                    <th align="center">操作</th>
                  </tr>
                </thead>
                <? if(is_array($this->usergroup)) { foreach($this->usergroup as $value) { ?>                <tbody>
                  <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                    <td align="center"><?=$value['groupid']?></td>
                    <td align="center"><?=$value['groupname']?></td>
                    <td align="center"><?=$value['usercount']?>个</td>
                    <td align="center"><? if($value['isadmin']) { ?><span style="color:#F00;">是</span><? } else { ?>否<? } ?></td>
                    <td align="center"><? if($value['system']) { ?><span style="color:#F00;">是</span><? } else { ?>否<? } ?></td>
                    <td align="center"><a href="<?=$value['editurl']?>">编辑</a> <a onclick="return remind();" href="<?=$value['delurl']?>">删除</a></td>
                  </tr>
                </tbody>
                <? } } ?>              </table>
              <div class="blank20"></div>
              </form>
              <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
              <div class="blank20"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="blank20"></div>
      <? } ?> </div>
    <div class="clear"></div>
  </div>
  <div class="clear"></div>
</div>
</div>
<script language="javascript">
function idcard(uid){
  openwin('<?=Purl("?mod=admin&act=profile&get=idcard"); ?>&uid='+uid,'用户实名信息',320,225);	
}
function editbank(uid){
  openwin('<?=Purl("?mod=admin&act=profile&get=editbank"); ?>&uid='+uid,'用户提现银行',420,215);	
}
</script>
<? include template('admin_footer','admin'); ?>
