<?php
/* Smarty version 3.1.30, created on 2018-01-31 01:20:27
  from "C:\xampp\htdocs\decydownik\admin\kryteria\add.tpl" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.30',
  'unifunc' => 'content_5a710bcb63f604_62498506',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'd769ba94b0ccb9c818d08befcc29b987e518685c' => 
    array (
      0 => 'C:\\xampp\\htdocs\\decydownik\\admin\\kryteria\\add.tpl',
      1 => 1517356549,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5a710bcb63f604_62498506 (Smarty_Internal_Template $_smarty_tpl) {
?>
<form method="post" enctype="multipart/form-data">
    <?php echo statement::display();?>

    <table class="table">
        <thead>
            <tr>
                <td colspan="2">Dodaj kryterium</td>
            </tr>
        </thead>
    
        <tr>
            <td style="width:35%">Nazwa</td>
            <td><input type="text" class="form-control" name="nazwa" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['nazwa'];?>
" /></td>
        </tr>
        <tr>
            <td style="width:35%">Obraz</td>
            <td><input type="file" name="image" />
            <div>
                <small class="fs10">Zalecane proporcje grafiki to 1:1, a rozmiar nie mniejszy niż 250x250 (może być dowolnie większy jeśli zachowuje proporcje)</small>
            </div>
            </td>
        </tr>
        <tr>
            <td>Temat</td>
            <td><select name="temat_id" class="form-control">
                <option value="">- wybierz -</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Tematy']->value->Items, 'Temat');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Temat']->value) {
?>
                <option value="<?php echo $_smarty_tpl->tpl_vars['Temat']->value->id;?>
"<?php if ($_smarty_tpl->tpl_vars['Temat']->value->id == $_smarty_tpl->tpl_vars['data']->value['temat_id']) {?> selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['Temat']->value->nazwa;?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

            </select></td>
        </tr>
        <tr>
            <td>Typ</td>
            <td><select name="typ_id" class="form-control">
                <option value="">- wybierz -</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Typy']->value->Items, 'Typ');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Typ']->value) {
?>
                <option value="<?php echo $_smarty_tpl->tpl_vars['Typ']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['Typ']->value->nazwa;?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

            </select></td>
        </tr>
        <?php echo '<script'; ?>
 type="text/javascript">
        $(document).on('change','[name=typ_id]',function(){

            switch( $(this).val() )
            {
                case '2':
                    $('#kryterium_type2').show();
                    $('#kryterium_type3').hide();
                break;
                
                case '3':
                    $('#kryterium_type3').show();
                    $('#kryterium_type2').hide();
                break;
                
                case '1':
                default:
                    $('#kryterium_type2, #kryterium_type3').hide();
                break;
            }
            
        });
        <?php echo '</script'; ?>
>
        <tr id="kryterium_type3" class="none">
            <td>Obrazy</td>
            <td><select name="Images" class="form-control">
                <option value="">- wybierz grupę -</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Images']->value->Items, 'Typ');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Typ']->value) {
?>
                <option value="<?php echo $_smarty_tpl->tpl_vars['Typ']->value->nazwa;?>
"><?php echo $_smarty_tpl->tpl_vars['Typ']->value->nazwa;?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

            </select></td>
        </tr> 
        <tr id="kryterium_type2" class="none">
            <td>Zmienne lingwistyczne</td>
            <td><select name="Lingwistyczne" class="form-control">
                <option value="">- wybierz grupę -</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Lingwistyczne']->value->Items, 'Typ');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Typ']->value) {
?>
                <option value="<?php echo $_smarty_tpl->tpl_vars['Typ']->value->nazwa;?>
"><?php echo $_smarty_tpl->tpl_vars['Typ']->value->nazwa;?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

            </select></td>
        </tr> 
        <tr>
            <td colspan="2" class="tac">
                <input class="btn btn-primary" type="submit" value="Zapisz" />
            </td>
        </tr>
    
    </table>
</form><?php }
}
