2022-12-11 13:55:49 +05:00
|
|
|
{include file=$header_admin title="Создать товар"}
|
|
|
|
|
|
|
|
<input type="hidden" id="parent_id" value="{$smarty.get.id}"> {* вышестоящая категория, если она есть *}
|
|
|
|
<input type="hidden" id="del_id" value="">{* Ид удаляемого контента *}
|
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li class="breadcrumb-item"><a href="/admin/">Главная</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="/a_tovar_cat/">Товары</a></li>
|
|
|
|
{if $smarty.get.id}
|
|
|
|
<li class="breadcrumb-item"><a href="/a_new_tovar/">Создать новый</a></li>
|
2022-12-17 18:15:09 +05:00
|
|
|
<li class="breadcrumb-item active" aria-current="page">Редактирование <b>{$tovar[0].title}</b></li>
|
2022-12-11 13:55:49 +05:00
|
|
|
{else}
|
|
|
|
<li class="breadcrumb-item active" aria-current="page">Создать новый</li>
|
|
|
|
{/if}
|
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="ibox">
|
|
|
|
<div class="ibox-head">
|
2022-12-17 18:15:09 +05:00
|
|
|
<div class="ibox-title">{if $smarty.get.id}{$tovar[0].title}{else}Новый товар{/if} <a href="/a_new_tovar/" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
2022-12-11 13:55:49 +05:00
|
|
|
</div>
|
|
|
|
<ul class="nav nav-tabs tabs-line pull-right">
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link active" href="#tab-8-1" data-toggle="tab"><i class="fa fa-taxi"></i> Основная информация</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="#tab-8-2" data-toggle="tab"><i class="fa fa-bus"></i> Фото</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="#tab-8-3" data-toggle="tab"><i class="fa fa-plane"></i> Характеристики</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="#tab-8-4" data-toggle="tab"><i class="fa fa-plane"></i> Движения</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="ibox-body">
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade show active" id="tab-8-1">
|
|
|
|
|
|
|
|
<input type="text" class="form-control mb-3" id="search_tovar" name="qs" placeholder="Попытаться найти из существующего (Штрих код или Артикул)">
|
|
|
|
|
|
|
|
<h4>Найдено: </h4>
|
|
|
|
<table class="table" id="searchResult"></table>
|
|
|
|
|
|
|
|
<form method="post" action="">
|
|
|
|
{if ($smarty.get.id)}
|
|
|
|
<input type="hidden" value="editTovar" name="act">
|
|
|
|
{else}
|
|
|
|
<input type="hidden" value="addTovar" name="act">
|
|
|
|
{/if}
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="exampleInputEmail1" class="form-label">Наименование товара</label>
|
2022-12-17 18:15:09 +05:00
|
|
|
<input type="text" class="form-control" name="txt" value="{$tovar[0].title}"> {*
|
2022-12-11 13:55:49 +05:00
|
|
|
<div id="emailHelp" class="form-text">Мы никогда никому не передадим вашу электронную почту.</div>*}
|
|
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="exampleInputPassword1" class="form-label">Артикул</label>
|
|
|
|
<input type="text" class="form-control" name="artikul" value="{$tovar[0].artikul}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="exampleInputPassword1" class="form-label">Штрих код</label>
|
|
|
|
<input type="text" class="form-control" name="barcode" value="{$tovar[0].barcode}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="exampleInputPassword1" class="form-label">Категория</label>
|
|
|
|
<select name="parent" class="form-control mt-3" id="input_parrent">
|
|
|
|
<option value="">Нет</option>
|
|
|
|
{section name=customer loop=$cats} {if $cats[customer].id}
|
|
|
|
<option value="{$cats[customer].id}" {if $cats[customer].id==$tovar[0].parent} selected{/if}>{$cats[customer].txt}</option>
|
|
|
|
{/if} {/section}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="exampleInputPassword1" class="form-label">Описание</label>
|
2022-12-17 18:15:09 +05:00
|
|
|
<textarea class="form-control" name="opisanie" style="height: 400px;" id='editarea'>{$tovar[0].txt}</textarea>
|
2022-12-11 13:55:49 +05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3 form-check pl-3">
|
2022-12-17 18:15:09 +05:00
|
|
|
<input type="checkbox" class="form-check-input" id="exampleCheck1" name="status" {if $status[0].public==1}checked{/if}>
|
2022-12-11 13:55:49 +05:00
|
|
|
<label class="form-check-label" for="exampleCheck1">Публиковать</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mb-3 form-check pl-3">
|
|
|
|
<input type="checkbox" class="form-check-input" id="exampleCheck2" name="zakazEnable" {if $tovar[0].zakazEnable==1}checked{/if}>
|
|
|
|
<label class="form-check-label" for="exampleCheck2">Доступно под заказ</label>
|
|
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="tab-8-2">
|
|
|
|
<div id="drop-area" class="container mt-2">
|
|
|
|
<form class="my-form">
|
|
|
|
<p>Загрузите фотографии</p>
|
|
|
|
<input type="file" id="fileElem" multiple accept="image/*" onchange="handleFiles(this.files)">
|
|
|
|
<label class="button" for="fileElem">Выбрать файлы</label>
|
|
|
|
</form>
|
|
|
|
<progress id="progress-bar" max=100 value=0></progress>
|
|
|
|
<div id="gallery"></div>
|
|
|
|
</div>
|
|
|
|
{section name=customer loop=$imgs} {if $imgs[customer].id}
|
|
|
|
<div class="card mb-3 mt-3" style="max-width: 90%;" id="{$imgs[customer].id}">
|
|
|
|
<div class="row g-0">
|
|
|
|
<div class="col-md-4">
|
2022-12-17 18:15:09 +05:00
|
|
|
<img src="/img/{$smarty.server.SERVER_NAME}/tovar/{$imgs[customer].filename}.jpg" class="img-fluid rounded-start" alt="...">
|
2022-12-11 13:55:49 +05:00
|
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">Имя файла: {$imgs[customer].fileName}</h5>
|
|
|
|
<p class="card-text"><input type="text" class="form-control" name="alt" placeholder="alt"></p>
|
|
|
|
<p class="card-text"><input type="text" class="form-control" name="title" placeholder="Title"></p>
|
|
|
|
<p class="card-text"><small class="text-muted delImg" data-id="{$imgs[customer].id}" style="cursor: pointer;">Удалить</small></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if} {/section}
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="tab-8-3">
|
|
|
|
<table class="table">
|
|
|
|
<tr>
|
|
|
|
<td><b>Наименование</b></td>
|
|
|
|
<td><b>Значение</b></td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
{section name=customer loop=$har} {if $har[customer].id}
|
|
|
|
<tr id="har_{$har[customer].id}">
|
|
|
|
<td>{$har[customer].har}</td>
|
|
|
|
<td>{$har[customer].txt}</td>
|
|
|
|
<td class="del_har" data-id="{$har[customer].id}" style="cursor: pointer;">Удалить</td>
|
|
|
|
</tr>
|
|
|
|
{/if} {/section}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><input type="text" class="form-control"></td>
|
|
|
|
<td><input type="text" class="form-control"></td>
|
|
|
|
<td><button class="btn btn-primary">Сохранить</button></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane fade" id="tab-8-4">
|
|
|
|
<div class="btn-group" role="group" aria-label="Простой пример">
|
|
|
|
<a class="btn btn-primary popup-content" href="#oprihodovanie">Оприходовать</a>
|
|
|
|
<a class="btn btn-primary popup-content" href="#schet">Создать заказ</a>
|
|
|
|
<button class="btn btn-primary">Списать</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table class="table">
|
|
|
|
<tr>
|
|
|
|
<td>Текущий остаток</td>
|
|
|
|
<td>Текущая цена</td>
|
|
|
|
<td>Продано</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="oprihodovanie" class="white-popup mfp-hide">
|
|
|
|
<h4>Оприходовать</h4>
|
|
|
|
<hr>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md">
|
|
|
|
<select class="form-select">
|
|
|
|
<option>Поставщик</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md">
|
|
|
|
<select class="form-select">
|
|
|
|
<option>Склад</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<table class="table">
|
|
|
|
<tr>
|
2022-12-17 18:15:09 +05:00
|
|
|
<td>{$tovar[0].title}</td>
|
2022-12-11 13:55:49 +05:00
|
|
|
<td><input class="form-control" placeholder="Количество"></td>
|
|
|
|
<td><input class="form-control" placeholder="Цена закупа"></td>
|
|
|
|
<td><input class="form-control" placeholder="Цена продажи"></td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<button class="btn btn-primary">Сохранить</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
<!-- Футер -->
|
|
|
|
{include file=$footer_admin}
|