namespace yii_app\actions\timetable;
+use app\records\TimetableFactModel;
use yii\base\Action;
use yii\helpers\ArrayHelper;
use yii_app\records\Admin;
if ($modelTypeId == AdminCheckin::TYPE_END) {
$adminStores = CityStore::getNames([$lastCheckin->store_id]);
+ $lastCheckinFact = TimetableFactModel::findOne(['checkin_start_id' => $lastCheckin->id]);
+ $shiftArray = $lastCheckinFact ? ['id' => $lastCheckinFact->shift_id, 'name' => $lastCheckinFact->shift->name] : [];
} else {
$adminStores = ArrayHelper::map($userModel->getStores(), 'id', 'name');
+ $shiftArray = ArrayHelper::map(Shift::find()->andWhere(['not in', 'id', [3, 4, 6]])->all(), 'id', 'name');
}
- $shiftArray = ArrayHelper::map(Shift::find()->all(), 'id', 'name');
return $this->controller->render('/timetable/start_shift_step_one.php', [
'userModel' => $userModel,
[['lat', 'lon'], 'double'],
[['comment', 'photo'], 'string'],
[['date'], 'date', 'format' => 'yyyy-M-d'],
- [['time'], 'date', 'format' => 'yyyy-M-d HH:mm:ss'],
+// [['time'], 'date', 'format' => 'yyyy-M-d HH:mm:ss'],
[['admin_id', 'type_id', 'status', 'date', 'time', 'device_id'], 'required'],
];
}
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->checkin_start_id)) {
- return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ return !empty($photo = $model->checkinStart->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
};
},
],
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->checkin_end_id)) {
- return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ return !empty($photo = $model->checkinEnd->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
};
},
],
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->checkin_start_id)) {
- return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ return !empty($photo = $model->checkinStart->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
};
},
],
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->checkin_end_id)) {
- return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ return !empty($photo = $model->checkinEnd->photo) ? Html::img("/$photo", ['alt' => 'selfie', 'height' => '100px']) : null;
};
},
]
\r
</div>\r
\r
- <div class="col-lg-3">\r
- <div class="text-secondary mb-1">Тип смены</div>\r
- <?= Html::dropDownList('shift_id', null, $shiftArray, [\r
- 'class' => "form-select",\r
- 'aria-label' => "Пример выбора по умолчанию",\r
- ]) ?>\r
- </div>\r
- <div class="col-lg-6 d-flex justify-content-end align-items-end">\r
+ <div class="col-lg-3">\r
+ <div class="text-secondary mb-1">Тип смены</div>\r
+ <?php\r
+ if (empty($lastCheckin->type_id) || $lastCheckin->isEnd() || $userModel->adminGroup->isRoaming()) {\r
+ echo Html::dropDownList('shift_id', null, $shiftArray, [\r
+ 'class' => "form-select",\r
+ 'aria-label' => "Пример выбора по умолчанию",\r
+ ]);\r
+ } else {\r
+ echo $shiftArray['name'];\r
+ echo Html::hiddenInput('shift_id', $shiftArray['id']);\r
+ }\r
+\r
+ ?>\r
+\r
+ </div>\r
+ <div class="col-lg-6 d-flex justify-content-end align-items-end">\r
\r
<?= Html::submitButton($textButton, ['class' => 'btn btn-bd-primary ps-3 pe-3 mt-2']); ?>\r
\r
--- /dev/null
+<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M29 27V28H11V27L13 25V19C13 15.9 15.03 13.17 18 12.29V12C18 11.4696 18.2107 10.9609 18.5858 10.5858C18.9609 10.2107 19.4696 10 20 10C20.5304 10 21.0391 10.2107 21.4142 10.5858C21.7893 10.9609 22 11.4696 22 12V12.29C24.97 13.17 27 15.9 27 19V25L29 27ZM22 29C22 29.5304 21.7893 30.0391 21.4142 30.4142C21.0391 30.7893 20.5304 31 20 31C19.4696 31 18.9609 30.7893 18.5858 30.4142C18.2107 30.0391 18 29.5304 18 29" fill="#CAC4D0"/>
+</svg>
--- /dev/null
+<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_242_4447)">
+<rect width="14" height="14" fill="white" fill-opacity="0.01"/>
+<g clip-path="url(#clip1_242_4447)">
+<path d="M6.99963 3.06152C6.99963 2.94549 6.95354 2.83421 6.87149 2.75216C6.78945 2.67012 6.67817 2.62402 6.56213 2.62402C6.4461 2.62402 6.33482 2.67012 6.25277 2.75216C6.17073 2.83421 6.12463 2.94549 6.12463 3.06152V7.87402C6.12466 7.95114 6.14507 8.02688 6.18379 8.09357C6.22251 8.16026 6.27817 8.21552 6.34513 8.25377L9.40763 10.0038C9.50813 10.0581 9.62589 10.0709 9.73575 10.0396C9.8456 10.0082 9.93882 9.93513 9.9955 9.83595C10.0522 9.73676 10.0678 9.61934 10.0391 9.50878C10.0103 9.39821 9.93945 9.30328 9.84163 9.24427L6.99963 7.62027V3.06152Z" fill="#6C757D"/>
+<path d="M6.99963 13.999C8.85615 13.999 10.6366 13.2615 11.9494 11.9488C13.2621 10.636 13.9996 8.85554 13.9996 6.99902C13.9996 5.14251 13.2621 3.36203 11.9494 2.04928C10.6366 0.736521 8.85615 -0.000976562 6.99963 -0.000976562C5.14312 -0.000976562 3.36264 0.736521 2.04989 2.04928C0.737132 3.36203 -0.000366211 5.14251 -0.000366211 6.99902C-0.000366211 8.85554 0.737132 10.636 2.04989 11.9488C3.36264 13.2615 5.14312 13.999 6.99963 13.999ZM13.1246 6.99902C13.1246 8.62348 12.4793 10.1814 11.3307 11.3301C10.182 12.4787 8.62409 13.124 6.99963 13.124C5.37518 13.124 3.81727 12.4787 2.6686 11.3301C1.51994 10.1814 0.874634 8.62348 0.874634 6.99902C0.874634 5.37457 1.51994 3.81665 2.6686 2.66799C3.81727 1.51933 5.37518 0.874023 6.99963 0.874023C8.62409 0.874023 10.182 1.51933 11.3307 2.66799C12.4793 3.81665 13.1246 5.37457 13.1246 6.99902Z" fill="#6C757D"/>
+</g>
+</g>
+<defs>
+<clipPath id="clip0_242_4447">
+<rect width="14" height="14" fill="white"/>
+</clipPath>
+<clipPath id="clip1_242_4447">
+<rect width="14" height="14" fill="white"/>
+</clipPath>
+</defs>
+</svg>
--- /dev/null
+<svg width="37" height="45" viewBox="0 0 37 45" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="36" y="1" width="43" height="35" rx="9" transform="rotate(90 36 1)" fill="white"/>
+<path d="M21.7191 31.7602L14.2199 23.5788C14.1502 23.5029 14.0949 23.4126 14.0572 23.3133C14.0194 23.214 14 23.1075 14 23C14 22.8925 14.0194 22.786 14.0572 22.6867C14.0949 22.5874 14.1502 22.4971 14.2199 22.4212L21.7191 14.2398C21.8598 14.0862 22.0507 14 22.2497 14C22.4487 14 22.6395 14.0862 22.7802 14.2398C22.9209 14.3933 23 14.6015 23 14.8186C23 15.0357 22.9209 15.2439 22.7802 15.3974L15.8107 23L22.7802 30.6026C22.8499 30.6786 22.9052 30.7688 22.9429 30.8681C22.9806 30.9675 23 31.0739 23 31.1814C23 31.2889 22.9806 31.3953 22.9429 31.4947C22.9052 31.594 22.8499 31.6842 22.7802 31.7602C22.7106 31.8363 22.6278 31.8965 22.5368 31.9377C22.4458 31.9788 22.3482 32 22.2497 32C22.1511 32 22.0536 31.9788 21.9625 31.9377C21.8715 31.8965 21.7888 31.8363 21.7191 31.7602Z" fill="#4E46B4"/>
+<rect x="36" y="1" width="43" height="35" rx="9" transform="rotate(90 36 1)" stroke="#4E46B4" stroke-width="2"/>
+</svg>