<?php
-declare(strict_types = 1);
+declare(strict_types=1);
namespace yii_app\actions\timetable;
$firstRun = false;
if ($request->getIsPost()) {
if (!empty($request->getBodyParam('store_id'))) {
- $adminStoreId = (int) $request->getBodyParam('store_id');
+ $adminStoreId = (int)$request->getBodyParam('store_id');
$firstRun = true;
}
}
if ($fact) {
return AdminCheckin::TYPE_END;
}
- return AdminCheckin::TYPE_START;
+ return AdminCheckin::TYPE_START;
})();
$model->shift_id = $request->getBodyParam('shift_id');
$model->load($this->controller->request->post());
$model->photo = UploadedFile::getInstance($model, 'photo');
$validate = $model->validate();
- if ($validate) {
+ $twoMinutes = empty($fact->time_start) || !((strtotime(date('Y/m/d H:i:s')) - strtotime($fact->date_start . $fact->time_start)) < 120);
+
+ if ($validate && $twoMinutes) {
$model->save();
$model->checkin_id = $model->checkinModel->id;
$model->id = $model->checkinModel->id;
];
}
-
return $this->controller->render('/timetable/start_shift_step_three.php', [
'userModel' => $userModel,
'model' => $model,