195 lines
11 KiB
HTML
195 lines
11 KiB
HTML
{function razdel_551_tr fo=''}
|
||
<tr class="table_551_tr" data-fo="{$fo}">
|
||
<td>
|
||
<a href="#" class="btn btn-secondary btn-sm table_551_del_tr" data-fo="{$fo}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Удаление строки из таблицы, не забывайте сохранять!"><i class="bi bi-trash"></i></a>
|
||
</td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} table_55_tdinps table_551_td_{$fo}_sem" data-fo="{$fo}" data-name="sem" value="{if isset($data.sem)}{$data.sem}{/if}"></td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} inputModal" data-fo="{$fo}" data-name="numrazddisc" value="{if isset($data.numrazddisc)}{$data.numrazddisc|escape}{/if}"></td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} inputModal" data-fo="{$fo}" data-name="nameprakt" value="{if isset($data.nameprakt)}{$data.nameprakt|escape}{/if}"></td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} table_551_tdinp" data-fo="{$fo}" data-name="ofo" value="{if isset($data.ofo)}{$data.ofo}{/if}"></td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} table_551_tdinp" data-fo="{$fo}" data-name="zfo" value="{if isset($data.zfo)}{$data.zfo}{/if}"></td>
|
||
<td><input type="text" class="form-control form-control-sm table_551_td_{$fo} table_551_tdinp" data-fo="{$fo}" data-name="ozfo" value="{if isset($data.ozfo)}{$data.ozfo}{/if}"></td>
|
||
</tr>
|
||
{/function}
|
||
{literal}<script>$(document).ready(function(){
|
||
function checkHours4_551(fo0,fo1,sem,val){
|
||
let znach = parseFloat($("#tabl4vz_"+fo1+"_"+sem+"_sz").text());
|
||
val = parseFloat(val);
|
||
let sum1 = 0;
|
||
let semc=0;
|
||
let tr = null;
|
||
let valc = 0;
|
||
$(".table_551_tr[data-fo=1]").each(function(){
|
||
tr = $(this);
|
||
semc = parseFloat(tr.find("[data-name=sem]").val()); //текущий семестр
|
||
if(semc == parseFloat(sem)){
|
||
valc = parseFloat(tr.find("[data-name="+fo0+"]").val());
|
||
sum1 += valc;
|
||
}
|
||
})
|
||
if (sum1>znach){
|
||
window.ToastShow1("Ошибка часов!","В текущей позиции для семестра "+sem+"<br>не может быть больше "+znach+"<br>Сумма введенных часов равна <b>"+sum1+"</b>",1);
|
||
return 0;
|
||
}else{
|
||
return 1;
|
||
}
|
||
}
|
||
//Изменение полей в таблице семестр, проверка на существование
|
||
$(document).on("change", ".table_551_tdinps", function() {
|
||
let fo = $(this).data('fo'); if(fo=='1') fo='och'; if(fo=='2') fo='zao'; if(fo=='3') fo='ochzao';
|
||
let sem = $(this).val();
|
||
let err=0;
|
||
if($("#tabl4s_och_"+sem).length){}else{
|
||
if($("#tabl4s_zao_"+sem).length){}else{
|
||
if($("#tabl4s_ochzao_"+sem).length){}else{ err=1;}
|
||
}
|
||
}
|
||
if(err==1){
|
||
window.ToastShow1("Ошибка семестра!","Семестра "+sem+" нет в таблице 4, введите существующий семестр!",1);
|
||
$(this).val("");
|
||
}
|
||
});
|
||
|
||
//Удаление строк из таблицы
|
||
$(document).on("click", ".table_551_del_tr", function(){
|
||
let fo = $(this).data('fo');
|
||
$(this).closest( "tr" ).remove();
|
||
calc551(fo);
|
||
$(".tooltip").hide();
|
||
return false;
|
||
});
|
||
//Изменение полей в таблице
|
||
$(document).on("change", ".table_551_tdinp", function(){
|
||
let fo = $(this).data('fo');
|
||
let fo0 = $(this).data('name');
|
||
let fo1 = ''; if(fo0=='ofo') fo1 = 'och'; if(fo0=='zfo') fo1 = 'zao'; if(fo0=='ozfo') fo1 = 'ochzao';
|
||
let sem = $(this).closest('tr').find(".table_551_td_"+fo+"_sem").val();
|
||
let val = $(this).val();
|
||
let err = checkHours4_551(fo0,fo1,sem,val);
|
||
if(err==0) $(this).val(0);
|
||
calc551(fo);
|
||
});
|
||
function calc551(fo){
|
||
let name = '',check=1;
|
||
let ofo=0, zfo=0, ozfo=0, val=0;
|
||
$(".table_551_td_"+fo).each(function( index ) {
|
||
name = $(this).data('name');
|
||
if($(this).val()=='') val=0; else val = parseFloat($(this).val().replace(',','.'));
|
||
if(name=='ofo') ofo = ofo + val;
|
||
if(name=='zfo') zfo = zfo + val;
|
||
if(name=='ozfo') ozfo = ozfo + val;
|
||
});
|
||
let ofoI = 0; valI = $(".table_551itogo_"+fo+"_ofo").html().replace(',','.'); if(valI=='') ofoI = 0; else ofoI = parseFloat(valI);
|
||
let zfoI = 0; valI = $(".table_551itogo_"+fo+"_zfo").html().replace(',','.'); if(valI=='') zfoI = 0; else zfoI = parseFloat(valI);
|
||
let ozfoI = 0; valI = $(".table_551itogo_"+fo+"_ozfo").html().replace(',','.'); if(valI=='') ozfoI = 0; else ozfoI = parseFloat(valI);
|
||
|
||
if (ofo!=ofoI){ $(".table_551itogo_"+fo+"_ofo").css({'color':'#dc3545'}); check=0; }
|
||
else{ $(".table_551itogo_"+fo+"_ofo").css({'color':'#198754'}); }
|
||
if (zfo!=zfoI){ $(".table_551itogo_"+fo+"_zfo").css({'color':'#dc3545'}); check=0; }
|
||
else{ $(".table_551itogo_"+fo+"_zfo").css({'color':'#198754'}); }
|
||
if (ozfo!=ozfoI){ $(".table_551itogo_"+fo+"_ozfo").css({'color':'#dc3545'}); check=0; }
|
||
else{ $(".table_551itogo_"+fo+"_ozfo").css({'color':'#198754'}); }
|
||
if(check==1) $(".table_551_td_"+fo+"_btnsave").show(); else $(".table_551_td_"+fo+"_btnsave").hide();
|
||
}
|
||
//Добавление строки в таблицу
|
||
$(document).on("click", ".btn_add_table_551_tr", function(){
|
||
let fo = $(this).data('fo');
|
||
let tr = $('#table_551_orig_'+fo).val(); //получили оригинал
|
||
$('#table_551_'+fo).append(tr); //добавили
|
||
return false;
|
||
});
|
||
})</script>{/literal}
|
||
{function razdel_551}
|
||
<div class="razdel5_5_1">
|
||
{assign var=fo value='1'}
|
||
<textarea id="table_551_orig_{$fo}" style="display: none;">{razdel_551_tr fo=$fo}</textarea>
|
||
<table class="table table-bordered table-sm">
|
||
<thead>
|
||
<tr>
|
||
<th class="text-center" rowspan="2">№</th>
|
||
<th class="text-center" rowspan="2">Сем</th>
|
||
<th class="text-center" rowspan="2">Тема дисциплины</th>
|
||
<th class="text-center" rowspan="2">Наименование симуляционных занятий</th>
|
||
<th class="text-center" colspan="3">Объем в часах</th>
|
||
</tr>
|
||
<tr>
|
||
<th class="text-center">ОФО</th>
|
||
<th class="text-center">ЗФО</th>
|
||
<th class="text-center">ОЗФО</th>
|
||
</tr>
|
||
<tr>
|
||
<th class="text-center" style="width: 20px;">
|
||
<a href="#" class="btn btn-sm btn-warning btn_add_table_551_tr" data-fo="{$fo}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Добавление строки"><i class="bi bi-plus-square"></i></a>
|
||
</th>
|
||
<th class="text-center" style="width: 20px;">1</th>
|
||
<th class="col-3 text-center">2</th>
|
||
<th class="col-3 text-center">3</th>
|
||
<th class="col-1 text-center">4</th>
|
||
<th class="col-1 text-center">5</th>
|
||
<th class="col-1 text-center">6</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="table_551_{$fo}">
|
||
{if isset($save)&&count($save)&&count($save.razdel5_5_1)&&isset($save.razdel5_5_1[$fo])}
|
||
{foreach from=$save.razdel5_5_1[$fo] item=ss}
|
||
{razdel_551_tr fo=$fo data=$ss}
|
||
{/foreach}
|
||
{/if}
|
||
{razdel_551_tr fo=$fo}
|
||
</tbody>
|
||
<tfoot>
|
||
<tr>
|
||
<td>
|
||
<a href="#" class="btn btn-sm btn-danger table_551_td_{$fo}_btnsave btnsave_table" data-tds="table_551_td_{$fo}" data-form="table_551_{$fo}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="сохранение таблицы" style="display: none;"><i class="bi bi-save"></i></a>
|
||
</td>
|
||
<td></td>
|
||
<td class="fw-bolder">ИТОГО:</td>
|
||
<td></td>
|
||
<td class="table_551itogo_{$fo}_ofo fw-bolder">{if $sum_ofo!=0}{$sum_ofo}{/if}</td>
|
||
<td class="table_551itogo_{$fo}_zfo fw-bolder">{if $sum_zfo!=0}{$sum_zfo}{/if}</td>
|
||
<td class="table_551itogo_{$fo}_ozfo fw-bolder">{if $sum_ozfo!=0}{$sum_ozfo}{/if}</td>
|
||
</tr>
|
||
</tfoot>
|
||
</table>
|
||
</div>
|
||
{/function}
|
||
|
||
<div class="col-md-12">
|
||
<h4>Симуляционные занятия, их наименование, содержание и объем в часах {if $save.razdel5_5_1[0][0].sem=='null'}<a href="#" class="btn btn-danger razdelNot_btn" data-state="0" data-razdel="razdel5_5_1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Учебным планом не предусмотрено"><i class="bi bi-x-square"></i></a>{else}<a href="#" class="btn btn-secondary razdelNot_btn" data-state="1" data-razdel="razdel5_5_1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Учебным планом не предусмотрено"><i class="bi bi-x-square"></i></a>{/if}</h4>
|
||
{assign var=sum_ofo value=0}
|
||
{assign var=sum_zfo value=0}
|
||
{assign var=sum_ozfo value=0}
|
||
|
||
{foreach from=$DISCIPS item=discipsfo key=fo}
|
||
{assign var=summ value=0}
|
||
{foreach from=$discipsfo.uchebplan.json item=Kurss key=kurs}
|
||
{foreach from=$Kurss item=Sems key=sem}
|
||
{*if isset($Sems.lekcii)}{assign var=summ value=$summ+$Sems.lekcii}{/if*}
|
||
{*if isset($Sems.labs)}{assign var=summ value=$summ+$Sems.labs}{/if*}
|
||
{*if isset($Sems.pr)}{assign var=summ value=$summ+$Sems.pr}{/if*}
|
||
{*if isset($Sems.srp)}{assign var=summ value=$summ+$Sems.srp}{/if*}
|
||
{*if isset($Sems.krat)}{assign var=summ value=$summ+$Sems.krat}{/if*}
|
||
{*if isset($Sems.kontrol)}{assign var=summ value=$summ+$Sems.kontrol}{/if*}
|
||
{*if isset($Sems.sr)}{assign var=summ value=$summ+$Sems.sr}{/if*}
|
||
{if isset($Sems.sz)}{assign var=summ value=$summ+$Sems.sz}{/if}
|
||
{/foreach}
|
||
{/foreach}
|
||
{if $fo=='Очная'}{assign var=sum_ofo value=$sum_ofo+$summ}{/if}
|
||
{if $fo=='Заочная'}{assign var=sum_zfo value=$sum_zfo+$summ}{/if}
|
||
{if $fo=='Очно-заочная'}{assign var=sum_ozfo value=$sum_ozfo+$summ}{/if}
|
||
{/foreach}
|
||
|
||
{if isset($DISCIPS['Очная'])}
|
||
{razdel_551 DISCIPS=$DISCIPS['Очная'] title='Очная' sum_ofo=$sum_ofo sum_zfo=$sum_zfo sum_ozfo=$sum_ozfo}
|
||
{else}
|
||
{if isset($DISCIPS['Заочная'])}
|
||
{razdel_551 DISCIPS=$DISCIPS['Заочная'] title='Заочная' sum_ofo=$sum_ofo sum_zfo=$sum_zfo sum_ozfo=$sum_ozfo}
|
||
{else}
|
||
{if isset($DISCIPS['Очно-заочная'])}{razdel_551 DISCIPS=$DISCIPS['Очно-заочная'] title='Очно-заочная' sum_ofo=$sum_ofo sum_zfo=$sum_zfo sum_ozfo=$sum_ozfo}{/if}
|
||
{/if}
|
||
{/if}
|
||
|
||
{*<a href="#" class="btn btn-sm btn-info copy_51" data-to="table_551" data-fo="1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Копирование строк из таблицы 5.1 только названия">Скопировать из 5.1</a>*}
|
||
</div>
|
||
|