EIOS/rabprog/tpl/page_rpd.html

324 lines
16 KiB
HTML
Raw Permalink 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.

<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-t1-tab" data-bs-toggle="pill" data-bs-target="#pills-t1" type="button" role="tab" aria-controls="pills-t1" aria-selected="true">Титул</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t2-tab" data-bs-toggle="pill" data-bs-target="#pills-t2" type="button" role="tab" aria-controls="pills-t2" aria-selected="false">Разделы 1-4</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t3-tab" data-bs-toggle="pill" data-bs-target="#pills-t3" type="button" role="tab" aria-controls="pills-t3" aria-selected="false">Раздел 5.1-5.3</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t4-tab" data-bs-toggle="pill" data-bs-target="#pills-t4" type="button" role="tab" aria-controls="pills-t4" aria-selected="false">Раздел 5.4-5.9</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t6-tab" data-bs-toggle="pill" data-bs-target="#pills-t6" type="button" role="tab" aria-controls="pills-t6" aria-selected="false">Раздел 6.1-6.2</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t7-tab" data-bs-toggle="pill" data-bs-target="#pills-t7" type="button" role="tab" aria-controls="pills-t7" aria-selected="false">Раздел 7.1-7.4</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t8-tab" data-bs-toggle="pill" data-bs-target="#pills-t8" type="button" role="tab" aria-controls="pills-t8" aria-selected="false">Раздел 8.1-8.3</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t9-tab" data-bs-toggle="pill" data-bs-target="#pills-t9" type="button" role="tab" aria-controls="pills-t9" aria-selected="false">Раздел 9-10</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-t11-tab" data-bs-toggle="pill" data-bs-target="#pills-t11" type="button" role="tab" aria-controls="pills-t11" aria-selected="false">Раздел 11</button>
</li>
</ul>
<form method="post" class="row g-3">
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-t1" role="tabpanel" aria-labelledby="pills-t1-tab">
{include file="mod_rpd_titul.html"}
</div>
<div class="tab-pane fade" id="pills-t2" role="tabpanel" aria-labelledby="pills-t2-tab">
{include file="mod_rpd_razdel1.html"}
</div>
<div class="tab-pane fade" id="pills-t3" role="tabpanel" aria-labelledby="pills-t3-tab">
{include file="mod_rpd_razdel5.html"}
</div>
<div class="tab-pane fade" id="pills-t4" role="tabpanel" aria-labelledby="pills-t4-tab">
{include file="mod_rpd_razdel5_4.html"}
{include file="mod_rpd_razdel5_5.html"}
{include file="mod_rpd_razdel5_5_1.html"}
{include file="mod_rpd_razdel5_6.html"}
<div class="col-md-12">
<label for="razdel5_7" class="form-label">
<h4><a href="#" class="btn btn-sm btn-danger btnsave" data-itemid="razdel5_7" data-bs-toggle="tooltip" data-bs-placement="bottom" title="сохранение"><i class="bi bi-save"></i></a> 5.7. Примерная тематика курсовых проектов (работ) {if $save.razdel5_7=='null'}<a href="#" class="btn btn-danger razdelNot_btn" data-state="0" data-razdel="razdel5_7" data-tip="text" 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_7" data-tip="text" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Учебным планом не предусмотрено"><i class="bi bi-x-square"></i></a>{/if}</h4>
</label>
<textarea class="form-control razdel5_7" name="razdel5_7" id="razdel5_7" placeholder="Данный раздел самостоятельно заполняется преподавателем">{if isset($save)&&count($save)}{$save.razdel5_7}{/if}</textarea>
</div>
{include file="mod_rpd_razdel5_8.html"}
{include file="mod_rpd_razdel5_9.html"}
</div>
<div class="tab-pane fade" id="pills-t6" role="tabpanel" aria-labelledby="pills-t6-tab">
{include file="mod_rpd_razdel6.html"}
</div>
<div class="tab-pane fade" id="pills-t7" role="tabpanel" aria-labelledby="pills-t7-tab">
{include file="mod_rpd_razdel7.html"}
</div>
<div class="tab-pane fade" id="pills-t8" role="tabpanel" aria-labelledby="pills-t8-tab">
{include file="mod_rpd_razdel8.html"}
</div>
<div class="tab-pane fade" id="pills-t9" role="tabpanel" aria-labelledby="pills-t9-tab">
{include file="mod_rpd_razdel9.html"}
</div>
<div class="tab-pane fade" id="pills-t11" role="tabpanel" aria-labelledby="pills-t11-tab">
{include file="mod_rpd_razdel11.html"}
</div>
</div>
<input type="HIDDEN" name="ID_DISCIP" id="ID_DISCIP" value="{$ID_DISCIP}">
<input type="HIDDEN" name="ID_RPD" id="ID_RPD" value="{$ID_RPD}">
</form>
<br>
<br>
<br>
<br>
{literal}
<!-- include summernote css/js -->
<link href="/rabprog/inc/Editor/summernote/summernote-bs5.css" rel="stylesheet">
<script src="/rabprog/inc/Editor/summernote/summernote-bs5.js"></script>
<script src="/rabprog/inc/Editor/summernote/summernote-cleaner.js?v=23"></script>
<script src="/rabprog/inc/Editor/summernote/lang/summernote-ru-RU.min.js"></script>
<script src="/rabprog/tpl/js/jquery.base64.min.js"></script>
<style>
th.rotate, td.rotate {
position:relative;
}
th.rotate > div, td.rotate > div {
transform: rotate(-90deg);
position:absolute;
left:0;
right:0;
top: 10px;
margin:auto;
height: initial;
width: min-content;
}
.inputModal{
border-bottom: 1px solid #0a53be;
}
.formkomp54_div, .obrtech54_div{
position: absolute;
right: 0px;
top: 40px;
width: 400px;
height: 200px;
overflow: auto;
background: #fff;
padding: 6px;
border: 1px solid gray;
z-index: 100;
}
.formkomp54_div_close, .obrtech54_div_close{
position: absolute;
right:2px;
top:2px;
}
</style>
<script>$(document).ready(function(){
function replaceAll(str, find, replace) {
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
//Копирование из таблицы 5.1.
$(document).on("click", ".copy_51", function(){
let to = $(this).data('to');
let fo = $(this).data('fo');
let tr = '';
if(fo=='1') tr = $('#'+to+'_orig_'+fo).val(); //получили оригинал
if(fo=='2') tr = $('#'+to+'_orig_1').val(); //получили оригинал
let orig = ''; if(fo=='1') orig = 'och'; else orig = 'zao';
//console.log(tr);
$('#table_5_'+orig+' tr').each(function () {
if(to=='table_54') {
let name = $(this).find("input[data-name='razdel']").val();
if (name != '') {
let tr_tmp = tr;
tr_tmp = tr_tmp.replace('data-name="nametema" value=""', 'data-name="nametema" value="' + name + '"');
tr_tmp = tr_tmp.replaceAll('|/textarea|', '</textarea>');
$('#' + to + '_' + fo).append(tr_tmp);
}
}
if(to=='table_55') {
let name = $(this).find("input[data-name='razdel']").val();
if (name != '') {
let tr_tmp = tr;
tr_tmp = tr_tmp.replace('data-name="numrazddisc" value=""', 'data-name="numrazddisc" value="' + name + '"');
tr_tmp = tr_tmp.replaceAll('|/textarea|', '</textarea>');
$('#' + to + '_1').append(tr_tmp);
}
}
if(to=='table_56') {
let name = $(this).find("input[data-name='razdel']").val();
if (name != '') {
let tr_tmp = tr;
tr_tmp = tr_tmp.replace('data-name="numrazddisc" value=""', 'data-name="numrazddisc" value="' + name + '"');
tr_tmp = tr_tmp.replaceAll('|/textarea|', '</textarea>');
$('#' + to + '_1').append(tr_tmp);
}
}
if(to=='table_58') {
let name = $(this).find("input[data-name='razdel']").val();
if (name != '') {
let tr_tmp = tr;
tr_tmp = tr_tmp.replace('data-name="razdtemRPsami" value=""', 'data-name="razdtemRPsami" value="' + name + '"');
tr_tmp = tr_tmp.replaceAll('|/textarea|', '</textarea>');
$('#' + to + '_1').append(tr_tmp);
}
}
});
return false;
})
//кнопка сохранения для input, textarea
$(document).on("click", ".btnsave", function(){
let itemID = $(this).data('itemid');
let value = $("#"+itemID).val();
let ID_DISCIP = $("#ID_DISCIP").val();
let ID_RPD = $("#ID_RPD").val();
$.ajax({url: '/rabprog/rpd/',cache:false,datatype:'json',method:'post',
data: 'ajdes=RPD_Save&ID_DISCIP='+ID_DISCIP+'&ID_RPD='+ID_RPD+'&'+itemID+'='+encodeURIComponent(value),
success:function(data){
window.ToastShow1("Сохранение РПД",data.msg,data.err);
if ('ID_RPD' in data) $("#ID_RPD").val(data.ID_RPD);
}
});
return false;
});
//кнопка сохранения для table-структур
$(document).on("click", ".btnsave_table", function(){
let tds = $(this).data('tds');
let form = $(this).data('form');
let ID_DISCIP = $("#ID_DISCIP").val();
let ID_RPD = $("#ID_RPD").val();
let json=[],tmp=[], tr=0,first='';
$("."+tds).each(function( index ) {
name = $(this).data('name');
//value = escapeHtml_main($(this).val());
value = $(this).val();
//на каждой строке увеличим счетчик
if(first==name&&tr!=0) {
tr = tr +1;
json.push(tmp);
tmp=[];
}
let item = {'name':name,'value':value};
tmp.push(item);
//определим первое поле в строке
if(first!=name&&tr==0) {
tr = 1;
first=name;
}
});
json.push(tmp);
$.ajax({url: '/rabprog/rpd/',cache:false,datatype:'json',method:'post',
data: 'ajdes=RPD_SaveTable&ID_DISCIP='+ID_DISCIP+'&ID_RPD='+ID_RPD+'&form='+form+'&json='+encodeURIComponent(JSON.stringify(json)),
success:function(data){
window.ToastShow1("Сохранение РПД",data.msg,data.err);
if ('ID_RPD' in data) $("#ID_RPD").val(data.ID_RPD);
}
});
return false;
});
//Редактирование полей с большим текстом
var inputEl = null;
var inputModalEl = null;
$(document).on("click", ".inputModal",function(){
if($(this).hasClass("inputModalClearHelp")){}else{ $("#modal_variants").html(""); }
inputEl = $(this);
let val = $(this).val();
let options = { keyboard: false };
inputModalEl = new bootstrap.Modal(document.getElementById('InputModal'), options);
inputModalEl.toggle();
$("#inputval").val(val);
let inputmodaldop=$(this).data('inputmodaldop');
if(inputmodaldop=='mat101'){
$("#modal_variants").html("<a href='#' id='getinfo_101'>Взять из раздела 10.1</a>");
}
});
$("#inputmodal_save").click(function(){
inputEl.val($("#inputval").val());
inputModalEl.hide();
});
//Отключить раздел
$(".razdelNot_btn").click(function(){
let ID_DISCIP = $("#ID_DISCIP").val();
let ID_RPD = $("#ID_RPD").val();
let razdel = $(this).data("razdel");
let state = $(this).data("state");
let tip = "table";
if ($(this).data('tip')=="text") tip = "text";
if(state==1){
if(confirm(" Все данные этого блока удалятся! Вы уверены, что хотите скрыть блок?")) {
$(this).data("state", 0);
$(this).removeClass("btn-secondary").addClass("btn-danger");
$("." + razdel).hide();
$.ajax({
url: '/rabprog/rpd/', cache: false, datatype: 'json', method: 'post',
data: 'ajdes=RPD_RazdelNot&ID_DISCIP=' + ID_DISCIP + '&ID_RPD=' + ID_RPD + '&form=' + razdel + '&tip=' + tip + '&state=0',
success: function (data) {
window.ToastShow1("Убрали раздел из РПД", data.msg, data.err);
if ('ID_RPD' in data) $("#ID_RPD").val(data.ID_RPD);
}
});
}
}else{
$(this).data("state",1);
$(this).removeClass("btn-danger").addClass("btn-secondary");
$("."+razdel).show();
$.ajax({url: '/rabprog/rpd/',cache:false,datatype:'json',method:'post',
data: 'ajdes=RPD_RazdelNot&ID_DISCIP='+ID_DISCIP+'&ID_RPD='+ID_RPD+'&form='+razdel+'&state=1',
success:function(data){
window.ToastShow1("Включили раздел из РПД",data.msg,data.err);
if ('ID_RPD' in data) $("#ID_RPD").val(data.ID_RPD);
}
});
}
return false;
});
//Скрываем отключенные разделы
$(".razdelNot_btn").each(function(){
let razdel = $(this).data("razdel");
let state = $(this).data("state");
if(state==0){
$("."+razdel).hide();
}
});
function escapeHtml_main(text) {
var map = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
});</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:200px;"></textarea>
</div>
<div class="mb-3" id="modal_variants">
</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>