summaryrefslogtreecommitdiff
path: root/lab_details.inc
blob: aa83af8331e00193f8d5e90e6b4b121af0c6d291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
    function lab_migration_completed_labs_all() {
        $page_content = "";
        //$query = "SELECT * FROM {lab_migration_proposal} WHERE approval_status = 3";
        $query = db_select('lab_migration_proposal');
        $query->fields('lab_migration_proposal');
        $query->condition('approval_status', 3);
        $query->orderBy('approval_date', 'DESC');
        $result = $query->execute();
        //$result = db_query($query);
        $proposal_rows = array();
        $i=$result->rowCount();
            while($row = $result->fetchObject()) {
                $approval_date=date("Y", $row->approval_date);
                $preference_rows[] = array($i, $row->university , l($row->lab_title,"lab_migration_run/".$row->id),$approval_date);
                $i--;
            }
        $preference_header = array('No','Institute', 'Lab', 'Year');
        $output = theme('table', array('header' => $preference_header, 'rows' => $preference_rows));
        return $output;
    }                                                                           

    function lab_migration_labs_progress_all() {
        $page_content = "";
        //$query = "SELECT * FROM {lab_migration_proposal} WHERE approval_status = 1 and solution_status = 2";
        $query = db_select('lab_migration_proposal');
        $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>";
        while($row = $result->fetchObject()) {
            $page_content .= "<li>";
            $page_content .= $row->university . " ({$row->lab_title})";
            $page_content .= "</li>";
        }
        $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;
  }
?>