123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2017/5/23 0023
- * Time: 下午 8:24
- */
- use yii\helpers\Url;
- use yii\widgets\LinkPager;
- ?>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <div class="row">
- <div class="col-sm-5 m-b-xs">
- <div class="col-sm-9">
- </div>
- </div>
- </div>
- <div class="table-responsive">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>用户id</th>
- <th>用户名</th>
- <th>公司名</th>
- <th>营业执照</th>
- <th>电话</th>
- <th>等级</th>
- <th>年限</th>
- <th>领域</th>
- <th>地区</th>
- <th>注册时间</th>
- <th>审核</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($datas)):?>
- <?php foreach($datas as $data):?>
- <tr>
- <td><?=$data->id?></td>
- <td><?=$data->username?></td>
- <? $userinfo = isset($data->usercompany)?$data->usercompany:''?>
- <td><a class="introduce""><input hidden="hidden" class="introduce-val" value="<?=isset($userinfo->introduction)?$userinfo->introduction:''?>"><?=isset($userinfo->company)?$userinfo->company:''?></a></td>
- <td> <img <?php if(!empty($userinfo->logo)):?>src="<?=Yii::getAlias('@imgdomain').'/'.$userinfo->logo; ?>" style=" width: 50px;"><?php endif;?></td>
- <td><?=isset($userinfo->tel)?$userinfo->tel:''?></td>
- <td><?=isset($userinfo->level)?$userinfo->level:''?></td>
- <td><?=isset($userinfo->age)?$userinfo->age:''?></td>
- <td><?=isset($userinfo->licence)?$userinfo->licence:''?></td>
- <td><?=isset($userinfo->city)?$userinfo->city:''?><?=isset($userinfo->district)?$userinfo->district:''?><?=isset($userinfo->adress)?$userinfo->adress:''?></td>
- <?unset($userinfo)?>
- <td><?=date('Y-m-d H:i:s',$data->created_at)?></td>
- <td data="<?=$data->id?>">
- <a class="btn btn-sm btn-primary user-conduct" date="agree">通过</a>
- <button class="btn btn-sm btn-danger user-conduct" date="reject">驳回</button>
- </td>
- </tr>
- <?php endforeach;?>
- <?php endif?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- <script>
- $(".introduce").click(function(){
- var introduce = $(this).find('.introduce-val').val();
- var company = $(this).text();
- parent.layer.open({//layer弹窗插件语法
- title: company+'简介',//标题
- anim: 1 ,//动画类型有0-6,不想显示动画,设置 anim: -1
- scrollbar: false,//默认允许浏览器滚动,如果设定scrollbar: false,则屏蔽
- area: ['500px', '300px'],//自定义宽高
- content: '<textarea class="content" rows="6" cols="62">'+introduce+'</textarea>',//自定义内容
- shade: [0.8, '#393D49'],//默认是0.3透明度的黑色背景('#000'),不想显示遮罩shade: 0
- shadeClose:true,//控制点击弹层外区域关闭
- btn: ['确认'],//自定义按钮,默认第一个为确定按钮
- btnAlign: 'c',//按钮显示方式 'l' 按钮左对齐 'c' 按钮居中对齐 'r' 按钮右对齐(默认)
- btn1:function(index, content){
- }
- });
- });
- $('.type-select').change(function(){
- var type = $(this).val();
- window.location="<?=Url::toRoute(['user/auditlist']);?>?type="+type;
- })
- $('.user-conduct').click(function(){
- var ele = $(this);
- var id = ele.parent().attr('data');
- var conduct = $(this).attr('date');
- if(conduct=='agree'){
- var text = "确定审核通过?";
- }else{
- var text = "确定审核驳回?";
- }
- swal({
- title: "提醒",
- text: text,
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- closeOnConfirm: false
- }, function () {
- $.ajax({
- url:'<?=Url::toRoute(['user/useraudit']);?>',
- type:'POST',
- dataType:'json',
- data:{'id':id,'conduct':conduct,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
- success:function(data){
- if(data.sign==1){
- swal("", data.msg, "success");
- ele.parent().parent().remove();
- }else{
- swal("", data.msg, "error");
- }
- }
- });
- });
- })
- </script>
|