include('config.inc.php'); include(INCLUDEPATH.'statecodes.php'); include(INCLUDEPATH.'statename.php'); include(INCLUDEPATH.'surgery_types.php'); include('data.php'); #include(TEMPLATEPATH.'schools/data.php'); #if ( $data['keyword'] == 'DNP Programs' ) { include('data.php'); } #include(INCLUDEPATH.'newProgramLinks.php'); //SPAMmy site redirect if((text_get('state') == 'Washington Dc') || (text_get('state') == 'washington dc') || (text_get('state') == 'Washington DC')){ header("HTTP/1.1 301 Moved Permanently"); header("Location: ". THISDOMAIN ."/". underText_w($data['keyword']) ."/Washington-DC"); exit(); } else { if((text_get('state') != ucwords(text_get('state'))) || (text_get('city') != ucwords(text_get('city')))) { header("HTTP/1.1 301 Moved Permanently"); header("Location: ". THISDOMAIN ."/". url_w($data['keyword']) ."/". url_w(ucwords(text_get('state'))) ."/". url_w(ucwords(text_get('city')))); exit(); } }//END /// //Correct spaces in URL city & state if ((strpos($_GET['state'], ' ') !== FALSE) || (strpos($_GET['city'], ' ') !== FALSE)) { header("HTTP/1.1 301 Moved Permanently"); header("Location: ". THISDOMAIN ."/". url_w($data['keyword']) ."/". url_w(ucwords($_GET['state'])) ."/". url_w(ucwords($_GET['city']))); exit(); } //END /// // redirect to correct URL when another city is added to $_GET['state'] $state_var = text_get('state'); if (strpos($state_var, '/') ) { $pieces = explode("/", $state_var); header("HTTP/1.1 301 Moved Permanently"); header("Location: ". THISDOMAIN ."/". url_w($data['keyword']) ."/". $pieces[0] ."/". url_get('city')); exit(); } if ( strpos($_SERVER['REQUEST_URI'], '?q=') ) { $pieces = explode("?q=", $_SERVER['REQUEST_URI']); header("HTTP/1.1 301 Moved Permanently"); header("Location: ". $pieces[0]); exit(); } #include(INCLUDEPATH.'locations.php'); //include('flavorschool.php'); //include(INCLUDEPATH.'stateHealthDept.php'); //include(INCLUDEPATH.'LPN_zips.php'); //$this_zip = $zipLoc[$statecode[text_get('state')]][text_get('city')]; //if($this_zip === 0) { $this_zip = ''; } $st_code = $statecode[text_get('state')]; // // include(INCLUDEPATH.'dbcon.php'); /* SQL for single taxonomy term (no depth) * / $dbquery = "SELECT node.nid AS nid, node.title AS node_title, location.street AS location_street, location.additional AS location_additional, location.city AS location_city, location.province AS location_province, location.country AS location_country, location.postal_code AS location_postal_code FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid INNER JOIN term_node term_node ON node.vid = term_node.vid WHERE (node.status <> 0) AND (location.lid IS NOT NULL) AND (node.type in ('eye_surgeon')) AND (term_node.tid = ". $data['tax_id'] .") AND (location.country = 'US') AND (location.province = '". makeSafe($st_code) ."') AND (location.city = '". makeSafe(text_get('city')) ."')"; /* */ /* $dbquery = "SELECT DISTINCT(node.nid) AS nid, location.province AS location_province, location.country AS location_country, location.city AS location_city FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.vid IN ( SELECT tn.vid FROM term_node tn LEFT JOIN term_hierarchy th ON th.tid = tn.tid LEFT JOIN term_hierarchy th1 ON th.parent = th1.tid LEFT JOIN term_hierarchy th2 ON th1.parent = th2.tid LEFT JOIN term_hierarchy th3 ON th2.parent = th3.tid LEFT JOIN term_hierarchy th4 ON th3.parent = th4.tid LEFT JOIN term_hierarchy th5 ON th4.parent = th5.tid LEFT JOIN term_hierarchy th6 ON th5.parent = th6.tid LEFT JOIN term_hierarchy th7 ON th6.parent = th7.tid )) AND ((location.city) = ('". makeSafe(text_get('city')) ."')) AND (location.province = '". makeSafe($st_code) ."') AND (node.status = 1) AND (node.type in ('$typeofnode')) GROUP BY nid ORDER BY location_province ASC, location_city ASC"; */ $dbquery = "SELECT node.nid AS nid, location.province AS location_province, location.country AS location_country, location.city AS location_city, location.postal_code AS location_postal_code, location.street AS location_street, location.additional AS location_additional, node.title AS node_title FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.vid IN ( SELECT tn.vid FROM term_node tn LEFT JOIN term_hierarchy th ON th.tid = tn.tid LEFT JOIN term_hierarchy th1 ON th.parent = th1.tid LEFT JOIN term_hierarchy th2 ON th1.parent = th2.tid LEFT JOIN term_hierarchy th3 ON th2.parent = th3.tid LEFT JOIN term_hierarchy th4 ON th3.parent = th4.tid WHERE tn.tid = ". $data['tax_id'] ." OR th1.tid = ". $data['tax_id'] ." OR th2.tid = ". $data['tax_id'] ." OR th3.tid = ". $data['tax_id'] ." OR th4.tid = ". $data['tax_id'] ." )) AND ((location.city) = ('". makeSafe(text_get('city')) ."')) AND (location.province = '". makeSafe($st_code) ."') AND (node.status = 1) AND (node.type in ('$typeofnode')) GROUP BY nid ORDER BY location_province ASC, location_city ASC"; $dbresult = mysql_query($dbquery); // if no eye surgeons in this city, redirect to homepage //while($rrow = mysql_fetch_array($dbresult, MYSQL_ASSOC)) { // if(empty($rrow[0])) { //$surgeons_exist = mysql_num_rows($dbquery); //if(!$surgeons_exist) { // header("HTTP/1.1 301 Moved Permanently"); // header("Location: ". THISDOMAIN ."/"); // exit(); // } $cityListQuery = "SELECT location.city AS location_city,COUNT(node.nid) AS num_records FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid INNER JOIN term_node term_node ON node.vid = term_node.vid WHERE (node.status <> 0) AND (location.lid IS NOT NULL) AND (node.type in ('$typeofnode')) AND (term_node.tid = ". $data['tax_id'] .") AND (location.country = 'US') AND (location.province = '". makeSafe($st_code) ."') GROUP BY location_city ORDER BY location_city ASC"; $cityListResult = mysql_query($cityListQuery); $stateListQuery = "SELECT location.province AS location_province, COUNT(node.nid) AS num_records FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid INNER JOIN term_node term_node ON node.vid = term_node.vid WHERE (node.status <> 0) AND (location.lid IS NOT NULL) AND (node.type in ('$typeofnode')) AND (term_node.tid = ". $data['tax_id'] .") AND (location.country = 'US') GROUP BY location_province ORDER BY location_province ASC"; /* $stateListQuery = "SELECT DISTINCT(node.nid) AS nid, DISTINCT(location.province) AS location_province, location.country AS location_country, location.city AS location_city FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.vid IN ( SELECT tn.vid FROM term_node tn LEFT JOIN term_hierarchy th ON th.tid = tn.tid LEFT JOIN term_hierarchy th1 ON th.parent = th1.tid LEFT JOIN term_hierarchy th2 ON th1.parent = th2.tid LEFT JOIN term_hierarchy th3 ON th2.parent = th3.tid LEFT JOIN term_hierarchy th4 ON th3.parent = th4.tid LEFT JOIN term_hierarchy th5 ON th4.parent = th5.tid LEFT JOIN term_hierarchy th6 ON th5.parent = th6.tid LEFT JOIN term_hierarchy th7 ON th6.parent = th7.tid WHERE tn.tid = ". $data['tax_id'] ." OR th1.tid = ". $data['tax_id'] ." OR th2.tid = ". $data['tax_id'] ." OR th3.tid = ". $data['tax_id'] ." OR th4.tid = ". $data['tax_id'] ." OR th5.tid = ". $data['tax_id'] ." OR th6.tid = ". $data['tax_id'] ." OR th7.tid = ". $data['tax_id'] ." )) AND (node.status = 1) AND (node.type in ('$typeofnode')) GROUP BY nid ORDER BY location_province ASC"; */ include(INCLUDEPATH.'flinks/flinks-'. url_w($data['keyword']) .'.php'); // // $varState = $statecode[text_get('state')]; //include('schools/'. $varState .'.php'); ?>