EIOS/tpl/tpl_teacher_liquidation_ved...

110 lines
5.1 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.

<div class="widget red" id="vedomost_widget_el">
<div class="widget-title">
<h4><i class="icon-reorder"></i> Элективные дисциплины студент-преподаватель</h4>
<span class="tools"><a href="javascript:;" class="icon-chevron-up"> Развернуть/Свернуть</a></span>
</div>
<div class="widget-body" id="vedomost_form_div" style="display: none;">
{*<pre>{print_r($elektivs_errors)}</pre>*}
{if isset($elektivs_errors)&&count($elektivs_errors)}
{foreach from=$elektivs_errors item=ee key=ee_cat}
{foreach from=$ee item=ei}
<div class="alert alert-danger"><button data-dismiss="alert" class="close">×</button><strong>{$ei}</strong></div>
{/foreach}
{/foreach}
{/if}
{foreach from=$elektivs item=grupp key=key}
<div>
<table class="table">
<tr style="background-color: wheat;" class="elekt_grup_tr" data-idgrupp="{$grupp.id}">
<th colspan="2" width="40%">{$grupp.specialnost} <b>{$grupp.sokr}</b></th>
<th colspan="2" width="40%">{$grupp.fo} {$grupp.year_start}</th>
<th width="20%">
{foreach from=$grupp.discip item=discip3}
<a href="#" class="btn btn-info elekt_vedomosti_create" data-idgrupp="{$grupp.id}" data-iddiscip="{$discip3.id}">Создать ведомость</a>{*надо сделать ИУП*}
{/foreach}
</th>
</tr>
{foreach from=$grupp.students item=student name=foo1}
<tr {if !isset($student.elektive)}style="background-color: #fba8a8;"{/if} class="elekt_grup_item elekt_grup_item_{$grupp.id}">
<td width="10%">{$smarty.foreach.foo1.iteration}</td>
<td width="30%">{$student.fio}</td>
{if isset($student.elektive)&&count($student.elektive)}
<td width="20%">{$student.elektive.name}</td>
<td width="20%">{$student.elektive.fio}</td>
{else}
<td colspan="2" width="40%">
<a href="#" class="btn btn-warning stud_sel_elective" id="stud_sel_elective_btn_{$student.id}" data-kurs="{$grupp.kurs}" data-studid="{$student.id}">Выбрать эл.дисциплину</a>
<div class="stud_sel_elective_div" id="stud_sel_elective_div_{$student.id}">
</div>
</td>
{/if}
<td width="20%"></td>
</tr>
{/foreach}
</table>
</div>
{/foreach}
</div>
</div>
{literal}
<style>
.elekt_grup_tr{ cursor:pointer;}
.elekt_grup_item{ display:none;}
</style>
<script>$(document).ready(function(){
$(".elekt_grup_tr").click(function(){
let id_grupp=$(this).data('idgrupp');
//$(".elekt_grup_item").hide();
$(".elekt_grup_item_"+id_grupp).toggle();
});
$(document).on("click", ".stud_sel_elective_save", function(){
let idstud=$(this).data('idstud');
let idelkt=$("#idstud_"+idstud+" option:selected").val();
$.ajax({url: '/inc/dekanat.php',cache:false,dataType:'json',type:'POST', async: false,
data: 'ajdes=elektivs_select_save&idelkt='+idelkt+'&studid='+idstud,
success:function(data){
$("#stud_sel_elective_div_" + idstud).html(data.html);
$("#stud_sel_elective_btn_"+idstud).remove();
}
});
return false;
});
$(".stud_sel_elective").click(function(){
let kurs=$(this).data('kurs');
let studid=$(this).data('studid');
let element = $(this);
$(".stud_sel_elective_div").html("");
$(".stud_sel_elective").show();
$.ajax({url: '/inc/dekanat.php',cache:false,dataType:'json',type:'POST', async: false,
data: 'ajdes=elektivs_select&kurs='+kurs+'&studid='+studid,
success:function(data){
if(data.html==''){
$("#stud_sel_elective_div_" + studid).html('Нет эл.дисциплин для выбора');
}else {
$("#stud_sel_elective_div_" + studid).html(data.html);
}
element.hide();
}
});
return false;
})
$(".elekt_vedomosti_create").click(function(){
let idgrupp=$(this).data('idgrupp');
let iddiscip=$(this).data('iddiscip');
$.ajax({url: '/inc/dekanat.php',cache:false,dataType:'json',type:'POST', async: false,
data: 'ajdes=elektivs_create_vedomosti&idgrupp='+idgrupp+'&iddiscip='+iddiscip,
success:function(data){
if(data.err==1) alert('Ошибка: '+data.msg);
if(data.err==0) {
//alert('Успешно: '+data.msg);
$(this).hide();
edit_stat(data.id);
}
}
});
return false;
})
})</script>
{/literal}