EIOS/rabprog/tpl/page_komp_models_sem.html

276 lines
12 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.

{function sel_sem issave=0 sems='' save='' fo='' id_disc='' id_compet=''}
{*if count($save)}{assign var=sems value=$save}{/if*}
{if $issave==0}{assign var=sems value=$sems}{else}{assign var=sems value=$save}{/if}
{for $sem=1 to 12}
<input type="checkbox" class="form-check chk_{$id_disc}_{$id_compet}_{$fo}" id="chk_{$id_disc}_{$id_compet}_{$fo}_{$sem}" data-sem="{$sem}" style="display: inline;width: 20px;" {if in_array($sem,$sems)}CHECKED{/if}>
<!--label class="form-check-label" for="chk_{$id_disc}_{$id_compet}_{$fo}_{$sem}">{$sem}</label-->
{/for}
{/function}
{if $view=='edit'}
<br><br>
<h2>{$UPLAN.up.shifr} {$UPLAN.up.naprav} {$UPLAN.up.kvalif} {$UPLAN.up.god_nach_podgot} {$UPLAN.up.fo} <a href="#" class="btn btn-warning btn-sm form_add_wrap_btn">+</a> <a href="/rabprog/upload/COMP_edit.pdf" target="_blank" class="btn btn-info btn-sm">?</a> </h2>
{if count($UPLAN.comp)}
{literal}
<style>
.preloader {
background-color: #d7d7d7c9;
position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000;
}
.preloader__loader {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)
}
</style>{/literal}
<div class="preloader">
<div class="preloader__loader" style="text-align: center;">
<img src="/rabprog/tpl/images/Preloader_1.gif" alt="" /><br>
<i><b>загрузка ...</b></i>
</div>
</div>
<a name="addeditform" class="addeditform"></a> <form method="post">
<div class="row form_add_wrap" style="display: none;">
<div class="col-md-2 mb-3">
<label for="compsem_index" class="form-label">Индекс</label>
<input type="text" class="form-control" id="compsem_index" name="compsem_index" placeholder="ПКУВ-4.1">
</div>
<div class="col-md-4 mb-3">
<label for="compsem_descrip" class="form-label">Описание</label>
<input type="text" class="form-control" id="compsem_descrip" name="compsem_descrip" placeholder="Подготовка предложений...">
</div>
<div class="col-md-4 mb-3">
<label for="compsem_disciplins" class="form-label">Дисциплины, выбор с нажатым CTRL</label>
<select class="form-select" id="compsem_disciplins" name="compsem_disciplins[]" multiple>
<option value="">Выбрать дисциплины</option>
{foreach from=$disciplins item=discip}
<option value="{$discip.id}">{$discip.index1} {$discip.name}</option>
{/foreach}
</select>
</div>
<div class="col-md-2 mb-3">
<label for="compsem_des" class="form-label">Действие</label><br>
<input type="hidden" name="compsem_id_file" value="{$ID_PLAN}">
<input type="hidden" id="compsem_id_comp" name="compsem_id_comp" value="0">
<input type="submit" class="btn btn-warning" id="compsem_des" name="compsem_des" value="Добавить">
</div>
</div>
</form>
<table class="table">
<thead>
<tr>
<th class="col-1"></th>
<th class="col-6">Формы обучения</th>
<th class="col-5">Компетенция</th>
</tr>
</thead>
<tbody>
{foreach from=$UPLAN.comp item=comp key=kod name=foo}
<tr class="{if strpos($comp.index,'.')===false}table-primary{else}collapse_tr{/if}" data-id="{$comp.id}" data-idfile="{$comp.id_file}"{*if count($comp.discs)} class="collapse_tr" data-id="{$comp.id}" data-idfile="{$comp.id_file}"{else} class="table-primary"{/if*}>
<td><b>{$comp.index}</b></td>
<td colspan="3"><b>{$comp.descrip}</b></td>
<td><a href="#" class="btn-warning btn btn-sm comp_edit" data-id="{$comp.id}">редактировать</a></td>
</tr>
<tr id="tdshs_{$comp.id}"></tr>
{/foreach}
</tbody>
</table>
{literal}
<style>
.collapse_tr{cursor:pointer;}
/*.collapse_tds{display: none;}*/
</style>
<script>
jQuery(document).ready(function($) {
$(".comp_edit").click(function(){
let id_comp = $(this).data('id');
$(".form_add_wrap").show();
$.ajax({
url: '/rabprog/komp_models_sem/', cache: false, datatype: 'json', method: 'post',
data: 'ajdes=get_comp_sem&id_comp=' + id_comp,
success: function (data) {
$("#compsem_index").val(data.comp.index);
$("#compsem_descrip").val(data.comp.descrip);
$.each( data.comp.discips, function( key, value ) {
$('#compsem_disciplins option[value='+value+']').prop('selected', true);
});
$("#compsem_id_comp").val(id_comp);
$("#compsem_des").val('Изменить');
$('html,body').animate({scrollTop : $('.addeditform').offset().top},1000);
}
});
return false;
});
$(".form_add_wrap_btn").click(function(){
$("#compsem_des").val('Добавить');
$("#compsem_id_comp").val('0');
$('#compsem_disciplins option').prop('selected', false);
$(".form_add_wrap").toggle();
return false;
});
$(".collapse_tr").click(function(){
let id_comp = $(this).data('id');
let id_file = $(this).data('idfile');
if($("#tdshs_"+id_comp).length) {
$.ajax({
url: '/rabprog/komp_models_sem/', cache: false, datatype: 'json', method: 'post',
data: 'ajdes=show_comp_sem&id_comp=' + id_comp + '&id_file=' + id_file,
success: function (data) {
//window.ToastShow1("Сохранили семестры",data.msg,data.err);
//$(".msgCS_"+id_disc+"_"+id_compet).text(data.msg);
$("#tdshs_" + id_comp).after(data.html);
//$("#tdsh_" + id_comp).toggle();
//$("tr[id^='tds_"+id_comp+"']").toggle();
$("#tdshs_" + id_comp).remove();
}
});
}else{
$("tr[id^='tds_"+id_comp+"']").toggle();
$("#tdsh_" + id_comp).toggle();
}
});
});
$(window).on('load', function () {
var $preloader = $('.preloader');
$preloader.delay(250).fadeOut(200);
});
</script>{/literal}
{else}
<p>в плане нет компетенций!</p>
{/if}
<input type="HIDDEN" id="ID_PLAN" value="{$ID_PLAN}">
{literal}
<style>
.inputModal{
border-bottom: 1px solid #0a53be;
}
</style>
<script>$(document).ready(function(){
$(document).on("click", ".btndeleCOMPSEM", function(){
let ucid = $(this).data('ucid');
let trid = $(this).data('trid');
if(confirm('Удалить дисциплину из компетенции? Вы точно уверены что ее нет? Удалите и все созданные РПД необхимо будет перепроверить!')) {
$.ajax({
url: '/rabprog/komp_models_sem/', cache: false, datatype: 'json', method: 'post',
data: 'ajdes=dele_comp_sem&ucid=' + ucid,
success: function (data) {
window.ToastShow1("Удалить дисциплину из компетенции", data.msg, data.err);
$("#" + trid).remove();
}
});
}
return false;
});
$(document).on("click", ".btnsaveCOMPSEM", function(){
let id_disc = $(this).data('id_disc');
let id_compet = $(this).data('id_compet');
let ofo = '';
$(".chk_"+id_disc+"_"+id_compet+"_ofo").each(function(){
if ($(this).prop('checked')) ofo += $(this).data('sem')+';';
});
let zfo = '';
$(".chk_"+id_disc+"_"+id_compet+"_zfo").each(function(){
if ($(this).prop('checked')) zfo += $(this).data('sem')+';';
});
let ofozfo = '';
$(".chk_"+id_disc+"_"+id_compet+"_ofozfo").each(function(){
if ($(this).prop('checked')) ofozfo += $(this).data('sem')+';';
});
//console.log("id_disc="+id_disc+"; id_compet="+id_compet+"; ofo="+ofo+"; zfo="+zfo+"; ofozfo="+ofozfo);
$.ajax({url: '/rabprog/komp_models_sem/',cache:false,datatype:'json',method:'post',
data: 'ajdes=save_comp_sem&id_disc='+id_disc+'&id_compet='+id_compet+'&ofo='+ofo+'&zfo='+zfo+'&ofozfo='+ofozfo,
success:function(data){
window.ToastShow1("Сохранили семестры",data.msg,data.err);
$(".msgCS_"+id_disc+"_"+id_compet).text(data.msg);
}
});
return false;
});
})</script>{/literal}
<div class="modal fade" id="InputModal" tabindex="-1" aria-labelledby="InputModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="InputModalLabel">Редактирование текста в поле ввода</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<textarea class="form-control" id="inputval" style="height:400px;"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
<button type="button" class="btn btn-primary" id="inputmodal_save">Сохранить</button>
</div>
</div>
</div>
</div>
{/if}
{if $view=='all'}
{if count($UCHEBPLANS)}
<h3 class="text-center">Компетентностные модели</h3>
<h3 class="text-center">Список закрепленных за кафедрой дисциплин и практик</h3>
<h4><u>{$kaf.name}</u></h4>
<table class="table">
<thead>
<tr>
<th class="col-1">Шифр</th>
<th class="col-2">Направление</th>
<th class="col-1">Профиль</th>
<th class="col-1">Квалификация</th>
<th class="col-1">Год</th>
<th class="col-1">Срок</th>
<th class="col-1">ФО</th>
<th class="col-1"><input type="text" class="form-control filter" placeholder="фильтр" value=""></th>
</tr>
</thead>
<tbody id="fbody">
{foreach from=$UCHEBPLANS item=up}
<tr>
<td>{$up.shifr}</td>
<td>{$up.naprav}</td>
<td>{$up.profil}</td>
<td>{$up.kvalif}</td>
<td>{$up.god_nach_podgot}</td>
<td>{$up.srok_poluch_obr}</td>
<td>{$up.fo}</td>
<td>{if $up.fo=="Очная"}
<a href="/rabprog/shahtplans/one/{$up.id_file}/" class="btn btn-sm btn-success" data-bs-toggle="tooltip" data-bs-placement="top" title="Просмотр плана" target="_blank"><i class="bi bi-eye"></i></a>
<a href="/rabprog/komp_models_sem/edit/{$up.id_file}/" class="btn btn-sm btn-warning" data-bs-toggle="tooltip" data-bs-placement="top" title="Создание компетентностной модели"><i class="bi bi-pencil-square"></i></a>
{else}файл:{$up.id_file}{/if}</td>
</tr>
{/foreach}
</tbody>
</table>
{literal}
<script>$(document).ready(function(){
//фильтр таблицы
$(".filter").keyup(function () {
var data = this.value.split(" ");
var jo = $("#fbody").find("tr");
if (this.value == "") {
jo.show();
return;
}
jo.hide();
//Recusively filter the jquery object to get results.
jo.filter(function (i, v) {
var $t = $(this);
for (var d = 0; d < data.length; ++d) if ($t.is(":contains('" + data[d] + "')")) return true;
return false;
}).show();
}).focus(function () {
this.value = "";
$(this).css({"color": "black"});
$(this).unbind('focus');
}).css({"color": "#C0C0C0"});
//http://jsfiddle.net/ukW2C/3/ фильтр для всей таблицы
})</script>{/literal}
{else}
<p>нет планов</p>
{/if}
{/if}