<?php
include($globals['PHPAPI_PATH'] . 'veteran.php');

function veteranListDisplayList () {

	$list = phpVeteranGetVeteransList();
	
	$t = veteranListSetTemplateVars($list);
	$t->p('out');
} // end func veteranListDisplayList

function veteranListSetTemplateVars ($list) {
	global $globals;
	
	$t = new Template($globals['LAYOUT_PATH'] . 'veterans_list/tmpl/');
	$t->set_file('list', 'list.tmpl');
	$t->set_block('list', 'veteran_block', 'veteran');
	
	while (list($k, $v) = each ($list)) {
		$info = phpVeteranGetVeteranInfo($v['id']);
		$bio = (isset($info["biography"]) && (strlen($info["biography"]) > 1));
		
		$t->set_var(array('FIRST_NAME' => $info['first_name'],
				  'LAST_NAME' => $info['last_name'],
				  'VETERAN_ID' => $v['id'],
				  'BIOGRAPHY' => $bio ? "yes" : ""
				));
		$t->parse('veteran', 'veteran_block', true);
	}
	
	$t->parse('out', 'list');
	return $t;
	
} // end func veteranListSetTemplateVars

?>
