adding calendar table and logic

This commit is contained in:
RomanGolienko 2024-11-12 14:57:17 +03:00
parent 42efa74025
commit 79094a385a
2 changed files with 84 additions and 10 deletions

View File

@ -18,13 +18,16 @@ class attendancelog {
$url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp&param1=' . $groupName . '&param2=' . $educationForm; $url = 'https://eios.mkgtu.ru/api.php?des=studentsByGrupp&param1=' . $groupName . '&param2=' . $educationForm;
return json_decode(file_get_contents($url),1); 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() function mainPageAction()
{ {
$des = ''; if(isset($_GET['des'])) $des = $_GET['des']; $des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
if ($des == 'show'){ if ($des == 'show'){
//получаем список студентов по группе //получаем список студентов по группе
$sql_search = 'SELECT sokr, fo FROM acs_grupp WHERE id='. $_GET['id'] .' '; $current_group = $this->getGroupNamebyID($_GET['id']);
$current_group = $this->DB->QUR_SEL($sql_search);
return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']); return $this->getStudentsByGroup($current_group[1]['sokr'], $current_group[1]['fo']);
} }
} }
@ -35,7 +38,8 @@ class attendancelog {
$actionResult = $this->mainPageAction(); $actionResult = $this->mainPageAction();
//$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($_GET,1) . '</pre>'; $html .= '<pre>'. print_r($_GET,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'];
@ -52,7 +56,12 @@ class attendancelog {
} }
if ($page == 'main'){ 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->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');

View File

@ -29,16 +29,68 @@
{if $des == 'show'} {if $des == 'show'}
<a href="/modul/attendancelog/" role="button" class="btn"> Вернуться </a> <a href="/modul/attendancelog/" role="button" class="btn"> Вернуться </a>
<div class="row-fluid"> <div class="row-fluid">
<div class="span9"> <div class="span12">
<div class="widget blue"> <div class="widget blue">
<div class="widget-title"> <div class="widget-title">
<h4><i class="icon-reorder"></i></h4> <h4><i class="icon-reorder"></i> Посещение группы {$groupName} </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">
<table class="table table-striped table-bordered"> <div class="tabbable custom-tab">
<caption> Посещения группы </caption> <ul class="nav nav-tabs">
</table> <li class="active"><a href="#tab_1_1" data-toggle="tab">Понедельник</a></li>
<li class=""><a href="#tab_1_2" data-toggle="tab">Вторник</a></li>
<li class=""><a href="#tab_1_3" data-toggle="tab">Среда</a></li>
<li class=""><a href="#tab_1_4" data-toggle="tab">Четверг</a></li>
<li class=""><a href="#tab_1_5" data-toggle="tab">Пятница</a></li>
<li class=""><a href="#tab_1_6" data-toggle="tab">Суббота</a></li>
<li class=""><a href="#tab_1_7" data-toggle="tab">Воскресенье</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1_1">
<p>I'm in Section 1.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_2">
<p>Howdy, I'm in Section 2.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_3">
<p>What up girl, this is Section 3.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_4">
<p>What up girl, this is Section 3.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_5">
<p>What up girl, this is Section 3.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_6">
<p>What up girl, this is Section 3.</p>
<p>
Текст
</p>
</div>
<div class="tab-pane" id="tab_1_7">
<p>What up girl, this is Section 3.</p>
<p>
Текст
</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -52,7 +104,7 @@
</div> </div>
<div class="widget-body"> <div class="widget-body">
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<caption> Студенты группы </caption> <caption> Студенты группы {$groupName}</caption>
<thead> <thead>
<tr> <tr>
<th>Номер</th> <th>Номер</th>
@ -74,6 +126,18 @@
</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">
@ -105,5 +169,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{/if} {/if}