102 lines
3.2 KiB
PHP
102 lines
3.2 KiB
PHP
<?php /* Smarty version Smarty-3.1.13, created on 2022-04-11 20:53:18
|
||
compiled from "tpl/tpl_optionally_students.html" */ ?>
|
||
<?php /*%%SmartyHeaderCode:60758482362546b0e206037-50799534%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
|
||
$_valid = $_smarty_tpl->decodeProperties(array (
|
||
'file_dependency' =>
|
||
array (
|
||
'bda0f79ed957388a8b9414c808e610054ca935a2' =>
|
||
array (
|
||
0 => 'tpl/tpl_optionally_students.html',
|
||
1 => 1553676421,
|
||
2 => 'file',
|
||
),
|
||
),
|
||
'nocache_hash' => '60758482362546b0e206037-50799534',
|
||
'function' =>
|
||
array (
|
||
),
|
||
'variables' =>
|
||
array (
|
||
'zayavka' => 0,
|
||
'disc' => 0,
|
||
'it' => 0,
|
||
'parametr' => 0,
|
||
),
|
||
'has_nocache_code' => false,
|
||
'version' => 'Smarty-3.1.13',
|
||
'unifunc' => 'content_62546b0e20df31_55915058',
|
||
),false); /*/%%SmartyHeaderCode%%*/?>
|
||
<?php if ($_valid && !is_callable('content_62546b0e20df31_55915058')) {function content_62546b0e20df31_55915058($_smarty_tpl) {?>
|
||
<div class="row-fluid">
|
||
<div class="span12">
|
||
|
||
<div class="widget blue">
|
||
<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">
|
||
<?php if ($_smarty_tpl->tpl_vars['zayavka']->value==0){?>
|
||
<div class="discipline-one-window">
|
||
<p><i>Пожалуйста, выберите дисциплины, которые Вы желаете изучать.</i></p>
|
||
<table width="90%">
|
||
<?php $_smarty_tpl->tpl_vars['it'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['it']->_loop = false;
|
||
$_from = $_smarty_tpl->tpl_vars['disc']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
|
||
foreach ($_from as $_smarty_tpl->tpl_vars['it']->key => $_smarty_tpl->tpl_vars['it']->value){
|
||
$_smarty_tpl->tpl_vars['it']->_loop = true;
|
||
?>
|
||
<tr>
|
||
<!--td width="5%"><?php echo $_smarty_tpl->tpl_vars['it']->value['id'];?>
|
||
</td-->
|
||
<td><?php echo $_smarty_tpl->tpl_vars['it']->value['out'];?>
|
||
</td>
|
||
</tr>
|
||
<?php } ?>
|
||
</table><br />
|
||
|
||
<hr />
|
||
<input type="submit" class="btn btn-success save_optionally" value="Сохранить" />
|
||
</div>
|
||
<?php }else{ ?>
|
||
<div class="discipline-two-window">
|
||
<h4 align="center">Вы уже выбрали предметы!</h4>
|
||
</div>
|
||
<?php }?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script type="text/javascript">
|
||
$(document).ready(function(){
|
||
|
||
$(".save_optionally").click(function(){
|
||
var i = 0;
|
||
var str = ''; //строка с ид предметами - в БД
|
||
while (i < <?php echo $_smarty_tpl->tpl_vars['parametr']->value;?>
|
||
){
|
||
i++;
|
||
var select_value_radio = $('input[name=predmets'+i+']:checked').val();
|
||
|
||
str = str + select_value_radio + ',';
|
||
|
||
}
|
||
|
||
$.ajax({
|
||
url: '/json.php',dataType:'json',type:'POST',async:false,data:'ajdes=save_optionally&str='+str,
|
||
success: function(data){
|
||
//alert(str);
|
||
if (data.error == 1){
|
||
alert("Не все!");
|
||
} else{
|
||
alert("Вы сохранили выбранные дисциплины");
|
||
location.href = '/optionally/students/';
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
});
|
||
|
||
});
|
||
</script><?php }} ?>
|