From 000d2209153b41287719164fee3261dd3ce3a73d Mon Sep 17 00:00:00 2001
From: Sashi20
Date: Fri, 4 Nov 2022 13:04:39 +0530
Subject: Display completed books in descending order

---
 display_books.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'display_books.inc')

diff --git a/display_books.inc b/display_books.inc
index 97e4543..016162c 100755
--- a/display_books.inc
+++ b/display_books.inc
@@ -17,7 +17,7 @@ ORDER BY po.creation_date DESC
   ";
     $result = db_query($query);
     $proposal_rows = array();
-    $i = 1;
+    $i = $result->rowCount();
     $category_data = _tbc_list_of_category($preference_data->category);
     $output = "<hr>";
     while ($row = $result->fetchObject())
@@ -37,7 +37,7 @@ ORDER BY po.creation_date DESC
             $row->book . "<br><br>[ Author: " . $row->author . ", Publisher: " . $row->publisher . ", Year: " . $row->year . ", Edition: " . $row->edition . ", ISBN: " . $row->isbn . " ]",
             $category
         );
-        $i++;
+        $i--;
     } //$row = $result->fetchObject()
     $preference_header = array(
         'No',
-- 
cgit 


From 03e1c7520e6214891c73a9f2de475c3c7684d26a Mon Sep 17 00:00:00 2001
From: Sashi20
Date: Fri, 4 Nov 2022 13:07:48 +0530
Subject: Update completed books table

---
 display_books.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'display_books.inc')

diff --git a/display_books.inc b/display_books.inc
index 016162c..2d7c933 100755
--- a/display_books.inc
+++ b/display_books.inc
@@ -293,7 +293,7 @@ function _list_of_all_completed_books($category_default_value = NULL, $subcatego
     $result = db_query("SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1");
     $row = $result->fetchObject();
     $book_count = $row->book_count;
-    $i = 1;
+    $i = $result->rowCount();
     /* get preference */
     if ($category_default_value <= 0 && $subcategory_default_value == NULL)
     {
@@ -345,7 +345,7 @@ function _list_of_all_completed_books($category_default_value = NULL, $subcatego
             $preference_data->university,
             date("Y", $preference_data->completion_date)
         );
-        $i++;
+        $i--;
     } //$proposal_data = $proposal_q->fetchObject()
     /* check if there are any pending proposals */
     if (!$proposal_rows)
-- 
cgit 


From cf65f7f7ca722111024534576bb12c4947145794 Mon Sep 17 00:00:00 2001
From: Sashi20
Date: Fri, 4 Nov 2022 13:09:51 +0530
Subject: Update serial number

---
 display_books.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'display_books.inc')

diff --git a/display_books.inc b/display_books.inc
index 2d7c933..11d64b1 100755
--- a/display_books.inc
+++ b/display_books.inc
@@ -293,7 +293,7 @@ function _list_of_all_completed_books($category_default_value = NULL, $subcatego
     $result = db_query("SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1");
     $row = $result->fetchObject();
     $book_count = $row->book_count;
-    $i = $result->rowCount();
+    $i = $book_count;
     /* get preference */
     if ($category_default_value <= 0 && $subcategory_default_value == NULL)
     {
-- 
cgit