1'; } else { $reports_condition = ' AND id_report IN ('.implode(',', $userreports_id).')'; } $reports = false; if ($searchReports) { switch ($config['dbtype']) { case 'mysql': case 'postgresql': $sql = "SELECT id_report, name, description FROM treport WHERE (name LIKE '%".$stringSearchSQL."%' OR description LIKE '%".$stringSearchSQL."%')".$reports_condition; break; case 'oracle': $sql = "SELECT id_report, name, description FROM treport WHERE (upper(name) LIKE '%".strtolower($stringSearchSQL)."%' OR description LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition; break; } switch ($config['dbtype']) { case 'mysql': case 'postgresql': $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0); break; case 'oracle': $set = []; $set['limit'] = $config['block_size']; $set['offset'] = (int) get_parameter('offset'); $sql = oracle_recode_query($sql, $set); break; } switch ($config['dbtype']) { case 'mysql': case 'postgresql': $sql_count = "SELECT COUNT(id_report) AS count FROM treport WHERE (name LIKE '%".$stringSearchSQL."%' OR description LIKE '%".$stringSearchSQL."%')".$reports_condition; break; case 'oracle': $sql_count = "SELECT COUNT(id_report) AS count FROM treport WHERE (upper(name) LIKE '%".strtolower($stringSearchSQL)."%' OR upper(description) LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition; break; } if ($only_count) { $totalReports = db_get_value_sql($sql_count); } else { $reports = db_process_sql($sql); $totalReports = db_get_value_sql($sql_count); } }