331 lines
15 KiB
HTML
Executable File
331 lines
15 KiB
HTML
Executable File
{include file=$header_admin h1="Все товары" title="Все товары"}
|
||
<input type="hidden" id="global_id" value="{$smarty.get.id}">
|
||
<input type="hidden" id="parent_id" value="{$smarty.get.id}"> {* вышестоящая категория, если она есть *}
|
||
<input type="hidden" id="del_id" value="">{* Ид удаляемого контента *}
|
||
{if ($catInfo)}
|
||
<!--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>
|
||
<li class="breadcrumb-item active" aria-current="page">{$catInfo[0].title}</li>
|
||
</ol>
|
||
</nav -->
|
||
|
||
|
||
<ol class="breadcrumb" style="background-color: transparent;">
|
||
<li class="breadcrumb-item"><a href="/">Главная</a></li>
|
||
<li class="breadcrumb-item"><a href="/a_tovar_cat/0">Каталог</a></li>
|
||
{section name=customer loop=$Breadcrumb}{if ($Breadcrumb[customer].id &&
|
||
$Breadcrumb[customer].id!=$smarty.get.id)}
|
||
<li class="breadcrumb-item"><a href="/a_tovar_cat/{$Breadcrumb[customer].id}-">{$Breadcrumb[customer].title}</a>
|
||
</li>
|
||
{/if}{/section}
|
||
<li class="breadcrumb-item active" aria-current="page">{$catInfo[0].title}</li>
|
||
</ol>
|
||
|
||
|
||
|
||
<h1>{$catInfo[0].title}</h1>
|
||
{else}
|
||
<nav aria-label="breadcrumb">
|
||
<ol class="breadcrumb">
|
||
<li class="breadcrumb-item"><a href="/admin/">Главная</a></li>
|
||
<li class="breadcrumb-item active" aria-current="page">Товары</li>
|
||
</ol>
|
||
</nav>
|
||
{/if}
|
||
|
||
{if $saveResult==1}
|
||
<div class="alert alert-success" role="alert">
|
||
Сохранено
|
||
</div>
|
||
{/if}
|
||
<div class="ibox">
|
||
<div class="ibox-head">
|
||
<div class="ibox-title">
|
||
Товары
|
||
|
||
</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-sharp fa-solid fa-list"></i>
|
||
Список</a>
|
||
</li>
|
||
{if ($smarty.get.id)}
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#tab-8-2" data-toggle="tab"><i class="fa-sharp fa-solid fa-list"></i> Свойства
|
||
категории</a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#tab-8-3" data-toggle="tab"><i class="fa-sharp fa-solid fa-list"></i>
|
||
Изображения</a>
|
||
</li>
|
||
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#tab-8-4" data-toggle="tab"><i class="fa-sharp fa-solid fa-list"></i>
|
||
Автофильтр</a>
|
||
</li>
|
||
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="#tab-8-5" data-toggle="tab"><i class="fa-sharp fa-solid fa-list"></i>
|
||
Ключевые слова</a>
|
||
</li>
|
||
{/if}
|
||
</ul>
|
||
</div>
|
||
<div class="ibox-body">
|
||
<div class="tab-content">
|
||
<div class="tab-pane fade show active" id="tab-8-1">
|
||
<form action="" method="post"
|
||
class="input-group mb-2 col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12" role="group"
|
||
aria-label="Basic example">
|
||
<input type="text" name="txt" class="form-control">
|
||
<select class="form-control" name="category">
|
||
<option value="0">Нет</option>
|
||
{section name=customer loop=$catList} {if $catList[customer].id}
|
||
<option value="{$catList[customer].id}" {if $smarty.get.id==$catList[customer].id} selected
|
||
{/if}>{$catList[customer].title} | ID: {$catList[customer].id}</option>
|
||
{/if} {/section}
|
||
</select>
|
||
<input type="submit" name="move" value="Переместить" class="btn btn-primary">
|
||
</form>
|
||
<div class="btn-group" role="group" aria-label="Basic example">
|
||
<button type="button" href="#modal_new_tovar" data-toggle="modal" class="btn btn-primary"><i class="far fa-file"
|
||
style="margin-right: 7px;"></i>Создать товар</button>
|
||
<a type="button" class="btn btn-primary" href="#modal_new_cat" data-toggle="modal"><i
|
||
class="fas fa-plus" style="margin-right: 7px;"></i> Новая категория</a>
|
||
<button type="button" class="btn btn-primary" data-link="/a_tovar_cat/{$catInfo[0].category}"><i
|
||
class="fa-solid fa-circle-up" style="margin-right: 7px;"></i> Выше</button>
|
||
<button type="button" class="btn btn-primary" data-link="/a_edit_cat/"><i
|
||
class="fa-solid fa-circle-up" style="margin-right: 7px;"></i> Отключить пустые</button>
|
||
<label class="ui-checkbox ml-3 mt-1"><input type="checkbox" {if $set.showNoPublic=="1" } checked
|
||
{/if} id="setShowNoPublic"><span class="input-span"></span>Показывать отключенные</label>
|
||
</div>
|
||
<table class="table" id="filter-table">
|
||
<thead>
|
||
<tr>
|
||
<th scope="col" style="width: 70px;">ID</th>
|
||
<th scope="col">Заголовок</th>
|
||
<th scope="col">Сортировка</th>
|
||
<th scope="col">Цена</th>
|
||
<th scope="col">Статус</th>
|
||
<th scope="col">Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tr class='table-filters'>
|
||
<td>
|
||
<input type="text" class="form-control">
|
||
</td>
|
||
<td>
|
||
<input type="text" class="form-control">
|
||
</td>
|
||
<td>
|
||
<input type="text" class="form-control">
|
||
</td>
|
||
<td>
|
||
<input type="text" class="form-control">
|
||
</td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
{section name=customer loop=$catList}
|
||
<tr class='table-data' id="li_{$childrenPages[customer].id}">
|
||
<td>{$catList[customer].id}</td>
|
||
<td><a href="/a_tovar_cat/{$catList[customer].id}">{$catList[customer].title}</a></td>
|
||
<td><input type="text" class="form-control" value="{$catList[customer].sort}"></td>
|
||
<td></td>
|
||
<td><input type="checkbox" {if ($catList[customer].status)} checked {/if}></td>
|
||
<td></td>
|
||
</tr>
|
||
{/section}
|
||
|
||
{section name=customer loop=$catTovar}
|
||
<tr class='table-data' id="li_{$catTovar[customer].id}">
|
||
<td>{$catTovar[customer].id}</td>
|
||
<td><a href="/tovaredit/{$catTovar[customer].id}">{$catTovar[customer].title}</a></td>
|
||
<td><input type="text" class="form-control" value="{$catTovar[customer].sort}"></td>
|
||
<td><input type="text" class="form-control" value="{$catTovar[customer].cena}"></td>
|
||
<td><input type="checkbox" {if ($catTovar[customer].status)} checked {/if}></td>
|
||
<td></td>
|
||
</tr>
|
||
{/section}
|
||
</table>
|
||
|
||
</div>
|
||
{if ($smarty.get.id)}
|
||
{* Свойства категории *}
|
||
<div class="tab-pane" id="tab-8-2">
|
||
<form method="post">
|
||
<div class="mt-2 mb-2 p-3" style="border: 1px solid lightgray;">
|
||
<input type="text" placeholder="Наименование" data-pole="title" name="title"
|
||
data-id="{$smarty.get.id}" class="form-control save-title" value="{$catInfo[0].title}">
|
||
<input type="text" placeholder="keywords" data-pole="keywords" data-id="{$smarty.get.id}"
|
||
class="form-control mt-2 save-meta" value="{$catInfo[0].keywords}" name="keywords">
|
||
<input type="text" placeholder="description" data-pole="description" data-id="{$smarty.get.id}"
|
||
class="form-control mt-2 save-meta" value="{$catInfo[0].description}" name="description">
|
||
<select class="form-control mt-2 mb-2" name="category" id="category" data-id="{$smarty.get.id}">
|
||
<option value="0">Нет</option>
|
||
{section name=customer loop=$catList} {if $catList[customer].id}
|
||
<option value="{$catList[customer].id}" {if ($catInfo[0].category==$catList[customer].id)}
|
||
selected{/if}>{$catList[customer].title} - {$catList[customer].id}</option>
|
||
{/if} {/section}
|
||
</select>
|
||
<div class="form-check" style="padding-top: 5px; margin-left: 17px;">
|
||
<input type="checkbox" class="form-check-input" id="status" name="status" {if
|
||
$catInfo[0].status==1}checked{/if}>
|
||
<label class="form-check-label" for="public">Публиковать</label>
|
||
</div>
|
||
|
||
|
||
<textarea tabindex='2' name='txt' id='editarea'
|
||
style="height: 600px;">{$catInfo[0].txt}</textarea>
|
||
<input type="hidden" name="act" value="saveCategoryInfo">
|
||
<input type="hidden" name="id" value="{$smarty.get.id}">
|
||
<input type="submit" class="btn btn-primary" name="ok" value="Сохранить">
|
||
</form>
|
||
<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>
|
||
|
||
|
||
</div>
|
||
{if (!$smarty.get.id)}
|
||
|
||
<div id="drop-area" class="hidden"></div>
|
||
|
||
{/if}
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div class="tab-pane" id="tab-8-3">
|
||
|
||
{* Загрузка изображений категории *}
|
||
|
||
{include file=$uploadimg}
|
||
|
||
</div>
|
||
{/if}
|
||
|
||
|
||
<div class="tab-pane" id="tab-8-4">
|
||
<h2>Автофильтр</h2>
|
||
<p>Категория автоматически собирает товары соответствующие отбору:</p>
|
||
<div method="post" class="input-group mb-2" role="group" aria-label="Basic example">
|
||
<input type="text" name="txt" class="form-control" id="txt-add-filter">
|
||
<button type="button" class="btn btn-primary" id="btn-add-filter"
|
||
data-id="{$smarty.get.id}">Добавить</button>
|
||
</div>
|
||
<table class="table" id="table-filter">
|
||
|
||
{section name=customer loop=$autofilter} {if $autofilter[customer].id}
|
||
|
||
|
||
<tr>
|
||
<td>{$autofilter[customer].txt}</td>
|
||
<td>Удалить</td>
|
||
</tr>
|
||
|
||
|
||
|
||
{/if} {/section}
|
||
|
||
</table>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div class="tab-pane" id="tab-8-5">
|
||
<h2>Ключевые слова</h2>
|
||
|
||
<table class="table" id="table-filter">
|
||
|
||
{section name=customer loop=$autofilter} {if $autofilter[customer].id}
|
||
|
||
|
||
<tr>
|
||
<td>{$autofilter[customer].txt}</td>
|
||
<td>Удалить</td>
|
||
</tr>
|
||
|
||
|
||
|
||
{/if} {/section}
|
||
|
||
</table>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Модалка удаления -->
|
||
{include file=$modal_del_page}
|
||
{include file=$modal_new_cat}
|
||
|
||
|
||
|
||
|
||
|
||
{*
|
||
Модальное окно создания товара
|
||
*}
|
||
|
||
<div class="modal fade" id="modal_new_tovar" tabindex="-1" role="dialog" aria-hidden="true">
|
||
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-body">
|
||
<!-- -->
|
||
<div class="container-fluid">
|
||
<div class="row">
|
||
<div class="col text-right">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true"> <i class="fa fa-times"></i></span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- -->
|
||
<!-- -->
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<h3>Новый товар</h3>
|
||
<form id="formNewTovar" action="/act/a_tovar_cat">
|
||
<input class="hidden" name="act" value="new_tovar">
|
||
<input class="form-control mb-2" placeholder="Наименование" name="title">
|
||
<p>Вышестоящая:</p>
|
||
<select class="form-control mt-2 mb-2" name="category" id="category">
|
||
<option value="0">Нет</option>
|
||
{section name=customer loop=$allcats} {if $allcats[customer].id}
|
||
<option value="{$allcats[customer].id}" {if ($smarty.get.id==$allcats[customer].id)} selected{/if}>{$allcats[customer].title}</option>
|
||
{/if} {/section}
|
||
</select>
|
||
<input type="submit" class="btn btn-dark mb-2" id="btnAddOrg" data-id="" name="createOrg" value="Создать">
|
||
<div class="alert alert-light hidden" role="alert" id="resultAddOrg">
|
||
<p>Готово! Обновите страницу =)</p>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<!-- Футер -->
|
||
{include file=$footer_admin} |