designer.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2017/3/17 0017
  6. * Time: 上午 10:52
  7. */
  8. use yii\helpers\Url;
  9. use yii\widgets\LinkPager;
  10. ?>
  11. <style>
  12. .color{
  13. color: red;
  14. }
  15. </style>
  16. <div class="row">
  17. <div class="col-sm-12">
  18. <div class="ibox float-e-margins">
  19. <div class="ibox-content">
  20. <div class="row">
  21. <div class="col-sm-5 m-b-xs">
  22. <a class="btn btn-sm btn-primary addhotsearch" href="<?=Url::toRoute(['user/designer','conduct'=>'add'])?>">添加设计师</a>
  23. </div>
  24. </div>
  25. <div class="table-responsive">
  26. <table class="table table-striped">
  27. <thead>
  28. <tr>
  29. <th>ID</th>
  30. <th>头像</th>
  31. <th>名称</th>
  32. <th>简介</th>
  33. <th>创建时间</th>
  34. <th>更新时间</th>
  35. <th>操作</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <?php if(!empty($models)):?>
  40. <?php foreach($models as $mo):?>
  41. <tr class="">
  42. <td><?=$mo->id?></td>
  43. <td><img src="<?=empty($mo->image->pic)?"":Yii::getAlias('@imgdomain').$mo->image->pic?>" class="img-thumbnail " style="width: 150px;height: 80px;" imgtype="img"></td>
  44. <td><?=$mo->realname?></td>
  45. <td><?=$mo->introduction?></td>
  46. <td><?=date('Y-m-d H:i:s',$mo->created_at)?></td>
  47. <td><?=date('Y-m-d H:i:s',$mo->update_at)?></td>
  48. <td>
  49. <a href="<?=Url::toRoute(['user/designer','id'=>$mo->id,'conduct'=>'update'])?>" class="btn btn-sm btn-primary edit_advert">修改</a>
  50. <a class="btn btn-sm btn-danger delete" id="<?=$mo->id?>">删除</a>
  51. </td>
  52. </tr>
  53. <?php endforeach;?>
  54. <?php endif?>
  55. </tbody>
  56. </table>
  57. <?= LinkPager::widget(['pagination' => $pages]); ?>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <script>
  64. $('.delete').click(function(){
  65. var chat = $(this);
  66. var id = chat.attr('id');
  67. var conduct = 'delete';
  68. $.ajax({
  69. url:'<?=Url::toRoute(['user/designer']);?>',
  70. type:'GET',
  71. dataType:'json',
  72. data:{id:id,conduct:conduct},
  73. success:function(data){
  74. if(data.sign==1){
  75. alert(data.msg);
  76. chat.parent().parent().hide();
  77. }else{
  78. alert(data.msg);
  79. }
  80. }
  81. })
  82. });
  83. </script>