This repository has been archived by the owner on Feb 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjobs_content.php
executable file
·253 lines (189 loc) · 7.23 KB
/
jobs_content.php
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
// calcul les différents profils à partir d'une requete
// sort un $content
echo '
<body>';
include ("analytics.php");
echo ' <script type="text/javascript" src="js/whoswho.js"></script>
<div class="container-fluid">
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
';
$imsize = 150;
$content='';
$lab_list=array();
$orga_list=array();
$loop=0; //nombre de boucles
// ajout des scholars
foreach ($jobs as $job) {
if ($loop % 100){
set_time_limit(20);
}
$loop+=1;
$content.= '<div class="row">
<div class="span12">
<div class="row">
<div class="span9" align="justify">';
$content .= '<div>';
$content .= '<h2 >'. ucfirst($job['title']) .
' <small> - ' .$job['position'] . '</small></h2>';
if (($job['country'] != null)||($job['lab'] != null)||($job['affiliation'] != null)) {
$content .= '<dl>';
}
if ($job['country'] != null) {
$content .= '<dt>Location: '. '</dt>';
$content .= '<dd><strong>Country:</strong> ' . $job['country'] . '</dd>';
}
$affiliation = '';
if ($job['lab'] != null) {
$content .= '<dd><strong>' . clean_exp('Lab:</strong> '.$job['lab']) . '</dd> ';
$lab_list[]=$job['lab'];
}
if ($job['organization'] != null) {
$content .= '<dd><strong>' . clean_exp('Organization:</strong> '.$job['organization']) . '</dd> ';
$orga_list[]=$job['organization'];
//echo $job['affiliation'].'<br/>';
//$lab_query.='OR name="'.$job['affiliation'].'" ';
}
if (($job['organization'] != null) | ($job['lab'] != null)) {
$content .= '<dd>' . clean_exp($affiliation) . '</dd> ';
}
$affiliation2 = '';
if ((strcmp($affiliation2, '') != 0) | (strcmp($affiliation, '') != 0)) {
$content .= '<br/>';
}
$www = '';
if (substr($job['url'], 0, 3) === 'www') {
$www.=' <a href=' . trim(str_replace('&', ' and ', 'http://' . $job['url'])) . ' target=blank > Link to job offer </a ><br/>';
} elseif (substr($job['url'], 0, 4) === 'http') {
$www.=' <a href=' . trim(str_replace('&', ' and ', $job['url'])) . ' target=blank > Link to job offer </a ><br/>';
}
if (strcmp($www, '') != 0) {
$content .= '<dd><i class="icon-home"></i>' . $www . '</dd> ';
}
if (($job['position'] != null)||($job['lab'] != null)||($job['affiliation'] != null)) {
$content .= '</dl>';
}
$content .= '</div>';
$content .= '</div>';
if (($job['keywords'] != null) || ($job['address'] != null) || ($job['phone'] != null)) {
$content .= '<div class="span3" align="justify">';
if ($job['keywords'] != null){
$content .= '<i class="icon-tags"></i> ' . clean_exp($job['keywords']). '.<br/><br/>';
}
if ($job['deadline'] != null) {
$content .= '<address><i class="icon-calendar"></i><br/> <strong>Deadline: </strong>' . $job['deadline'] . '<br/>';
if ($job['start_date'] != null) {
$content .= '</i><strong>Start date:</strong> ' . $job['start_date'] . '<br/>';
}
$content .= '</address>';
}
if ($job['phone'] != null) {
$content .= '<address><strong>Phone</strong>: '.$job['phone'] . '<br/>';
if ($job['mobile'] != null) {
$content .='<strong>Mobile</strong>: '.$job['mobile']. '<br/>';
}
if ($job['fax'] != null) {
$content .='<strong>Fax</strong>: '.$job['fax'] . '<br/>';
}
}
$content .= '</div>';
}
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '
<center><img src="img/bar.png"></center>';
$content .= '<br/>';
$content .= '<br/>';
// fin du profil
}
if (strcmp(substr($lab_query, 0,2),'OR')==0){
$lab_query=substr($lab_query,2);
}
if (strcmp(substr($orga_query, 0,2),'OR')==0){
$orga_query=substr($orga_query,2);
}
//////////////////////////
// liste des labs ////////
//////////////////////////
$labs = array();
sort($lab_list);
foreach ($lab_list as $name) {
if ((trim($name)) != NULL) {
$sql = "SELECT * FROM labs where name='" . $name . "' OR acronym='" . $name . "'";
foreach ($base->query($sql) as $row) {
$info = array();
$info['unique_id'] = $row['id'];
$info['name'] = $row['name'];
$info['acronym'] = $row['acronym'];
$info['url'] = $row['url'];
$info['keywords'] = $row['keywords'];
$info['country'] = $row['country'];
$info['address'] = $row['address'];
$info['organization'] = $row['organization'];
$info['organization2'] = $row['organization2'];
$orga_list[] = $row['organization'];
$orga_list[] = $row['organization2'];
$info['object'] = $row['object'];
$info['methods'] = $row['methods'];
$info['director'] = $row['director'];
$info['admin'] = $row['admin'];
$info['phone'] = $row['phone'];
$info['fax'] = $row['fax'];
$info['login'] = $row['login'];
$labs[$row['id']] = $info;
}
}
}
//////////////////////////
// liste des organizations ////////
//////////////////////////
$organiz = array();
sort($orga_list);
foreach ($orga_list as $name) {
if ((trim($name))!=NULL){
$sql = "SELECT * FROM organizations where name='" . $name. "' OR acronym='".$name."'";
$temp=true;
foreach ($base->query($sql) as $row) {
if ($temp){
$info = array();
$info['unique_id'] = $row['id'];
$info['name'] = $row['name'];
$info['acronym'] = $row['acronym'];
$info['url'] = $row['url'];
$info['keywords'] = $row['keywords'];
$info['country'] = $row['country'];
$info['street'] = $row['street'];
$info['city'] = $row['city'];
$info['state'] = $row['state'];
$info['postal_code'] = $row['postal_code'];
$info['fields'] = $row['fields'];
$info['admin'] = $row['admin'];
$info['phone'] = $row['phone'];
$info['fax'] = $row['fax'];
$info['login'] = $row['login'];
$organiz[$row['id']] = $info;
$temp=false;
}
}
}
}
///////Ajout des labs
$content .= '<br/> <A NAME="labs"> </A>
<h1>Labs by alphabetical order</h1>
<p><i>List of labs where there is a job opening</i></p>';
include('labs_list.php');
//////////////////////////
// liste des orga ////////
//////////////////////////
$content .= '<br/> <A NAME="orga"> </A>
<h1>Organizations by alphabetical order</h1>
<br/>
<p><i>List of organizations where there is a job opening</i></p>';
include('orga_list.php');
/// ajout des organisations
// $query = "CREATE TABLE organizations (id integer,name text,acronym text,url text,
//keywords text,country text,street text,city text,state text,postal_code text,fields text, director text,
//admin text, phone text,fax text,login text)";
?>