<?php | |
//error_reporting(E_ALL); ini_set("display_errors", true); | |
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include("_projectCommon.php"); # All on the same line to unclutter the user's desktop' | |
#***************************************************************************** | |
# | |
# Author: Donald Smith | |
# Date: 2005-11-11 | |
#**************************************************************************** | |
# | |
# Begin: page-specific settings. Change these. | |
$pageTitle = "Eclipse Membership Logos"; | |
$pageKeywords = "Type, page, keywords, here"; | |
$pageAuthor = "Type your name here"; | |
require_once("./scripts/db_access.php"); | |
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/smartconnection.class.php"); | |
require_once("./lookup_exceptions.php"); | |
$dbc = new DBConnection(); | |
$dbc->connect(); | |
$_ORDER = $_POST['order'] ? $_POST['order'] : $_GET['order']; | |
$_TYPE = $_POST['type'] ? $_POST['type'] : $_GET['type']; | |
$valid = array("SD", "SC", "AP", "AS", "ENTRP"); | |
if(!in_array($_TYPE, $valid)) { | |
unset($_TYPE); | |
} | |
$_NUMCOLS = 8; | |
if (isset($_GET['numcols'])) { | |
$count = (int)$_GET['numcols']; | |
$_NUMCOLS = max(8, min(64, $count)); | |
} | |
switch ($_ORDER) { | |
case "type": $order_by = "ORG.member_type desc, ORG.name1"; break; | |
case "complete": $order_by = "COMPLETE, ORG.name1"; break; | |
default: $order_by = "ORG.name1"; | |
} | |
if ($_TYPE != "") | |
$where_clause = "WHERE ORG.member_type = '" . $_TYPE . "'"; | |
else | |
$where_clause = "WHERE ORG.member_type in ('SD', 'SC', 'AP', 'AS', 'ENTRP')"; | |
//WTB: Modified to exclude organizations that have not provided a small logo. | |
$selectall = "SELECT ORGI.OrganizationID, ORG.name1, ORGI.short_description, ORG.member_type, ORGI.company_url IS NULL AS COMPLETE | |
from OrganizationInformation as ORGI | |
RIGHT JOIN organizations as ORG on ORGI.OrganizationID = ORG.organization_id | |
" . $where_clause . " and ORGI.small_logo is not null | |
ORDER BY | |
" . $order_by; | |
// echo "SQL: " . $selectall; | |
$MATCHES = mysql_evaluate_rows($selectall); | |
$LIST = '<table><tr>'; | |
$count=1; | |
foreach ($MATCHES as $a) { | |
$org_id = $a[0]; | |
$org_name = $a[1]; | |
$org_short_desc = $a[2]; | |
$org_type = $a[3]; | |
$LIST .= '<td><img src="./scripts/get_image.php?id=' . $org_id. '&size=small" style="padding:1px;" alt="'. $org_name . '"></td>'; | |
if ( ($count++ % $_NUMCOLS) == 0 ) { | |
$LIST .= '</tr><tr>'; | |
} | |
} | |
$LIST .= '</tr></table>'; | |
?> | |
<html> | |
<head> | |
<title>Eclipse Member Company Logos</title> | |
<style> | |
img {max-width:120px;max-height:120px} | |
td {text-align:center;vertical-align:middle;} | |
</style> | |
</head> | |
<body> | |
<?php echo $LIST; ?> | |
</body> | |
</html> |