123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?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>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($datas)):?>
- <?php foreach($datas as $data):?>
- <tr>
- <td><?=$data->id?></td>
- <?php $nickname = isset($data->nickname)?$data->nickname:''?>
- <td><?=isset($nickname->nickname)?$nickname->nickname:''?></td>
- <?php $userinfo = isset($data->userinfo)?$data->userinfo:''?>
- <td><?=isset($data->compound)?$data->compound:''?></td>
- <td><?=isset($data->layout)?$data->layout:''?></td>
- <td><?=isset($data->acreage)?$data->acreage:''?></td>
- <td><?=isset($data->amount)?$data->amount:''?></td>
- <td><?=isset($data->province)?$data->province:''?>
- <?=isset($data->city)?$data->city:''?>
- <?=isset($data->district)?$data->district:''?>
- <?=isset($data->address)?$data->address:''?></td>
- <?unset($userinfo)?>
- <td><?=date('Y-m-d H:i',$data->updated_at)?></td>
- <td>
- <a class="btn btn-sm btn-danger del"data="<?= $data->id?>">删除</a>
- </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){
- }
- });
- });
- $('.table-responsive').on('click','.del',function(){
- var id = $(this).attr('data');
- var text = $(this);
- swal({
- title: "确定删除?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- closeOnConfirm: true,
- closeOnCancel: true },
- function(isConfirm){
- if (isConfirm) {
- $.ajax({
- url:'<?=Url::toRoute(['user/del_house']);?>',
- type:'POST',
- dataType:'json',
- data:{id:id,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
- success:function(data){
- if(data.sign==1){
- text.parents('tr').remove();
- }else{
- swal("", data.msg, "error");
- }
- }
- })
- }
- });
- })
- </script>
|