$request_uri = $_SERVER['REQUEST_URI'];
$qParts = explode ('/',$request_uri);
$qyArr = array ();
$H1 = "Default Page Title";
$per_page = 6;
if ($qParts[1] == 'Schools') { include_once ("$webdir/pages/schools.tpl.html"); exit; }
?>
=''?>
$f = url_codify ($qParts[1],'d');
$search = (in_array ( url_codify ($qParts[1],'d'),$degreeArr))?true:false;
if ($search)
{
$temptable = substr(md5 (uniqid (rand())),0,16);
mysql_query ("CREATE TEMPORARY TABLE $temptable LIKE schools");
// parse the $qParts
foreach ($qParts as $v)
{
if (empty($v) || $v == 'Online-and-Campus') { continue; }
elseif (in_array (url_codify ($v,'d'), $degreeArr))
{
$dec['deg'] = $qyArr['Program_Degree'] = url_codify ($v,'d');
}
elseif (in_array (url_codify ($v,'d'), $progMainCatName))
{
$dec['main'] = url_codify ($v,'d');
$x = array_keys ($progMainCatName, $dec['main']);
$mainID = $qyArr['Program_Main_CategoryID'] = $x[0];
}
elseif (in_array (url_codify ($v,'d'), $progSubCatName))
{
$dec['sub'] = url_codify ($v,'d');
$x = array_keys ($progSubCatName, $dec['sub']);
$subID = $qyArr['Program_Sub_CategoryID'] = $x[0];
}
elseif (in_array (url_codify ($v,'d'), $Branch_Type))
{
unset ($locID, $dec['loc']);
$dec['loc'] = url_codify ($v,'d');
$x = array_keys ($Branch_Type, $dec['loc']);
$locID = ($x[0]>0)?$x[0]:'';
}
elseif (strstr ($v, ","))
{
$limit = ($v)?explode(",",$v):array(0,$per_page);
}
else//if (substr()){} //must be zip code
{
// echo $v;
$dec['zip'] = $v;
if (is_numeric ($dec['zip'])) { str_pad($dec['$zip'], 5, '0', STR_PAD_LEFT); }
if (!empty($dec['zip'])) { $qyZip = " AND zips LIKE '%{$dec['zip']}%'"; }
}
$url[] = $v;
unset($x);
}
$locFirst = ($locID)?$dec['loc']:'Online';
$locFirstID = ($locID)?$locID:1;
if (!isset($limit)) { $limit = array (0,$per_page); }
// Generate the breadcrumbs
$decVal = array_values ($dec);
for ($i=0; $i'.$decVal[$i].''; }
}
$H1 = implode (" » ", $H1Arr);
// Run the query from parsed URL
foreach ($qyArr as $k=>$v) { if(!empty($v)){$where[] = "$k=\"$v\"";} }
$sql = "SELECT * FROM schools WHERE ".implode (' AND ', $where)." $qyZip AND Rate!=0 GROUP BY School_Name, Branch_Type ORDER BY Branch_Type ASC, Rate DESC";
mysql_query ("INSERT INTO $temptable $sql");
$schArr = mysql_wrap ("SELECT * FROM $temptable");
$schCount = $dispCount = count ($schArr);
// Page numbering
if (!is_array($schArr))
{
$noresult = true;
}
else
{
foreach ($schArr as $v)
{
if ($v['Branch_Type'] == 2) { $Campus++; } elseif ($v['Branch_Type'] == 1) { $Online++; }
}
if ($Campus == 0) { $locFirst = 'Online'; $locFirstID = 1; }
elseif ($Online == 0) { $locFirst = 'Campus'; $locFirstID = 2; }
if ($Campus>0 && $Online>0)
{
if ($limit[0]+$per_page < ${$locFirst}) { $next_str = min(($limit[0]+$per_page),${$locFirst}).','.$per_page.'/'; }
if ($limit[0] != 0) { $prev_str = max(($limit[0]-$per_page),0).','.$per_page.'/'; }
}
else
{
if ($limit[0]+$per_page < $schCount) { $next_str = min(($limit[0]+$per_page),$schCount).','.$per_page.'/'; }
if ($limit[0] != 0) { $prev_str = max(($limit[0]-$per_page),0).','.$per_page.'/'; }
}
}
$incFile = "$webdir/pages/search.tpl.html";
$description = $descArr[$_GET['id']];
$arrIdx = array("Get your degree at ".$schArr[$_GET['id']]);
$search_textArr[2] = $arrIdx[0];
// Blurbs
$bvArr = array ($dec['deg'],$dec['main'], $dec['sub']);
$bfArr = array ('Program_Degree','Program_Main_Category','Program_Sub_Category');
for ($i=0;$i";
foreach ($metaArr[1] as $v) { $meta = explode ('::',$v); ${$meta[0]} = $meta[1]; }
}
if ($description == '')
{
if ($search_textArr){ $description = substr ($search_textArr[3],0,strpos($search_textArr[3],"\n")-1); }
else
{
$blurb = array_rand($blurbArr);
$description = strip_tags($blurbArr[$blurb]);
$ttl2 = array_rand($title_2_Arr);
$search_textArr[2] = $title_2_Arr[$ttl2];
}
}
?>
=$title?> » The College Degrees . Com