diff --git a/htdocs/comm/prospect/prospects.php b/htdocs/comm/prospect/prospects.php index f216debe421..932bbcbda11 100644 --- a/htdocs/comm/prospect/prospects.php +++ b/htdocs/comm/prospect/prospects.php @@ -56,11 +56,11 @@ $search_level_to = isset($_GET["search_level_to"])?$_GET["search_level_to"]:(isS // If both parameters are set, search for everything BETWEEN them if ($search_level_from != '' && $search_level_to != '') -{ +{ // Ensure that these parameters are numbers $search_level_from = (int) $search_level_from; $search_level_to = (int) $search_level_to; - + // If from is greater than to, reverse orders if ($search_level_from > $search_level_to) { @@ -77,7 +77,7 @@ else if ($search_level_from != '') { // Ensure that this parameter is a number $search_level_from = (int) $search_level_from; - + // Generate the SQL request $sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range'; } @@ -86,7 +86,7 @@ else if ($search_level_to != '') { // Ensure that this parameter is a number $search_level_to = (int) $search_level_to; - + // Generate the SQL request $sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range'; } @@ -107,25 +107,25 @@ if ($resql) { $tab_level = array(); $search_levels = array(); - + while ($obj = $db->fetch_object($resql)) { // Compute level text $level=$langs->trans($obj->code); if ($level == $obj->code) $level=$langs->trans($obj->label); - + // Put it in the array sorted by sortorder $tab_level[$obj->sortorder] = $level; - + // If this potentiel fit in parameters, add its code to the $search_levels array if ($obj->is_in_range == 1) { $search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"'; } - + $i++; } - + // Implode the $search_levels array so that it can be use in a "IN (...)" where clause. // If no paramters was set, $search_levels will be empty $search_levels = implode(',', $search_levels); @@ -267,39 +267,41 @@ if ($resql) } // $param and $urladd should have the same value $urladd = $param; - + print_barre_liste($langs->trans("ListOfProspects"), $page, $_SERVER["PHP_SELF"], $param, $sortfield,$sortorder,'',$num,$nbtotalofrecords); - + // Print the search-by-sale and search-by-categ filters print '
"; - + $db->free($resql); } else