I'm a newbie - contact mgmt system / address book
Posted: Tue Apr 01, 2003 8:08 am
I'm trying to create a contact management system that's pretty in depth. I've created a couple scripts & the database, but I need help w/ formatting. Below is the code (I've left out the less relevant code for space' sake)
You can see the results @ http://www.zeitco.com/results.php
It's pretty ugly. What I'd like to be able to do is have the results display more concisely (it's doing a break in the table cells every time there's a space in the record for some reason). Also, I'd like to 1) be able to sort by any of the column headers, 2) do a search for any of the data in the table, 3) be able to click on any of the people and get more information (found in other tables), and 4) limit entries per page to 10 per page.
It's beyond my current abilities, so I'm asking for help. Thanks
Code: Select all
//display results
echo '<table width="1000" border="0" cellpadding="0" cellspacing="0" mm:layoutgroup="true">';
echo '<tr><td width="25" height="15" valign="bottom"><div align="left"><strong>First Name: </td>';
echo '<td width ="3"></td>';
echo '<td width="35" valign="bottom"><div align="left"><strong>Last Name: </td>';
echo '<td width ="3"></td>';
echo '<td width="75" valign="bottom"><div align="left"><strong>Spouse: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>Street Address: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>City: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>State: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>Zip Code: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>Email Address: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>Home Phone: </td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="bottom"><div align="left"><strong>Work Phone: </td>';
echo '<td width ="3"></td>';
echo '<td width="35" valign="bottom"><div align="left"><strong>Birth Date: </td>';
echo '<td width ="3"></td>';
echo "</p></strong></tr>";
while ($row = mysql_fetch_assoc($result))
{
$firstname = stripslashes($rowї'firstname']);
$lastname = stripslashes($rowї'lastname']);
$spouse = stripslashes($rowї'spouse']);
$streetaddress = stripslashes($rowї'streetaddress']);
$city = stripslashes($rowї'city']);
$state = stripslashes($rowї'state']);
$zip = stripslashes($rowї'zip']);
$email1 = stripslashes($rowї'email1']);
$homephone = stripslashes($rowї'homephone']);
$workphone = stripslashes($rowї'workphone']);
$birthdate = stripslashes($rowї'birthdate']);
// html stuff
echo '<tr>';
echo '<td width="25" valign="top">'.$firstname.'</td>';
echo '<td width ="3"></td>';
echo '<td width="35" valign="top">'.$lastname.'</td>';
echo '<td width ="3"></td>';
echo '<td width="75" valign="top">'.$spouse.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$streetaddress.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$city.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$state.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$zip.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$email1.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$homephone.'</td>';
echo '<td width ="3"></td>';
echo '<td width="25" valign="top">'.$workphone.'</td>';
echo '<td width ="3"></td>';
echo '<td width="35" valign="top">'.$birthdate.'</td>';
echo '<td width ="3"></td>';
echo '</tr>';
}It's pretty ugly. What I'd like to be able to do is have the results display more concisely (it's doing a break in the table cells every time there's a space in the record for some reason). Also, I'd like to 1) be able to sort by any of the column headers, 2) do a search for any of the data in the table, 3) be able to click on any of the people and get more information (found in other tables), and 4) limit entries per page to 10 per page.
It's beyond my current abilities, so I'm asking for help. Thanks