<?php
/* Smarty version 3.1.30, created on 2018-02-03 19:02:17
  from "C:\xampp\htdocs\decydownik\ajax\proces\alternatywy.tpl" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.30',
  'unifunc' => 'content_5a75f929a4b6c1_29120940',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '82b72543ec8956ef19afb62ee831855bef0ac5a8' => 
    array (
      0 => 'C:\\xampp\\htdocs\\decydownik\\ajax\\proces\\alternatywy.tpl',
      1 => 1517680933,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5a75f929a4b6c1_29120940 (Smarty_Internal_Template $_smarty_tpl) {
?>
<div class="p10">
    <div class="col-md-8 col-md-offset-2">
        <div class="DecsisionFrame">
            <form action="javascript:;">
                <input type="hidden" name="mode" value="proces" />
                <input type="hidden" name="function" value="confirm" />
                <input type="hidden" name="proces_id" value="<?php echo $_smarty_tpl->tpl_vars['ProcesId']->value;?>
" />
                <?php if ($_smarty_tpl->tpl_vars['Alternatywy']->value->Count) {?>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Alternatywy']->value->Items, 'Alternatywa', false, NULL, 'alternatywa', array (
  'first' => true,
  'index' => true,
));
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Alternatywa']->value) {
$_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['index']++;
$_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['first'] = !$_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['index'];
?>
                <div id="Alternatywa<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" class="AlternativeGroup<?php if (!(isset($_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['first']) ? $_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['first'] : null)) {?> none<?php }?>">
                    <div class="AlternativeName"><?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->nazwa;?>
 <a href="javascript:;" data-action="delete_alternative" data-target="#Alternatywa<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" data-a="<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" onclick="$.get('ajax.php?mode=proces&function=removealt&id=<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
');" class="btn btn-default RemoveAlternative SetTooltip" title="Usuń alternatywę"><i class="fa fa-trash"></i></a> <a href="javascript:;" data-a="<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" data-url="ajax.php?mode=proces&function=editalternative&id=<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" class="btn btn-default SetTooltip ProcesMoreOptions" title="Edytuj alternatywę"><i class="fa fa-edit"></i></a></div>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Alternatywa']->value->kryteria->Items, 'Kryterium', false, NULL, 'kryterium', array (
));
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Kryterium']->value) {
?>
                    <div class="AlternativeQuestion AlternativeQuestion<?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->id;?>
">
                        <label><?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->nazwa;?>
 <a href="javascript:;" class="ProcesMoreOptions" data-url="ajax.php?mode=proces&function=editkryterium&id=<?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->id;?>
&subid=<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->id;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->id;?>
" data-type="kryterium"><i class="fa fa-edit SetTooltip" title="Edytuj kryterium"></i></a></label>                            
                        <div class="input-group">
                            <?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->html_field;?>

                            <div class="input-group-addon"><a href="javascript:;" class="RemoveKryterium" data-k="<?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->id;?>
"><i class="fa fa-trash SetTooltip" title="Usuń kryterium"></i></a></div>
                        </div>
                    </div>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

                    <?php if ($_smarty_tpl->tpl_vars['Alternatywa']->value->image) {?>
                    <div class="p10 tac">
                        <img src="<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->image;?>
" class="pointer SetTooltip" title="Kliknij by powiększyć" style="width: 250px;margin:0 auto;" data-image="<?php echo $_smarty_tpl->tpl_vars['Alternatywa']->value->image;?>
" />
                    </div>
                    <?php }?>
                    <div class="p10">
                        <?php if (!(isset($_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['first']) ? $_smarty_tpl->tpl_vars['__smarty_foreach_alternatywa']->value['first'] : null)) {?>
                        <a href="javascript:;" class="btn btn-default AlternativePrev"><?php echo l('Wróć');?>
</a>&nbsp;&nbsp;
                        <?php }?>
                        <a href="javascript:;" class="btn btn-primary AlternativeNext"><?php echo l('Dalej');?>
</a>                    
                    </div>
                </div>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

                <div class="p10 tac none" id="ProcessSummary">
                    <div class="AlternativeName"><?php echo l('Jakich wag chcesz użyć dla tego procesu?');?>
</div>
                    <div class="AlternativeName none"><?php echo l('Przypisz wagi do kryteriów');?>
</div>
                    <div class="p10">
                        <a href="javascript:;" class="btn btn-primary btn-weights wmax DynamicFormSubmit bold fs14" data-btn="game"><?php echo l('GRA');?>
</a> 
                    </div>
                    
                    <div class="p10">
                        <a href="javascript:;" class="btn btn-default btn-weights wmax DynamicFormSubmit" data-btn="default"><?php echo l('Wagi domyślne*');?>
</a> 
                    </div>

                    <div class="p10">
                        <div id="NewWeightsForm" class="none">
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['Alternatywy']->value->Items[0]->kryteria->Items, 'Kryterium');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['Kryterium']->value) {
?>
                            <div class="form-group">
                                <label><?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->nazwa;?>
</label>
                                <input placeholder="1-10" type="text" name="waga[<?php echo $_smarty_tpl->tpl_vars['Kryterium']->value->id;?>
]" class="form-control" />
                            </div>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
?>

                        </div>
                        <a href="javascript:;" class="btn btn-default btn-weights NewWeights wmax"><?php echo l('Przypisz wagi');?>
</a>
                        <a href="javascript:;" class="btn btn-default btn-weights none wmax DynamicFormSubmit" id="SaveWeights" data-btn="new"><?php echo l('Zakończ proces');?>
</a>
                    </div>
                    <div class="pt10">
                        <div><small>* <?php echo l('Waga domyślna = 1');?>
</small></div>
                    </div>
                </div>
                <?php } else { ?>
                <div class="bg-danger p10">Coś poszło nie tak :(</div>
                <?php }?>                
            </form>
        </div>
    </div>

    <div class="clear"></div>
    <div class="p10 tac">
        <a href="javascript:;" class="btn btn-success ProcesMoreOptions" data-url="ajax.php?mode=proces&function=newalternative&ProcesId=<?php echo $_smarty_tpl->tpl_vars['ProcesId']->value;?>
&temat_id=<?php echo $_smarty_tpl->tpl_vars['Temat']->value->id;?>
">Dodaj alternatywę</a> 
        <a href="javascript:;" class="btn btn-success ProcesMoreOptions" data-url="ajax.php?mode=proces&function=newkryterium&ProcesId=<?php echo $_smarty_tpl->tpl_vars['ProcesId']->value;?>
&temat_id=<?php echo $_smarty_tpl->tpl_vars['Temat']->value->id;?>
">Dodaj kryterium</a>
    </div>
</div><?php }
}
