subscribe.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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="table-responsive">
  21. <table class="table table-striped">
  22. <thead>
  23. <tr>
  24. <th>预约人</th>
  25. <th>类型</th>
  26. <th>工地名称</th>
  27. <th>创建时间</th>
  28. <th>预定时间</th>
  29. <th>联系电话</th>
  30. <!-- <th>联系名称</th>-->
  31. <th>备注信息</th>
  32. <th>状态</th>
  33. <th>操作</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. <?php if(!empty($models)):?>
  38. <?php foreach($models as $mo):?>
  39. <tr class="">
  40. <td><?=$mo->applicant_name?></td>
  41. <td><?=$mo->type==1?"工地":"样板房"?></td>
  42. <td><?=isset($mo->building->name)?$mo->building->name:""?></td>
  43. <td><?=date('Y-m-d H:i:s',$mo->created_at)?></td>
  44. <td><?=date('Y-m-d H:i:s',$mo->booking_time)?></td>
  45. <td>
  46. <?php if($member!=\common\models\UserCompany::ISMEMBER){
  47. echo \common\models\Appointment::telPreg($mo->applicant_tel);
  48. }else{
  49. echo $mo->applicant_tel;
  50. } ?>
  51. </td>
  52. <td><?=$mo->remark?></td>
  53. <td><?=$mo->state==0?'未处理':'已处理'?></td>
  54. <td>
  55. <?php if($mo->state==0):?>
  56. <a class="btn btn-sm btn-info <?php if($member!=\common\models\UserCompany::ISMEMBER){echo "warning";}else{echo "posted"; } ?> " id="<?=$mo->id?>">处理</a>
  57. <?php else:?>
  58. <a class="btn btn-sm btn-default " >已处理</a>
  59. <?php endif?>
  60. </td>
  61. </tr>
  62. <?php endforeach;?>
  63. <?php endif?>
  64. </tbody>
  65. </table>
  66. <?= LinkPager::widget(['pagination' => $pages]); ?>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <script>
  73. $(document).on('click','.posted',function(){
  74. var chat = $(this);
  75. var id = chat.attr('id');
  76. $.ajax({
  77. url:'<?=Url::toRoute(['building/dispose']);?>',
  78. type:'GET',
  79. dataType:'json',
  80. data:{id:id},
  81. success:function(data){
  82. if(data.sign==1){
  83. layer.msg(data.msg);
  84. chat.removeClass('btn-info');
  85. chat.removeClass('posted');
  86. chat.addClass('btn-default');
  87. chat.text('已处理');
  88. }else{
  89. layer.msg(data.msg);
  90. }
  91. }
  92. })
  93. });
  94. $('.warning').click(function () {
  95. swal({
  96. title: "您还不是豪省心的会员,无法查看业主联系方式,请联系平台客服400-0592-018开通会员",
  97. //text: "删除后将无法恢复,请谨慎操作!",
  98. type: "warning",
  99. //showCancelButton: true,
  100. confirmButtonColor: "#DD6B55",
  101. confirmButtonText: "确认",
  102. closeOnConfirm: false
  103. });
  104. });
  105. </script>