Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
193 righe
7.1 KiB
193 righe
7.1 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
|
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && $_SESSION["utente"]->permission("mercato")) { |
|
$error = false; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
|
|
if(!empty(Market::getOeInMercato())){ |
|
|
|
$cart = Market::getProductsInCart(); |
|
|
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-6"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
|
|
<div class="col-6 d-flex justify-content-end align-items-center"> |
|
<? if($cart['totCarrello'] > 0){ ?> |
|
<a href="/backend/marketplace/carrello.php" class="btn btn-secondary btn"> |
|
<?= __('Vai Carrello') ?> |
|
<span class="badge badge-warning ml-1"> |
|
<i class="fas fa-shopping-cart"></i> |
|
<?= $cart['totCarrello'] ?> |
|
</span> |
|
</a> |
|
<? } ?> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="commands container-fluid mb-2"> |
|
<div class="row"> |
|
<div class="col-12 d-flex justify-content-end"> |
|
|
|
<div class="btn-group"> |
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-filter"> |
|
<span class="fa fa-filter"></span> |
|
<?= __('Filtri') ?> |
|
</button> |
|
|
|
<button id="remove-filter-link" class="btn btn-danger" style="display:none" onClick="$('#remove-filter').trigger('click')"> |
|
<span class="fa fa-times"></span> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="clearfix"></div> |
|
</div> |
|
<? |
|
|
|
$prodotti = Market::getProducts(); |
|
|
|
if(!empty($prodotti)){ |
|
?> |
|
<div class="container-fluid"> |
|
<div class="row"> |
|
<div class="card col-12"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<h2 id="table-title"></h2> |
|
<table class="table table-striped table-hover" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10%"><?= __("ID") ?></th> |
|
<th><?= __("Denominazione") ?></th> |
|
<th><?= __("Marca") ?></th> |
|
<th><?= __("Fornitore") ?></th> |
|
<th width="10%"><?= __("Prezzo") ?></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<!-- modal --> |
|
<div class="modal fade" id="modal-filter" tabindex="-1" aria-hidden="true"> |
|
<div class="modal-dialog modal-xl"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h3 class="modal-title"><span class="fa fa-filter"></span> <?= __("filtra") ?></h3> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<form id="form-filter" rel="valida"> |
|
<div class="modal-body"> |
|
<? include_once("filter-form.php") ?> |
|
</div> |
|
<div class="modal-footer btn-group"> |
|
<button class="btn btn-info" onclick="table.draw(); $('#modal-filter').modal('hide'); $('html,body').animate({ scrollTop: $('#table-title').offset().top },1000); return false;"> |
|
<span class="fa fa-filter"></span> <?= __("applica") ?> |
|
</button> |
|
<button class="btn btn-danger" id="remove-filter" onclick="$('#form-filter').find(':input').val('').trigger('chosen:updated'); $('#modal-filter').modal('hide'); $('.cpv-list').show(); table.draw(); return false;"> |
|
<span class="fa fa-times"></span><?= __("elimina") ?> |
|
</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<script> |
|
var table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "/backend/marketplace/table.php", |
|
"data": function (d) { |
|
|
|
var selezionate = []; |
|
$(".selected-cpv","#network-cpv-list").each(function(){ |
|
selezionate.push($(this).val()); |
|
}); |
|
|
|
d.advanced = {}; |
|
$(":input","#advanced").each(function() { |
|
if ($(this).val().trim() !== "" && $(this).val().trim() !== "-1") { |
|
d.advanced[$(this).attr("name")] = $(this).val(); |
|
} |
|
}); |
|
|
|
count_adv = Object.keys(d.advanced).length; |
|
d.cpv = btoa(selezionate.join(",")); |
|
|
|
if (d.cpv.trim() === "" && count_adv == 0) { |
|
$("#show-filter").removeClass('btn-success').removeClass('active').addClass('btn-warning').html('<span class="fa fa-filter"></span> <?= __('filtra') ?>'); |
|
$("#remove-filter-link").slideUp(); |
|
} else { |
|
$("#show-filter").removeClass('btn-warning').addClass('btn-success').addClass('active').html('<span class="fa fa-filter"></span> <?= __('modifica') ?>'); |
|
$("#remove-filter-link").slideDown(); |
|
} |
|
} |
|
}, |
|
"order": [[1,'ASC']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
null, |
|
null, |
|
null, |
|
null, |
|
{ "sClass": "text-end" }, |
|
{ "orderable": false } |
|
] |
|
}); |
|
|
|
</script> |
|
<? |
|
|
|
}else{ |
|
?> |
|
<h3 class="alert alert-warning text-center"> |
|
<span class="fa fa-exclamation-triangle fa-2x"></span><br> |
|
<?= __("Nessun risultato"); ?> |
|
</h3> |
|
<? |
|
} |
|
|
|
}else{ |
|
?> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<? alertManager::printWarningBox(__("Nessun Qualifica del Mercato Elettronica Attiva")); ?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
|
|
|
|
include_once ($beRoot."/layout/bottom.php"); |
|
} |
|
if($error){ |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|