<div class="content_wrapper">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>用户查询</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" onkeydown="if(event.keyCode==13){ $('#SubmitBtn').click(); return false; }" role="form" method="post" action="user/searchuser"  data-validate="validateUser" data-callBack="showuserinfo" data-useDefaultCallBack="on" data-sendingText="查询中">
                                        <div class="col-sm-3">
                                            <span class="gap"></span>
                                            <div class="form-group">
                                                <label>用户/昵称:</label>
                                                <input type="text" class="form-control" placeholder="用户UID" name="userid" id="userid" value="<?php echo $uid ?? '';?>">
                                            </div>
                                            <span class="gap"></span>
                                            <button type="button" class="btn btn-primary J_ajaxSubmitBtn" id="SubmitBtn">查询</button>
                                        </div>
                                        <div class="col-sm-3">
                                            <label class="radio-inline">
                                                <input type="radio" name="userType" class="typeRadio" value="0" checked> 所有用户
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="userType" class="typeRadio" value="1"> 有效用户
                                            </label>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>

        <div class="row" id="nickDiv" style="display: none;">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>玩家信息</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                        <thead>
                                        <tr>
                                            <th>用戶ID</th>
                                            <th>用戶昵称</th>
                                        </tr>
                                        </thead>
                                        <tbody id="nickTable">
                                            <tr><td class="searchBynick"></td><td></td></tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>玩家信息</header>
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table">
                                    <thead>
                                    <tr><td colspan="17">体力累计消耗</td></tr>
                                        <?php
                                            foreach ($slotTitle as $k=>$v){
                                                echo "<th>{$v}</th>";
                                            }
                                        ;?>
                                    </thead>
                                    <tbody>
                                        <tr id="slotSpinsLost"></tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-striped">
                                        <tr style="height: 100px;">

                                        </tr>
										<tr style="height: 100px;"><td>玩家头像</td>
                                        	<td>
                                        		<?php
                                        			$picture = intval($s_picture);
                                        			if($picture <= 10){
                                        				$s_picture = '/public/games_avatar/u_headImg'.$picture.'.png';
                                        			}
                                        		?>
                                        		<img  class="s_picture" width="80px" height="80px" src="<?php echo $s_picture ?? '';?>" />
                                        		<span>注：facebook用户头像需要在VPN下才能显示</span>
                                        	</td>
                                        </tr>
                                        <tr><td>玩家uid</td><td class="userid"><?php echo $uid ?? '';?>&nbsp;&nbsp;<?php
                                                if($status == 3 || $status == 2){
                                                    echo '<div class="btn btn-danger">用户已失效</div>';
                                                }else if(isset($status) && $status == 0){
                                                    echo '<div class="btn btn-danger">用户已封号</div>';
                                                }
                                                ?></td></tr>
                                        <tr><td>玩家siteuid</td><td class="siteuid"><?php echo $siteuid ?? '';?></td></tr>
                                        <tr><td>登录设备</td><td class="loginplat"><?php echo strtoupper($login_plat) ?? '';?></td></tr>
                                        <tr><td>玩家昵称</td><td class="username"><?php echo $nick ?? '';?></td></tr>
                                        <tr><td>邮箱</td><td class="email"><?php echo $email ?? '';?></td></tr>
                                        <tr><td>验证邮箱</td><td class="emailNew"><?php echo $emailNew ?? '';?></td></tr>
                                        <tr><td>注册时间</td><td class="createtime"><?php echo $createtime ?? '';?></td></tr>
                                        <tr><td>最后登录时间</td><td class="lasttime"><?php echo $lasttime ?? '';?></td></tr>
                                        <tr><td>登录时长</td><td class="loginTime"><?php echo $loginTime ?? '';?></td></tr>
                                        <tr><td>是否机器人</td><td class="isrobot"><?php echo $isRobot ?? '';?></td></tr>
                                        <tr><td>是否在线</td><td class="isOnline"><?php echo $isOnline?'是':'否'; ?></td></tr>
                                        <tr><td>是否游客</td><td class="isVistor" style="word-break: break-all;width: 80%;"><?php echo $isVistor ?? '';?></td></tr>
                                        <tr><td>是否VIP</td><td class="isVip" style="word-break: break-all;width: 80%;"><?php echo $isVip ?? '';?></td></tr>
                                        <tr><td>VIP积分</td><td class="vipPoint" style="word-break: break-all;width: 80%;"><?php echo $vipPoint ?? '';?></td></tr>
                                        <tr><td>VIP等级</td><td class="vipLv" style="word-break: break-all;width: 80%;"><?php echo $vipLv ?? '';?></td></tr>
                                        <tr><td>是否VIP</td><td class="isVip" style="word-break: break-all;width: 80%;"><?php echo $isVip ?? '';?></td></tr>
                                        <tr><td>IP地址</td><td class="locale"><?php echo $locale ?? '';?></td></tr>
                                        <tr><td>玩家签名</td><td class="signature"><?php echo $signature ?? '';?></td></tr>
                                        <tr><td>玩家金币</td><td
                                        class="money"><?=$money ? number_format($money) : '';?></td></tr>
                                        <tr><td>玩家盾牌</td><td
                                        class="shield"><?=$shield ? number_format($shield) : '';?></td></tr>
                                        <tr><td>玩家体力</td><td
                                        class="spins"><?=$spins ? number_format($spins) : '';?></td></tr>
                                        <tr><td>玩家星星数</td><td
                                        class="star"><?= $star ?  number_format($star) : '';?></td></tr>
                                        <tr><td>玩家钻石数</td><td
                                        class="diamond"><?=$diamond ? number_format($diamond) : '';?></td></tr>
                                        <tr><td>充值总额</td><td class="sumMoney"><?php echo $sumMoney;?></td></tr>
										<tr><td>当天获得金币</td><td
                                        class="todayMoney"><?=$todayMoney ? number_format($todayMoney) : '';?></td></tr>
                                        <tr><td>当天获得体力</td>
                                        <td class="todaySpins"><?=$todaySpins ? number_format($todaySpins) : '';?></td></tr> 
                                        <tr><td>当天获得钻石</td>
                                        <td class="todayDiamond"><?=$todayDiamond ? number_format($todayDiamond) : '';?></td></tr>
                                        <tr><td>好友数量</td>
                                        <td
                                        class="friendNumber"><?=$friendNumber ? number_format($friendNumber) : '';?></td></tr>
                                        <tr><td>用户分组</td><td class="userGroup"><?php echo $userGroupName;?></td></tr>
                                        <tr><td>Adjust分组</td><td class="userAdjustGroup"><?php echo $userAdjustGroup == "Not" ? "未归类" : $userAdjustGroup;?></td></tr>
                                        <tr><td>数数分组</td><td class="userGroupSS"><?php echo $userGroupNameSS;?></td></tr>
                                        <tr><td>邀请人数</td><td class="inviteNumber"><?php echo $invite_number;?></td></tr>
                                        <tr><td>邀请成功</td><td class="inviteSuccess"><?php echo $invite_success;?></td></tr>
                                        <tr><td>邀请人</td><td class="inviteuid"><?php echo $inviteuid;?></td></tr>
                                        <tr><td>国家</td><td class="countryCode"><?php echo $country_code;?></td></tr>
                                        <tr><td>当前版本</td><td class="version"><?php echo $version;?></td></tr>
                                        <tr><td>当前岛</td><td class="levelId"> <?php echo $levelId ?? '';?> </td></tr>
                                        <tr>
                                            <td>通行证</td>
                                            <td class="">
                                                <span class="traffic"><?php echo empty($trafficStatus) ? '未激活' : $trafficStatus == 1 ? '已激活普通版' : '已激活精英版'; ?></span>
                                                <button style="margin-left: 10px" type="button" class="btn btn-info  " onclick="activTraffic('normal')">激活普通版</button>
                                                <button style="margin-left: 10px" type="button" class="btn btn-info  " onclick="activTraffic('special')">激活精英版</button>
                                                <button style="margin-left: 10px" type="button" class="btn btn-info btnActivTrafficSix">通行证升级</button>
                                            </td>
                                        </tr>
                                        <tr id="element">
                                            <td>岛建筑</td>
                                            <td></td>
                                        </tr>
                                        <?php if(isset($element)){
                                            foreach ($element as $key=>$val){ ?>
                                                <tr>
                                                    <td style="text-align: center">建筑<?php echo $val['id'];?></td>
                                                    <td style="text-align: center">当前等级：<?php echo $val['level'];?> ，最大等级：<?php echo $val['maxLevel'];?> ，当前状态：<?php echo ($val['status'])?'破损':'正常';?></td>
                                                </tr>
                                            <?php }

                                        }?>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>操作玩家</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <button disabled class="btn btn-primary checkmoneylog" id="moneylog" role="button">查看流水账</button>
                                    <button disabled class="btn btn-primary" role="button" id="order">查看充值订单</button>
                                    <a href="#abnormal/moneySpinsSource/<?php echo $uid; ?>" target="_blank" disabled class="btn btn-primary" role="button" id="moneySpinsSource">金币体力来源</a>
									<a href="#abnormal/upStarsLine/<?php echo $uid; ?>" target="_blank" disabled class="btn btn-primary" role="button" id="upStarsLine">玩家升级曲线</a>
									<a href="#abnormal/upStarsLine/<?php echo $uid; ?>/star" target="_blank" disabled class="btn btn-primary" role="button" id="starLine">玩家星星曲线</a>
                                    <a href="#user/activityData/<?php echo $uid; ?>" target="_blank" disabled class="btn btn-primary" role="button" id="activityData">用户活动数据</a>
                                    <hr/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <button disabled type="button" class="btn btn-primary actionMoney" data-toggle="modal" data-target="#actionMoney">加减金币/体力/盾牌/钻石</button>
                                    <button disabled type="button" class="btn btn-success actionProps" data-toggle="modal" data-target="#actionProps">添加道具</button>
                                    <button disabled type="button" class="btn btn-primary actionPropsList" onclick="actionPropsList()">背包数据</button>
                                    <button disabled type="button" class="btn btn-success actionCard" data-toggle="modal" data-target="#actionCard">加减卡片</button>
                                    <button disabled type="button" class="btn btn-primary actionCardData" onclick="actionCard()">卡片数据</button>
                                    <button disabled type="button" class="btn btn-primary actionPet" onclick="actionPet()">宠物数据</button>
                                    <button disabled type="button" class="btn btn-primary actionMoney" data-toggle="modal" data-target="#actionLevel">设置等级</button>
                                    <button disabled type="button" class="btn btn-primary actionVip" data-toggle="modal" data-target="#actionVip">设置Vip积分</button>
                                    <button type="button" class="btn btn-primary openVip" >开通vip</button>

                                    <?php
                                    if(empty($chatLock) || !$chatLock){
                                        echo '<button disabled id="chatLock" type="button" class="btn btn-danger" onclick="changeChatLock(1)">世界聊天禁言</button>';
                                    }else{
                                        echo '<button id="chatLock" type="button" class="btn btn-success" onclick="changeChatLock(2)">解除禁言</button>';
                                    } ?>
                                    <button disabled type="button" class="btn btn-danger clearAccount">删除该账号</button>
                                    <?php if(isset($status) && $status == 0){ ?>
                                        <button type="button" class="btn btn-success suspendAccount">解封</button>
                                    <?php }else if(isset($status) && $status == 1){ ?>
                                        <button type="button" class="btn btn-danger suspendAccount">封号</button>
                                    <?php }else{ ?>
                                        <button disabled type="button" class="btn btn-danger suspendAccount">封号</button>
                                    <?php } ?>
                                    <button  type="button" class="btn btn-primary actionUInfo2" data-toggle="modal" onclick="actionUInfo2()">账号变更</button>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>
</div>

<!-- 操作金币弹出框 -->
<div class="modal fade" id="actionMoney" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">玩家UID:<span class="modal_uid"><?php echo $uid ?? '';?></span></h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/actionusermoney" data-callBack="updatemoney">
                <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                <input type="hidden" name="mylevel" value="<?php echo $levelId ?? '';?>" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">目前金币值:</label>
                        <div class="col-sm-9">
                            <input readonly type="text" value="<?=$money ? number_format($money) : '';?>" class="form-control modal_money" name="user_oldmoney">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">操作金币值:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="直接填写数字,减钱添加负号即可,不填则不更改" name="newmoney" id="newmoney">
                            <button type="button" onclick="addMoney(10000)" style="margin-top: 10px;" class="btn btn-primary">1W</button>
                            <button type="button" onclick="addMoney(100000)" style="margin-top: 10px;" class="btn btn-primary">10W</button>
                            <button type="button" onclick="addMoney(1000000)" style="margin-top: 10px;" class="btn btn-primary">1M</button>
                            <button type="button" onclick="addMoney(10000000)" style="margin-top: 10px;" class="btn btn-primary">10M</button>
                            <button type="button" onclick="addMoney(50000000)" style="margin-top: 10px;" class="btn btn-primary">50M</button>
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">操作体力数:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="直接填写数字,减钱添加负号即可,不填则不更改" name="newspins">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">操作盾牌数:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="直接填写数字,减钱添加负号即可,不填则不更改" name="newshield">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">操作星星数:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="直接填写数字,减钱添加负号即可,不填则不更改" name="newstar">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">操作钻石数:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="直接填写数字,减钱添加负号即可,不填则不更改" name="newdiamond">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" id="actionusermoney" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="actionVip" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">玩家UID:<span class="modal_uid"><?php echo $uid ?? '';?></span></h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/setVipPoint" data-callBack="updateother">
                <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                <input type="hidden" name="myvipPoint" value="" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">目前Vip积分:</label>
                        <div class="col-sm-9">
                            <input readonly type="text" value="<?php echo $vipPoint ?? '';?>" class="form-control modal_money" name="myvipPoint">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">设置Vip积分:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="vipPoint" required value="0">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="modal fade" id="actionUInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">当前查询UID(<spin style="color: red">仅支持FB</spin>):<span class="modal_uid"><?php echo $uid ?? '';?></span></h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/changeUid" data-callBack="updateother">
                <input type="hidden" name="actionuid" value="" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">当前生效玩家UID:<spin style="color: red" class="okUid"></spin></label>
                        <input type="hidden" name="useUid" value="" id="useUid"/>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">保留账号UID(<spin style="color: red">仅支持FB</spin>):</label>
                        <div class="col-sm-4">
                            <input  type="text" value="" class="form-control" name="toChangeUid">
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">同账号有:</label>
                        <div class="col-sm-4 gleicheUidList" style="color:blue;table-layout : auto" >

                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="modal fade" id="actionLevel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">玩家UID:<span class="modal_uid"><?php echo $uid ?? '';?></span></h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/setLevel" data-callBack="updatemoney">
                <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                <input type="hidden" name="mylevel" value="" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">目前等级:</label>
                        <div class="col-sm-9">
                            <input readonly type="text" value="<?php echo $levelId ?? '';?>" class="form-control modal_money" name="mylevel">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">设置等级:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="levelId" required value="0">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- LINE认证 -->
<div class="modal fade" id="actionLine" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">玩家UID:<span class="modal_uid"><?php echo $uid ?? '';?></span></h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/actionline" data-callBack="updateline">
                <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">LINE账号:</label>
                        <div class="col-sm-9">
                            <input disabled type="text" class="form-control modal_money" name="userline">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 操作金币弹出框 -->
<div class="modal fade" id="actionProps" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">添加道具</h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/actionProps" >
                <div class="modal-body">
                    <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                    <div class="form-group addOrDelControl" id="vipDiv">
                        <label class="col-sm-3 control-label">奖励道具:</label>
                        <div class="col-sm-9">
                            <div class="col-sm-12" style="margin-top: 1rem;">
                                <button type="button" class="btn btn-success addParent" >新增道具</button>
                            </div>
                        </div>
                    </div>
                    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 操作金币弹出框 -->
<div class="modal fade" id="actionCard" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">加减卡片</h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" method="post" action="user/actionCard" >
                <div class="modal-body">
                    <input type="hidden" name="actionuid" value="<?php echo $uid ?? '';?>" />
                    <div class="form-group addOrDelControl">
                        <div class="col-sm-12">
                            <div class="col-sm-12" style="margin-top: 1rem;">
                                <button type="button" class="btn btn-success addCardParent" >新增卡片</button>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>


<!-- 操作金币弹出框 -->
<div class="modal fade" id="actionPropsList" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="top: 20%;width: 60%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabelProps">用户背包道具列表</h4>
            </div>
            <div class="modal-body" id="PropsListBody">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 操作金币弹出框 -->
<div class="modal fade" id="actionCardData" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 60%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">用户卡片信息</h4>
            </div>
            <div class="modal-body" id="actionCardDataBody">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>


<script>
    var returnDataInfo ;
    $(function () {
        $('.openVip').click(function(){
            var userId = $('#userid').val();
            if(!userId)return '请输入玩家UID';
            userId = parseInt(userId)
            if(isNaN(userId))return '请输入数值UID';
            var day = prompt('开通天数', 1);
            if(day < 1)return ;
            $.post('/user/openVip',{uid:userId, day:day}, function(res){
                console.log(res)
                if(typeof res =='string')res = JSON.parse(res)
                alert(res.msg)
            })
        })
        <?php
        if(!empty($uid)){
            echo "$('.actionMoney').removeAttr('disabled');";
            echo "$('.checkmoneylog').removeAttr('disabled');";
            echo "$('.clearAccount').removeAttr('disabled');";
            echo "$('#chatLock').removeAttr('disabled');";
			echo "$('#order').removeAttr('disabled');";
			echo "$('#moneySpinsSource').removeAttr('disabled');";
			echo "$('#activityData').removeAttr('disabled');";
			echo "$('#upStarsLine').removeAttr('disabled');";
			echo "$('#starLine').removeAttr('disabled');";
			echo "$('.actionProps').removeAttr('disabled');";
			echo "$('.actionPropsList').removeAttr('disabled');";
			echo "$('.actionCard').removeAttr('disabled');";
			echo "$('.actionCardData').removeAttr('disabled');";
			echo "$('.actionPet').removeAttr('disabled');";
			echo "$('.actionVip').removeAttr('disabled');";
        }
        ?>
    })
    function validateUser($from) {
        var pid = $from.find('input[name="userid"]');
        if (pid.val() == 0) {
            return '请输入玩家UID';
        }

        return true;
    }

    var htmlStr = '<select  name="vip" id="vip" class="selectpicker show-tick form-control">'+
        '<?php foreach($vipLevelList as $k=>$v) {?>'+
        '<option value="<?php echo $k;?>"><?php echo $v;?></option>'+
        '<?php }?>'+
        '</select>';


    function showuserinfo(returnData, $from) {
        if( returnData.state == 'success' && returnData.type == 'uid'){
            returnDataInfo = returnData;
            if(parseInt(returnData.userinfo.s_picture) <= 10){
                $('.s_picture').attr('src','/public/games_avatar/u_headImg'+ parseInt(returnData.userinfo.s_picture)+'.png');
            }else{
                $('.s_picture').attr('src',returnData.userinfo.s_picture);
            }
            var userInfo = '';
            var uid = returnData.userinfo.uid;
            if(returnData.userinfo.status == 3 || returnData.userinfo.status == 2){
                userInfo = uid + '&nbsp;&nbsp;<div class="btn btn-danger">用户已失效</div>';
            }else if(returnData.userinfo.status == 0){
                userInfo = uid + '&nbsp;&nbsp;<div class="btn btn-danger">用户已封号</div>'
                $('.suspendAccount').text('解封');
                $('.suspendAccount').attr('class','btn btn-success suspendAccount');
            }else{
                userInfo = uid;
            }

            if(returnData.userinfo.trafficStatus > 0 ){
                $('.traffic').text('已激活');
            }else{
                $('.traffic').text('未激活');
            }
            $('.userid').html(userInfo);
            $('.username').text(returnData.userinfo.nick);
            $('.email').text(returnData.userinfo.email);

            console.log('======',returnData.emailInfo,returnData.emailInfo.length);
            var textInfo = "未填写";
            if (returnData.emailInfo!=undefined){
                if (returnData.emailInfo.isVerified==0){
                    textInfo =returnData.emailInfo.email + "-状态:待验证";
                }else if(returnData.emailInfo.isVerified==1){
                    textInfo =returnData.emailInfo.email + "-状态:已发领奖";
                }else if(returnData.emailInfo.isVerified==2){
                    textInfo =returnData.emailInfo.email + "-状态:已发验证待领奖";
                }else if(returnData.emailInfo.isVerified==3){
                    textInfo =returnData.emailInfo.email + "-状态:验证失败";
                }
            }
            //
            $('.emailNew').text(textInfo);

            $('.siteuid').text(returnData.userinfo.siteuid);
            $('.createtime').text(returnData.userinfo.createtime);
            $('.lasttime').text(returnData.userinfo.lasttime);
            $('.loginTime').text(returnData.userinfo.loginTime);
            $('.loginplat').text(returnData.userinfo.login_plat.toUpperCase());
            $('.isrobot').text(returnData.userinfo.isRobot);
            console.log(returnData);
            $('.gleicheUidList').text(returnData.gleicheUidList);
            if(returnData.userinfo.isVistor == '是'){
                $('.isVistor').text(returnData.userinfo.isVistor + ' ( '+returnData.userinfo.mac+' )');
            }else{
                var str = '<p title="'+returnData.userinfo.token+'">'+returnData.userinfo.isVistor + ' ( '+returnData.userinfo.token+' ) '+'</p>'
                $('.isVistor').html(str);
            }
            var timestamp = parseInt(Date.parse(new Date())/1000);
            if(returnData.userinfo.vip = '1' && parseInt(returnData.userinfo.vip_expire) > timestamp){
                $('.isVip').html('是');
            }else{
                $('.isVip').html('否');
            }
            if(returnData.userinfo.isOnline == 1){
            	$('.isOnline').html('是');
            }else{
            	$('.isOnline').html('否');
            }
            $('.signature').text(returnData.userinfo.signature);
            $('.spins').text(returnData.userinfo.spins);
            $('.star').text(returnData.userinfo.star);
            $('.shield').text(returnData.userinfo.shield);
            $('.diamond').text(returnData.userinfo.diamond);
            $('.levelId').text(returnData.userinfo.levelId);
            $('.locale').text(returnData.userinfo.locale);
            $('.sumMoney').text(returnData.userinfo.sumMoney);
            $('.version').text(returnData.userinfo.version);
            $('.money').text(thoundsFormat(returnData.userinfo.money*1000000, ','));
			$('.todayMoney').text(returnData.userinfo.todayMoney);
            $('.todaySpins').text(returnData.userinfo.todaySpins);
            $('.todayDiamond').text(returnData.userinfo.todayDiamond);
            $('.friendNumber').text(returnData.userinfo.friendNumber);
            $('.userGroup').text(returnData.userinfo.userGroupName);
            $('.userGroupSS').text(returnData.userinfo.userGroupNameSS);
            $('.userAdjustGroup').text(returnData.userinfo.userAdjustGroup == "Not" ? "未归类" : returnData.userinfo.userAdjustGroup);
			$('.inviteNumber').text(returnData.userinfo.invite_number);
			$('.inviteSuccess').text(returnData.userinfo.invite_success);
			$('.inviteuid').text(returnData.userinfo.inviteuid);
            $('.countryCode').text(returnData.userinfo.country_code);
            $('.vipLv').text(returnData.userinfo.vipLv);
            $('.vipPoint').text(returnData.userinfo.vipPoint);

            $("#element").nextAll().remove();
            var element = returnData.userinfo.element;
            var eHtml = '';
            for (var i=0;i<element.length;i++){
                var status = element[i].status;
                if(status == '0'){
                    var temp = '正常';
                }else{
                    var temp = '破损';
                }
                eHtml += '<tr><td style="text-align: center">建筑'+element[i].id+'</td><td style="text-align: center">当前等级：'+element[i].level+'，最大等级：'+element[i].maxLevel+' ，当前状态：'+temp+'</td></tr>'
            }

            $('#element').after(eHtml);
            $('.losetimes').text(returnData.userinfo.losetimes);
            //模态框
            $('.actionMoney').removeAttr('disabled');
            $('.actionVip').removeAttr('disabled');
            $('.actionPropsList').removeAttr('disabled');
            $('.actionCard').removeAttr('disabled');
            $('.modal_uid').text(returnData.userinfo.uid);
            $("input[name='actionuid']").val(returnData.userinfo.uid);
            $('.modal_money').val(thoundsFormat(returnData.userinfo.money, ','));
            $("input[name='mylevel']").val(returnData.userinfo.levelId);
            $("input[name='myvipPoint']").val(returnData.userinfo.vipPoint);

            if( returnData.userinfo.line == 0 && returnData.userinfo.lineaccount ){//LINE按钮
                $('.actionLine').removeAttr('disabled');
                $("input[name='actionuid']").val(returnData.userinfo.uid);
                $("input[name='userline']").val(returnData.userinfo.lineaccount);
            }
            //链接按钮
            $('.checkpokerlog').removeClass('disabled');
            $('.checkmoneylog').removeClass('disabled');
            $('.clearAccount').removeAttr('disabled');
            $('.clearAcc').removeAttr('disabled');
            $('#moneylog').removeAttr('disabled');
            $('#order').removeAttr('disabled');
            $('.actionProps').removeAttr('disabled');
            $('.actionCardData').removeAttr('disabled');
            $('.actionPet').removeAttr('disabled');

            $('#moneySpinsSource').removeAttr('disabled');
            $('#moneySpinsSource').attr("href","#abnormal/moneySpinsSource/"+uid);

            $('#activityData').removeAttr('disabled');
            $('#activityData').attr("href","#user/activityData/"+uid);

            $('#upStarsLine').removeAttr('disabled');
            $('#upStarsLine').attr("href","#abnormal/upStarsLine/"+uid);

			$('#starLine').removeAttr('disabled');
            $('#starLine').attr("href","#abnormal/upStarsLine/"+uid+"/star");
			
            $('#chatLock').removeAttr('disabled');
            if(returnData.userinfo.chatLock){
                $('#chatLock').removeClass('btn-danger');
                $('#chatLock').addClass('btn-success');
                $('#chatLock').html('解除禁言');
            }
        }else if(returnData.state == 'success' && returnData.type == 'nick'){
            $('#nickDiv').show();
            var userType = $("input[name='userType']:checked").val();
            var shtml = '';
            for (i=0;i<returnData.userinfo.length;i++){
                if(userType == 1 && returnData.userinfo[i].status != 1){
                    continue;
                }
                shtml += '<tr><td class="searchBynick">'+returnData.userinfo[i].uid+'</td><td>'+returnData.userinfo[i].nick+'</td></tr>'
            }
            $('#nickTable').html(shtml);
        }
        var slotHtml = '';
        $('#slotSpinsLost').empty();
        for(var i=1;i<15;i++){
            console.log(returnData.spinslost[i]);
            var num = returnData.spinslost[i]!==undefined?parseInt(returnData.spinslost[i]):0;
            slotHtml +="<td>"+num+"</td>";
        }

        $('#slotSpinsLost').append(slotHtml);


    }

    $("#nickDiv").on('click','.searchBynick',function(){
        var uid = parseInt($(this).html());
        $('#userid').val(uid);
        setTimeout(function () {
            $('#SubmitBtn').click();
        },1000)
    })

    function changeChatLock(type) {
        var tips = (type==1)?"确认禁言该账号?备注原因：":"确认解除禁言?";
        var tips2 = (type==1)?"禁言成功":"解除禁言成功";
        var remark = '';
        if(type==1){
            remark = prompt(tips);
            if(remark){

            }else if(remark === ""){
                alert('请输入禁言原因');
                return false;
            }else{
                return false;
            }
        }
        var uid = $("input[name='userid']").val();
        $.post("user/chatLock", { uid: uid,remark:remark }, function(data){
            if( data == 1 ){
                alert(tips2);
                <?php
                if(!empty($uid)){
                    echo "window.location.reload()";;
                }else{
                    echo "window.location.href = '#user/index/'+uid";
                }
                ?>
            }
        });
    }

    //更新 筹码 钻石 道具 经验
    function updatemoney(returnData, $from) {
        var level;
        if(returnData.retdata.mylevel > 0) {
            level = returnData.retdata.mylevel;
        }else {
            level = returnData.mylevel;
        }
        if( returnData.state == 'success' ){
            $('.money').text(thoundsFormat(returnData.retdata.money));
            $('.safebox').text(returnData.retdata.safe_box);
            $('.masterPoints').text(returnData.retdata.masterpoints);
            $('.diamonds').text(returnData.retdata.diamonds);
            $('.count').text(returnData.retdata.propsnum);
            $('.speaker').text(returnData.retdata.speakernum);
            $('.exp').text(level+'('+returnData.retdata.exp+')');
        }

    }
    function updateother(returnData, $from) {
        console.log(returnData);
        console.log($from);
    }

    //添加VIP
    function addvip(returnData, $from) {
        if(returnData.state == 'success') {
            var userInfo = $('.userid').text(),
                userInfoList;
            //截取用户信息
            userInfoList = userInfo.split('|');
            userInfoList.pop();//弹出数组最后一个元素
            userInfoList.push('VIP'+returnData.retdata.type + ')');
            userInfo = userInfoList.join('|');
            $('.userid').text(userInfo);
            $('.vipdays').text(returnData.retdata.day);
        }
    }

    function updateline(returnData, $from) {
        if( returnData.state == 'success' ){
            $('.lineaccount').children('.wrz').remove();
            $('.lineaccount').append("<span class='yrz'>(已认证)</span>");
            $('.actionLine').attr('disabled',true);
        }
    }

    //删除账号
    $('.clearAccount').click(function(){
        if( confirm("确认删除该账号?") ){
            var uid = $("input[name='userid']").val();
            $.post("user/clearAccount", { uid: uid }, function(data){
                if( data == 1 ){
                    alert('删除成功');
                    window.location.reload();
                }
            });
        }
    });

    //封账号
    $('.suspendAccount').click(function(){
        var tips = $('.suspendAccount').text()
        if( confirm("确认对该账号进行"+tips+"?") ){
            var uid = $("input[name='userid']").val();
            $.post("user/suspendAccount", { uid: uid }, function(data){
                if( data == 1 ){
                    if(tips == "封号"){
                        $('.suspendAccount').text('解封');
                        $('.suspendAccount').attr('class','btn btn-success suspendAccount');
                        $('.userid').html(uid + '&nbsp;&nbsp;<div class="btn btn-danger">用户已封号</div>');
                    }else{
                        $('.suspendAccount').text('封号');
                        $('.suspendAccount').attr('class','btn btn-danger suspendAccount');
                        $('.userid').html(uid);
                    }
                    alert('操作成功');
                }else {
                    alert('操作失败');
                }
            });
        }
    });


    //跳转订单
    $('#order').click(function () {
        var uid = $('#userid').val();
        location.href = rootPath + '#payment/index?uid=' + uid;
    });
    //金流订单
    $('#moneylog').click(function () {
        var uid = $('#userid').val();
        window.open(rootPath + '#user/log/' + uid+'/all');
    });

    function addMoney(money) {
        $('#newmoney').val(money);
    }
    
    var idData = JSON.parse('<?php echo json_encode($propsConfig); ?>');
    $('.addParent').on("click",function(){
        var str = '<div class="col-sm-12" style="margin-top: 1rem;padding-left:0"><div class="col-sm-5"><select class="form-control typeControl" name="props[id][]">';
        for(var x in idData) {
            str += '<option value="'+idData[x]['id']+'">'+idData[x]['msg']+'</option>';
        }
        str +='</select></div><div class="col-sm-5"><input type="number" class="form-control" placeholder="道具数量" name="props[num][]" min="1" value="1"></div><div class="col-sm-1"><button type="button" class="btn btn-danger deleteParent" >删除</button></div></div>';
        $(this).parent().before(str);
    });
    $('.addOrDelControl').on("click",'.deleteParent',function(){
        $(this).parent().parent().remove();
    });

    var cardData = JSON.parse('<?php echo addslashes(json_encode($cardConfig)); ?>');
    $('.addCardParent').on("click",function(){
        var str = '<div class="col-sm-12" style="margin-top: 1rem;padding-left:0">';
        str += '<div class="col-sm-4"><select class="form-control" onchange="cgChange(this,this.value)">';
        for(var x in cardData) {
            str += '<option value="'+cardData[x]['cgid']+'">'+cardData[x]['name']+'</option>';
        }
        str += '</select></div>';
        str += '<div class="col-sm-4"><select class="form-control typeControl" name="card[id][]">';
        for(var x in cardData[1]['card']) {
            str += '<option value="'+cardData[1]['card'][x]['ciid']+'">'+cardData[1]['card'][x]['ci_name_zh']+'</option>';
        }
        str += '</select></div>';

        str += '<div class="col-sm-3"><input type="number" class="form-control" placeholder="卡片数量" name="card[num][]" value="1"></div><div class="col-sm-1"><button type="button" class="btn btn-danger deleteParent" >删除</button></div></div>';
        $(this).parent().before(str);
    });

    function cgChange(obj , value){
        var selObj = $(obj).parent().next().children();
        selObj[0].options.length=0;
        for(var x in cardData[value]['card']) {
            $(selObj).append('<option value="'+cardData[value]['card'][x]['ciid']+'">'+cardData[value]['card'][x]['ci_name_zh']+'</option>');
        }
    }

    $('.addOrDelControl').on("click",'.deleteParent',function(){
        $(this).parent().parent().remove();
    });


    function actionPropsList() {
        var uid = $("input[name='userid']").val();
        $.post("user/props", { uid: uid }, function(data){
            $("#myModalLabelProps").html("用户背包道具列表");
            data = JSON.parse(data);
            data = data.data;
            var i= 0;
            var str = "";
            for(var x in data) {
                if(i%3==0){
                    str += '<div class="row">';
                }
                str += '<div class="col-sm-4"><div class="col-sm-6"><input type="text" readonly class="form-control" value="'+data[x]['name']+'"></div><div class="col-sm-6"><input readonly type="number" class="form-control" value="'+data[x]['count']+'"></div></div>';
                i++;
                if(i%3==0){
                    str += '</div>';
                }
            }
            $('#PropsListBody').html(str);
            $('#actionPropsList').modal('show')
        });
    }
    function actionCard() {
        var uid = $("input[name='userid']").val();
        $.post("user/card", { uid: uid }, function(data){
            data = JSON.parse(data);
            data = data.data;
            var str = '<div class="accordion" id="accordion2">';
            for(var x in data) {
                str += '<div class="accordion-group" style="display: inline-block;width: 100%;"><div class="accordion-heading" style="margin: 10px;"><button class="btn btn-success accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse'+x+'">'+data[x]["name"]+'</button></div>';
                str += '<div id="collapse'+x+'" class="accordion-body collapse" style="height: 0px; "><div class="accordion-inner">';
                var i= 0;
                for(var y in data[x]['card']) {
                    if(i%3==0){
                        str += '<div class="row">';
                    }
                    str += '<div class="col-sm-4"><div class="col-sm-6"><input type="text" readonly class="form-control" value="'+data[x]['card'][y]['name']+'"></div><div class="col-sm-6"><input readonly type="number" class="form-control" value="'+data[x]['card'][y]['num']+'"></div></div>';
                    i++;
                    if(i%3==0){
                        i = 0;
                        str += '</div>';
                    }
                }

                if(i != 0){
                    str += '</div>';
                }

                str += '</div></div></div>';
            }
            str += '</div>';
            $('#actionCardDataBody').html(str);
            $('#actionCardData').modal('show')
        });
    }

    function actionPet() {
        var uid = $("input[name='userid']").val();
        $.post("user/pet", { uid: uid }, function(data){
            $("#myModalLabelProps").html("用户宠物列表");
            data = JSON.parse(data);
            data = data.data;
            var i= 0;
            var str = "";
            for(var x in data) {
                if(i%3==0){
                    str += '<div class="row">';
                }
                str += '<div class="col-sm-4"><div class="col-sm-6"><input type="text" readonly class="form-control" value="'+data[x]['name']+'"></div><div class="col-sm-6"><input readonly type="number" class="form-control" value="'+data[x]['lv']+'"></div></div>';
                i++;
                if(i%3==0){
                    str += '</div>';
                }
            }
            $('#PropsListBody').html(str);
            $('#actionPropsList').modal('show')
        });
    }


    function actionUInfo2() {
        alert("查询同号耗时可能过长请等待...");
        var siteuid = returnDataInfo.userinfo.siteuid;

        $.post("user/getGleicheUinfo", { siteuid: siteuid }, function(data){
            data = JSON.parse(data);
            data = data.data;
            console.log('=====',data);
            $('.okUid').text(data.ssuid);
            $('#useUid').val(data.ssuid);
            $('.gleicheUidList').text(data.gleicheUidList);
            $('#actionUInfo').modal('show')
        });
    }



    function activTraffic(type) {
        console.log(type);
        let trafficTypes = ['normal', 'special'];
        if (!trafficTypes.includes(type)) {
            return;
        }
        let typeText = '';
        switch (type) {
            case 'normal':
                typeText = '普通版';
                break;
            case 'special':
                typeText = '精英版';
                break;
            default:
                return;
        }
        var uid = $("input[name='userid']").val();
        if (!uid) {
            return;
        }
        if (confirm('确定给用户：' + uid + ' 激活通行证' + typeText + '？')) {
            $.post("user/setTrafficPermit", {uid: uid, option: 2, type: type}, function (data) {
                if (typeof data == 'string') data = JSON.parse(data)
                alert(data.msg)
            });
        }
    }

    $('.btnActivTrafficSix').click(function () {
        var uid = $("input[name='userid']").val();
        if (!uid) {
            return;
        }
        var lv = prompt('输入提升等级数')
        lv = parseInt(lv)
        if (isNaN(lv) || (lv < 0)) {
            alert('不支持的等级')
            return;
        }
        if (confirm('确定给用户：' + uid + ' 通行证提升' + lv + '级？')) {
            $.post("user/setTrafficPermit", {uid: uid, option: 3, lv: lv}, function (data) {
                if (typeof data == 'string') data = JSON.parse(data)
                alert(data.msg)
            });
        }
    });

</script>