You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
2.6 KiB

  1. <?php
  2. use yii\helpers\Html;
  3. use common\components\zGridView;
  4. /* @var $this yii\web\View */
  5. /* @var $model backend\modules\motorcade\models\searchDocument */
  6. /* @var $form yii\widgets\ActiveForm */
  7. \yii\widgets\Pjax::begin(['id' => 'pjax-tab1', 'timeout' => false]);
  8. echo $this->render('_search', ['model' => $searchModel, 'tab' => '1', 'type' => 'driver']);
  9. ?>
  10. <div class="tab-pane" role="tabpanel">
  11. <?php
  12. echo zGridView::widget([
  13. 'id' => 'grid-view-tab1',
  14. 'dataProvider' => $dataProvider,
  15. 'resizableColumns'=>false,
  16. 'pagerFixed' => true,
  17. 'rowOptions' => function ($model, $key, $index, $column) {
  18. return ['class' => ($model->EXPIRE_DATE < date('Y-m-d', strtotime('+30 days')) ? 'bg-light-sky-blue bg-font-light-pink' : '')];
  19. },
  20. 'columns' => [
  21. [
  22. 'width' => '3%',
  23. 'class' => 'kartik\grid\CheckboxColumn',
  24. 'rowSelectedClass' => '',
  25. ],
  26. [
  27. 'width'=>'230px',
  28. 'label' => '姓名',
  29. 'attribute' => 'driver.DRIVER_NAME'
  30. ],
  31. [
  32. 'width'=>'310px',
  33. 'label' => '手机号',
  34. 'attribute' => 'driver.PHONE_NO'
  35. ],
  36. [
  37. 'width'=>'280px',
  38. 'label' => '有效期',
  39. 'attribute' => 'EXPIRE_DATE'
  40. ],
  41. // 'driver.DRIVER_NAME',
  42. // 'driver.PHONE_NO',
  43. // 'EXPIRE_DATE',
  44. [
  45. 'hAlign'=>'center',
  46. // 'width'=>'125px',
  47. 'header' => '操作',
  48. // 'class' => 'yii\grid\ActionColumn',
  49. //// 'headerOptions' => ['class' => 'kartik-sheet-style'],
  50. // 'template' => '{update}',
  51. // 'buttons' => [
  52. // 'update' => function ($url, $model, $key) {
  53. // return Html::a('更新', $url);
  54. // },
  55. // ],
  56. // 'urlCreator' => function ($action, $model, $key, $index) {
  57. // return '/motorcade/driver/update?id=' . $model->DOC_ID . '&tab=doc&type=view';
  58. // }
  59. 'value' => function ($model) {
  60. $href = 'upload-tab1';
  61. $contain = 'image1';
  62. return '<a class="btn btn-link" href="#' . $href . '" data-toggle="modal"
  63. onclick="javascirpt:$.pjax.reload({container: \'#' . $contain . '\', data:{doc_id:' . $model->DOC_ID . ',doc_option:' . $model->DOC_OPTION . '},url: \'/motorcade/warning/images\', timeout: false, replace: false})">更新</a>';
  64. },
  65. 'format' => 'raw',
  66. ],
  67. ],
  68. ]);
  69. \yii\widgets\Pjax::end();
  70. ?>
  71. </div>