diff --git a/inc/attendancelog.php b/inc/attendancelog.php index 96c6b11..fec3da6 100644 --- a/inc/attendancelog.php +++ b/inc/attendancelog.php @@ -18,13 +18,16 @@ class attendancelog { $url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp¶m1=' . $groupName . '¶m2=' . $educationForm; return json_decode(file_get_contents($url),1); } + function getGroupNameByID($id) { + $sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $id .' '; + return $this->DB->QUR_SEL($sql_search); + } function mainPageAction() { $des = ''; if(isset($_GET['des'])) $des = $_GET['des']; if ($des == 'show'){ //получаем список студентов по группе - $sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $_GET['id'] .' '; - $current_group = $this->DB->QUR_SEL($sql_search); + $current_group = $this->getGroupNamebyID($_GET['id']); return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']); } } @@ -35,7 +38,8 @@ class attendancelog { $actionResult = $this->mainPageAction(); //$html .= '
'. print_r($groups,1) . '
'; //$html .= '
'. print_r($actionResult,1) . '
'; - //$html .= '
'. print_r($_GET,1) . '
'; + $html .= '
'. print_r($_GET,1) . '
'; +// $html .= '
'. print_r($_SESSION,1) . '
'; GLOBAL $smarty; $page = ''; if(isset($_GET['page'])) $page = $_GET['page']; $des = ''; if(isset($_GET['des'])) $des = $_GET['des']; @@ -52,7 +56,12 @@ class attendancelog { } if ($page == 'main'){ - $smarty->assign('actionResult', $actionResult); + if ($des == 'show'){ + $smarty->assign('actionResult', $actionResult); + $groupName = $this->getGroupNameByID($_GET['id']); + $groupName = $groupName[1]['sokr']; + $smarty->assign('groupName', $groupName); + } $smarty->assign('groups',$groups); $smarty->clearCache('moduls/attendancelog/tpl/main_page.html'); $html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html'); diff --git a/tpl/main_page.html b/tpl/main_page.html index 13d0158..c521d2e 100644 --- a/tpl/main_page.html +++ b/tpl/main_page.html @@ -29,16 +29,68 @@ {if $des == 'show'} Вернуться
-
+
-

+

Посещение группы {$groupName}

- - -
Посещения группы
+
+ +
+
+

I'm in Section 1.

+

+ Текст +

+
+
+

Howdy, I'm in Section 2.

+

+ Текст +

+
+
+

What up girl, this is Section 3.

+

+ Текст +

+
+
+

What up girl, this is Section 3.

+

+ Текст +

+
+
+

What up girl, this is Section 3.

+

+ Текст +

+
+
+

What up girl, this is Section 3.

+

+ Текст +

+
+
+

What up girl, this is Section 3.

+

+ Текст +

+
+
+
@@ -52,7 +104,7 @@
- + @@ -74,6 +126,18 @@ {else}
+
+
+
+

Мои группы

+ +
+
+ +
+
+ +
@@ -105,5 +169,6 @@
+
{/if} \ No newline at end of file
Студенты группы Студенты группы {$groupName}
Номер