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) . '';