From ecc45eb6aaf538957a0e5ca8ba520a29fb339003 Mon Sep 17 00:00:00 2001 From: RomanGolienko Date: Tue, 12 Nov 2024 13:08:43 +0300 Subject: [PATCH] first commit --- description.php | 5 ++ inc/attendancelog.php | 64 +++++++++++++++++++++++++ out.php | 30 ++++++++++++ tpl/headman.html | 27 +++++++++++ tpl/main_page.html | 109 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 235 insertions(+) create mode 100644 description.php create mode 100644 inc/attendancelog.php create mode 100644 out.php create mode 100644 tpl/headman.html create mode 100644 tpl/main_page.html diff --git a/description.php b/description.php new file mode 100644 index 0000000..34f855f --- /dev/null +++ b/description.php @@ -0,0 +1,5 @@ +DB = $DB; + $this->name = $name; + } + function getAllGrupps() { + $sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp ORDER BY `sokr` DESC'; + $rez = $this->DB->QUR_SEL($sql_search); + return $rez; + } + function getStudentsByGroup($groupName,$educationForm) + { + $educationForm = urlencode($educationForm); + $groupName = urlencode($groupName); + $url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp¶m1=' . $groupName . '¶m2=' . $educationForm; + return json_decode(file_get_contents($url),1); + } + 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); + return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']); + } + } + function HTML() + { + $html = ''; + $groups = $this->getAllGrupps(); + $actionResult = $this->mainPageAction(); + //$html .= '
'. print_r($groups,1) . '
'; + //$html .= '
'. print_r($actionResult,1) . '
'; + //$html .= '
'. print_r($_GET,1) . '
'; + GLOBAL $smarty; + $page = ''; if(isset($_GET['page'])) $page = $_GET['page']; + $des = ''; if(isset($_GET['des'])) $des = $_GET['des']; + $smarty->assign('des', $des); + $smarty->assign('name', $this->name); + if($page == 'headman') { + $smarty->clearCache('moduls/attendancelog/tpl/headman.html'); + $html .= $smarty->fetch('moduls/attendancelog/tpl/headman.html'); + } + if ($page == ''){ + $smarty->assign('groups',$groups); + $smarty->clearCache('moduls/attendancelog/tpl/main_page.html'); + $html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html'); + + } + if ($page == 'main'){ + $smarty->assign('actionResult', $actionResult); + $smarty->assign('groups',$groups); + $smarty->clearCache('moduls/attendancelog/tpl/main_page.html'); + $html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html'); + + } + + return $html; + } +} \ No newline at end of file diff --git a/out.php b/out.php new file mode 100644 index 0000000..00e2db6 --- /dev/null +++ b/out.php @@ -0,0 +1,30 @@ +' . print_r($_SESSION['user'],1) . ''; +include_once "inc/attendancelog.php"; +global $DB; +if (isset($_SESSION['user']['fio'])){ +// $class = new attendancelog($DB, $_SESSION['user']['fio']); + $class = new attendancelog($DB, $_SESSION['user']['fio']); + $OUT = $class->HTML(); +} else { + +} + +//#МОДУЛИ +//RewriteRule ^modul/([^/]*)/([^/]*)/p([[0-9]+]*)/$ /index.php?modul=$1&page=$2&p=$3 [L] +//RewriteRule ^modul/([^/]*)/([^/]*)/([^/]*)/([[0-9]+]*)/$ /index.php?modul=$1&page=$2&des=$3&id=$4 [L] +//RewriteRule ^modul/([^/]*)/([^/]*)/([^/]*)/$ /index.php?modul=$1&page=$2&des=$3 [L] +//RewriteRule ^modul/([^/]*)/([^/]*)/$ /index.php?modul=$1&page=$2 [L] +//RewriteRule ^modul/([^/]*)/$ /index.php?modul=$1 [L] +//RewriteRule ^modul/$ /index.php?modul [L] +//$OUT .= '
'.print_r($_GET,1).'
'; + +//https://eios.mkgtu.ru/modul/aiassistant/admin/edit/12/ +//Array +//( +// [modul] => aiassistant +// [page] => admin +// [des] => edit +// [id] => 12 +//) +//$out = $smarty->fetch('moduls/skudp/tpl/index.html'); \ No newline at end of file diff --git a/tpl/headman.html b/tpl/headman.html new file mode 100644 index 0000000..bf55f10 --- /dev/null +++ b/tpl/headman.html @@ -0,0 +1,27 @@ +
+
+

Посещаемость

+ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/tpl/main_page.html b/tpl/main_page.html new file mode 100644 index 0000000..e71a556 --- /dev/null +++ b/tpl/main_page.html @@ -0,0 +1,109 @@ +
+
+

Посещаемость

+ +
+
+ +
+
+ +
+
+ +{if $des == 'show'} + Вернуться +
+
+
+
+

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

+ +
+
+ + + + + + + + + + {foreach from=$actionResult['students'] key=key item=name} + + + + + {/foreach} + +
Студенты группы
НомерИмя
{$key +1 }{$name}
+
+
+
+
+{else} +
+
+
+
+

Все группы

+ +
+
+ + + + + + + + + + + {foreach from=$groups key=key item=group} + {if $key != 0} + + + + + + {/if} + {/foreach} + +

Выберите группу для просмотра

НазваниеФорма обученияКурс
{$group['sokr']}{$group['fo']}{$group['kurs']}
+
+
+
+
+{/if} \ No newline at end of file