-
Notifications
You must be signed in to change notification settings - Fork 6
/
flowsheet_details.inc
executable file
·93 lines (92 loc) · 3.62 KB
/
flowsheet_details.inc
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
// DWSIM Flowsheet display completed proposals
function dwsim_flowsheet_completed_proposals_all()
{
$output = "";
$query = db_select('dwsim_flowsheet_proposal');
$query->fields('dwsim_flowsheet_proposal');
$query->condition('approval_status', 3);
$query->orderBy('actual_completion_date', 'DESC');
//$query->condition('is_completed', 1);
$result = $query->execute();
if ($result->rowCount() == 0)
{
$output .= "Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit ".l("https://dwsim.fossee.in/flowsheeting-project","https://dwsim.fossee.in/flowsheeting-project", array('attributes' => array('target' => '_blank')))."<br>"."<h4>"."If you are looking for flowsheeting project ideas, ".l("click here","https://dwsim.fossee.in/flowsheeting-ideas",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank')))."</h4>"."<hr>";
} //$result->rowCount() == 0
else
{
$output .= "Total number of completed flowsheets: " . $result->rowCount() . "<br>";
$output .= "Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit ".l("https://dwsim.fossee.in/flowsheeting-project","https://dwsim.fossee.in/flowsheeting-project", array('attributes' => array('target' => '_blank')))."<br>"."<h4>"."If you are looking for flowsheeting project ideas, ".l("click here","https://dwsim.fossee.in/flowsheeting-ideas",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank')))."</h4>"."<hr>";
$preference_rows = array();
$i = $result->rowCount();
while ($row = $result->fetchObject())
{
$completion_date = date("Y", $row->actual_completion_date);
$preference_rows[] = array(
$i,
l($row->project_title, "flowsheeting-project/dwsim-flowsheet-run/" . $row->id, array('attributes' => array('title' => 'This is a zip file containing a pdf (abstract) and a dwxml/dwxmz file which is the DWSIM flow sheet which is to be viewed by right clicking on the file and opening with DWSIM.'))),
$row->contributor_name,
$row->university,
$completion_date
);
$i--;
} //$row = $result->fetchObject()
$preference_header = array(
'No',
'Flowsheet Project',
'Contributor Name',
'University / Institute',
'Year of Completion'
);
$output .= theme('table', array(
'header' => $preference_header,
'rows' => $preference_rows
));
}
return $output;
}
// DWSIM Flowsheet display in progress proposals
function dwsim_flowsheet_progress_all()
{
$page_content = "";
$query = db_select('dwsim_flowsheet_proposal');
$query->fields('dwsim_flowsheet_proposal');
$query->condition('approval_status', 1);
$query->condition('is_completed', 0);
$query->orderBy('approval_date', DESC);
$result = $query->execute();
if ($result->rowCount() == 0)
{
$page_content .= "Work is in progress for the following flowsheets under Flowsheeting Project<hr>";
} //$result->rowCount() == 0
else
{
$page_content .= "Work is in progress for the following flowsheets under Flowsheeting Project<hr>";;
$preference_rows = array();
$i = $result->rowCount();
while ($row = $result->fetchObject())
{
$approval_date = date("Y", $row->approval_date);
$preference_rows[] = array(
$i,
$row->project_title,
$row->contributor_name,
$row->university,
$approval_date
);
$i--;
} //$row = $result->fetchObject()
$preference_header = array(
'No',
'Flowsheet Project',
'Contributor Name',
'University / Institute',
'Year'
);
$page_content .= theme('table', array(
'header' => $preference_header,
'rows' => $preference_rows
));
}
return $page_content;
}