Commit cb8f9988 authored by Romain Loth's avatar Romain Loth

just remove trailing spaces

parent 30997cec
<?php
// calcul les différents profils à partir d'une requete
// sort un $content
// sort un $content
echo '
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">
';
......@@ -17,7 +17,7 @@ echo ' <script type="text/javascript" src="js/whoswho.js"></script>
$imsize = 150;
$content='';
......@@ -33,8 +33,8 @@ foreach ($jobs as $job) {
}
$loop+=1;
$content.= '<div class="row">
<div class="span12">
<div class="row">
<div class="span12">
<div class="row">
<div class="span9" align="justify">';
$content .= '<div>';
......@@ -46,21 +46,21 @@ foreach ($jobs as $job) {
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> ';
$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> ';
$content .= '<dd><strong>' . clean_exp('Organization:</strong> '.$job['organization']) . '</dd> ';
$orga_list[]=$job['organization'];
//echo $job['affiliation'].'<br/>';
//$lab_query.='OR name="'.$job['affiliation'].'" ';
......@@ -71,7 +71,7 @@ foreach ($jobs as $job) {
$affiliation2 = '';
if ((strcmp($affiliation2, '') != 0) | (strcmp($affiliation, '') != 0)) {
$content .= '<br/>';
......@@ -88,34 +88,34 @@ foreach ($jobs as $job) {
$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/>';
$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) {
......@@ -125,16 +125,16 @@ foreach ($jobs as $job) {
}
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/>';
......@@ -217,9 +217,9 @@ foreach ($orga_list as $name) {
$info['fax'] = $row['fax'];
$info['login'] = $row['login'];
$organiz[$row['id']] = $info;
$temp=false;
$temp=false;
}
}
}
}
}
......
......@@ -72,35 +72,35 @@ foreach ($jobs as $row) {
$position_list[$position] = 1;
}
// traitement des organismes de rattachement
$affiliation = trim($row["affiliation"]);
if (strcmp($affiliation, "") == 0) {
$missing_affiliation+=1;
} else {
} else {
if (array_key_exists($affiliation, $organizations_list)) {
$organizations_list[$affiliation]+=1;
} else {
$organizations_list[$affiliation] = 1;
}
}
$affiliation2 = trim($row["affiliation2"]);
if (strcmp($affiliation2, "") == 0) {
$missing_affiliation+=1;
} else {
} else {
if (array_key_exists($affiliation2, $organizations_list)) {
$organizations_list[$affiliation2]+=1;
} else {
$organizations_list[$affiliation2] = 1;
}
}
}
......@@ -119,7 +119,7 @@ foreach ($country_list as $key => $value) {
} else {
$other_country+=$value;
}
}
//if (false) {
if ($missing_country>0){
......@@ -231,7 +231,7 @@ $(document).ready(function() {
name: "Position",' . $position_data .
'}]
});
......
......@@ -12,15 +12,15 @@ foreach ($labs as $lab) {
}
$loop+=1;
$content.= '<div class="row">
<div class="span12">
<div class="row">
<div class="span12">
<div class="row">
<div class="span9" align="justify">';
$content .= '<div>';
$content .= '<h2 >' . $lab['name'];
if ($lab['acronym'] != null){
$content.=' ('.$lab['acronym'].')';
}
}
$content.=' <small> - ' . $lab['country'] . '</small></h2>';
......@@ -34,7 +34,7 @@ foreach ($labs as $lab) {
if (strcmp($www, '') != 0) {
$content .= '<dl><dd><i class="icon-home"></i>' . $www . '</dd></dl> ';
}
if ($lab['organization'] != null) {
$content .= '<dl>
<dt>Institutions:</dt>';
......@@ -101,7 +101,7 @@ foreach ($labs as $lab) {
$content .= '<address><strong>Phone</strong>: '.$lab['phone'] . '<br/>';
if ($lab['fax'] != null) {
$content .='<strong>Fax</strong>: '.$lab['fax'] . '<br/>';
}
}
}
$content .= '</div>';
......@@ -111,7 +111,7 @@ $content .= '</div>';
$content .= '</div>';
$content .= '</div>';
$content .= '
<center><img src="img/bar.png"></center>';
$content .= '<br/>';
......
......@@ -5,22 +5,22 @@ function normalize_position($value) {
// global normalization
$value=str_replace('.','', $value);
// phd
$value=str_replace('professor', 'prof', $value);
$value=str_replace('profesor', 'prof', $value);
$value=str_replace('proffesor', 'prof', $value);
$value=str_replace('laboratory', ' lab', $value);
// final normalization
$value=str_replace('phd student', 'phd', $value);
$value=str_replace('doctor', 'dr', $value);
// phd
$value=str_replace('prof', 'professor', $value);
$value=str_replace('head of lab', 'head of laboratory', $value);
$value=str_replace('research officer', 'research assistant', $value);
......@@ -30,9 +30,9 @@ function normalize_position($value) {
$value=str_replace('phd', 'phd student', $value);
$value=str_replace('dr', 'doctor', $value);
$value = preg_replace('/\b(\w)/e', 'strtoupper("$1")', $value);
return $value;
}
......@@ -48,23 +48,23 @@ function normalize_country($value) {
function sanitize_input($value) {
//$value = mysql_real_escape_string($value);
//the use of addslashes() for string escaping in MySQL queries can lead to SQL injection
//through the abuse of multibyte character sets. In his example he relies on addslashes()
//to convert an invalid multibyte sequence into a valid one, which also has an embedded ' that
//is not escaped. And in an ironic twist, the function intended to protect against SQL injection
// is used to actually trigger it.
//to convert an invalid multibyte sequence into a valid one, which also has an embedded ' that
//is not escaped. And in an ironic twist, the function intended to protect against SQL injection
// is used to actually trigger it.
// lame security
$value=str_replace('drop','', $value);
$value=str_replace('select','', $value);
$value=str_replace('update','', $value);
$value=str_replace('delete','', $value);
$value = addcslashes($value, '%_');
$value = trim($value);
$value = htmlspecialchars($value);
return $value;
}
......
......@@ -15,8 +15,8 @@ foreach ($organiz as $orga) {
if ($orga['name'] != null) {
$orga_count+=1;
$content.= '<div class="row">
<div class="span12">
<div class="row">
<div class="span12">
<div class="row">
<div class="span9" align="justify">';
$content .= '<div>';
......@@ -46,11 +46,11 @@ foreach ($organiz as $orga) {
$content .= '<div><p>';
//echo $orga['fields'].'<br/>';
$fields=trim(str_replace('Other','',clean_exp($orga['fields'])));
if (strcmp(',', substr($fields,-1,1))==0){
$fields=substr($fields,0,-1);
}
$fields=str_replace('%%%', ', ',$fields);
$fields=str_replace('%%%', ', ',$fields);
$content .= '<i>Fields: </i> ' . str_replace(", , ", ", ", $fields). '.<br/><br/>';
$content .= '</p></div>';
......@@ -71,12 +71,12 @@ foreach ($organiz as $orga) {
$content .= '<address><i class="icon-info-sign"></i> Administrative contact: ' . ucwords($orga['admin']) . '<br/></address>';
}
if (trim($orga['street']) != null) {
$address = $orga['street'] . ', ' . $orga['city'] . ', ' . $orga['postal_code']
$address = $orga['street'] . ', ' . $orga['city'] . ', ' . $orga['postal_code']
. ', ' . $orga['state']. ', ' . $orga['country'];
$address = str_replace(", , , , ", ", ", $address);
$address = str_replace(", , , ", ", ", $address);
$address = str_replace(", , , , ", ", ", $address);
$address = str_replace(", , , ", ", ", $address);
$address = str_replace(", , ", ", ", $address);
$content .= '<address><i class="icon-envelope"></i> ' . $address . '<br/></address>';
}
......
......@@ -55,7 +55,7 @@ $meta = '<!DOCTYPE html>
define('_is_utf8_split', 5000);
function is_utf8($string) {
// From http://w3.org/International/questions/qa-forms-utf-8.html
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
......@@ -67,7 +67,7 @@ function is_utf8($string) {
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $string);
}
$data = json_decode($_GET['query']);
......@@ -78,7 +78,7 @@ function objectToArray($d) {
// with get_object_vars function
$d = get_object_vars($d);
}
if (is_array($d)) {
/*
* Return array converted to object
......@@ -121,13 +121,13 @@ if ($keywords) {
$word = sanitize_input(trim(strtolower($word)));
if ($word == "") continue;
$query_details.=$word.', ';
if ($i > 0)
if ($i > 0)
$f .= " OR ";
$f .= 'keywords LIKE "%' . $word . '%" ';
$i++;
}
}
$f .= ") ";
$f .= ") ";
}
if ($countries) {
......@@ -142,8 +142,8 @@ if ($countries) {
if ($country == "") continue;
if ($i > 0)
$f .= " OR ";
$f .= 'country = "' . $country . '" ';
$query_details.=$country.', ';
$f .= 'country = "' . $country . '" ';
$query_details.=$country.', ';
$i++;
}
$f .= ") ";
......@@ -161,10 +161,10 @@ if ($laboratories) {
if ($i > 0)
$f .= " OR ";
$f .= 'lab LIKE "%' . $lab . '%" ';
$query_details.=$lab.', ';
$query_details.=$lab.', ';
$i++;
}
$f .= ") ";
$f .= ") ";
}
if ($organizations) {
......@@ -176,14 +176,14 @@ if ($organizations) {
$i = 0;
foreach ($organizations as $org) {
$org = sanitize_input(trim(strtolower($org)));
if ($org == "") continue;
$query_details.=$org.', ';
$f .= 'affiliation LIKE "%' . $org . '%" OR affiliation2 LIKE "%' . $org . '%" ';
$query_details.=$org.', ';
$f .= 'affiliation LIKE "%' . $org . '%" OR affiliation2 LIKE "%' . $org . '%" ';
//'affiliation LIKE "%' . $org . '% OR affiliation2 LIKE "%' . $org . '%"';
$i++;
}
$f .= ") ";
$f .= ") ";
}
$query_details.='</ul>';
......@@ -201,7 +201,7 @@ if (substr($labfilter, 0,3)=='AND'){
$imsize = 150;
$content='';
if (strlen($f)>0){
$sql = "SELECT * FROM jobs where " . " " . $f.' ORDER BY position';
}else{
......@@ -224,9 +224,9 @@ foreach ($base->query($sql) as $row) {
$info['organization'] = $row['organization'];
$info['keywords'] = $row['keywords'];
$info['url'] = $row['url'];
$info['deadline'] = $row['deadline'];
$info['deadline'] = $row['deadline'];
$info['start_date'] = $row['start_date'];
$info['login'] = $row['login'];
$info['login'] = $row['login'];
$jobs[$row['id']] = $info;
}
......@@ -245,7 +245,7 @@ include ("jobs_content.php");
$content .= '</div>';
$content .= '</div>
<footer>
GENERATED BY <a href="http://iscpif.fr"><img src="css/branding/logo-iscpif_medium.png" alt="iscpif.fr" style="border: none; margin-bottom : -6px;" title="isc-pif" /></a>- <a href="http://sciencemapping.com" target="_BLANK">MOMA</a> - <a href="http://www.crea.polytechnique.fr/LeCREA/" target="_BLANK">CREA</a> - <a href="http://www.cnrs.fr/fr/recherche/index.htm" target="_BLANK">CNRS</a>
GENERATED BY <a href="http://iscpif.fr"><img src="css/branding/logo-iscpif_medium.png" alt="iscpif.fr" style="border: none; margin-bottom : -6px;" title="isc-pif" /></a>- <a href="http://sciencemapping.com" target="_BLANK">MOMA</a> - <a href="http://www.crea.polytechnique.fr/LeCREA/" target="_BLANK">CREA</a> - <a href="http://www.cnrs.fr/fr/recherche/index.htm" target="_BLANK">CNRS</a>
</footer>
</div>
</body>
......@@ -264,13 +264,13 @@ This directory presents the <a href="#scholars">'. count($jobs).' jobs openings
. count($labs).' labs</a> and <a href="#orga">'.$orga_count.' organizations</a> in
the field of Complex Systems';
if (strlen(trim($query_details))>3){
$header .= ': </p>'.$query_details;
$header .= ': </p>'.$query_details;
}else{
$header .='.</p> ';
}
$header .='
<br/>
<p>On the complex systems registry, you can
<p>On the complex systems registry, you can
<a href="http://main.csregistry.org/jobs-submission">submit new job openings</a> or <a href="http://main.csregistry.org/jobmarket">announce that you will be looking for a job
in the next 12 months.</a></p>
<br/>
......@@ -293,4 +293,4 @@ echo $content;
?>
\ No newline at end of file
?>
......@@ -92,7 +92,7 @@ foreach ($scholars as $row) {
} elseif (strcmp($title, "M.") == 0) {
$title = "Mr.";
} elseif (strcmp($title, "Professor.") == 0) {
$title = "Prof.";
$title = "Prof.";
}
if (array_key_exists($title, $title_list)) {
......@@ -101,35 +101,35 @@ foreach ($scholars as $row) {
$title_list[$title] = 1;
}
}
// traitement des organismes de rattachement
$affiliation = trim($row["affiliation"]);
if (strcmp($affiliation, "") == 0) {
$missing_affiliation+=1;
} else {
} else {
if (array_key_exists($affiliation, $organizations_list)) {
$organizations_list[$affiliation]+=1;
} else {
$organizations_list[$affiliation] = 1;
}
}
$affiliation2 = trim($row["affiliation2"]);
if (strcmp($affiliation2, "") == 0) {
$missing_affiliation+=1;
} else {
} else {
if (array_key_exists($affiliation2, $organizations_list)) {
$organizations_list[$affiliation2]+=1;
} else {
$organizations_list[$affiliation2] = 1;
}
}
}
......@@ -149,7 +149,7 @@ foreach ($country_list as $key => $value) {
} else {
$other_country+=$value;
}
}
//if (false) {
if ($missing_country>0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment