| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- use yii\widgets\LinkPager;
- use common\components\stringUtil;
- ?>
- <?php
- use backend\widgets\TabWidget;
- echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
- ?>
- <div class="panel panel-default">
- <?php
- use backend\widgets\SubTabWidget;
-
- echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
- ?>
- <a href="/teach/teacher-add" class="btn btn-secondary btn-single" style="margin-right:15px;">添加讲师</a>
- <div class="panel-body">
- <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="table-responsive">
- <table class="table table-bordered table-striped">
- <thead>
- <tr class="active">
- <th class="no-sorting"><input type="checkbox"></th>
- <th>ID</th>
- <th>名称</th>
- <th>头像</th>
- <th>头衔</th>
- <th>创建日期</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach ($models as $key => $val) { ?>
- <tr>
- <td></td>
- <td><?= $val['id'] ?></td>
- <td><?= $val['teacherName'] ?></td>
- <td>
- <?php if(!empty($val['avatar'])){ ?>
- <img width="30" src="<?= Yii::$app->params['imgUrl'].$val['avatar'] ?>" />
- <?php } ?>
- </td>
- <td><?= $val['title'] ?></td>
- <td><?php echo date("Y-m-d H:i", $val['addTime']); ?></td>
- <td>
- <a href="/teach/teacher-edit?id=<?= $val['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">修改 </a>
- <a href="javascript:;" onclick="delTeacher(<?= $val['id'] ?>)" class="btn btn-danger btn-sm btn-icon icon-left">删除 </a>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <div class="dataTables_paginate paging_simple_numbers"
- style="float:right;padding-top:0px;margin-right:15px;">
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- echo FooterWidget::widget();
- ?>
- <!-- footer -->
- <script>
- function delTeacher()
- {
- var id = arguments[0];
- var respond = confirm('确认要删除?');
- if(respond == false){
- return false;
- }
- $.ajax({type:"GET",url:'/teach/teacher-del?id='+id,async:false,dataType:'json',success:function(data){
- xhPopMsg(data.msg);
- if(data.code == 'A0001'){
- setTimeout(function(){
- window.location.reload();
- },1500);
- }
- }});
- }
- </script>
|