1) {
$sx = "s";
}
if ($cCount<>0) {
return "Total of $cCount center".$sx." in $prevCountry
"; } } $cCount = 0; $select = "SELECT t.name as 'Region', lc.name as Country,f.title as 'Center',l.street as 'Street', n.language, n.nid as nnid"; $from = " FROM `node` as n, `forum_index` as f, `taxonomy_term_data` as t, `location` as l, `location_instance` as li, `location_country` as lc"; $where = " WHERE n.status=1 and n.type='forum' and li.nid=n.nid and li.lid=l.lid and li.vid=n.vid and n.nid=f.nid and t.tid=f.tid and l.country=lc.code and t.name like '%Centers'"; $orderby = " order by t.name, lc.name, f.title"; $sql = $select . $from . $where . $orderby; $output = $prevReg = $prevCountry = ""; $gData = db_query($sql); $cnt=$gData->rowCount(); print $cnt; // if (isset($gData) && count($gData)>0){ if (isset($gData) && $cnt>0){ $output.=" ";
$i=0;
foreach ($gData as $d){
if ($prevCountry <> $d->Country) {
$output.=getCountryCount($prevCountry, $cCount);
// $output.="
"; $cCount = 0; } if ($prevReg <> $d->Region) { $output.="[".$d->Region."]
"; } $url = ''.$d->Country.' - '.$d->Center.''; $output.="
".$url; // $output.="
".$d->Country.", ".$d->Center; $prevReg = $d->Region; $prevCountry = $d->Country; $i++; $cCount++; } } return $output.getCountryCount($prevCountry, $cCount)."Grand Total Centers: $i"; } ?>
"; } } $cCount = 0; $select = "SELECT t.name as 'Region', lc.name as Country,f.title as 'Center',l.street as 'Street', n.language, n.nid as nnid"; $from = " FROM `node` as n, `forum_index` as f, `taxonomy_term_data` as t, `location` as l, `location_instance` as li, `location_country` as lc"; $where = " WHERE n.status=1 and n.type='forum' and li.nid=n.nid and li.lid=l.lid and li.vid=n.vid and n.nid=f.nid and t.tid=f.tid and l.country=lc.code and t.name like '%Centers'"; $orderby = " order by t.name, lc.name, f.title"; $sql = $select . $from . $where . $orderby; $output = $prevReg = $prevCountry = ""; $gData = db_query($sql); $cnt=$gData->rowCount(); print $cnt; // if (isset($gData) && count($gData)>0){ if (isset($gData) && $cnt>0){ $output.="
Divine Dharma Meditation Centers
"; $cCount = 0; } if ($prevReg <> $d->Region) { $output.="[".$d->Region."]
"; } $url = ''.$d->Country.' - '.$d->Center.''; $output.="
".$url; // $output.="
".$d->Country.", ".$d->Center; $prevReg = $d->Region; $prevCountry = $d->Country; $i++; $cCount++; } } return $output.getCountryCount($prevCountry, $cCount)."Grand Total Centers: $i"; } ?>