<p>Hauek dira webgunean une honetan jasota dauden toponimo guztiak. Kokapen geografikoa elementuari dagokio, ez etiketari.</p>
<style>.esk{text-align:right}</style>
<?php
$result = db_query('SELECT n.nid, n.title, t.utmx, t.utmy, td.name FROM node n LEFT JOIN toponimo t ON n.nid = t.nid LEFT JOIN `topo_label` l ON n.nid = l.nid LEFT JOIN term_node tn ON n.nid = tn.nid LEFT JOIN term_data td ON tn.tid = td.tid AND td.vid = 6 WHERE n.type = "toponimo" AND td.vid = 6 AND t.maparako = 1 ORDER BY n.title');
$rows = array();
while($row = db_fetch_array($result)){
$row['utmx'] = array('data' => number_format($row['utmx'], 1, '.', ''), 'class' => 'esk');
$row['utmy'] = array('data' => number_format($row['utmy'], 1, '.', ''), 'class' => 'esk');
$rows[] = $row;
}
$headers = array('NID', 'Toponimoa', 'UTMX', 'UTMY', 'Mota');
switch(arg(2)){
case 'csv':
$output = '"'. join($headers, '", "') .'";\n"';
foreach($rows as $row){
$output .= '"'. join($row, '", "') .'";\n"';
}
print $output;
break;
default:
print theme('table', $headers, $rows);
}
?>