From 3592283fc977bd8f689939f2bee65a3fca36008b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2019 19:34:13 +0100 Subject: [PATCH] Fix Pagination of catgories and product on TakePOS --- htdocs/takepos/takepos.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index ce19f2c4f16df..f136ca564c0f7 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -40,8 +40,8 @@ $categorie = new Categorie($db); -$MAXCATEG = 16; -$MAXPRODUCT = 32; +$MAXCATEG = 8; +$MAXPRODUCT = 8; /* @@ -111,7 +111,7 @@ var editaction="qty"; var editnumber=""; function PrintCategories(first) { - for (i = 0; i < 14; i++) { + for (i = 0; i < ; i++) { if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") break; $("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']); $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']); @@ -121,31 +121,32 @@ function PrintCategories(first) { } function MoreCategories(moreorless) { - if (moreorless=="more"){ + console.log("MoreCategories moreorless="+moreorless+" pagecategories="+pagecategories); + if (moreorless=="more") { $('#catimg15').animate({opacity: '0.5'}, 1); $('#catimg15').animate({opacity: '1'}, 100); pagecategories=pagecategories+1; } - if (moreorless=="less"){ + if (moreorless=="less") { $('#catimg14').animate({opacity: '0.5'}, 1); $('#catimg14').animate({opacity: '1'}, 100); if (pagecategories==0) return; //Return if no less pages pagecategories=pagecategories-1; } - if (typeof (categories[14*pagecategories] && moreorless=="more") == "undefined"){ // Return if no more pages + if (typeof (categories[ * pagecategories] && moreorless=="more") == "undefined"){ // Return if no more pages pagecategories=pagecategories-1; return; } - for (i = 0; i < 14; i++) { - if (typeof (categories[i+(14*pagecategories)]) == "undefined"){ - $("#catdesc"+i).text(""); - $("#catimg"+i).attr("src","genimg/empty.png"); - $("#catwatermark"+i).hide(); - continue; - } - $("#catdesc"+i).text(categories[i+(14*pagecategories)]['label']); - $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[i+(14*pagecategories)]['rowid']); - $("#catdiv"+i).data("rowid",categories[i+(14*pagecategories)]['rowid']); + for (i = 0; i < ; i++) { + if (typeof (categories[i+( * pagecategories)]) == "undefined") { + $("#catdesc"+i).text(""); + $("#catimg"+i).attr("src","genimg/empty.png"); + $("#catwatermark"+i).hide(); + continue; + } + $("#catdesc"+i).text(categories[i+( * pagecategories)]['label']); + $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[i+( * pagecategories)]['rowid']); + $("#catdiv"+i).data("rowid",categories[i+( * pagecategories)]['rowid']); $("#catwatermark"+i).show(); } } @@ -221,7 +222,7 @@ function MoreProducts(moreorless) { pageproducts=pageproducts-1; return; } - idata=30*pageproducts; //product data counter + idata= * pageproducts; //product data counter ishow=0; //product to show counter while (ishow < maxproduct) {