Compare commits
No commits in common. "dev" and "main" have entirely different histories.
|
@ -7,7 +7,7 @@ class attendancelog {
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
function getAllGrupps() {
|
function getAllGrupps() {
|
||||||
$sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp WHERE fo="ОФО" ORDER BY `sokr` DESC';
|
$sql_search = 'SELECT id, sokr, fo, kurs FROM acs_grupp ORDER BY `sokr` DESC';
|
||||||
$rez = $this->DB->QUR_SEL($sql_search);
|
$rez = $this->DB->QUR_SEL($sql_search);
|
||||||
return $rez;
|
return $rez;
|
||||||
}
|
}
|
||||||
|
@ -18,69 +18,14 @@ class attendancelog {
|
||||||
$url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp¶m1=' . $groupName . '¶m2=' . $educationForm;
|
$url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp¶m1=' . $groupName . '¶m2=' . $educationForm;
|
||||||
return json_decode(file_get_contents($url),1);
|
return json_decode(file_get_contents($url),1);
|
||||||
}
|
}
|
||||||
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;
|
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getGroupNameByID($id) {
|
|
||||||
$sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $id .' ';
|
|
||||||
return $this->DB->QUR_SEL($sql_search);
|
|
||||||
}
|
|
||||||
function mainPageAction()
|
function mainPageAction()
|
||||||
{
|
{
|
||||||
$des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
|
$des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
|
||||||
if ($des == 'show'){
|
if ($des == 'show'){
|
||||||
//получаем список пар по имени группы
|
//получаем список студентов по группе
|
||||||
// $current_group = $this->getGroupNamebyID($_GET['id']);
|
$sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $_GET['id'] .' ';
|
||||||
// return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']);
|
$current_group = $this->DB->QUR_SEL($sql_search);
|
||||||
|
return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']);
|
||||||
|
|
||||||
$current_group = $this->getGroupNamebyID($_GET['id']);
|
|
||||||
$current_group_classes = $this->getClassesByGroup($current_group[1]['sokr'], $current_group[1]['fo']);
|
|
||||||
$currentTime = $this->currentTime();
|
|
||||||
$out = array();
|
|
||||||
foreach ($current_group_classes['raspis'] as $class) {
|
|
||||||
if ($class['week1'] == $currentTime['week1']) {
|
|
||||||
$out['info'][$class['day1']]['day_name'] = $class['day_name'];
|
|
||||||
$out['info'][$class['day1']][$class['time1']] = $class;
|
|
||||||
$out['students'] = $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $out;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function HTML()
|
function HTML()
|
||||||
|
@ -88,19 +33,14 @@ class attendancelog {
|
||||||
$html = '';
|
$html = '';
|
||||||
$groups = $this->getAllGrupps();
|
$groups = $this->getAllGrupps();
|
||||||
$actionResult = $this->mainPageAction();
|
$actionResult = $this->mainPageAction();
|
||||||
$currentTime = $this->currentTime();
|
|
||||||
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
|
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
|
||||||
$html .= '<pre>'. print_r($actionResult,1) . '</pre>';
|
//$html .= '<pre>'. print_r($actionResult,1) . '</pre>';
|
||||||
$html .= '<pre>'. print_r($currentTime,1) . '</pre>';
|
|
||||||
//$html .= '<pre>'. print_r($_GET,1) . '</pre>';
|
//$html .= '<pre>'. print_r($_GET,1) . '</pre>';
|
||||||
//$html .= '<pre>'. print_r($_POST,1) . '</pre>';
|
|
||||||
//$html .= '<pre>'. print_r($_SESSION,1) . '</pre>';
|
|
||||||
GLOBAL $smarty;
|
GLOBAL $smarty;
|
||||||
$page = ''; if(isset($_GET['page'])) $page = $_GET['page'];
|
$page = ''; if(isset($_GET['page'])) $page = $_GET['page'];
|
||||||
$des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
|
$des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
|
||||||
$smarty->assign('des', $des);
|
$smarty->assign('des', $des);
|
||||||
$smarty->assign('name', $this->name);
|
$smarty->assign('name', $this->name);
|
||||||
$smarty->assign('currentTime', $currentTime);
|
|
||||||
if($page == 'headman') {
|
if($page == 'headman') {
|
||||||
$smarty->clearCache('moduls/attendancelog/tpl/headman.html');
|
$smarty->clearCache('moduls/attendancelog/tpl/headman.html');
|
||||||
$html .= $smarty->fetch('moduls/attendancelog/tpl/headman.html');
|
$html .= $smarty->fetch('moduls/attendancelog/tpl/headman.html');
|
||||||
|
@ -112,12 +52,7 @@ class attendancelog {
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($page == 'main'){
|
if ($page == 'main'){
|
||||||
if ($des == 'show'){
|
$smarty->assign('actionResult', $actionResult);
|
||||||
$smarty->assign('actionResult', $actionResult);
|
|
||||||
$groupName = $this->getGroupNameByID($_GET['id']);
|
|
||||||
$groupName = $groupName[1]['sokr'];
|
|
||||||
$smarty->assign('groupName', $groupName);
|
|
||||||
}
|
|
||||||
$smarty->assign('groups',$groups);
|
$smarty->assign('groups',$groups);
|
||||||
$smarty->clearCache('moduls/attendancelog/tpl/main_page.html');
|
$smarty->clearCache('moduls/attendancelog/tpl/main_page.html');
|
||||||
$html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html');
|
$html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html');
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ul class="nav ">
|
<ul class="nav ">
|
||||||
<li><a href="/modul/attendancelog/">Главная</a></li>
|
<li><a href="https://eios.mkgtu.ru/modul/attendancelog/">Главная</a></li>
|
||||||
<li class="active" ><a href="/modul/attendancelog/headman/">Старосты</a></li>
|
<li class="active" ><a href="https://eios.mkgtu.ru/modul/attendancelog/headman/">Старосты</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav pull-right">
|
<ul class="nav pull-right">
|
||||||
<li><a href="#">{$name}</a></li>
|
<li><a href="#">{$name}</a></li>
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ul class="nav ">
|
<ul class="nav ">
|
||||||
<li class="active" ><a href="/modul/attendancelog/">Главная</a></li>
|
<li class="active" ><a href="https://eios.mkgtu.ru/modul/attendancelog/">Главная</a></li>
|
||||||
<li><a href="/modul/attendancelog/headman/">Старосты</a></li>
|
<li><a href="https://eios.mkgtu.ru/modul/attendancelog/headman/">Старосты</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav pull-right">
|
<ul class="nav pull-right">
|
||||||
<li><a href="#">{$name}</a></li>
|
<li><a href="#">{$name}</a></li>
|
||||||
|
@ -27,103 +27,53 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $des == 'show'}
|
{if $des == 'show'}
|
||||||
<a href="/modul/attendancelog/" role="button" class="btn"> Вернуться </a>
|
<a href="https://eios.mkgtu.ru/modul/attendancelog/" role="button" class="btn"> Вернуться </a>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span9">
|
||||||
<div class="widget blue">
|
<div class="widget blue">
|
||||||
<div class="widget-title">
|
<div class="widget-title">
|
||||||
<h4><i class="icon-reorder"></i> Посещение группы {$groupName} </h4>
|
<h4><i class="icon-reorder"></i></h4>
|
||||||
<span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span>
|
<span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-body">
|
<div class="widget-body">
|
||||||
<div class="tabbable custom-tab">
|
<table class="table table-striped table-bordered">
|
||||||
<ul class="nav nav-tabs">
|
<caption> Посещения группы </caption>
|
||||||
{foreach from=$actionResult.info key=key item=day}
|
</table>
|
||||||
<li {if $key == $currentTime.day1} class="active" {/if}><a href="#tab_1_{$key}" data-toggle="tab">{$day['day_name']}</a></li>
|
</div>
|
||||||
{/foreach}
|
</div>
|
||||||
</ul>
|
</div>
|
||||||
<div class="tab-content" style="overflow-x: scroll">
|
</div>
|
||||||
{foreach from=$actionResult.info key=key item=day}
|
<div class="row-fluid">
|
||||||
<div class="tab-pane {if $key == $currentTime.day1} active {/if}" id="tab_1_{$key}">
|
<div class="span9">
|
||||||
<div class="accordion" id="accordion{$key}">
|
<div class="widget blue">
|
||||||
{foreach from=$day key=key item=class}
|
<div class="widget-title">
|
||||||
{if $key != 0}
|
<h4><i class="icon-reorder"></i></h4>
|
||||||
<table class="table">
|
<span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span>
|
||||||
<tbody>
|
</div>
|
||||||
<tr>
|
<div class="widget-body">
|
||||||
<td style="vertical-align: middle; text-align: center;"><h3 class="text-warning">{$class.time1}</h3></td>
|
<table class="table table-striped table-bordered">
|
||||||
<td style="vertical-align: middle; "><div class="accordion-group">
|
<caption> Студенты группы </caption>
|
||||||
<div class="accordion-heading">
|
<thead>
|
||||||
<a class="accordion-toggle {if $key != $currentTime.time1 } collapsed {/if}" data-toggle="collapse" data-parent="#accordion{$day.day1}" href="#collapse_{$class.day1}-{$class.time1}">
|
<tr>
|
||||||
{$class.predmet}
|
<th>Номер</th>
|
||||||
</a>
|
<th>Имя</th>
|
||||||
</div>
|
</tr>
|
||||||
<div id="collapse_{$class.day1}-{$class.time1}" class="accordion-body collapse {if $key == $currentTime.time1 } in {/if}">
|
</thead>
|
||||||
<div class="accordion-inner">
|
<tbody>
|
||||||
<form action="" method="post">
|
{foreach from=$actionResult['students'] key=key item=name}
|
||||||
<table class="table table-striped">
|
<tr>
|
||||||
<thead>
|
<td>{$key +1 }</td>
|
||||||
<tr>
|
<td>{$name}</td>
|
||||||
<th>No</th>
|
</tr>
|
||||||
<th>ФИО</th>
|
{/foreach}
|
||||||
<th>Присутствие</th>
|
</tbody>
|
||||||
<th>Примечание</th>
|
</table>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{foreach from=$actionResult.students.students key=key item=student}
|
|
||||||
<tr>
|
|
||||||
<td>{$key}</td>
|
|
||||||
<td>{$student}</td>
|
|
||||||
<td>
|
|
||||||
<input type="hidden" name="attendance_add_edit[attendance][{$student}]" value="off">
|
|
||||||
<input type="hidden" name="attendance_add_edit[info]['week1']" value="{$class.week1}">
|
|
||||||
<input type="hidden" name="attendance_add_edit[info]['day1']" value="{$class.day1}">
|
|
||||||
<input type="hidden" name="attendance_add_edit[info]['time1']" value="{$class.time1}">
|
|
||||||
<input type="hidden" name="attendance_add_edit[info]['predmet']" value="{$class.predmet}">
|
|
||||||
<input type="hidden" name="attendance_add_edit[info]['gruppa']" value="{$groupName}">
|
|
||||||
<input type="checkbox" name="attendance_add_edit[attendance][{$student}]" id="{$key}">
|
|
||||||
</td>
|
|
||||||
<td><input type="text" name="" id="" value=""></td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<button type="submit" class="btn btn-success">Сохранить</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
{/if}
|
|
||||||
{/foreach}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/foreach}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{else}
|
{else}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span4">
|
|
||||||
<div class="widget yellow">
|
|
||||||
<div class="widget-title">
|
|
||||||
<h4><i class="icon-reorder"></i> Мои группы </h4>
|
|
||||||
<span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span>
|
|
||||||
</div>
|
|
||||||
<div class="widget-body">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<div class="widget red">
|
<div class="widget red">
|
||||||
<div class="widget-title">
|
<div class="widget-title">
|
||||||
|
@ -143,11 +93,11 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$groups key=key item=group}
|
{foreach from=$groups key=key item=group}
|
||||||
{if $key != 0}
|
{if $key != 0}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/modul/attendancelog/main/show/{$group['id']}/">{$group.sokr}</a></td>
|
<td><a href="https://eios.mkgtu.ru/modul/attendancelog/main/show/{$group['id']}/">{$group['sokr']}</a></td>
|
||||||
<td>{$group['fo']}</td>
|
<td>{$group['fo']}</td>
|
||||||
<td>{$group['kurs']}</td>
|
<td>{$group['kurs']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -155,6 +105,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
Loading…
Reference in New Issue