<?php
/* Smarty version 3.1.29, created on 2017-06-15 22:56:28
  from "/var/www/h3ysh156/data/www/freyamu.ru/views/templates/default/admin/newsmanager.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_5943028cccfea3_00403928',
  'file_dependency' => 
  array (
    '330f6245335ed6a20b248d476e6122e8f3d305b7' => 
    array (
      0 => '/var/www/h3ysh156/data/www/freyamu.ru/views/templates/default/admin/newsmanager.tpl',
      1 => 1479256504,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5943028cccfea3_00403928 ($_smarty_tpl) {
if (!is_callable('smarty_modifier_date_format')) require_once '/var/www/h3ysh156/data/www/freyamu.ru/library/Smarty/plugins/modifier.date_format.php';
echo '<script'; ?>
 type="text/javascript" src="/web/templates/default/admin/ckeditor/ckeditor.js"><?php echo '</script'; ?>
>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">

<?php echo '<script'; ?>
 type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"><?php echo '</script'; ?>
>

<h1>News Manager</h1>


<form action="/admin/news" method="post">
    <label for="">Count News In Page</label>
    <input name="count_in_page" type="number" style="width:30px;" value="<?php echo $_smarty_tpl->tpl_vars['Config']->value['CountInPage'];?>
">
</form>
<form action="/admin/news" method="post" >
    <table width="100%"><tr><td>
    <table id="news" class="display">
        <thead>
        <tr>
            <th>Title</th>
            <th>Date</th>
            <th>Edit</th>
            <th>Delete</th>
        </tr>
        </thead>
        <tbody>
           <?php
$_from = $_smarty_tpl->tpl_vars['News']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_article_0_saved_item = isset($_smarty_tpl->tpl_vars['article']) ? $_smarty_tpl->tpl_vars['article'] : false;
$__foreach_article_0_saved_key = isset($_smarty_tpl->tpl_vars['i']) ? $_smarty_tpl->tpl_vars['i'] : false;
$_smarty_tpl->tpl_vars['article'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['article']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['i']->value => $_smarty_tpl->tpl_vars['article']->value) {
$_smarty_tpl->tpl_vars['article']->_loop = true;
$__foreach_article_0_saved_local_item = $_smarty_tpl->tpl_vars['article'];
?>
               <tr>
                   <td><?php echo $_smarty_tpl->tpl_vars['article']->value[0];?>
</td>
                   <td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['article']->value[1],"%D %H:%M");?>
</td>
                   <td><button value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" name="update_article">Update</button></td>
                   <td><button class="btn-dangerous" value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" name="delete_article">Delete</button></td>
               </tr>
           <?php
$_smarty_tpl->tpl_vars['article'] = $__foreach_article_0_saved_local_item;
}
if ($__foreach_article_0_saved_item) {
$_smarty_tpl->tpl_vars['article'] = $__foreach_article_0_saved_item;
}
if ($__foreach_article_0_saved_key) {
$_smarty_tpl->tpl_vars['i'] = $__foreach_article_0_saved_key;
}
?>
        </tbody>
    </table>
            </td></tr></table>
</form>

    <h3>Add/Edit Article</h3>

    <div id="news">
        <form action="/admin/news" method="post">
            <table width="100%">
                <tr>
                    <th>Title</th>
                    <td><input type="text" placeholder="Title" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value[0];?>
" name="news_title"></td>
                </tr>

                <tr>
                    <th colspan="2">Description</th>
                </tr>
                <tr>
                    <td colspan="2"><textarea placeholder="Description" name="news_desc"><?php echo $_smarty_tpl->tpl_vars['Update']->value[2];?>
</textarea></td>
                </tr>
                <tr>
                    <td colspan="2"><label >Format (2001-03-10 17:16:18) </label> <input type="datetime" name="news_date" placeholder="PubDate" value="<?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['Update']->value[1],"Y-m-d H:i:s");?>
"></td>
                </tr>
                <tr>
                    <td colspan="2"><button class="button_send"  name="news_btn" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Key'];?>
">Отправить</button></td>
                </tr>
            </table>
        </form>
    </div>
<?php echo '<script'; ?>
 type="text/javascript">
    CKEDITOR.replace("news_desc");
    $(document).ready(function(){
        $('#news').DataTable();
    });
<?php echo '</script'; ?>
>
<?php }
}
