Free search input in event list view filter also by custom_data - #311
This commit is contained in:
parent
51538db187
commit
c4ffd0257f
|
@ -76,9 +76,29 @@ switch ($status) {
|
|||
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 != "") {
|
||||
$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 != "") {
|
||||
|
|
Loading…
Reference in New Issue