From 919ced37c7093b5216c5dd1797c2d27e1257cc95 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 9 Jul 2007 09:26:05 +0000 Subject: [PATCH] Bugfix navigation multipage --- htdocs/telephonie/facturation/cdr.php | 46 +++++++++++++-------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/htdocs/telephonie/facturation/cdr.php b/htdocs/telephonie/facturation/cdr.php index 1fd34c2f0a1..5d3d62a00f3 100644 --- a/htdocs/telephonie/facturation/cdr.php +++ b/htdocs/telephonie/facturation/cdr.php @@ -42,6 +42,12 @@ if (!$user->rights->telephonie->facture->ecrire) accessforbidden(); $page = $_GET["page"]; $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; +if ($page == -1) { $page = 0 ; } + +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + llxHeader(); @@ -61,23 +67,27 @@ if ($sortfield == "") { $sortfield="date ASC"; } -/* - * Recherche - * - * - */ - -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - /* * Mode Liste * */ +$sql = "SELECT ligne,date,heure,num, montant, duree,fichier"; +$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_import_cdr"; +$sql .= " WHERE 1=1"; +if ($_GET["search_ligne"]) +{ + $sel =urldecode($_GET["search_ligne"]); + $sel = ereg_replace("\.","",$sel); + $sel = ereg_replace(" ","",$sel); + $sql .= " AND ligne LIKE '%".$sel."%'"; +} +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); +$resql = $db->query($sql); + +$num = $db->num_rows($resql); + + print_barre_liste("CDR a traiter", $page, "cdr.php", "", $sortfield, $sortorder, '', $num); print ''; @@ -97,18 +107,6 @@ print '
plimit($conf->liste_limit+1, $offset); -$resql = $db->query($sql); while ($obj = $db->fetch_object($resql)) {