summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2021-02-11 16:56:32 +0530
committerprashantsinalkar2021-02-11 16:56:32 +0530
commit29e5418d64f7253f9a533bafc1b13c72efbf060a (patch)
tree2af1f615091828e5b97d1d91870a3bff922bea7c
parentee8c969fcea83cd7c92eac8b67e06510ef6812b7 (diff)
downloaddwsim_textbook_companion-29e5418d64f7253f9a533bafc1b13c72efbf060a.tar.gz
dwsim_textbook_companion-29e5418d64f7253f9a533bafc1b13c72efbf060a.tar.bz2
dwsim_textbook_companion-29e5418d64f7253f9a533bafc1b13c72efbf060a.zip
Update completed books table
-rw-r--r--tbc_details.inc19
1 files changed, 10 insertions, 9 deletions
diff --git a/tbc_details.inc b/tbc_details.inc
index 639557b..b3d7e87 100644
--- a/tbc_details.inc
+++ b/tbc_details.inc
@@ -5,12 +5,12 @@ function dwsim_tbc_completed_book_proposal_all()
$output = "";
$query = db_select('textbook_companion_preference', 'pe');
$query->fields('pe', array('book', 'author', 'publisher', 'year', 'id'));
- $query->leftJoin('textbook_companion_proposal', 'po', 'pe.proposal_id = po.id');
+ $query->leftJoin('textbook_companion_proposal', 'po','pe.proposal_id = po.id');
+ $query->fields('po', array('full_name', 'university', 'completion_date'));
$query->condition('po.proposal_status', 3);
$query->condition('pe.approval_status', 1);
- $query->orderBy('pe.year', 'DESC');
+ $query->orderBy('po.completion_date', 'DESC');
$result = $query->execute();
-
if ($result->rowCount() == 0)
{
$output .= "Work has been completed on the following books under the Textbook Companion Project.
@@ -26,13 +26,13 @@ function dwsim_tbc_completed_book_proposal_all()
$i = 1;
while ($row = $result->fetchObject())
{
- $year = date("Y", $row->year);
+ $completion_date = date("Y", $row->completion_date);
$preference_rows[] = array(
$i,
- l($row->book, "textbook-companion/textbook-run/" . $row->id),
- $row->author,
- $row->publisher,
- $row->year
+ l($row->book . ' by ' . $row->author . ', ' . $row->publisher . ', ' . $row->year, 'textbook-companion/textbook-run/' . $row->id),
+ $row->full_name,
+ $row->university,
+ $completion_date
);
$i++;
/*$preference_data->book . " by " . $preference_data->author . ", " . $preference_data->publisher . ", " . $preference_data->year, 'textbook-companion/textbook-run/' . $preference_data->id*/
@@ -50,4 +50,5 @@ function dwsim_tbc_completed_book_proposal_all()
));
}
return $output;
-} \ No newline at end of file
+}
+