1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
| <?php
/*
* Résultat recherche
*/
require_once('toto.php');
require_once( 'titi.phps');
require_once( 'tutu.php');
require_once(. tuti.php');
require_once( 'tito.php');
require_once('pou.php');
require_once( 'yuo.php');
require_once( 'lph.php');
require_once( 'sdfgh.php');
require_once( 'kdhdodui.php');
require_once( 'ourhfj.php');
require_once( 'bchddssksk.php');
session_read();
$sql_where = get_condition_recherche_search();
$count_recherche = nb_seller_recherche($sql_where);
//cherche les resultats
/*$sql_select_limit = " ORDER BY poids DESC, uid LIMIT " . MAX_RESULT_PAGE;
if (isset($_GET["jump"]) && is_numeric($_GET["jump"])){
$sql_select_limit .= " OFFSET " . ((intval($_GET["jump"]) - 1) * MAX_RESULT_PAGE);
} else{
$_GET["jump"] = 1;
}*/
if (!isset($_GET["tri"])) {
$sql_select_limit = " ORDER BY poids DESC, uid LIMIT " . MAX_RESULT_PAGE;
} else {
switch ($_GET["tri"]) {
case 'cp':
$sql_select_limit = " ORDER BY code_postal LIMIT " . MAX_RESULT_PAGE;
break;
case 'v':
$sql_select_limit = " ORDER BY nom_ville, code_postal";
break;
case 'ag':
$sql_select_limit = " ORDER BY nom_seller, code_postal";
break;
}
}
if (isset($_GET["jump"]) && is_numeric($_GET["jump"])){
$sql_select_limit .= " OFFSET " . ((intval($_GET["jump"]) - 1) * MAX_RESULT_PAGE);
} else{
$_GET["jump"] = 1;
}
//calcul du decallage en fonction du jour de l'année
$day = date("z"); // day in year
if ($count_recherche == 0) {
$decal = 0;
} elseif ($count_recherche < $day) {
$decal = $day % $count_recherche;
} else {
$decal = $count_recherche % $day;
}
$sql_select = "Grosse requête SQL " .
$sql_where . " ORDER BY seller.uid ";
$tr =& new Transaction();
$tr->execute("(SELECT 2 AS poids, " . $sql_select . " OFFSET " . $decal . ") UNION (SELECT 1 AS poids, " . $sql_select . " LIMIT " . $decal . ") " . $sql_select_limit);
//construction de la liste des commerces à afficher
$liste_commerce = new ListeCommerces();
for ($i = 0; $i < $tr->numrows(); $i++){
$commerces = $tr->fetch_array($i);
$commerce["pos"] = (($i + 1) + (($_GET["jump"] - 1) * MAX_RESULT_PAGE)); //position dans la recherche
$commerces["activites"] = getActivitesCommerces($commerces["uid"]);
$liste_commerces->append(new Commerces($commerces));
}
session_write();
require_once('jfhfuf.phps');
require_once('header.phps');
require_once('menu.phps');
require_once('search_res.phps');
$show_page_nr = true;
require('search/navig_liste.php');
//verification des paramètres pour essayer de savoir d'ou l'on vient
$from_where = "default";
require('look_url.php');
//
require(tri_commerces.php');
affiche_liste_resultat($liste_commerces, default.php');
$show_page_nr = false;
require(search/navig_liste.php');
require_once('footer.php');
require_once('close.php');
?> |
Partager