summaryrefslogtreecommitdiff
path: root/cfd_case_study_details.inc
blob: d545f242869f4151930c193e9be1047e0e29d789 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
// eSim case study display completed proposals
function cfd_case_study_completed_proposals_all()
{
	$output = "";
	$query = db_select('case_study_proposal');
	$query->fields('case_study_proposal');
	$query->condition('approval_status', 3);
	$query->orderBy('actual_completion_date', 'DESC');
	//$query->condition('is_completed', 1);
	$result = $query->execute();
	
	//var_dump($case_study_abstract);die;
	if ($result->rowCount() == 0)
	{
		$output .= "Work has been completed for the following case study. We welcome your contributions." ."<hr>";

	} //$result->rowCount() == 0
	else
	{
		$output .= "Work has been completed for the following case study. We welcome your contributions." . "<hr>";
		$preference_rows = array();
		$i = 1;
		while ($row = $result->fetchObject())
		{
			$proposal_id = $row->id;
			$query1 = db_select('case_study_submitted_abstracts_file');
			$query1->fields('case_study_submitted_abstracts_file');
			$query1->condition('file_approval_status', 1);
			$query1->condition('proposal_id', $proposal_id);
			$case_study_files = $query1->execute();
			$case_study_abstract = $case_study_files->fetchObject();
			$project_title = WordWrap(l($row->project_title, "case-study-project/case-study-run/" . $row->id),10,"\n",true);
			$year = date("Y", $row->actual_completion_date);
			$solver_used = WordWrap($row->solver_used,10,"\n",true);
			$preference_rows[] = array(
				$i,
				$project_title,
				$solver_used,
				l('Download', "case-study-project/download/project-file/" . $row->id),
				$row->contributor_name,
				$row->university,
				$row->institute,
				$year
			);
			$i++;
		} //$row = $result->fetchObject()
		$preference_header = array(
			'No',
			'Case Study Project',
			'Solver used',
			'Abstract File',
			'Contributor Name',
			'University',
			'Institute',
			'Year'
		);
		$output .= theme('table', array(
			'header' => $preference_header,
			'rows' => $preference_rows
		));
	}
	return $output;
}
// case study display in progress proposals
function cfd_case_study_progress_all()
{
	$page_content = "";
	$query = db_select('case_study_proposal');
	$query->fields('case_study_proposal');
	$query->condition('approval_status', 1);
	$query->condition('is_completed', 0);
	$result = $query->execute();
	if ($result->rowCount() == 0)
	{
		$page_content .= "Work is in progress for the following case study under case study Project<hr>";
	} //$result->rowCount() == 0
	else
	{
		$page_content .= "Work is in progress for the following case study under case study Project<hr>";
		$preference_rows = array();
		$i = 1;
		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',
			'Case Study Project',
			'Contributor Name',
			'Institute',
			'Year'
		);
		$page_content .= theme('table', array(
			'header' => $preference_header,
			'rows' => $preference_rows
		));
	}
	return $page_content;
}