From 576b4672acb972c2dece7fca5a33b2894f313dd2 Mon Sep 17 00:00:00 2001 From: RomanGolienko Date: Fri, 22 Nov 2024 13:11:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/attendancelog.php | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/inc/attendancelog.php b/inc/attendancelog.php index d39cc0a..4db344e 100644 --- a/inc/attendancelog.php +++ b/inc/attendancelog.php @@ -55,7 +55,36 @@ class attendancelog { $rez['week1'] = $week['week_cur']; return $rez; } + function timeGroup() { + $raspis = $this->mainPageAction(); + + $out = array(); + $currentTime = $this->currentTime(); + $first_weekday_of_year = $currentTime['year'] .'-01-01'; + $first_weekday_of_year= date('w', strtotime($first_weekday_of_year)); + $weekday = $first_weekday_of_year; + for ($month = 1; $month <= 12; $month++){ + $day_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $currentTime['year']); + $day = 1; + $week = 1; + for ($day; $day <= $day_in_month; $day++){ + if($weekday > 7){ + $weekday = 1; + $week++; + } + $tmp1 = $currentTime['year'] . '-' . $month . '-' . '01'; + $month_name = date('M',strtotime($tmp1)); + $out[$currentTime['year']][$month_name][$week . ' неделя'][$day] = $raspis['info'][$weekday]; + + + $weekday++; + + } + } + + return $out; + } function getGroupNameByID($id) { $sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $id .' '; return $this->DB->QUR_SEL($sql_search); @@ -81,6 +110,8 @@ class attendancelog { } } return $out; + }elseif($des == 'calendar_show'){ + } } function HTML() @@ -89,9 +120,11 @@ class attendancelog { $groups = $this->getAllGrupps(); $actionResult = $this->mainPageAction(); $currentTime = $this->currentTime(); + $timeGroup = $this->timeGroup(); //$html .= '
'. print_r($groups,1) . '
'; - $html .= '
'. print_r($actionResult,1) . '
'; - $html .= '
'. print_r($currentTime,1) . '
'; + //$html .= '
'. print_r($actionResult,1) . '
'; + $html .= '
'. print_r($timeGroup,1) . '
'; + //$html .= '
'. print_r($currentTime,1) . '
'; //$html .= '
'. print_r($_GET,1) . '
'; //$html .= '
'. print_r($_POST,1) . '
'; //$html .= '
'. print_r($_SESSION,1) . '
';