<?php
/**************************************************************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@Authors: Ryan Thompson(hide@address.com)
***************************************************************************/
require('contacts/class.contacts.php');
$ct = new contacts;
//$sql = "SELECT * FROM o_bookmarks WHERE user_id='". $O->user->user_id ."'";
?>
<table width="100%" cellspacing="0">
<tr>
<td>
<h2 class="home_header">
<?php echo $O->create_link("/contacts", $ct->msg('service_name'), 'home_header')?>
</h2>
</td>
</tr>
<tr>
<td style="text-align:right">
<table width="100%">
<?php
$db->query("SELECT address_id, lastname, firstname, phone, email FROM o_contacts WHERE user_id='{$user->user_id}'");
while($db->fetch_results())
{
if($class == "list_light")
{
$class = "list_dark";
} else {
$class = "list_light";
}
echo "<tr>";
echo "<td class=\"$class\" width=\"35%\" style=\"text-align: left\">";
echo $O->create_link("/contacts/edit_contact.php?id=". $db->record['address_id'],
$db->record['lastname'] .", ". $db->record['firstname'], $class);
echo "</td><td class=\"$class\" width=\"25%\" style=\"text-align: left\">";
echo $db->record['phone'];
echo "</td><td class=\"$class\" width=\"40%\" style=\"text-align: left\">";
echo "<a href=\"mailto:". $db->record['email'] ."\" class=\"$class\">". $db->record['email'] ."</a>";
echo "</td>";
echo "</tr>";
}
?>
</table>
<?php echo $O->create_link("/contacts/add_contact.php", $ct->msg('add_contact'), 'menu_link');?>
</td>
</tr>
</table>