From 74f763069cc07a418abee35b8a7315d60ae49f33 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 11 Apr 2003 13:59:28 +0000 Subject: [PATCH] =?UTF-8?q?Am=E9lioration=20de=20la=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/promotion/index.php | 59 +++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/htdocs/product/promotion/index.php b/htdocs/product/promotion/index.php index 6e4fe4cb7d8..1ca99cd3df6 100644 --- a/htdocs/product/promotion/index.php +++ b/htdocs/product/promotion/index.php @@ -26,11 +26,40 @@ llxHeader(); $db = new Db(); -print_barre_liste("Liste des promotions", $page, $PHP_SELF); +if ($action == "inactive") +{ + $promotion = new Promotion($db); + $promotion->set_inactive($id); +} +if ($action == "active") +{ + $promotion = new Promotion($db); + $promotion->set_active($id); +} -$sql = "SELECT pd.products_name, s.specials_new_products_price, p.products_price"; +if ($sortfield == "") +{ + $sortfield="pd.products_name"; +} +if ($sortorder == "") +{ + $sortorder="ASC"; +} + +if ($page == -1) { $page = 0 ; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; + +print_barre_liste("Liste des promotions", $page, $PHP_SELF, "",$sortfield, $sortorder); + +$urladd = "&sortorder=$sortorder&sortfield=$sortfield"; + +$sql = "SELECT pd.products_name, s.specials_new_products_price, p.products_price, p.products_model, s.status, p.products_id"; +$sql .= ",".$db->pdate("expires_date")." as fin"; $sql .= " FROM ".DB_NAME_OSC.".specials as s,".DB_NAME_OSC.".products_description as pd,".DB_NAME_OSC.".products as p"; $sql .= " WHERE s.products_id = pd.products_id AND pd.products_id = p.products_id AND pd.language_id = ".OSC_LANGUAGE_ID; +$sql .= " ORDER BY $sortfield $sortorder "; +$sql .= $db->plimit( $limit ,$offset); if ( $db->query($sql) ) { @@ -38,8 +67,11 @@ if ( $db->query($sql) ) $i = 0; print '

'; print ""; + print ""; print ''; print ''; print "\n"; @@ -49,9 +81,26 @@ if ( $db->query($sql) ) $objp = $db->fetch_object( $i); $var=!$var; - print ""; + print ""; + print '"; print '"; - print '"; + + if ($objp->status == 1) + { + print ''; + print ''; + } + else + { + print ''; + print ''; + } + print ""; + print '"; print '"; print ""; $i++;
"; - print_liste_field_titre("Titre",$PHP_SELF, "a.title"); + print_liste_field_titre("Réf",$PHP_SELF, "p.products_model"); + print ""; + print_liste_field_titre("Titre",$PHP_SELF, "pd.products_name"); print "FinPrix initialPrix remisé
'.$objp->products_model."'.$objp->products_name."'.price($objp->products_price)."actif'; + print ''; + print ''; + print ''; + print 'inactif".strftime("%d/%m/%Y", $objp->fin)."'.price($objp->products_price)."'.price($objp->specials_new_products_price)."