From 414100913745990d42317bc11adefe0004dac0dd Mon Sep 17 00:00:00 2001 From: RomanGolienko Date: Tue, 17 Dec 2024 14:03:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D0=B0=D0=BC=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B8=20=D1=81=D0=B5?= =?UTF-8?q?=D0=BA=D1=80=D0=B5=D1=82=D0=B0=D1=80=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/attendancelog.php | 15 ++++++++++++++- tpl/main_page.html | 13 +++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/inc/attendancelog.php b/inc/attendancelog.php index 9d28a26..b270d50 100644 --- a/inc/attendancelog.php +++ b/inc/attendancelog.php @@ -107,7 +107,6 @@ class attendancelog { $rez['week1'] = $week['week_cur']; return $rez; } - function getGroupNameByID($id) { $sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $id .' '; $tmp = $this->DB->QUR_SEL($sql_search); @@ -136,6 +135,14 @@ class attendancelog { } return $search['id']; } + public function gruppsSearch($request){ + if(isset($_POST['all_grupps_search'])){ + $sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp WHERE fo="ОФО" AND sokr NOT LIKE "Выпуск%" AND sokr LIKE "%'. $this->DB->rescape($request) .'%" OR fo LIKE "%'. $this->DB->rescape($request) .'%"'; + $tmp = $this->DB->QUR_SEL($sql_search); + unset($tmp[0]); + return $tmp; + } + } public function AttendanceAddEdit() { if(isset($_POST['attendance_add_edit'])){ @@ -253,8 +260,11 @@ class attendancelog { $mainPageActionResult = $this->mainPageAction(); $headmanPageActionResult = $this->headmanPageAction(); $predmetsAddEdit = $this->predmetsAddEdit('Исследование операций и методы оптимизации'); + $gruppsSearch = $this->gruppsSearch($_POST['all_grupps_search']); + //$html .= '
'. print_r($groups,1) . '
'; + //$html .= '
'. print_r($gruppsSearch,1) . '
'; //$html .= '
'. print_r($currentUserInfo,1) . '
'; //$html .= '
'. print_r($mainPageActionResult,1) . '
'; //$html .= '
'. print_r($headmanPageActionResult,1) . '
'; @@ -287,6 +297,9 @@ class attendancelog { } $groups = $this->getAllGrupps(); $facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']); + if(isset($_POST['all_grupps_search'])){ + $groups = $this->gruppsSearch($_POST['all_grupps_search']); + } $smarty->assign('groups',$groups); $smarty->assign('facult_groups',$facult_groups); $smarty->clearCache('moduls/attendancelog/tpl/main_page.html'); diff --git a/tpl/main_page.html b/tpl/main_page.html index ec84679..56d465f 100644 --- a/tpl/main_page.html +++ b/tpl/main_page.html @@ -75,7 +75,7 @@

{$class.time1}

{$class.time_name.0} - {$class.time_name.1}
-
+
+
+
+
+ + + +
+
+
-

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

Название