| <?php |
| preg_match( '/[A-Za-z0-9\.\_\-]*/', $_REQUEST['project'], $matches ); |
| $id = $matches[0]; |
| include "/home/data/httpd/eclipse-php-classes/system/dbconnection_foundation_ro.class.php"; |
| $_dbc = new DBConnectionFoundation(); |
| $_dbh = $_dbc->connect(); |
| $query = "SELECT ProjectPhase FROM Projects WHERE ProjectID = '$id'"; |
| $result = mysql_query($query,$_dbh); |
| |
| if (!$result) { |
| echo("MySQL Error: ".mysql_error()); |
| } else { |
| $row = mysql_fetch_assoc($result); |
| |
| if( $row['ProjectPhase'] == 'Regular' ) { |
| header("Content-type: image/gif"); |
| $img = file_get_contents('/home/local/data/httpd/www.eclipse.org/html/projects/images/ok.gif'); |
| echo "$img"; |
| } else if( $row['ProjectPhase'] == 'Incubation' ) { |
| header("Content-type: image/gif"); |
| $img = file_get_contents('/home/local/data/httpd/www.eclipse.org/html/projects/images/egg.gif'); |
| echo "$img"; |
| } else if( $row['ProjectPhase'] == 'Incubation.nc' ) { |
| header("Content-type: image/jpeg"); |
| $img = file_get_contents('/home/local/data/httpd/www.eclipse.org/html/projects/images/egg-redx.jpg'); |
| echo "$img"; |
| } else { |
| echo "Unknown Project Phase"; |
| } |
| } |
| ?> |