Files
drmaterac.pl/modules/phstickers/views/templates/admin/addCategory.tpl
2025-01-06 20:47:25 +01:00

68 lines
3.1 KiB
Smarty

<form method="post" enctype="multipart/form-data" class="defaultForm form-horizontal">
<div class="panel">
<div class="panel-heading">
<i class="icon-cogs"></i> Dodaj naklejkę do kategorii
</div>
<div class="form-wrapper">
<div class="row">
<div class="col-lg-4">
<p class='alert alert-info'>Możesz wybrać maksymalnie <b>{$PHSTICKERS_PRODUCT_MAX}</b> naklejki.</p>
<div class="form-group">
<label class="control-label col-lg-3">Naklejki:</label>
<div class="col-lg-9">
{foreach $list as $l}
<div class="row">
<div class="checkbox col-sm-3">
<label>
<input type="checkbox" name="stickers[]" value="{$l.id_sticker}" class="stickerChbox" />
<img src="{$imageStickerDir}{$l.file_name}" alt="" style="max-width:60px;max-height: 60px;vertical-align: middle;" />
</label>
</div>
<div class="col-sm-6">
<select name="position[{$l.id_sticker}]">
<option value="">wybierz pozycję</option>
{foreach $positions as $key => $p}
<option value="{$key}">{$p}</option>
{/foreach}
</select>
</div>
</div>
{/foreach}
</div>
</div>
</div>
<div class="col-lg-8">
<div class="form-group">
<label class="control-label col-lg-3">Kategorie:</label>
<div class="col-lg-9">
{$helper_category_ceneo}
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<button id="configuration_form_submit_btn" class="btn btn-default pull-right" type="submit" value="1" name="submitAddCategoryProcess"><i class="process-icon-save"></i> {l s='Save' mod='phstickers'}</button>
</div>
</div>
</form>
<script type="text/javascript">
var max = '{$PHSTICKERS_PRODUCT_MAX}';
$(document).ready(function() {
$('.stickerChbox').on('click', function() {
var stickers = 0;
$('.stickerChbox').each(function() {
if ($(this).is(':checked')) {
stickers += 1;
}
});
if ($(this).is(':checked')) {
if (stickers > max) {
alert('Nie możesz zaznaczyć więcej niż '+max+' naklejek!');
return false;
}
}
});
});
</script>