EIOS/inc/smarty/templates_c/32a4421d8bac0bdc2e7320577d5...

174 lines
6.8 KiB
PHP
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.

<?php /* Smarty version Smarty-3.1.13, created on 2022-06-01 10:40:49
compiled from "tpl/tpl_alneo_courses.html" */ ?>
<?php /*%%SmartyHeaderCode:1698945327629718019abda2-98373704%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'32a4421d8bac0bdc2e7320577d5a4742bc3c23e5' =>
array (
0 => 'tpl/tpl_alneo_courses.html',
1 => 1577773018,
2 => 'file',
),
),
'nocache_hash' => '1698945327629718019abda2-98373704',
'function' =>
array (
),
'variables' =>
array (
'teacher' => 0,
'teach' => 0,
'courses' => 0,
'k' => 0,
'course' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.13',
'unifunc' => 'content_62971801a09171_52207475',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_62971801a09171_52207475')) {function content_62971801a09171_52207475($_smarty_tpl) {?><!-- BEGIN PAGE HEADER-->
<div class="row-fluid">
<div class="span12">
<h3 class="page-title">Редактирование курсов</h3>
<ul class="breadcrumb">
<li><a href="/">Главная</a><span class="divider">/</span></li>
<li class="active"><a href="/alneo/course/">Редактирование курсов</a></li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="widget green">
<div class="widget-title">
<h4><i class="icon-reorder"></i> Курсы дополнительного профессионального образования</h4>
<span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span>
</div>
<div class="widget-body">
<h4>Добавление нового курса</h4>
<form name="add_course" method="post" action="#" onsubmit="return false;">
<div class="control-group">
<label class="control-label span4">Полное название: </label>
<div class="controls" >
<input type="text" class="span8 tooltips" name="name" data-trigger="hover" data-original-title="Например: Оператор электронно-вычислительных и вычислительных машин" required />
</div>
</div>
<div class="control-group">
<label class="control-label span4">Вид программы: </label>
<div class="controls" >
<select name="type" class="span8 tooltips" data-trigger="hover" data-original-title="Выберите тип">
<option value="3">Курс, тренинг, марафон</option>
<option value="2">Повышение квалификации</option>
<option value="1">Профессиональная переподготовка</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label span4">Преподаватель</label>
<div class="controls">
<select data-placeholder="Укажите преподавателя для группы" class="chzn-select span8" tabindex="6" name="id_teacher">
<option value="0">нет преподавателя</option>
<?php $_smarty_tpl->tpl_vars['teach'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['teach']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['teacher']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['teach']->key => $_smarty_tpl->tpl_vars['teach']->value){
$_smarty_tpl->tpl_vars['teach']->_loop = true;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['teach']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['teach']->value['name'];?>
</option>
<?php } ?>
</select>
</div>
</div>
<input type="submit" class="btn btn-success add_course" value="Добавить" />
</form>
<hr />
<table class="table table-striped table-bordered table-advance table-hover">
<thead>
<tr>
<th>№</th>
<th>Название</th>
<th>Вид</th>
<th>Преподаватель</th>
<th>Операции</th>
</tr>
</thead>
<tbody class="load-course">
<?php $_smarty_tpl->tpl_vars['course'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['course']->_loop = false;
$_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['courses']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['course']->key => $_smarty_tpl->tpl_vars['course']->value){
$_smarty_tpl->tpl_vars['course']->_loop = true;
$_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['course']->key;
?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['k']->value+1;?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['course']->value['name'];?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['course']->value['type'];?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['course']->value['fio'];?>
</td>
<td><button data-id="<?php echo $_smarty_tpl->tpl_vars['course']->value['id'];?>
" class="btn btn-danger del-course">Удалить</button></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
//добавление нового курса
$('.add_course').click(function(){
var name = $('form[name=add_course] input[name=name]').val();
var type = $('form[name=add_course] select[name=type]').val();
var teach = $('form[name=add_course] select[name=id_teacher]').val();
$.ajax({
url: '/json.php', dataType: 'json', type: 'POST', async: false, data: 'ajdes=add_course&name='+name+'&type='+type+'&teach='+teach,
//url: '/json.php', dataType: 'json', type: 'POST', async: false, data: 'ajdes=add_course',
success: function(data){
$('.load-course').html(data.html);
}
});
});
//удаление курса
$('.del-course').click(function(){
var id = $(this).data("id");
var is = confirm("Вы уверены, что хотите удалить курс ДПО? К нему могут быть привязаны лекции, за которые слушатели уже получили оценки.");
if (is){
$.ajax({
url: '/json.php', dataType: 'json', type: 'POST', async: false, data: 'ajdes=del_course&id='+id,
success: function(data){
$('.load-course').html(data.html);
}
});
}
});
});
</script>
<?php }} ?>