virt2/api/mod/tovar_edit.html

86 lines
4.9 KiB
HTML
Raw Permalink Normal View History

{include file=$header_admin title="Редактирование товара"}
<input type="hidden" id="input_tovar_id" value="{$smarty.get.id}">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-info" data-link="/t_cats/">В список</button>
{if ($smarty.get.id)}
<button type="button" class="btn btn-info" data-link="/tovar_show/{$smarty.get.id}">Просмотр</button>
{/if}
</div>
<div id="tabs">
<ul>
<li><a href="#MAIN">Основная информация</a></li>
{if ($smarty.get.id)}
<li><a href="#IMG">Дополнительные фото</a></li>
<li><a href="#OTZ">Отзывы</a></li>
{/if}
</ul>
<div id="MAIN">
<form style="margin-top: 15px;" id="form-edit-tovar" action="/act/tovar_edit" method="post">
<input type="hidden" name="act" value="save">
{if $smarty.get.id}<input type="hidden" name="id" value="{$smarty.get.id}">{/if}
<input type="text" name="artikul" value="{$tovar[0].artikul}" placeholder="Артикул" style="margin-top: 15px;" class="form-control">
<input type="text" name="naim" value="{$tovar[0].naim}" placeholder="Наименование" style="margin-top: 15px;" class="form-control">
<p style="margin-top: 15px;">Описание:</p>
<textarea placeholder="Описание" style="margin-top: 15px; height: 300px;" name="opis">{$tovar[0].opis}</textarea>
<script language="javascript" type="text/javascript" src="/api/soft/tinymce/4.3.12/tinymce.min.js"></script><script language="javascript" type="text/javascript" src="/api/soft/tinymce/4.3.12/load.php"></script>
<input type="text" name="keywords" value="{$tovar[0].keywords}" placeholder="keywords" style="margin-top: 15px;" class="form-control">
<input type="text" name="description" value="{$tovar[0].description}" placeholder="description" style="margin-top: 15px;" class="form-control">
<select name="public" class="form-control" style='margin-top:15px;'>
<option value="1">Публиковать</option>
<option value="0" {if ($tovar[0].public=='0')} selected{/if}>Не публиковать</option>
</select>
<p style='margin-top:10px;'>Категория</p>
<select name="m_groupe" 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 ($tovar[0].m_groupe==$cats[customer].id)} selected{/if}>{$cats[customer].naim}</option>
{/if}
{/if}
{/section}
</select>
<input type="text" name="cena" value="{$tovar[0].cena}" placeholder="Цена" style="margin-top: 15px;" class="form-control">
<input type="text" name="akccena" value="{$tovar[0].akccena}" placeholder="Акционная цена" style="margin-top: 15px;" class="form-control">
<input type="text" name="ostatok" value="{$tovar[0].ostatok}" placeholder="Остаток на складе" style="margin-top: 15px;" class="form-control">
<p style='margin-top:10px;'>
Главное фото
</p>
<input type="file" id="img" name="img" class="btn btn-outline-info" style="margin-top: 10px;">
{if ($smarty.get.id || $tovar[0].img)}
<img src="/img/magazin/cats/{$tovar[0].img}_210_270.jpg">
{/if}
<br>
<input type="submit" name="ok" value="Сохранить" style="margin-top: 15px;" class="btn btn-info">
</form>
</div>
{if ($smarty.get.id)}
<div id="IMG">
<button type="button" class="btn btn-info" id="btn-upload">Добавить картинку</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>
<div id="OTZ">
</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'>
{include file=$footer_admin}