diff options
author | prashantsinalkar | 2021-02-11 13:28:56 +0530 |
---|---|---|
committer | prashantsinalkar | 2021-02-11 13:28:56 +0530 |
commit | f0b454aa06a631d20e896cef3ea5704fed3e5e72 (patch) | |
tree | 87fa6d486bdb13e92124c3c722f0e4917920b376 /tbc_details.inc | |
parent | 08051b1894f3003b72542a0910ea0ccf1d4dab5b (diff) | |
download | DWSIM_textbook_companion-f0b454aa06a631d20e896cef3ea5704fed3e5e72.tar.gz DWSIM_textbook_companion-f0b454aa06a631d20e896cef3ea5704fed3e5e72.tar.bz2 DWSIM_textbook_companion-f0b454aa06a631d20e896cef3ea5704fed3e5e72.zip |
Update completed books view format
Diffstat (limited to 'tbc_details.inc')
-rw-r--r-- | tbc_details.inc | 53 |
1 files changed, 53 insertions, 0 deletions
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 @@ +<?php +// DWSIM TBC display completed Books +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->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. + <span style='color:red;'>The list below is not the books as named but only are the solved example for DWSIM</span>"; + + } //$result->rowCount() == 0 + else + { + /*$output .= "Total number of completed TBC: " . $result->rowCount() . "<br>";*/ + $output .= "Work has been completed on the following books under the Textbook Companion Project. <br> + <span style='color:red;'>The list below is not the books as named but only are the solved example for DWSIM.</span>"; + $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 |