pmtpenza

Untitled

Jun 29th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\grid\GridView;
  5. use backend\models\Uslugi;
  6.  
  7. /* @var $this yii\web\View */
  8. /* @var $searchModel backend\models\ZayvkiSearch */
  9. /* @var $dataProvider yii\data\ActiveDataProvider */
  10.  
  11. $this->title = 'Заявки';
  12. $this->params['breadcrumbs'][] = $this->title;
  13.  
  14. ?>
  15. <div class="zayvki-index">
  16.  
  17. <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  18.  
  19. <p>
  20. <?= Html::a('Создать заявку на услуги', ['create'], ['class' => 'btn btn-success']) ?>
  21. <?= Html::a('Создать заявку на услуги эконом', ['createiko'], ['class' => 'btn btn-success']) ?>
  22. <?= Html::a('Выгрузить в EXCEL', ['createiko'], ['class' => 'btn btn-success']) ?>
  23. </p>
  24.  
  25. <?= GridView::widget([
  26. 'dataProvider' => $dataProvider,
  27. 'rowOptions' => function ($model, $key, $index, $grid)
  28. {
  29. if($model->status == 1) {
  30. return ['style' => 'background-color:#ea8a18;'];
  31. }
  32. if($model->status == 2) {
  33. return ['style' => 'background-color:#18ea7d;'];
  34. }
  35.  
  36. },
  37. 'filterModel' => $searchModel,
  38. 'columns' => [
  39.  
  40. 'id',
  41. [
  42. 'attribute'=>'typeName',
  43.  
  44. ],
  45. // 'user_id',
  46. [
  47. 'attribute'=>'status',
  48. 'value' => function($statuses){
  49. if($statuses->status == 1){
  50. return 'Новая';
  51. }
  52. if($statuses->status == 2){
  53. return 'В работе';
  54. }
  55. if($statuses->status == 3){
  56. return 'Отклоненна';
  57. }
  58. if($statuses->status == 4){
  59. return 'Выполенная';
  60. }
  61. }
  62. ],
  63. // 'master',
  64. [
  65. 'attribute' => 'uk',
  66. 'format' => 'raw',
  67. 'value' => 'useruk.username',
  68. ],
  69. 'create_at',
  70. 'data_vyp',
  71. [
  72. 'attribute'=>'oplata_id',
  73. 'value' => function($oplata){
  74. if($oplata->oplata->cposob_opl == 1){
  75. return 'Наличные';
  76. }
  77. if($oplata->oplata->cposob_opl == 2){
  78. return 'Оплаченно';
  79. }
  80. }
  81.  
  82. ],
  83. ['class' => 'yii\grid\ActionColumn'],
  84. ],
  85. ]); ?>
  86. </div>
Add Comment
Please, Sign In to add comment