]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
поставил поисковую форму
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 3 Sep 2024 13:32:37 +0000 (16:32 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 3 Sep 2024 13:32:37 +0000 (16:32 +0300)
erp24/actions/cabinet/IndexAction.php
erp24/views/cabinet/_search_form.php
erp24/views/cabinet/administrator.php
erp24/views/cabinet/florist.php
erp24/views/cabinet/index.php
erp24/views/cabinet202310/_search_form.php

index 912abca8166fbce0bb5d873c3f640078a3b31e6a..114d1d7227fc07e9f07ee128072e7814df27ccfb 100755 (executable)
@@ -85,6 +85,19 @@ class IndexAction extends Action
 
         }
 
+        foreach ($adminFlorist as $storeName => $employees) {
+            // Фильтруем сотрудников, убираем уволенных
+            $adminFlorist[$storeName] = array_filter($employees, function ($employee) {
+                return strpos($employee, 'уволенные сотрудники') === false;
+            });
+
+            // Если в результате фильтрации подмассив стал пустым, можно удалить его
+            if (empty($adminFlorist[$storeName])) {
+                unset($adminFlorist[$storeName]);
+            }
+        }
+
+
         ksort($adminFlorist);
 
         $dateFrom = date("Y-m-01", time());
@@ -103,10 +116,12 @@ class IndexAction extends Action
 
         if (empty($daysSearchForm->dateFrom)) {
             $daysSearchForm->dateFrom = $dateFrom;
+            $daysSearchForm->dateFrom = date("Y-08-01", time());
         }
 
         if (empty($daysSearchForm->dateTo)) {
             $daysSearchForm->dateTo = $dateTo;
+            $daysSearchForm->dateTo = date("Y-08-21", time());
         }
 
         $dateFrom = $daysSearchForm->dateFrom;
index 5bd9441f594a601cc5e449a51bad1158110c491d..141e971b05ebfb29d8d1031871586130697a7c0a 100755 (executable)
@@ -26,20 +26,6 @@ $searchForm = \yii\widgets\ActiveForm::begin([
         }
         ?>
     </table>
-
-    <div class="d-flex align-items-center justify-content-center gap-2">
-        <div class="mb-3">Сотрудник:</div>
-        <div style="display:inline-block">
-            <?= $searchForm->field($daysSearchForm, 'employee_id')->widget(\kartik\select2\Select2::class, [
-                'data' => ArrayHelper::map($adminFlorist, 'id', 'name_full'),
-                'language' => 'ru',
-                'options' => ['placeholder' => 'Сотрудник...'],
-                'pluginOptions' => [
-                    'allowClear' => true
-                ],
-            ])->label(false) ?>
-        </div>
-    </div>
     <div class="row mb-3">
         <div class="col-lg-2">
             <?= $searchForm->field($daysSearchForm, 'dateFrom', [
index ee86bcadb2fdf748645089539d8f4b89ef209bfb..a8ebdee214f0ea198f160b05f21ccf1e847a1140 100755 (executable)
@@ -161,7 +161,7 @@ $this->params['breadcrumbs'][] = $this->title;
 <div class="dashboard-index">
 
     <h1><?= Html::encode($this->title) ?></h1>
-    <div class="mb-3">Сотрудник:</div>
+
     <?php echo $this->render('/cabinet/_search_form', [
         'person' => $person,
         'adminFlorist' => $adminFlorist,
index 047fdb5d62df6480854457be4f235741a6223106..dd82dda9433f166307b5088d13a74044ad311939 100755 (executable)
@@ -144,7 +144,7 @@ $this->params['breadcrumbs'][] = $this->title;
 <div class="dashboard-index">
 
     <h1><?= Html::encode($this->title) ?></h1>
-    <div class="mb-3">Сотрудник:</div>
+
     <?php echo $this->render('/cabinet/_search_form', [
         'person' => $person,
         'adminFlorist' => $adminFlorist,
index afec97caf99166f216d100bb9b8afe85a5f8a2fa..ac163a3c421cf1d34abb16e09b5cc27645d1a2e4 100755 (executable)
@@ -80,8 +80,6 @@ $this->registerJsFile('/js/dashboard/index.js', ['position' => \yii\web\View::PO
         <?= Html::dropDownList('employee_id', $employeeSelect['id'] ?? '',
             ArrayHelper::map($adminFlorist, 'id', 'name_full')) ?>
     </table>
-
-
     <div class="row mb-3">
         <div class="col-lg-2">
             <?= $searchForm->field($daysSearchForm, 'dateFrom', [
index 141e971b05ebfb29d8d1031871586130697a7c0a..e19cdcc6f70c4c5c8b0e55a5b7a71ea8364d001f 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
 
+use yii\helpers\ArrayHelper;
 use yii\helpers\Html;
 use yii_app\forms\dashboard\DaysSearchForm;
 
@@ -20,12 +21,27 @@ $searchForm = \yii\widgets\ActiveForm::begin([
 ]); ?>
     <table>
         <?php
-        if (false === $person) {
+/*        if (false === $person) {
             echo Html::dropDownList('employee_id', $employeeSelect['id'] ?? '',
                 $adminFlorist);
         }
-        ?>
+        */?>
     </table>
+
+<div class="row mb-3">
+    <div class="col-lg-4">
+        <?php if (false === $person) { ?>
+        <?= $searchForm->field($daysSearchForm, 'employeeId')->widget(\kartik\select2\Select2::class, [
+            'data' => $adminFlorist,
+            'language' => 'ru',
+            'options' => ['placeholder' => 'Сотрудник...'],
+            'pluginOptions' => [
+                'allowClear' => true
+            ],
+        ])->label(false) ?>
+        <?php }    ?>
+    </div>
+</div>
     <div class="row mb-3">
         <div class="col-lg-2">
             <?= $searchForm->field($daysSearchForm, 'dateFrom', [
@@ -55,4 +71,6 @@ $searchForm = \yii\widgets\ActiveForm::begin([
             </div>
         </div>
     </div>
-<?php $searchForm::end() ?>
\ No newline at end of file
+<?php $searchForm::end() ?>
+
+