EIOS/tpl/tpl_mhelp_secretary.html

120 lines
4.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h4 align="center">Секретарю стипендиальной комиссии</h4>
{if isset($user.statuses[42])}
<div class="alert alert-success" style="display: none;"></div>
<div class="widget-body">
<table class="table table-striped table-bordered table-advance table-hover table-person">
<thead>
<tr>
<th></th>
<th>Дата</th>
<th>ФИО</th>
<th>Тип</th>
<th>Сумма</th>
<th>Доп. информация</th>
<th>Файлы</th>
<th>Статус</th>
<th>Операции</th>
</tr>
</thead>
<tbody>
{foreach from=$zayavks item=it}
<tr>
<td></td>
<td>{$it.data_cr}</td>
<td>{$it.fio}</td>
<td>{$it.type}</td>
<td>{$it.summa} руб.</td>
<td>{$it.phone}
{if $it.dop_info != '|'}{$it.dop_info}{/if}<br />
<b>Группа:</b> {foreach from=$student.grupps item=gp}{if $gp.active==1} {$gp.sokr}-{$gp.kurs} {$gp.fo}{/if}{/foreach}
</td>
<td>{$it.files}</td>
<td nowrap class="mhelp_status">
{$it.status}
</td>
<td width="15%">
<a href="#{$it.pn}" class="btn btn-success ok_get" data-id="{$it.id}">Одобрить</a><br /><br />
<a href="#{$it.pn}" class="btn btn-warning double_one" data-id="{$it.id}">Отклонить</a>
<textarea class="form-control mhelp_com" style="display: none;" rows="5" placeholder="Ваш комментарий" style="width: 100%;"></textarea>
<a href="#{$it.pn}" style="display: none;" class="btn btn-danger noget" data-id="{$it.id}">Отклонить</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<script>
$(document).ready(function(){ //ждем, когда страница полностью будет прочитана
$(".double_one").click(function(){ //отображаем текстовое поле для ввода комментария
$(this).css("display", "none");
$(this).find("+ .mhelp_com + .noget").css("display", "block");
$(this).find("+ .mhelp_com").css("display", "block");
});
//нумерация строк
$(function(){
$('.table-person td:first-child').each(function (i) {
$(this).html(i+1);
});
});
$(".noget").click(function(){ //при клике на кнопку "Отклонить" с таким классом
var zayId = $(this).data('id'); //берем data-id - уникальный идентификатор кнопки отклонения - то есть тот номер, с которым будем работать в дальнейшем.
//берем номер строки, на которой была нажата кнопка
var id_href = $(this).attr("href");
id_href = id_href.slice(1);
var comment = $(this).prev('.mhelp_com').val();
//$(this).find("+ .mhelp_com").css("display", "none");
$(this).css("display", "none");
$.ajax({
url: '/json.php',dataType:'json',type:'POST',async:false,data:'no_id_order='+zayId+'&comment='+comment,
success: function(data){
$(".table-person tbody tr").eq(id_href - 1).remove();
//обновляем нумерацию строк
$('.table-person td:first-child').each(function (i) {
$(this).html(i+1);
});
$(".alert-success").html("Заявление отклонено");
$(".alert-success").css("display", "block");
}
});
});
$(".ok_get").click(function(){ //при клике на кнопку "Отклонить" с таким классом
var zayId2 = $(this).data('id'); //берем data-id - уникальный идентификатор кнопки отклонения - то есть тот номер, с которым будем работать в дальнейшем.
//берем номер строки, на которой была нажата кнопка
var id_tr = $(this).attr("href");
id_tr = id_tr.slice(1);
$(this).css("display", "none");
$.ajax({
url: '/json.php',dataType:'json',type:'POST',async:false,data:'ok_id_order='+zayId2,
success: function(data){
$(".table-person tbody tr").eq(id_tr - 1).remove();
//обновляем нумерацию строк
$('.table-person td:first-child').each(function (i){
$(this).html(i+1);
});
$(".alert-success").html("Заявление одобрено");
$(".alert-success").css("display", "block");
}
});
});
});
</script>
{else}
<p align="center" style="margin-top: calc(40vh);">У Вас нет доступа!</p>
{/if}