From f0b454aa06a631d20e896cef3ea5704fed3e5e72 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Thu, 11 Feb 2021 13:28:56 +0530 Subject: Update completed books view format --- tbc_details.inc | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tbc_details.inc (limited to 'tbc_details.inc') diff --git a/tbc_details.inc b/tbc_details.inc new file mode 100644 index 0000000..6316b80 --- /dev/null +++ b/tbc_details.inc @@ -0,0 +1,53 @@ +fields('pe', array('book', 'author', 'publisher', 'year', 'id')); + $query->leftJoin('textbook_companion_proposal', 'po', 'pe.proposal_id = po.id'); + $query->condition('po.proposal_status', 3); + $query->condition('pe.approval_status', 1); + $query->orderBy('pe.book', 'ASC'); + $result = $query->execute(); + + if ($result->rowCount() == 0) + { + $output .= "Work has been completed on the following books under the Textbook Companion Project. + The list below is not the books as named but only are the solved example for DWSIM"; + + } //$result->rowCount() == 0 + else + { + /*$output .= "Total number of completed TBC: " . $result->rowCount() . "
";*/ + $output .= "Work has been completed on the following books under the Textbook Companion Project.
+ The list below is not the books as named but only are the solved example for DWSIM."; + $preference_rows = array(); + $i = 1; + while ($row = $result->fetchObject()) + { + $year = date("Y", $row->year); + $preference_rows[] = array( + $i, + l($row->book, "textbook-companion/textbook-run/" . $row->id), + $row->author, + $row->publisher, + $row->year + ); + $i++; + /*$preference_data->book . " by " . $preference_data->author . ", " . $preference_data->publisher . ", " . $preference_data->year, 'textbook-companion/textbook-run/' . $preference_data->id*/ + } //$row = $result->fetchObject() + $preference_header = array( + 'S.No', + 'TBC Project', + 'Contributor Name', + 'Publisher', + 'Year of Completion' + ); + $output .= theme('table', array( + 'header' => $preference_header, + 'rows' => $preference_rows + )); + } + return $output; +} \ No newline at end of file -- cgit