mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Merge branch '311-Filtrar-por-campo-personalizado-en-eventos' into 'develop'
Free search input in event list view filter also by custom_data - #311 See merge request !486
This commit is contained in:
commit
08642eacd3
@ -76,9 +76,29 @@ switch ($status) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevento WHERE custom_data != ""');
|
||||||
|
$count_events = 0;
|
||||||
|
$events_wi_cdata_id = 'OR id_evento IN (';
|
||||||
|
foreach ($events_wi_cdata as $key => $value) {
|
||||||
|
if(strpos(base64_decode($value['custom_data']),$search) != false){
|
||||||
|
$events_wi_cdata_id .= $value['id_evento'];
|
||||||
|
$count_events++;
|
||||||
|
}
|
||||||
|
if ($value !== end($events_wi_cdata) && $count_events > 0) {
|
||||||
|
$events_wi_cdata_id .= ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$events_wi_cdata_id .= ')';
|
||||||
|
|
||||||
|
if($count_events == 0){
|
||||||
|
$events_wi_cdata_id = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($search != "") {
|
if ($search != "") {
|
||||||
$filter_resume['free_search'] = $search;
|
$filter_resume['free_search'] = $search;
|
||||||
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%')";
|
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%' ".$events_wi_cdata_id.")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($event_type != "") {
|
if ($event_type != "") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user