index.php
4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
use yii\helpers\Html;
use backend\widgets\LinkPager;
?>
<div>
<p class="lead">
<span class="mr10">房间号:<?php echo $filter['room_id']?>#<?php echo $room['title']?></span>
<span>直播状态:<?php echo Yii::$app->params['config']['room_living'][$room['living']]?></span>
</p>
</div>
<div class="col-md-5">
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline" method="post" action="/forbidden/create">
<div>
<div class="form-group">
<label class="control-label">用户UID:</label>
<input class="form-control" name="uid" value="">
</div>
<div class="form-group">
<label class="control-label">用户昵称:</label>
<input class="form-control" name="name" value="">
</div>
<input type="hidden" name="room_id" value="<?php echo $filter['room_id']?>">
<button type="submit" class="btn btn-primary mr5">+添加</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline" method="get" >
<div>
<div class="form-group">
<label class="control-label">用户UID:</label>
<input class="form-control" name="uid" value="<?php echo $filter['uid']?>">
</div>
<div class="form-group">
<label class="control-label">用户昵称:</label>
<input class="form-control" name="name" value="<?php echo $filter['name']?>">
</div>
<input type="hidden" name="room_id" value="<?php echo $filter['room_id']?>">
<button type="submit" class="btn btn-primary mr5">查询</button>
</div>
</form>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label>-->
<!-- <a href="/live/addmaster" class="btn btn-primary">+ 添加主播</a>-->
<!-- </label>-->
<!-- </div>-->
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-dark mb30">
<thead>
<tr>
<th>用户UID</th>
<th>用户昵称</th>
<th>最后一次发言时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($list as $v):?>
<tr>
<td><?php echo $v->uid;?></td>
<td><?php echo $v->name;?></td>
<td></td>
<td>
<?php if($v->status==Yii::$app->params['config']['is_forbid_stat']){?>
<a class="btn btn-info set-status" unqid="<?php echo $v->id;?>" stat="<?php echo (1-$v->status);?>">取消禁言</a>
<?php }else{?>
<a class="btn btn-danger set-status" unqid="<?php echo $v->id;?>" stat="<?php echo (1-$v->status);?>">禁言</a>
<?php }?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<!-- table-responsive -->
<?php echo LinkPager::widget(['pagination' => $pagination]);?>
</div>
<!-- col-md-12 -->
</div>
</div>
<div class="col-md-7">
<iframe height="600px" width="100%" src="/forbidden/getcomments?room_id=<?php echo $filter['room_id']?>">
</iframe>
</div>
<script type="text/javascript">
$(function(){
$('.set-status').click(function(){
var stat = $(this).attr('stat');
var obj = $(this);
$.get("/forbidden/set-status",{id:$(this).attr('unqid'),status:stat},function(data){
// alert(stat);return;
if(data.code==200){
if(stat==0){
obj.html('禁言');
obj.attr('stat',1).attr('class','btn btn-danger set-status');
// obj.className = "btn btn-info set-status";
}
if(stat==1){
obj.html('取消禁言');
obj.attr('stat',0).attr('class','btn btn-info set-status');
}
}else{
alert('设置失败');
}
},'json');
});
});
</script>