summaryrefslogtreecommitdiff
path: root/lab_details.inc
diff options
context:
space:
mode:
authorakshay2024-12-13 12:13:31 +0530
committerGitHub2024-12-13 12:13:31 +0530
commit63998fc60a076433c5f1ff94fce8b6cb110393a6 (patch)
tree01d227a646020d3a4553659cf49f6cc8c36ac9f5 /lab_details.inc
parenteb0907cf29eb2cb373a829af33cdb25d2a653d54 (diff)
downloadesim_lab_migration-master.tar.gz
esim_lab_migration-master.tar.bz2
esim_lab_migration-master.zip
table order by year in desc orderHEADmaster
Diffstat (limited to 'lab_details.inc')
-rwxr-xr-xlab_details.inc37
1 files changed, 35 insertions, 2 deletions
diff --git a/lab_details.inc b/lab_details.inc
index f912dde..aa83af8 100755
--- a/lab_details.inc
+++ b/lab_details.inc
@@ -27,9 +27,10 @@
$query->fields('lab_migration_proposal');
$query->condition('approval_status', 1);
$query->condition('solution_status', 2);
+ $query->orderBy('approval_date','DESC');
$result = $query->execute();
//$result = db_query($query);
- $page_content .= "<ol>";
+ /* $page_content .= "<ol>";
while($row = $result->fetchObject()) {
$page_content .= "<li>";
$page_content .= $row->university . " ({$row->lab_title})";
@@ -37,5 +38,37 @@
}
$page_content .= "</ol>";
return $page_content;
- }
+ }*/
+ if ($result->rowCount() == 0)
+ {
+ $page_content .= "We are in the process of updating the lab migration data.";
+ }
+ else
+ {
+ $preference_rows = array();
+ $i = $result->rowCount();
+ while ($row = $result->fetchObject())
+ {
+ $approval_date = date("Y", $row->approval_date);
+ $preference_rows[] = array(
+ $i,
+ $row->university,
+ $row->lab_title,
+ $approval_date
+ );
+ $i--;
+ }
+ $preference_header = array(
+ 'No',
+ 'Institute',
+ 'Lab',
+ 'Year'
+ );
+ $page_content .= theme('table', array(
+ 'header' => $preference_header,
+ 'rows' => $preference_rows
+ ));
+ }
+ return $page_content;
+ }
?>