mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-23 22:03:18 +01:00
Aggiunto ajax-source per zone
This commit is contained in:
parent
a89f954e62
commit
ed96f1ed28
19
modules/zone/ajax/select.php
Normal file
19
modules/zone/ajax/select.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
switch ($resource) {
|
||||
case 'zone':
|
||||
|
||||
$query = 'SELECT `id`, CONCAT(`nome`, \' - \', `descrizione`) AS `descrizione` FROM an_zone |where| ORDER BY descrizione ASC';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'id='.prepare($element);
|
||||
}
|
||||
if (!empty($search)) {
|
||||
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
|
||||
$search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
@ -47,7 +47,7 @@ echo '
|
||||
{[ "type": "select", "label": "'.tr('Nazione').'", "name": "id_nazione", "ajax-source": "nazioni" ]}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Zona').'", "name": "idzona", "values": "query=SELECT `id`, CONCAT(`nome`, \' - \', `descrizione`) AS `descrizione` FROM `an_zone` ORDER BY `descrizione` ASC" ]}
|
||||
{[ "type": "select", "label": "'.tr('Zona').'", "name": "idzona", "ajax-source": "zone", "placeholder": "'.tr('Nessuna zona').'", "icon-after": "add|'.Modules::get('Zone')['id'].'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -80,7 +80,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Zona').'", "name": "idzona", "values": "query=SELECT `id`, CONCAT_WS(\' - \', `nome`, `descrizione`) AS `descrizione` FROM `an_zone` ORDER BY `descrizione` ASC", "value": "$idzona$", "placeholder": "'.tr('Nessuna zona').'", "icon-after": "add|'.Modules::get('Zone')['id'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Zona').'", "name": "idzona", "ajax-source": "zone", "value": "$idzona$", "placeholder": "'.tr('Nessuna zona').'", "icon-after": "add|'.Modules::get('Zone')['id'].'" ]}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user