From 1fc92ac77390debc68759221fa502eee0002a6ee Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 6 Sep 2021 16:31:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=20=D1=83=D0=BC=D0=BE=D0=BB=D1=87?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=B4=D0=B5=D0=BD=D1=8C=20=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B5=D0=BF=D0=BE=D1=80=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/reports/models/Month.php | 12 -- .../modules/reports/views/reports/index.php | 2 +- .../modules/reports/views/reports/user.php | 165 +----------------- 3 files changed, 8 insertions(+), 171 deletions(-) diff --git a/backend/modules/reports/models/Month.php b/backend/modules/reports/models/Month.php index e52cf44..f5512c6 100644 --- a/backend/modules/reports/models/Month.php +++ b/backend/modules/reports/models/Month.php @@ -16,16 +16,13 @@ class Month public function __construct($date = null) { -// $date = '2021-08-10'; $this->inactive_begin = []; $this->inactive_end = []; -// Debug::prn($date); if (!$date and !self::is_date($date)) { $date = date('Y-m-d'); Debug::dd($date); } -// Debug::dd($date); $first_day_of_week = self::get_day_week(self::get_first_day($date)); $quantity_days = self::get_days_month($date); @@ -47,7 +44,6 @@ class Month for ($index = $first_day_of_week - 1; $index >= 1; $index--, $day--) { $this->inactive_begin[$index] = $day; } -// Debug::dd($first_day_of_week); $day = 1; $index_end = (in_array($first_day_of_week, [6,7])?42:35); for ($index = $quantity_days + $first_day_of_week; $index <=$index_end; $index++, $day++) { @@ -55,7 +51,6 @@ class Month } $this->days = array_merge($this->inactive_end, $this->inactive_begin, $this->active); -// Debug::dd($this); } @@ -91,11 +86,4 @@ class Month return date("t", strtotime($date)); } - - public function a() - { -// $a = date('w', strtotime(date(''))) - } - - } \ No newline at end of file diff --git a/backend/modules/reports/views/reports/index.php b/backend/modules/reports/views/reports/index.php index c2fcb72..8728f83 100644 --- a/backend/modules/reports/views/reports/index.php +++ b/backend/modules/reports/views/reports/index.php @@ -86,7 +86,7 @@ function next_day($date, $number) 'attribute' => 'ФИО', 'filter' => Html::activeTextInput($searchModel, 'fio', ['class' => 'form-control']), 'value' => function ($data) { - return '' . \common\models\Reports::getFio($data) . ''; + return '' . \common\models\Reports::getFio($data) . ''; }, ], diff --git a/backend/modules/reports/views/reports/user.php b/backend/modules/reports/views/reports/user.php index a1cf635..7e8e4eb 100644 --- a/backend/modules/reports/views/reports/user.php +++ b/backend/modules/reports/views/reports/user.php @@ -1,11 +1,7 @@ title = 'Календарь пользователя - ' . Reports::getFio($reports[0]); $dates_created_at = array_unique(array_map('get_dates_created_at', $reports)); - -//for ($date = '2021-08-01', $i = 0; $date != '2021-09-01'; $date = next_day($date, 1), $i++) { -// if ($i == 7) { -// echo '
'; -// $i = 0; -// } -// if (in_array($date, $dates_created_at)) { -// $color = 'primary'; -// } else -// $color = 'danger'; -// echo Html::a($date, ['reports/?date=' . $date], ['class' => 'btn btn-' . $color . '', -// 'style' => 'margin: 10px;']); -// -//} -// - -// -//?> - +?>
- - - -
- - - - - - - - - - - inactive_begin)) { - // echo '
'; - // - // for ($index = 1; $index <= count($month->inactive_begin); $index++, $index_raw++) - // echo '
- // - // ' . $month->inactive_begin[$index] . ' - //
'; - // } - // for (; $index <= array_key_last($month->active); $index++, $index_raw++) { - // - // if ($index_raw % 7 == 0) { - // if ($index != 1) echo '
'; - // echo '
- // '; - // } - // echo ' - //
- // - // ' . $month->active[$index] . ' - // - //
- // '; - // } - // ?> - inactive_end); $index++, $index_raw++): ?> - - //
- // '; - // ?> - - - -
@@ -389,7 +241,6 @@ ${report['today'][j]['task']}

` } }; - const CALENDAR_BAR = ` < section class @@ -457,7 +308,6 @@ ${report['today'][j]['task']}

` if (days[i].classList.contains('inactive')) { days[i].onclick = function () { let date = getFutureDate(datePicker.value, parseInt(days[i].textContent)) - console.log(date) datePicker.value = date; datePicker.onchange() } @@ -471,7 +321,7 @@ ${report['today'][j]['task']}

` } calendar.load() - + datePicker.onchange() function isOldDatePicker(datePicker, oldDate) { if (datePicker.value.substr(0, 7) == oldDate) @@ -479,7 +329,6 @@ ${report['today'][j]['task']}

` return false } - async function updateMonthReports(date) { let monthNumber = date.substr(5, 2); @@ -509,7 +358,7 @@ ${report['today'][j]['task']}

` date = new Date(date.getFullYear(), date.getMonth() - 1, value); } } - return date.getFullYear() + '-' + IntToDate(date.getMonth()+1) + '-' + IntToDate(value); + return date.getFullYear() + '-' + IntToDate(date.getMonth() + 1) + '-' + IntToDate(value); }