2024-11-12 13:08:43 +03:00
< ? php
class attendancelog {
private string $name ;
private $DB ;
public function __construct ( $DB , $name ){
$this -> DB = $DB ;
$this -> name = $name ;
}
2024-12-13 17:11:33 +03:00
public function currentUserInfo (){
2024-12-03 16:29:23 +03:00
$currentUserInfo = array ();
2024-12-24 13:45:42 +03:00
$currentUserInfo [ 'user_id' ] = $_SESSION [ 'user' ][ 'id' ];
2024-12-13 17:11:33 +03:00
if ( isset ( $_SESSION [ 'user' ][ 'teacher' ])) {
2024-12-03 16:29:23 +03:00
$currentUserInfo [ 'role' ] = 'teacher' ;
$currentUserInfo [ 'teacher_id' ] = $_SESSION [ 'user' ][ 'teacher' ][ 'id' ];
if ( isset ( $_SESSION [ 'user' ][ 'teacher' ][ 'fakultet' ])){
$sql_search = 'SELECT id FROM acs_faculties WHERE name="' . $_SESSION [ 'user' ][ 'teacher' ][ 'fakultet' ] . '"' ;
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
unset ( $tmp [ 0 ]);
$currentUserInfo [ 'facult' ][ 'facult_name' ] = $_SESSION [ 'user' ][ 'teacher' ][ 'fakultet' ];
$currentUserInfo [ 'facult' ][ 'facult_id' ] = $tmp [ 1 ][ 'id' ];
$sql_search = 'SELECT id, sokr, fo FROM acs_grupp WHERE id_facult="' . $tmp [ 1 ][ 'id' ] . '" AND sokr NOT LIKE "Выпуск%"' ;
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
unset ( $tmp [ 0 ]);
foreach ( $tmp as $grupp ){
$currentUserInfo [ 'related_grupps' ][ $grupp [ 'sokr' ]] = $grupp ;
}
}
return $currentUserInfo ;
2024-12-24 13:45:42 +03:00
} else if ( isset ( $_SESSION [ 'user' ][ 'statuses' ][ '25' ])) {
$currentUserInfo [ 'role' ] = 'secretary' ;
return $currentUserInfo ;
2024-12-13 17:11:33 +03:00
} else if ( isset ( $_SESSION [ 'user' ][ 'student' ])) {
2024-12-03 16:29:23 +03:00
$currentUserInfo [ 'role' ] = 'student' ;
2024-12-13 17:11:33 +03:00
$sql_search = 'SELECT * FROM acs_attendancelog_headmen WHERE user_id=' . $currentUserInfo [ 'user_id' ] . ' ' ;
$rez = $this -> DB -> QUR_SEL ( $sql_search );
if ( ! isset ( $rez [ 1 ])){
return 0 ;
}
2024-12-03 16:29:23 +03:00
$currentUserInfo [ 'student_id' ] = $_SESSION [ 'user' ][ 'student' ][ 'id' ];
$currentUserInfo [ 'grupp_id' ] = $_SESSION [ 'user' ][ 'student' ][ 'grupp' ][ 'id' ];
if ( isset ( $_SESSION [ 'user' ][ 'student' ][ 'grupp' ])){
$currentUserInfo [ 'facult' ][ 'facult_id' ] = $_SESSION [ 'user' ][ 'student' ][ 'grupp' ][ 'id_facult' ];
$sql_search = 'SELECT name FROM acs_faculties WHERE id=' . $currentUserInfo [ 'facult' ][ 'facult_id' ] . ' ' ;
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
unset ( $tmp [ 0 ]);
}
return $currentUserInfo ;
2024-12-24 13:45:42 +03:00
} else {
return 0 ;
2024-12-03 16:29:23 +03:00
}
}
function getAllGrupps ( $facult = '' ) {
if ( $facult != '' ){
$sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp WHERE fo="ОФО" AND id_facult="' . $facult . '" AND sokr NOT LIKE "Выпуск%" ORDER BY `sokr` DESC' ;
} else {
$sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp WHERE fo="ОФО" AND sokr NOT LIKE "Выпуск%" ORDER BY `sokr` DESC' ;
}
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
unset ( $tmp [ 0 ]);
return $tmp ;
2024-11-12 13:08:43 +03:00
}
function getStudentsByGroup ( $groupName , $educationForm )
{
$educationForm = urlencode ( $educationForm );
$groupName = urlencode ( $groupName );
2024-12-09 08:55:29 +03:00
$url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp¶m1=' . $groupName . '¶m2=' . $educationForm . '¶m3=1' ;
2024-11-12 13:08:43 +03:00
return json_decode ( file_get_contents ( $url ), 1 );
}
2024-11-13 16:26:13 +03:00
function getClassesByGroup ( $groupName , $educationForm )
{
$tmp = explode ( '-' , $groupName );
$groupName = trim ( $tmp [ 0 ]);
$groupNumber = substr ( $tmp [ 1 ], 0 , 2 );
$educationForm = urlencode ( $educationForm );
$groupName = urlencode ( $groupName );
$groupNumber = urlencode ( $groupNumber );
$url = 'https://local.mkgtu.ru/raspisnew/api.php?des=raspis_grupp&name=' . $groupName . '&number=' . $groupNumber . '&fo=' . $educationForm ;
return json_decode ( file_get_contents ( $url ), 1 );
//return $url;
}
2024-11-14 17:00:33 +03:00
function currentTime () { //возвращает информацию о текущем моменте для пользователя
$rez = array ();
$moment = getdate ();
$curr_minutes = $moment [ 'hours' ] * 60 + $moment [ 'seconds' ];
$minutes = 480 ;
for ( $i = 1 ; $i < 8 ; $i ++ ) { //возвращает текущую пару в университете
if ( $curr_minutes >= $minutes - 10 AND $curr_minutes <= $minutes + 90 ){
$rez [ 'time1' ] = $i ;
}
if ( $i == 4 ){
$minutes = $minutes + 110 ;
} else {
$minutes = $minutes + 100 ;
}
}
$week = json_decode ( file_get_contents ( 'https://local.mkgtu.ru/raspisnew/api.php?des=raspis_week_cur' ), 1 );
$rez [ 'day1' ] = $moment [ 'wday' ];
$rez [ 'mday' ] = $moment [ 'mday' ];
$rez [ 'mon' ] = $moment [ 'mon' ];
$rez [ '0' ] = $moment [ '0' ];
$rez [ 'year' ] = $moment [ 'year' ];
$rez [ 'date' ] = date ( " Y-m-d " );
$rez [ 'week1' ] = $week [ 'week_cur' ];
return $rez ;
}
2024-11-12 14:57:17 +03:00
function getGroupNameByID ( $id ) {
$sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id=' . $id . ' ' ;
2024-12-13 17:11:33 +03:00
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
return $tmp [ 1 ];
2024-11-12 14:57:17 +03:00
}
2024-11-25 14:26:19 +03:00
public function getWeekByDate ( $ts = 0 ) {
$url = 'https://local.mkgtu.ru/raspisnew/api.php?des=raspis_week_cur&ts=' . $ts ;
$awn = json_decode ( file_get_contents ( $url ), 1 );
return $awn [ 'week_cur' ];
2024-12-10 12:30:43 +03:00
}
2024-12-09 11:38:53 +03:00
public function predmetsAddEdit ( $predmet_name ){
//принимает имя предмета. Делает запись в таблицу предметов, если такой нет. В любом случае возвращает айди предмета
$sql_search = 'SELECT id, name FROM acs_attendancelog_predmets WHERE name="' . $predmet_name . '"' ;
$search = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $search [ 1 ])){
$search = $search [ 1 ];
}
if ( count ( $search ) == 0 ){
$sql_insert = 'INSERT INTO acs_attendancelog_predmets (id, name) VALUES (0,"' . $predmet_name . '")' ;
$rez = $this -> DB -> QUR ( $sql_insert );
$sql_search = 'SELECT id, name FROM acs_attendancelog_predmets WHERE name="' . $predmet_name . '"' ;
$search = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $search [ 1 ])){
$search = $search [ 1 ];
}
}
return $search [ 'id' ];
}
2024-12-17 14:03:46 +03:00
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 ;
}
}
2024-12-02 15:00:31 +03:00
public function AttendanceAddEdit ()
{
if ( isset ( $_POST [ 'attendance_add_edit' ])){
2024-12-09 08:55:29 +03:00
foreach ( $_POST [ 'attendance_add_edit' ][ 'attendance' ] as $user_id => $student_att ){
2025-01-17 13:16:30 +03:00
$sql_search = 'SELECT id, appr FROM acs_attendancelog_students_attendance WHERE user_id="' . $user_id . '" AND gruppa="' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'gruppa' ]) . '" AND date1="' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'date' ]) . '" AND time1=' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'time1' ]) . ' AND predmet_id="' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'predmet_id' ]) . '" ' ;
2024-12-02 15:00:31 +03:00
$search = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $search [ 1 ])){
2025-01-17 13:16:30 +03:00
if ( 0 == $search [ 1 ][ 'appr' ]){
$sql_update = 'UPDATE acs_attendancelog_students_attendance SET att=' . $student_att . ', appr=' . $_POST [ 'attendance_add_edit' ][ 'info' ][ 'approval' ] . ' WHERE id=' . $search [ 1 ][ 'id' ] . ' ' ;
$rez = $this -> DB -> QUR ( $sql_update );
}
2024-12-02 15:00:31 +03:00
} else {
2025-01-17 13:16:30 +03:00
$sql_insert = 'INSERT INTO acs_attendancelog_students_attendance (id, user_id, gruppa, date1, att, appr, time1, predmet_id) VALUES (0,"' . $user_id . '", "' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'gruppa' ]) . '", "' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'date' ]) . '", ' . $student_att . ',' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'approval' ]) . ', ' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'time1' ]) . ',"' . $this -> DB -> rescape ( $_POST [ 'attendance_add_edit' ][ 'info' ][ 'predmet_id' ]) . '")' ;
2024-12-02 15:00:31 +03:00
$rez = $this -> DB -> QUR ( $sql_insert );
}
}
2024-12-03 16:29:23 +03:00
$rez [ 'date_cur' ] = $_POST [ 'attendance_add_edit' ][ 'info' ][ 'date' ];
2024-12-02 15:00:31 +03:00
return $rez ;
}
}
2024-12-13 17:11:33 +03:00
public function headmanAddDelete (){
if ( isset ( $_POST [ 'headman_request' ])){
$currentUserInfo = $this -> currentUserInfo ();
$current_time = $this -> currentTime ();
$current_group = $this -> getGroupNamebyID (( int ) $_GET [ 'id' ]);
$students = $this -> getStudentsByGroup ( $current_group [ 'sokr' ], $current_group [ 'fo' ]);
$sql_search = 'SELECT * FROM acs_attendancelog_headmen WHERE gruppa="' . $current_group [ 'sokr' ] . '" ' ;
$rez = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $rez [ 1 ])){
$rez = $rez [ 1 ];
$sql_delete = 'DELETE FROM acs_attendancelog_headmen WHERE gruppa="' . $current_group [ 'sokr' ] . '" ' ;
$rez = $this -> DB -> QUR ( $sql_delete );
}
$sql_insert = 'INSERT INTO acs_attendancelog_headmen (id, user_id, gruppa, date_add, added_by) VALUES (0, ' . $this -> DB -> rescape ( $_POST [ 'headman_request' ]) . ', "' . $current_group [ 'sokr' ] . '", "' . $current_time [ 'date' ] . '", ' . $currentUserInfo [ 'user_id' ] . ' )' ;
$rez = $this -> DB -> QUR ( $sql_insert );
return $rez ;
}
}
2024-11-12 13:08:43 +03:00
function mainPageAction ()
{
2024-12-03 16:29:23 +03:00
$currentUserInfo = $this -> currentUserInfo ();
2024-11-12 13:08:43 +03:00
$des = '' ; if ( isset ( $_GET [ 'des' ])) $des = $_GET [ 'des' ];
if ( $des == 'show' ){
2024-12-03 16:29:23 +03:00
$current_group = $this -> getGroupNamebyID (( int ) $_GET [ 'id' ]);
2024-12-13 17:11:33 +03:00
$current_group_classes = $this -> getClassesByGroup ( $current_group [ 'sokr' ], $current_group [ 'fo' ]);
2024-11-14 17:00:33 +03:00
$currentTime = $this -> currentTime ();
2024-11-13 16:26:13 +03:00
$out = array ();
2024-12-13 17:11:33 +03:00
$tmp = $this -> getStudentsByGroup ( $current_group [ 'sokr' ], $current_group [ 'fo' ]);
2024-12-09 08:55:29 +03:00
$out [ 'students_all' ] = $tmp [ 'students' ];
2024-12-02 15:00:31 +03:00
if ( isset ( $_POST [ 'date_request' ])) {
$week_compare = $this -> getWeekByDate ( strtotime ( $_POST [ 'date_request' ]));
$day_compare = date ( 'w' , strtotime ( $_POST [ 'date_request' ]));
$db_date = $this -> DB -> rescape ( $_POST [ 'date_request' ]);
} else {
$week_compare = $currentTime [ 'week1' ];
$day_compare = $currentTime [ 'day1' ];
$db_date = $currentTime [ 'date' ];
}
2024-11-13 16:26:13 +03:00
foreach ( $current_group_classes [ 'raspis' ] as $class ) {
2024-11-25 14:26:19 +03:00
if ( $class [ 'week1' ] == $week_compare ) {
if ( $class [ 'day1' ] == $day_compare ){
$out [ 'day_name' ] = $class [ 'day_name' ];
$out [ 'day_info' ][ $class [ 'time1' ]] = $class ;
2024-12-09 11:38:53 +03:00
$out [ 'day_info' ][ $class [ 'time1' ]][ 'predmet_id' ] = $this -> predmetsAddEdit ( $class [ 'predmet' ]);
2025-01-17 13:16:30 +03:00
$sql_search = 'SELECT appr FROM acs_attendancelog_students_attendance WHERE gruppa="' . $current_group [ 1 ][ 'sokr' ] . '" AND date1="' . $db_date . '" AND time1=' . $class [ 'time1' ] . ' AND predmet_id=' . $out [ 'day_info' ][ $class [ 'time1' ]][ 'predmet_id' ];
$search = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $search [ 1 ])){
$out [ 'day_info' ][ $class [ 'time1' ]][ 'approval' ] = $search [ 1 ][ 'appr' ];
}
2024-12-09 08:55:29 +03:00
foreach ( $out [ 'students_all' ] as $student_id => $student_name ){
$out [ 'day_info' ][ $class [ 'time1' ]][ 'students' ][ $student_id ] = '0' ;
2024-12-09 11:38:53 +03:00
$sql_search = 'SELECT user_id, att FROM acs_attendancelog_students_attendance WHERE user_id="' . $student_id . '" AND gruppa="' . $current_group [ 1 ][ 'sokr' ] . '" AND date1="' . $db_date . '" AND time1=' . $class [ 'time1' ] . ' AND predmet_id=' . $out [ 'day_info' ][ $class [ 'time1' ]][ 'predmet_id' ];
2024-12-02 15:00:31 +03:00
$search = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $search [ 1 ])){
2024-12-09 08:55:29 +03:00
$out [ 'day_info' ][ $class [ 'time1' ]][ 'students' ][ $student_id ] = $search [ 1 ][ 'att' ];
2024-12-02 15:00:31 +03:00
}
}
2024-12-09 11:38:53 +03:00
2024-11-25 14:26:19 +03:00
}
2024-11-14 17:00:33 +03:00
}
2024-11-13 16:26:13 +03:00
}
return $out ;
2024-11-12 13:08:43 +03:00
}
}
2024-12-10 12:30:43 +03:00
function headmanPageAction (){
$des = '' ; if ( isset ( $_GET [ 'des' ])) $des = $_GET [ 'des' ];
if ( $des == 'add_edit' ){
2024-12-13 17:11:33 +03:00
$out = array ();
$current_group = $this -> getGroupNamebyID (( int ) $_GET [ 'id' ]);
$students = $this -> getStudentsByGroup ( $current_group [ 'sokr' ], $current_group [ 'fo' ]);
$out [ 'current_group' ] = $current_group ;
$sql_search = 'SELECT * FROM acs_attendancelog_headmen WHERE gruppa="' . $current_group [ 'sokr' ] . '" ' ;
$rez = $this -> DB -> QUR_SEL ( $sql_search );
if ( isset ( $rez [ 1 ])){
$rez = $rez [ 1 ];
}
foreach ( $students [ 'students' ] as $user_id => $student_name ){
$out [ 'students' ][ $user_id ][ 'student_name' ] = $student_name ;
if ( $rez [ 'user_id' ] == $user_id ){
$out [ 'students' ][ $user_id ][ 'headman' ] = 1 ;
$out [ 'headman' ] = $student_name ;
} else {
$out [ 'students' ][ $user_id ][ 'headman' ] = 0 ;
}
}
return $out ;
2024-12-10 12:30:43 +03:00
}
}
2025-01-14 12:12:03 +03:00
function getHeadman ( $group ){
$sql_search = 'SELECT * FROM acs_attendancelog_headmen WHERE gruppa="' . $group . '" ' ;
$tmp = $this -> DB -> QUR_SEL ( $sql_search );
return $tmp [ 1 ];
}
2024-11-12 13:08:43 +03:00
function HTML ()
{
2024-12-03 16:29:23 +03:00
GLOBAL $smarty ;
2024-11-12 13:08:43 +03:00
$html = '' ;
2024-12-03 16:29:23 +03:00
$currentUserInfo = $this -> currentUserInfo ();
2024-11-14 17:00:33 +03:00
$currentTime = $this -> currentTime ();
2024-12-03 16:29:23 +03:00
$AttendanceAddEdit = $this -> AttendanceAddEdit (); // должен вызываться перед mainPageAction
2024-12-13 17:11:33 +03:00
$headmanAddDelete = $this -> headmanAddDelete ();
2024-12-10 12:30:43 +03:00
$mainPageActionResult = $this -> mainPageAction ();
$headmanPageActionResult = $this -> headmanPageAction ();
2024-12-09 11:38:53 +03:00
$predmetsAddEdit = $this -> predmetsAddEdit ( 'Исследование операций и методы оптимизации' );
2024-12-17 14:03:46 +03:00
$gruppsSearch = $this -> gruppsSearch ( $_POST [ 'all_grupps_search' ]);
2024-11-12 13:08:43 +03:00
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
2024-12-17 14:03:46 +03:00
//$html .= '<pre>'. print_r($gruppsSearch,1) . '</pre>';
2024-12-03 16:29:23 +03:00
//$html .= '<pre>'. print_r($currentUserInfo,1) . '</pre>';
2024-12-10 12:30:43 +03:00
//$html .= '<pre>'. print_r($mainPageActionResult,1) . '</pre>';
2024-12-13 17:11:33 +03:00
//$html .= '<pre>'. print_r($headmanPageActionResult,1) . '</pre>';
2024-12-10 12:30:43 +03:00
//$html .= '<pre>'. print_r($predmetsAddEdit,1) . '</pre>';
2024-12-13 17:11:33 +03:00
//$html .= '<pre>'. print_r($headmanAddDelete,1) . '</pre>';
2024-11-25 14:26:19 +03:00
//$html .= '<pre>'. print_r($currentTime,1) . '</pre>';
2024-12-03 16:29:23 +03:00
//$html .= '<pre>'. print_r($_SESSION,1) . '</pre>';
2024-12-02 15:00:31 +03:00
//$html .= '<pre>'. print_r($AttendanceAddEdit,1) . '</pre>';
2024-11-13 16:26:13 +03:00
//$html .= '<pre>'. print_r($_GET,1) . '</pre>';
2024-12-10 12:30:43 +03:00
//$html .= '<pre>'. print_r($_POST,1) . '</pre>';
2024-12-03 16:29:23 +03:00
//$html .= '<pre>'. print_r($_SESSION,1) . '</pre>';
2024-11-12 13:08:43 +03:00
$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 );
2024-11-14 17:00:33 +03:00
$smarty -> assign ( 'currentTime' , $currentTime );
2024-12-03 16:29:23 +03:00
$smarty -> assign ( 'currentUserInfo' , $currentUserInfo );
2024-11-12 13:08:43 +03:00
if ( $page == 'headman' ) {
2024-12-10 12:30:43 +03:00
$facult_groups = $this -> getAllGrupps ( $currentUserInfo [ 'facult' ][ 'facult_id' ]);
2025-01-14 12:12:03 +03:00
foreach ( $facult_groups as $key => $group ) {
$students = $this -> getStudentsByGroup ( $group [ 'sokr' ], $group [ 'fo' ]);
$students = $students [ 'students' ];
$headman = $this -> getHeadman ( $group [ 'sokr' ]);
foreach ( $students as $user_id => $student_name ) {
if ( $headman [ 'user_id' ] == $user_id ){
$facult_groups [ $key ][ 'headman' ] = $student_name ;
}
}
}
2024-12-10 12:30:43 +03:00
$smarty -> assign ( 'facult_groups' , $facult_groups );
$smarty -> assign ( 'headmanPageActionResult' , $headmanPageActionResult );
2024-11-12 13:08:43 +03:00
$smarty -> clearCache ( 'moduls/attendancelog/tpl/headman.html' );
$html .= $smarty -> fetch ( 'moduls/attendancelog/tpl/headman.html' );
2025-01-14 12:12:03 +03:00
2024-11-12 13:08:43 +03:00
}
if ( $page == '' ){
2024-12-03 16:29:23 +03:00
if ( $currentUserInfo [ 'role' ] == 'student' ){
$header = " Location: https://eios.mkgtu.ru/modul/attendancelog/main/show/ " . $currentUserInfo [ 'grupp_id' ] . '/' ;
header ( $header );
}
$groups = $this -> getAllGrupps ();
2025-01-14 12:12:03 +03:00
if ( isset ( $currentUserInfo [ 'facult' ][ 'facult_id' ])){
$facult_groups = $this -> getAllGrupps ( $currentUserInfo [ 'facult' ][ 'facult_id' ]);
}
2024-12-17 14:03:46 +03:00
if ( isset ( $_POST [ 'all_grupps_search' ])){
$groups = $this -> gruppsSearch ( $_POST [ 'all_grupps_search' ]);
}
2024-11-12 13:08:43 +03:00
$smarty -> assign ( 'groups' , $groups );
2024-12-03 16:29:23 +03:00
$smarty -> assign ( 'facult_groups' , $facult_groups );
2024-11-12 13:08:43 +03:00
$smarty -> clearCache ( 'moduls/attendancelog/tpl/main_page.html' );
$html .= $smarty -> fetch ( 'moduls/attendancelog/tpl/main_page.html' );
}
2024-12-10 12:30:43 +03:00
if ( $page == 'main' ){
2024-11-12 14:57:17 +03:00
if ( $des == 'show' ){
2024-12-03 16:29:23 +03:00
$smarty -> assign ( 'AttendanceAddEdit' , $AttendanceAddEdit );
2024-12-10 12:30:43 +03:00
$smarty -> assign ( 'mainPageActionResult' , $mainPageActionResult );
2024-12-03 16:29:23 +03:00
$groupName = $this -> getGroupNameByID (( int ) $_GET [ 'id' ]);
2024-11-12 14:57:17 +03:00
$groupName = $groupName [ 1 ][ 'sokr' ];
$smarty -> assign ( 'groupName' , $groupName );
}
2024-12-03 16:29:23 +03:00
//$smarty->assign('groups',$groups);
2024-11-12 13:08:43 +03:00
$smarty -> clearCache ( 'moduls/attendancelog/tpl/main_page.html' );
$html .= $smarty -> fetch ( 'moduls/attendancelog/tpl/main_page.html' );
}
return $html ;
}
}