Commit 543508854a0bbb9597de8ddf3b194b22366d75cc
1 parent
653d2754
-Order module small screen fix smaller
Showing
1 changed file
with
144 additions
and
125 deletions
Show diff stats
views/order/index.php
| ... | ... | @@ -61,120 +61,120 @@ JS; |
| 61 | 61 | |
| 62 | 62 | </p> |
| 63 | 63 | <div class="row"> |
| 64 | - <div class="col-md-4"> | |
| 65 | - <?php | |
| 66 | - echo $searchForm->field($searchModel, 'label') | |
| 67 | - ->widget( | |
| 68 | - Select2::className(), | |
| 69 | - [ | |
| 70 | - 'data' => Label::find() | |
| 71 | - ->joinWith('lang') | |
| 72 | - ->select( | |
| 73 | - [ | |
| 74 | - 'CONCAT(order_label.label,order_label_lang.title) AS name', | |
| 75 | - 'id', | |
| 76 | - ] | |
| 77 | - ) | |
| 78 | - ->indexBy('id') | |
| 79 | - ->asArray() | |
| 80 | - ->column(), | |
| 81 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 82 | - 'pluginOptions' => [ | |
| 83 | - 'allowClear' => true, | |
| 84 | - 'multiple' => true, | |
| 85 | - ], | |
| 86 | - ] | |
| 87 | - ); | |
| 88 | - ?> | |
| 89 | - <?php | |
| 90 | - echo $searchForm->field($searchModel, 'delivery') | |
| 91 | - ->widget( | |
| 92 | - Select2::className(), | |
| 93 | - [ | |
| 94 | - 'data' => Delivery::find() | |
| 95 | - ->joinWith('lang') | |
| 96 | - ->select('order_delivery_lang.title, id') | |
| 97 | - ->indexBy('id') | |
| 98 | - ->asArray() | |
| 99 | - ->column(), | |
| 100 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 101 | - 'pluginOptions' => [ | |
| 102 | - 'allowClear' => true, | |
| 103 | - 'multiple' => true, | |
| 104 | - ], | |
| 105 | - ] | |
| 106 | - ); | |
| 107 | - ?> | |
| 108 | - | |
| 109 | - <?php | |
| 110 | - $query = new JsExpression( | |
| 111 | - 'function(params) { return {q:params.term}; }' | |
| 112 | - ); | |
| 113 | - echo $searchForm->field($searchModel, 'sku') | |
| 114 | - ->widget( | |
| 115 | - Select2::className(), | |
| 116 | - [ | |
| 117 | - 'options' => [ 'placeholder' => 'Search for a product ...' ], | |
| 118 | - 'pluginOptions' => [ | |
| 119 | - 'allowClear' => true, | |
| 120 | - 'minimumInputLength' => 3, | |
| 121 | - 'language' => [ | |
| 122 | - 'errorLoading' => new JsExpression( | |
| 123 | - "function () { return 'Waiting for results...'; }" | |
| 124 | - ), | |
| 125 | - ], | |
| 126 | - 'ajax' => [ | |
| 127 | - 'url' => \yii\helpers\Url::to([ 'find-product' ]), | |
| 128 | - 'dataType' => 'json', | |
| 129 | - 'data' => $query, | |
| 130 | - ], | |
| 131 | - 'escapeMarkup' => new JsExpression( | |
| 132 | - 'function (markup) { return markup; }' | |
| 133 | - ), | |
| 134 | - 'templateResult' => new JsExpression( | |
| 135 | - 'function(data) { return data.sku; }' | |
| 136 | - ), | |
| 137 | - 'templateSelection' => new JsExpression( | |
| 138 | - 'function (data) { | |
| 64 | + <div class="col-md-4"> | |
| 65 | + <?php | |
| 66 | + echo $searchForm->field($searchModel, 'label') | |
| 67 | + ->widget( | |
| 68 | + Select2::className(), | |
| 69 | + [ | |
| 70 | + 'data' => Label::find() | |
| 71 | + ->joinWith('lang') | |
| 72 | + ->select( | |
| 73 | + [ | |
| 74 | + 'CONCAT(order_label.label,order_label_lang.title) AS name', | |
| 75 | + 'id', | |
| 76 | + ] | |
| 77 | + ) | |
| 78 | + ->indexBy('id') | |
| 79 | + ->asArray() | |
| 80 | + ->column(), | |
| 81 | + 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 82 | + 'pluginOptions' => [ | |
| 83 | + 'allowClear' => true, | |
| 84 | + 'multiple' => true, | |
| 85 | + ], | |
| 86 | + ] | |
| 87 | + ); | |
| 88 | + ?> | |
| 89 | + <?php | |
| 90 | + echo $searchForm->field($searchModel, 'delivery') | |
| 91 | + ->widget( | |
| 92 | + Select2::className(), | |
| 93 | + [ | |
| 94 | + 'data' => Delivery::find() | |
| 95 | + ->joinWith('lang') | |
| 96 | + ->select('order_delivery_lang.title, id') | |
| 97 | + ->indexBy('id') | |
| 98 | + ->asArray() | |
| 99 | + ->column(), | |
| 100 | + 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 101 | + 'pluginOptions' => [ | |
| 102 | + 'allowClear' => true, | |
| 103 | + 'multiple' => true, | |
| 104 | + ], | |
| 105 | + ] | |
| 106 | + ); | |
| 107 | + ?> | |
| 108 | + | |
| 109 | + <?php | |
| 110 | + $query = new JsExpression( | |
| 111 | + 'function(params) { return {q:params.term}; }' | |
| 112 | + ); | |
| 113 | + echo $searchForm->field($searchModel, 'sku') | |
| 114 | + ->widget( | |
| 115 | + Select2::className(), | |
| 116 | + [ | |
| 117 | + 'options' => [ 'placeholder' => 'Search for a product ...' ], | |
| 118 | + 'pluginOptions' => [ | |
| 119 | + 'allowClear' => true, | |
| 120 | + 'minimumInputLength' => 3, | |
| 121 | + 'language' => [ | |
| 122 | + 'errorLoading' => new JsExpression( | |
| 123 | + "function () { return 'Waiting for results...'; }" | |
| 124 | + ), | |
| 125 | + ], | |
| 126 | + 'ajax' => [ | |
| 127 | + 'url' => \yii\helpers\Url::to([ 'find-product' ]), | |
| 128 | + 'dataType' => 'json', | |
| 129 | + 'data' => $query, | |
| 130 | + ], | |
| 131 | + 'escapeMarkup' => new JsExpression( | |
| 132 | + 'function (markup) { return markup; }' | |
| 133 | + ), | |
| 134 | + 'templateResult' => new JsExpression( | |
| 135 | + 'function(data) { return data.sku; }' | |
| 136 | + ), | |
| 137 | + 'templateSelection' => new JsExpression( | |
| 138 | + 'function (data) { | |
| 139 | 139 | if(data.sku == undefined) { |
| 140 | 140 | return "sku"; |
| 141 | 141 | } else { |
| 142 | 142 | return data.sku; |
| 143 | 143 | } |
| 144 | 144 | }' |
| 145 | - ), | |
| 146 | - ], | |
| 147 | - ] | |
| 148 | - ); | |
| 149 | - | |
| 150 | - ?> | |
| 151 | - </div> | |
| 152 | - | |
| 153 | - | |
| 154 | - <div class="col-md-4"> | |
| 155 | - <?= $searchForm->field($searchModel, 'manager_id') | |
| 156 | - ->dropDownList( | |
| 157 | - ArrayHelper::map( | |
| 158 | - User::find() | |
| 159 | - ->asArray() | |
| 160 | - ->all(), | |
| 161 | - 'id', | |
| 162 | - 'username' | |
| 163 | - ), | |
| 164 | - [ 'prompt' => \Yii::t('app', 'ะัะฑะตัะธัะต ะผะตะฝะตะดะถะตัะฐ ...') ] | |
| 165 | - ) ?> | |
| 166 | - | |
| 167 | - <?= $searchForm->field($searchModel, 'email') | |
| 168 | - ->textInput() ?> | |
| 169 | - | |
| 170 | - </div> | |
| 171 | - <div class="col-md-4"> | |
| 172 | - <?= $searchForm->field($searchModel, 'declaration') | |
| 173 | - ->textInput() ?> | |
| 174 | - | |
| 175 | - <?= $searchForm->field($searchModel, 'consignment') | |
| 176 | - ->textInput() ?> | |
| 177 | - </div> | |
| 145 | + ), | |
| 146 | + ], | |
| 147 | + ] | |
| 148 | + ); | |
| 149 | + | |
| 150 | + ?> | |
| 151 | + </div> | |
| 152 | + | |
| 153 | + | |
| 154 | + <div class="col-md-4"> | |
| 155 | + <?= $searchForm->field($searchModel, 'manager_id') | |
| 156 | + ->dropDownList( | |
| 157 | + ArrayHelper::map( | |
| 158 | + User::find() | |
| 159 | + ->asArray() | |
| 160 | + ->all(), | |
| 161 | + 'id', | |
| 162 | + 'username' | |
| 163 | + ), | |
| 164 | + [ 'prompt' => \Yii::t('app', 'ะัะฑะตัะธัะต ะผะตะฝะตะดะถะตัะฐ ...') ] | |
| 165 | + ) ?> | |
| 166 | + | |
| 167 | + <?= $searchForm->field($searchModel, 'email') | |
| 168 | + ->textInput() ?> | |
| 169 | + | |
| 170 | + </div> | |
| 171 | + <div class="col-md-4"> | |
| 172 | + <?= $searchForm->field($searchModel, 'declaration') | |
| 173 | + ->textInput() ?> | |
| 174 | + | |
| 175 | + <?= $searchForm->field($searchModel, 'consignment') | |
| 176 | + ->textInput() ?> | |
| 177 | + </div> | |
| 178 | 178 | </div> |
| 179 | 179 | |
| 180 | 180 | <p> |
| ... | ... | @@ -197,7 +197,7 @@ JS; |
| 197 | 197 | ->textInput(), |
| 198 | 198 | 'content' => function($model) { |
| 199 | 199 | $manager = $model->manager; |
| 200 | - if (empty( $manager )) { | |
| 200 | + if (empty($manager)) { | |
| 201 | 201 | return $model->id; |
| 202 | 202 | } else { |
| 203 | 203 | return $model->id . '<br>' . $manager->username; |
| ... | ... | @@ -206,7 +206,9 @@ JS; |
| 206 | 206 | ], |
| 207 | 207 | [ |
| 208 | 208 | 'attribute' => 'created_at', |
| 209 | - 'format' => ['date', 'php:d/m/Y G:i'], | |
| 209 | + 'content' => function($model) { | |
| 210 | + return date('d/m/Y', $model->created_at) . '<br>' . date('G:i', $model->created_at); | |
| 211 | + }, | |
| 210 | 212 | 'filter' => $searchForm->field($searchModel, 'date_range') |
| 211 | 213 | ->widget( |
| 212 | 214 | DateRangePicker::className(), |
| ... | ... | @@ -235,7 +237,16 @@ JS; |
| 235 | 237 | }, |
| 236 | 238 | ], |
| 237 | 239 | 'name', |
| 238 | - 'total', | |
| 240 | + [ | |
| 241 | + 'attribute' => 'total', | |
| 242 | + 'content' => function($model) { | |
| 243 | + if (empty($model->total)) { | |
| 244 | + return ''; | |
| 245 | + } else { | |
| 246 | + return $model->total; | |
| 247 | + } | |
| 248 | + }, | |
| 249 | + ], | |
| 239 | 250 | [ |
| 240 | 251 | 'attribute' => 'pay', |
| 241 | 252 | 'content' => function($model) { |
| ... | ... | @@ -250,12 +261,16 @@ JS; |
| 250 | 261 | [ |
| 251 | 262 | 'attribute' => 'adress', |
| 252 | 263 | 'content' => function($model) { |
| 253 | - if (!empty( $model->adress )) { | |
| 254 | - return Html::a(StringHelper::truncate($model->adress, 10, '...'), '#', [ | |
| 255 | - 'data-toggle' => 'tooltip', | |
| 256 | - 'title' => $model->adress, | |
| 257 | - 'onclick' => 'event.preventDefault();', | |
| 258 | - ]); | |
| 264 | + if (!empty($model->adress)) { | |
| 265 | + return Html::a( | |
| 266 | + StringHelper::truncate($model->adress, 10, '...'), | |
| 267 | + '#', | |
| 268 | + [ | |
| 269 | + 'data-toggle' => 'tooltip', | |
| 270 | + 'title' => $model->adress, | |
| 271 | + 'onclick' => 'event.preventDefault();', | |
| 272 | + ] | |
| 273 | + ); | |
| 259 | 274 | } else { |
| 260 | 275 | return ''; |
| 261 | 276 | } |
| ... | ... | @@ -268,7 +283,7 @@ JS; |
| 268 | 283 | /** |
| 269 | 284 | * @var Order $modl |
| 270 | 285 | */ |
| 271 | - if (empty( $model->orderLabel )) { | |
| 286 | + if (empty($model->orderLabel)) { | |
| 272 | 287 | return '--'; |
| 273 | 288 | } else { |
| 274 | 289 | return $model->orderLabel->label; |
| ... | ... | @@ -278,7 +293,7 @@ JS; |
| 278 | 293 | [ |
| 279 | 294 | 'attribute' => 'body', |
| 280 | 295 | 'content' => function($model) { |
| 281 | - if (!empty( $model->body )) { | |
| 296 | + if (!empty($model->body)) { | |
| 282 | 297 | return StringHelper::truncate($model->body, 12, '...'); |
| 283 | 298 | } else { |
| 284 | 299 | return ''; |
| ... | ... | @@ -288,12 +303,16 @@ JS; |
| 288 | 303 | [ |
| 289 | 304 | 'attribute' => 'sms', |
| 290 | 305 | 'content' => function($model) { |
| 291 | - if (!empty( $model->sms )) { | |
| 292 | - return Html::a(StringHelper::truncate($model->sms, 12, '...'), '#', [ | |
| 293 | - 'data-toggle' => 'tooltip', | |
| 294 | - 'title' => $model->sms, | |
| 295 | - 'onclick' => 'event.preventDefault();', | |
| 296 | - ]); | |
| 306 | + if (!empty($model->sms)) { | |
| 307 | + return Html::a( | |
| 308 | + StringHelper::truncate($model->sms, 12, '...'), | |
| 309 | + '#', | |
| 310 | + [ | |
| 311 | + 'data-toggle' => 'tooltip', | |
| 312 | + 'title' => $model->sms, | |
| 313 | + 'onclick' => 'event.preventDefault();', | |
| 314 | + ] | |
| 315 | + ); | |
| 297 | 316 | } else { |
| 298 | 317 | return ''; |
| 299 | 318 | } | ... | ... |