1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2017/3/17 0017
- * Time: 上午 10:52
- */
- use yii\helpers\Url;
- use yii\widgets\LinkPager;
- ?>
- <style>
- .color{
- color: red;
- }
- </style>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <div class="row">
- <div class="ibox-title">
- <h5><a class="btn btn-xs btn-primary" href="<?=\yii\helpers\Url::toRoute(['building/index']);?>"><i class="fa fa-reply"></i> 返回列表</a></h5>
- </div>
- </div>
- <div class="table-responsive">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>ID</th>
- <th>工地名称</th>
- <th>金额</th>
- <th>领取时间</th>
- <th>状态</th>
- </tr>
- </thead>
- <tbody>
- <form id="checkForm" method="post">
- <?php $i=0; foreach($list as $data):?>
- <tr >
- <td><?=$data['id'] ?></td>
- <td><?=$data['name'] ?></td>
- <td class="keyword"><?=$data['amount'] ?></td>
- <td class="keyword"><?=date("Y-m-d H:i",$data['receive_at'])?></td>
- <td><?php if($data['status']==\common\models\ActivityReceive::STATUS_NOT)echo "未领取";else echo "已领取"; ?></td>
- </tr>
- <?php endforeach;?>
- <input type="hidden" name="_csrf-backend" value="<?=Yii::$app->request->csrfToken;?>" />
- <input type="hidden" value="" name="key" class="shelves-key">
- </form>
- </tbody>
- </table>
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- $('.table-responsive').on('click','.del_manage',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(['redpack/delete']);?>',
- 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>
|