summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2016-08-30 15:04:09 +0530
committerprashantsinalkar2016-08-30 15:04:09 +0530
commitdac778a221932dce3d51499084acedaf5cb0ea58 (patch)
treef17fac25cf96be3a4e253f70b75d41e46de05047
parentc368e3861fa443842e1efe5aaa0d296805869dc8 (diff)
downloadscilab_textbook_companion-dac778a221932dce3d51499084acedaf5cb0ea58.tar.gz
scilab_textbook_companion-dac778a221932dce3d51499084acedaf5cb0ea58.tar.bz2
scilab_textbook_companion-dac778a221932dce3d51499084acedaf5cb0ea58.zip
done minor changes
-rw-r--r--display_books.inc84
1 files changed, 29 insertions, 55 deletions
diff --git a/display_books.inc b/display_books.inc
index e00102e..dd8706d 100644
--- a/display_books.inc
+++ b/display_books.inc
@@ -7,74 +7,48 @@ function tbc_books_in_progress_all()
$query->fields('list_of_category');
$query->orderBy('id', 'ASC');
$category_list = $query->execute();
- /*$output .= "<div style='width:35%; float:left;'><ul>";
- while ($category_list_data = $category_list->fetchObject())
- {
- if($category_list_data->category_id < 8){
- $output .= '<li><a href="'.$category_list_data->category_id.'#">'.$category_list_data->category_name.'</a></li>';
- }elseif($category_list_data->category_id == 8){
- $output .= "</ul></div><div style='width:35%; float:left;'><ul>";
- $output .= '<li><a href="'.$category_list_data->category_id.'#">'.$category_list_data->category_name.'</a></li>';
- }elseif($category_list_data->category_id > 7){
- $output .= '<li><a href="'.$category_list_data->category_id.'#">'.$category_list_data->category_name.'</a></li>';
- }elseif($category_list_data->category_id == 14){
- $output .= "</ul></div>";
- }
- }
- $output .= "</ul></div>";*/
- /*$query = "SELECT pe.book as book, pe.author as author, pe.publisher as publisher, pe.year as year, pe.id as pe_id
- FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id
- WHERE po.proposal_status IN (1,4) AND pe.approval_status = 1 AND pe.category = 9 ORDER BY pe.book ASC";*/
$query = "
- SELECT po.creation_date, pe.book as book, pe.author as author, pe.publisher as publisher, pe.year as year, pe.id as pe_id, loc.category_name as category, loc.category_id as cat_id
+ SELECT po.creation_date, pe.book as book, pe.author as author, pe.publisher as publisher,pe.edition as edition, pe.isbn as isbn, pe.year as year, pe.id as pe_id, loc.category_name as category, loc.category_id as cat_id
FROM textbook_companion_preference pe
LEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id
LEFT JOIN list_of_category loc on pe.category = loc.category_id
WHERE po.proposal_status IN (1,4) AND pe.approval_status = 1
-ORDER BY po.creation_date ASC
+ORDER BY po.creation_date DESC
";
$result = db_query($query);
$proposal_rows = array();
$i = 1;
$category_data = _tbc_list_of_category($preference_data->category);
- $output .= "<div style='width:100%'>";
- foreach ($category_data as $cat)
+ $output = "<hr>";
+ while ($row = $result->fetchObject())
{
- $output .= "<div style='width:100%'><br><strong><h3>" . $cat . "</h3></strong><hr>";
- while ($row = $result->fetchObject())
+ $proposal_date = date("d-m-Y", $row->creation_date); // remove comment to display year
+ if ($row->category != NULL)
+ {
+ $category = $row->category;
+ } //$row->category != NULL
+ else
{
- $proposal_date = date("d-m-Y", $row->creation_date); // remove comment to display year
- if ($row->category != NULL)
- {
- $category = $row->category;
- } //$row->category != NULL
- else
- {
- $category = "Not assigned";
- }
- $preference_rows[] = array(
- $i,
- $proposal_date,
- $row->book,
- $row->author,
- $category
- );
- $i++;
- } //$row = $result->fetchObject()
- $preference_header = array(
- 'No',
- 'Proposal Date',
- 'Book',
- 'Author',
- 'Category'
- //'Year' // remove comment to display year
+ $category = "Not assigned";
+ }
+ $preference_rows[] = array(
+ $i,
+ $proposal_date,
+ $row->book . "<br><br>[ Author: " . $row->author . ", Publisher: " . $row->publisher . ", Year: " . $row->year . ", Edition: " . $row->edition . ", ISBN: " . $row->isbn . " ]",
+ $category
);
- $output .= theme('table', array(
- 'header' => $preference_header,
- 'rows' => $preference_rows
- ));
- } //$category_data as $cat
- $output .= "</div>";
+ $i++;
+ } //$row = $result->fetchObject()
+ $preference_header = array(
+ 'No',
+ 'Proposal Date',
+ 'Book',
+ 'Category'
+ );
+ $output .= theme('table', array(
+ 'header' => $preference_header,
+ 'rows' => $preference_rows
+ ));
return $output;
}