Добавлено отображение статуса старосты в группе в боковой панели на админ. странице
This commit is contained in:
parent
b66ca40355
commit
564e8c6bf7
|
@ -247,6 +247,11 @@ class attendancelog {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getHeadman($group){
|
||||||
|
$sql_search = 'SELECT * FROM acs_attendancelog_headmen WHERE gruppa="'. $group .'" ';
|
||||||
|
$tmp = $this->DB->QUR_SEL($sql_search);
|
||||||
|
return $tmp[1];
|
||||||
|
}
|
||||||
function HTML()
|
function HTML()
|
||||||
{
|
{
|
||||||
GLOBAL $smarty;
|
GLOBAL $smarty;
|
||||||
|
@ -260,7 +265,6 @@ class attendancelog {
|
||||||
$predmetsAddEdit = $this->predmetsAddEdit('Исследование операций и методы оптимизации');
|
$predmetsAddEdit = $this->predmetsAddEdit('Исследование операций и методы оптимизации');
|
||||||
$gruppsSearch = $this->gruppsSearch($_POST['all_grupps_search']);
|
$gruppsSearch = $this->gruppsSearch($_POST['all_grupps_search']);
|
||||||
|
|
||||||
|
|
||||||
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
|
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
|
||||||
//$html .= '<pre>'. print_r($gruppsSearch,1) . '</pre>';
|
//$html .= '<pre>'. print_r($gruppsSearch,1) . '</pre>';
|
||||||
//$html .= '<pre>'. print_r($currentUserInfo,1) . '</pre>';
|
//$html .= '<pre>'. print_r($currentUserInfo,1) . '</pre>';
|
||||||
|
@ -283,10 +287,21 @@ class attendancelog {
|
||||||
$smarty->assign('currentUserInfo', $currentUserInfo);
|
$smarty->assign('currentUserInfo', $currentUserInfo);
|
||||||
if($page == 'headman') {
|
if($page == 'headman') {
|
||||||
$facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']);
|
$facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$smarty->assign('facult_groups',$facult_groups);
|
$smarty->assign('facult_groups',$facult_groups);
|
||||||
$smarty->assign('headmanPageActionResult', $headmanPageActionResult);
|
$smarty->assign('headmanPageActionResult', $headmanPageActionResult);
|
||||||
$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');
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($page == ''){
|
if ($page == ''){
|
||||||
if($currentUserInfo['role'] == 'student'){
|
if($currentUserInfo['role'] == 'student'){
|
||||||
|
@ -294,7 +309,10 @@ class attendancelog {
|
||||||
header($header);
|
header($header);
|
||||||
}
|
}
|
||||||
$groups = $this->getAllGrupps();
|
$groups = $this->getAllGrupps();
|
||||||
$facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']);
|
if (isset($currentUserInfo['facult']['facult_id'])){
|
||||||
|
$facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']);
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST['all_grupps_search'])){
|
if(isset($_POST['all_grupps_search'])){
|
||||||
$groups = $this->gruppsSearch($_POST['all_grupps_search']);
|
$groups = $this->gruppsSearch($_POST['all_grupps_search']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,19 +28,25 @@
|
||||||
|
|
||||||
{if $des == 'add_edit'}
|
{if $des == 'add_edit'}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span3">
|
<div class="span4">
|
||||||
<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> Выбрать группу </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">
|
<table class="table table-bordered">
|
||||||
<caption><h4></h4> </caption>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Группа</th>
|
||||||
|
<th>Староста</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$facult_groups key=key item=group}
|
{foreach from=$facult_groups key=key item=group}
|
||||||
<tr>
|
<tr {if isset($smarty.get.id) AND $group['id'] == $smarty.get.id } style="background-color: #dff0d8;"{/if}>
|
||||||
<td {if isset($smarty.get.id) AND $group['id'] == $smarty.get.id } style="text-align: center; background-color: #dff0d8; " {else} style="text-align: center;" {/if}><a href="/modul/attendancelog/headman/add_edit/{$group['id']}/"> <h4>{$group.sokr}</h4></a></td>
|
<td><a href="/modul/attendancelog/headman/add_edit/{$group['id']}/"> <h5 class="text-center">{$group.sokr}</h5></a></td>
|
||||||
|
<td> <h5 class="text-center">{if isset($group.headman)}{$group.headman} {else} <span style="color: red">не назначен !</span> {/if}</h5></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -48,7 +54,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span9">
|
<div class="span8">
|
||||||
{if isset($headmanPageActionResult.headman) }
|
{if isset($headmanPageActionResult.headman) }
|
||||||
<div class="alert alert-info"> <button class="close" data-dismiss="alert">×</button> <h3>Староста уже выбран(а)! - <strong> {$headmanPageActionResult.headman}</strong></h3> </div>
|
<div class="alert alert-info"> <button class="close" data-dismiss="alert">×</button> <h3>Староста уже выбран(а)! - <strong> {$headmanPageActionResult.headman}</strong></h3> </div>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -63,7 +69,7 @@
|
||||||
<caption><h4>{$headmanPageActionResult.current_group.sokr}</h4></caption>
|
<caption><h4>{$headmanPageActionResult.current_group.sokr}</h4></caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$headmanPageActionResult.students key=user_id item=info}
|
{foreach from=$headmanPageActionResult.students key=user_id item=info}
|
||||||
<tr {if $info.headman == 1} style="color: #468847; background-color: #dff0d8;" {/if}>
|
<tr {if $info.headman == 1} style="c6olor: #48847; background-color: #dff0d8;" {/if}>
|
||||||
<td> <h5>{$info.student_name}</h5> </td>
|
<td> <h5>{$info.student_name}</h5> </td>
|
||||||
<td style="min-width: 30%"><h5><input type="radio" name="headman_request" value="{$user_id}" {if $info.headman == 1} checked {/if}></h5></td>
|
<td style="min-width: 30%"><h5><input type="radio" name="headman_request" value="{$user_id}" {if $info.headman == 1} checked {/if}></h5></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -89,11 +95,17 @@
|
||||||
</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><h4></h4> </caption>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Группа</th>
|
||||||
|
<th>Староста</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$facult_groups key=key item=group}
|
{foreach from=$facult_groups key=key item=group}
|
||||||
<tr>
|
<tr {if isset($smarty.get.id) AND $group['id'] == $smarty.get.id } style="background-color: #dff0d8;"{/if}>
|
||||||
<td style="text-align: center"><a href="/modul/attendancelog/headman/add_edit/{$group['id']}/"><h4>{$group.sokr}</h4></a></td>
|
<td><a href="/modul/attendancelog/headman/add_edit/{$group['id']}/"> <h5 class="text-center">{$group.sokr}</h5></a></td>
|
||||||
|
<td> <h5 class="text-center">{if isset($group.headman)}{$group.headman} {else} <span style="color: #9d0202">не назначен !</span> {/if}</h5></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue