<?php
/************************************************************************
	UebiMiau is a GPL'ed software developed by 
	 - Aldoir Ventura - aldoir@users.sourceforge.net
	 - http://uebimiau.sourceforge.net SåÐ Paulo - Brasil
   		
	***********************************************************************
	Version 3.2.0 Upgrades and templates developed by
	 - Todd Henderson - Lead Developer - http://tdah.us 
	 - Dave Rodgers - Developer - http://www.manvel.net 
	 - Laurent (AdNovea) - Developer - http://adnovea.free.fr
	 
	***********************************************************************
	 - Special thanks to the developers at 
	codeworxtech.com, tinymce.moxiecode.com
	telaen.org, phptoys.com, winged.info, ngcoders.com
	without help this project wouldn't be possible 
	
	***********************************************************************/

require('./inc/inc.php');

	$filename = $userfolder.DB_ADRESSBOOK;
	$myfile = $UM->_read_file($filename);
	
	if($myfile != "") 
		$addressbook = unserialize(base64_decode($myfile));
		
	array_qsort2($addressbook,"name");
	$listbox = "<select name='contacts' class='quicklist' size='8' onDblClick=\"Add('to')\">\r\n";
	
	for($i=0;$i<count($addressbook);$i++) {
		$line = $addressbook[$i];
		$name = htmlspecialchars(trim($line["name"]));;
		$email = htmlspecialchars(trim($line["email"]));
		//$listbox .= "<option value=\"&quot;$name&quot; &lt;$email&gt;\"> &quot;$name&quot; &lt;$email&gt;";
		$listbox .= "<option value=\"&quot;$name&quot; &lt;$email&gt;\"> $name &lt;$email&gt;";
	}
	
	$listbox .= "</select>";
	
// Set SMARTY variables for templates and display
	$smarty->assign("umContacts",$listbox);

	$smarty->display("$selected_theme/".HTML_QUICK_ADDRESS);

?>