virt2/api/mod/t_cats_edit.html

114 lines
6.0 KiB
HTML
Raw Permalink Normal View History

{include file=$header_admin title="Редактирование категории"}
<button type="button" class="btn btn-info" data-link="/t_cats/">Категории товара</button>
<div id="tabs">
<ul>
<li><a href="#MAIN">Основная информация</a></li>
{if ($smarty.get.id)}
<li><a href="#IMG">Слайдер</a></li>
{/if}
</ul>
<div id="MAIN">
<form style="margin-top: 15px;" id="form-edit-cats" action="/act/t_cats_edit" method="post">
<input type="hidden" name="id" value="{$list[0].id}">
<input type="hidden" name="img" value="{$list[0].img}">
<input type="hidden" name="act" value="save">
<input type="text" name="naim" class="form-control" placeholder="Название категории" value="{$list[0].naim}">
<input type="text" name="keywords" value="{$list[0].keywords}" class="form-control" placeholder="Ключевые слова" style="margin-top: 15px;">
<input type="text" name="description" value="{$list[0].description}" class="form-control" placeholder="Описание" style="margin-top: 15px;">
<select name="public" class="form-control" style='margin-top:10px;'>
<option value="1">Публиковать</option>
<option value="0" {if ($list[0].status=='0')} selected{/if}>Не публиковать</option>
</select>
<p style='margin-top:10px;'>Вышестоящая категория</p>
<select name="parent" class="form-control" style='margin-top:10px;'>
<option value="0">Корневая категория</option>
{section name=customer loop=$cats}
{if $cats[customer].id}
{if ($list[0].id!=$cats[customer].id)}
<option value="{$cats[customer].id}" {if ($list[0].parent==$cats[customer].id)} selected{/if}>{$cats[customer].naim}</option>
{/if}
{/if}
{/section}
</select>
{*<select name="show_mnu" class="form-control" style='margin-top:10px;'>
<option value="1">Показывать в главном меню</option>
<option value="0" {if ($list[0].show_mnu=='0')} selected{/if}>Не показывать</option>
</select>*}
<p style='margin-top:10px;'>Обложка</p>
<input type="file" id="img" name="img" class="btn btn-outline-info" style="margin-top: 10px;">
<br>
<input type="submit" value="Сохранить" name="ok" class="btn btn-outline-info" style="margin-top: 15px;">
</form>
{if ($list[0].img)}
<img src="/img/magazin/cat/{$list[0].img}.jpg" style="width: 300px">
{/if}
</div>
{if ($smarty.get.id)}{******** слайдер *********}
<div id="IMG">
<button type="button" class="btn btn-info" data-modal="downloadslider">Добавить картинку</button>
<div class="row" id="div_preload">
{section name=customer loop=$img}
{if $img[customer].id}
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3" id="img_{$img[customer].id}">
<img src="/img/magazin/cats/{$img[customer].img}_150_150.jpg" style="width: 100%">
<p class="text-center"><a href="{$img[customer].id}" data-img="{$img[customer].img}" class="a_del_img">Удалить</a></p>
</div>
{/if}
{/section}
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3">
<form action="" method="post" id="upload-image">
<input type="hidden" name="act" value="upload">
<input type="hidden" name="id" value="{$smarty.get.id}">
<input type="file" name="img2" style="display:none;" id="input-img2">
{*<img src="/api/img/addimg/1.png" id="img-img2" style="width:100%; background-color:lightgray;">*}
</form>
</div>
</div>
</div>
{/if}
</div>
<link rel='stylesheet' href='/api/jquery/jquery-ui/dark-hive1.12.1/jquery-ui.css'><link rel='stylesheet' href='/api/jquery/jquery-ui/dark-hive1.12.1/jquery-ui.theme.min.css'>
<div class="modal fade" id="downloadslider" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<form>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Загрузить слайдер</h5>
<!-- button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button -->
</div>
<div class="modal-body">
<p id="modal_txt">
<input type="hidden" name="id" value="{$list[0].id}">
<input type="hidden" name="act" value="slider_save">
<div class="form-group">
<label for="exampleInputEmail1">Заголовок</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Жирный заголовок</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Текст</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Файл</label>
<input type="file" class="btn" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
</p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Загрузить</button>
{*<button type="button" class="btn btn-dark" id="del">Удалить</button>*}
<button type="button" class="btn btn-secondary" data-dismiss="modal">Отмена</button>
</div>
</div>
</div>
</form>
</div>
<link rel="stylesheet" href="/api/jquery/jquery-ui/dark-hive1.12.1/jquery-ui.css">
<link rel="stylesheet" href="/api/jquery/jquery-ui/dark-hive1.12.1/jquery-ui.theme.min.css">
{include file=$footer_admin}