receive.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="ibox-title">
  22. <h5><a class="btn btn-xs btn-primary" href="<?=\yii\helpers\Url::toRoute(['building/index']);?>"><i class="fa fa-reply"></i>&nbsp;返回列表</a></h5>
  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. </tr>
  35. </thead>
  36. <tbody>
  37. <form id="checkForm" method="post">
  38. <?php $i=0; foreach($list as $data):?>
  39. <tr >
  40. <td><?=$data['id'] ?></td>
  41. <td><?=$data['name'] ?></td>
  42. <td class="keyword"><?=$data['amount'] ?></td>
  43. <td class="keyword"><?=date("Y-m-d H:i",$data['receive_at'])?></td>
  44. <td><?php if($data['status']==\common\models\ActivityReceive::STATUS_NOT)echo "未领取";else echo "已领取"; ?></td>
  45. </tr>
  46. <?php endforeach;?>
  47. <input type="hidden" name="_csrf-backend" value="<?=Yii::$app->request->csrfToken;?>" />
  48. <input type="hidden" value="" name="key" class="shelves-key">
  49. </form>
  50. </tbody>
  51. </table>
  52. <?= LinkPager::widget(['pagination' => $pages]); ?>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <script>
  59. $('.table-responsive').on('click','.del_manage',function(){
  60. var id = $(this).attr('data');
  61. var text = $(this);
  62. swal({
  63. title: "确定删除该活动?",
  64. type: "warning",
  65. showCancelButton: true,
  66. confirmButtonColor: "#DD6B55",
  67. confirmButtonText: "确定",
  68. cancelButtonText: "取消",
  69. closeOnConfirm: true,
  70. closeOnCancel: true },
  71. function(isConfirm){
  72. if (isConfirm) {
  73. $.ajax({
  74. url:'<?=Url::toRoute(['redpack/delete']);?>',
  75. type:'POST',
  76. dataType:'json',
  77. data:{id:id,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
  78. success:function(data){
  79. if(data.sign==1){
  80. text.parents('tr').remove();
  81. }else{
  82. swal("", data.msg, "error");
  83. }
  84. }
  85. })
  86. }
  87. });
  88. });
  89. </script>