<?php
/* Smarty version 3.1.29, created on 2017-06-23 06:16:41
  from "/var/www/h3ysh156/data/www/freyamu.ru/views/templates/default/admin/modules/shop.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_594ca4392d02c4_11661932',
  'file_dependency' => 
  array (
    'dceae1b37ab0724f35aa6303acb0ca6cb8d29b91' => 
    array (
      0 => '/var/www/h3ysh156/data/www/freyamu.ru/views/templates/default/admin/modules/shop.tpl',
      1 => 1479256536,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_594ca4392d02c4_11661932 ($_smarty_tpl) {
echo '<script'; ?>
 type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"><?php echo '</script'; ?>
>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">
<div>
    <h1>Shop</h1>
    <div class="shop-config">
        <form action="/admin/modules/shop" method="post">
            <table width="100%">
                <tr>
                    <td>Enable</td>
                    <td>
                        <?php if ($_smarty_tpl->tpl_vars['Config']->value['Enable']) {?>
                            <input name="Enable" id="Enable" type="checkbox" checked/>
                        <?php } else { ?>
                            <input name="Enable" id="Enable" type="checkbox"/>
                        <?php }?>
                    </td>
                </tr>
                <tr>
                    <td>Main Valute (Default: <?php echo $_smarty_tpl->tpl_vars['Valutes']->value[0]['Name'];?>
)</td>
                    <td>
                        <select name="main_valute" id="main_valute">
                            <?php
$_from = $_smarty_tpl->tpl_vars['Valutes']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_val_0_saved_item = isset($_smarty_tpl->tpl_vars['val']) ? $_smarty_tpl->tpl_vars['val'] : false;
$__foreach_val_0_saved_key = isset($_smarty_tpl->tpl_vars['i']) ? $_smarty_tpl->tpl_vars['i'] : false;
$_smarty_tpl->tpl_vars['val'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['val']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['i']->value => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
$__foreach_val_0_saved_local_item = $_smarty_tpl->tpl_vars['val'];
?>
                                <?php if ($_smarty_tpl->tpl_vars['val']->value['Name'] != '') {?>
                                    <?php if ($_smarty_tpl->tpl_vars['Config']->value['MainValute'] == $_smarty_tpl->tpl_vars['i']->value) {?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" selected><?php echo $_smarty_tpl->tpl_vars['val']->value['Name'];?>
</option>
                                    <?php } else { ?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['val']->value['Name'];?>
</option>
                                    <?php }?>
                                <?php }?>
                            <?php
$_smarty_tpl->tpl_vars['val'] = $__foreach_val_0_saved_local_item;
}
if ($__foreach_val_0_saved_item) {
$_smarty_tpl->tpl_vars['val'] = $__foreach_val_0_saved_item;
}
if ($__foreach_val_0_saved_key) {
$_smarty_tpl->tpl_vars['i'] = $__foreach_val_0_saved_key;
}
?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Return Procent</td>
                    <td><input name="return_proc" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['ReturnProcent'];?>
"></td>
                </tr>
                <tr>
                    <th style="font-size: 14px" colspan="2">Price option</th>
                </tr>
                <tr>
                    <td>Luck</td>
                    <td><input name="opt_luck" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Luck'];?>
"></td>
                </tr>
                <tr>
                    <td>Skill</td>
                    <td><input name="opt_skill" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Skill'];?>
"></td>
                </tr>
                <tr>
                    <td>Level (+1)</td>
                    <td><input name="opt_level" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Level'];?>
"></td>
                </tr>
                <tr>
                    <td>Addition option (+4/+1%)</td>
                    <td><input name="opt_addition" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Option'];?>
"></td>
                </tr>
                <tr>
                    <td>Harmony</td>
                    <td><input name="opt_harmony" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Harmony'];?>
"></td>
                </tr>
                <tr>
                    <td>Harmony level</td>
                    <td><input name="opt_harmony_level" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['HarmonyLevel'];?>
"></td>
                </tr>
                <tr>
                    <td>Excellent</td>
                    <td><input name="opt_excellent" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Excellent'];?>
"></td>
                </tr>
                <tr>
                    <td>Ancient</td>
                    <td><input name="opt_ancient" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Ancient'];?>
"></td>
                </tr>
                <tr>
                    <td colspan="2">Sockets are disabled</td>
                </tr>
                <tr>
                    <td>Socket 1</td>
                    <td><input name="opt_soc1" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Socket1'];?>
"></td>
                </tr>
                <tr>
                    <td>Socket 2</td>
                    <td><input name="opt_soc2" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Socket2'];?>
"></td>
                </tr>
                <tr>
                    <td>Socket 3</td>
                    <td><input name="opt_soc3" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Socket3'];?>
"></td>
                </tr>
                <tr>
                    <td>Socket 4</td>
                    <td><input name="opt_soc4" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Socket4'];?>
"></td>
                </tr>
                <tr>
                    <td>Socket 5</td>
                    <td><input name="opt_soc5" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Socket5'];?>
"></td>
                </tr>
                <tr>
                    <td colspan="2"><button class="def_adm_btn" name="shop_save">Save</button></td>
                </tr>
            </table>
        </form>

        <form action="/admin/modules/shop" method="post">
            <table width="100%"><tr><td>
            <table id="list-shop-items" class="display">
                <thead>
                <tr>
                    <th>Item name</th>
                    <th>Char class</th>
                    <th>Item type</th>
                    <th>Item index</th>
                    <th>Skill</th>
                    <th>Luck</th>
                    <th>Harmony</th>
                    <th>Ancient</th>
                    <th>Max Addition</th>
                    <th>Max Level</th>
                    <th>Max Excellent</th>
                    <th>Max Socket</th>
                    <th>Start Price (<?php echo $_smarty_tpl->tpl_vars['Valutes']->value[$_smarty_tpl->tpl_vars['Config']->value['MainValute']]['Name'];?>
)</th>
                    <th>Update</th>
                    <th>Delete</th>
                </tr>
                </thead>
                <tbody>
                <?php
$_from = $_smarty_tpl->tpl_vars['Config']->value['Items'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_item_1_saved_item = isset($_smarty_tpl->tpl_vars['item']) ? $_smarty_tpl->tpl_vars['item'] : false;
$__foreach_item_1_saved_key = isset($_smarty_tpl->tpl_vars['i']) ? $_smarty_tpl->tpl_vars['i'] : false;
$_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['item']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['i']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->_loop = true;
$__foreach_item_1_saved_local_item = $_smarty_tpl->tpl_vars['item'];
?>
                    <tr>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Name'];?>
</td>
                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "0") {?>
                                Dark Wizard
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "1") {?>
                                Dark Knight
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "2") {?>
                                Fairy Elf
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "3") {?>
                                Summoner
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "4") {?>
                                Magic Gladiator
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "5") {?>
                                Dark Lord
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "6") {?>
                                Rage Fight
                            <?php } elseif ($_smarty_tpl->tpl_vars['item']->value['CharClass'] == "7") {?>
                                Other Item
                            <?php }?>
                          
                        </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Type'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Index'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Skill'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Luck'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Harmony'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['Ancient1'];?>
|<?php echo $_smarty_tpl->tpl_vars['item']->value['Ancient2'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['MaxAddition'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['MaxLevel'];?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['MaxExcellent'];?>
</td>
                        <td>-</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['item']->value['StartPrice'];?>
</td>
                        <td><button value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" name="update_item">Update</button></td>
                        <td><button value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" name="delete_item">Delete</button></td>
                    </tr>
                <?php
$_smarty_tpl->tpl_vars['item'] = $__foreach_item_1_saved_local_item;
}
if ($__foreach_item_1_saved_item) {
$_smarty_tpl->tpl_vars['item'] = $__foreach_item_1_saved_item;
}
if ($__foreach_item_1_saved_key) {
$_smarty_tpl->tpl_vars['i'] = $__foreach_item_1_saved_key;
}
?>
                </tbody>
            </table>
                    </td></tr></table>
        </form>
        <form action="/admin/modules/shop" method="post">
            <table width="100%">
                <tr>
                    <th colspan="2" style="font-size: 18px;">Add item</th>
                </tr>
                <tr>
                    <td>Character class</td>
                    <td>
                        <select name="add_item_class" id="add_item_class">
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 0) {?>
                                <option value="0" selected>Dark Wizard</option>
                            <?php } else { ?>
                                <option value="0">Dark Wizard</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 1) {?>
                                <option value="1" selected>Dark Knight</option>
                            <?php } else { ?>
                                <option value="1">Dark Knight</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 2) {?>
                                <option value="2" selected>Fairy Elf</option>
                            <?php } else { ?>
                                <option value="2">Fairy Elf</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 3) {?>
                                <option value="3" selected>Summoner</option>
                            <?php } else { ?>
                                <option value="3">Summoner</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 4) {?>
                                <option value="4" selected>Magic Gladiator</option>
                            <?php } else { ?>
                                <option value="4">Magic Gladiator</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 5) {?>
                                <option value="5" selected>Dark Lord</option>
                            <?php } else { ?>
                                <option value="5">Dark Lord</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 6) {?>
                                <option value="6" selected>Rage Fight</option>
                            <?php } else { ?>
                                <option value="6">Rage Fight</option>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['Update']->value['CharClass'] == 7) {?>
                                <option value="7" selected>Other Item</option>
                            <?php } else { ?>
                                <option value="7">Other Item</option>
                            <?php }?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Item name</td>
                    <td><input name="add_item_name" type="text" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Name'];?>
"></td>
                </tr>
                <tr>
                    <td>Item type</td>
                    <td><input name="add_item_type" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Type'];?>
"></td>
                </tr>
                <tr>
                    <td>Item index</td>
                    <td><input name="add_item_index" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Index'];?>
"></td>
                </tr>
                <tr><th colspan="2" style="font-size: 16px;">Option</th></tr>
                <tr>
                    <td>Luck</td>
                    <?php if ($_smarty_tpl->tpl_vars['Update']->value['Luck']) {?>
                        <td><input name="add_item_luck" type="checkbox" checked></td>
                    <?php } else { ?>
                    <td><input name="add_item_luck" type="checkbox"></td>
                    <?php }?>
                </tr>
                <tr>
                    <td>Skill</td>
                    <?php if ($_smarty_tpl->tpl_vars['Update']->value['Skill']) {?>
                    <td><input name="add_item_skill" type="checkbox"></td>
                    <?php } else { ?>
                    <td><input name="add_item_skill" type="checkbox"></td>
                    <?php }?>
                </tr>
                <tr>
                    <td>Harmony</td>
                    <?php if ($_smarty_tpl->tpl_vars['Update']->value['Harmony']) {?>
                    <td><input name="add_item_harmony" type="checkbox"></td>
                    <?php } else { ?>
                    <td><input name="add_item_harmony" type="checkbox"></td>
                    <?php }?>
                </tr>
                <tr><td colspan="2">Leave empty if not needed</td></tr>
                <tr>
                    <td>Ancient Name 1</td>
                    <td><input name="add_item_anc1" type="text" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Ancient1'];?>
"></td>
                </tr>
                <tr>
                    <td>Ancient Name 2</td>
                    <td><input name="add_item_anc2" type="text" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Ancient2'];?>
"></td>
                </tr>
                <tr>
                    <td>Max Level</td>
                    <td><input name="add_item_max_level" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['MaxLevel'];?>
"></td>
                </tr>
                <tr>
                    <td>Max Excellent</td>
                    <td><input name="add_item_max_exl" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['MaxExcellent'];?>
"></td>
                </tr>
                <tr>
                    <td>Max Addition</td>
                    <td><input name="add_item_max_add" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['MaxAddition'];?>
"></td>
                </tr>
                <tr>
                    <td colspan="2">Sockets are disabled</td>
                </tr>
                <tr>
                    <td>Max Socket</td>
                    <td><input name="add_item_max_soc" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['MaxSockets'];?>
"></td>
                </tr>
                <tr>
                    <td>Price (<?php echo $_smarty_tpl->tpl_vars['Valutes']->value[$_smarty_tpl->tpl_vars['Config']->value['MainValute']]['Name'];?>
)</td>
                    <td><input name="add_item_price" type="number" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['StartPrice'];?>
"></td>
                </tr>

                <tr>
                    <td colspan="2"><button class="def_adm_btn" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Key'];?>
" name="add_item">Add/Update</button></td>
                </tr>
            </table>
        </form>
    </div>
</div>


<?php echo '<script'; ?>
 type="text/javascript">
    $(document).ready(function(){
        $('#list-shop-items').DataTable();
    });
<?php echo '</script'; ?>
>
<?php }
}
