$g4 ) { $msg = 'New passwords should be the same'; $submit = $last; } else { $fontsize = $g5 < 8 ? '8' : "$g5"; $fontsize = $fontsize > 20 ? '20' : $fontsize; $qry1 = empty($g3) ? '' : ", subcat=\"$g3\""; $qry = "update contact set name=\"$g0\", email=\"$g1\", web=\"$g2\", company=\"$fontsize\" $qry1 where owner=\"$u\" and category=\"$prot\""; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } $msg = 'Saved'; } } elseif ( $submit == 'Confirm' && $last == 'Add User' ) { $qry = "select * from contact where owner=\"$g0\" and category=\"$prot\""; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } if ( mysql_num_rows($res) > 0 ) { $msg = 'User already exists'; } else { $qry = "insert into contact set owner=\"$g0\", category=\"$prot\", subcat='first'"; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } $msg = 'User added, initial password is "first", please change it'; } } elseif ( $submit == 'Confirm' && $last == 'Delete User' ) { $qry = "select * from contact where owner=\"$g0\""; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } if ( mysql_num_rows($res) < 1 ) { $msg = 'User does not exist'; } else { $qry = "delete from contact where owner=\"$g0\""; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } $msg = 'User and related records are deleted'; } } ?> Multi-Purpose Record
\n"; print $msg; switch ( $submit ) { case 'Edit': $qry = "select category,subcat,name,phone,web,email,company,fax,phone2,fax2,notes,ldate from contact where owner=\"$u\" and sid=$id"; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } $row = mysql_fetch_row($res); case 'Add Line': print "$submit
\n"; print "\n"; print tr(). "
Category\n"; print tr(). "Sub-cat\n"; print tr(). "Name\n"; print tr(). "Phone\n"; print tr(). "Web\n"; print tr(). "eMail\n"; print tr(). "Company\n"; print tr(). "Fax\n"; print tr(). "Phone 2\n"; print tr(). "Fax 2\n"; print tr(). "Notes
Last update: $row[11]\n"; print "
\n"; push(); print "\n"; print "\n"; print "\n"; if ($submit=='Edit') print "\n\n"; break; case 'Config': $qry = "select name,email,web,company from contact where owner=\"$u\" and category=\"$prot\""; print "\n\n"; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql)); } $row = mysql_fetch_row($res); print "$submit
\n"; print "\n"; print tr(). "
My Name\n"; print tr(). "My eMail (for getting password back)\n"; print tr(). "Category (for initial display)\n"; print tr(). "New Password (if you want to change password)\n"; print tr(). "Re-enter\n"; print tr(). "Font Size (8 - 20)\n"; print "
\n"; push(); print "\n"; print "\n"; break; case 'Add User': case 'Delete User': print "$submit
\n"; print "\n"; print tr(). "
User\n"; print "
\n"; push(); print "\n"; print "\n"; break; default: if ( $u == $admin) { print "\n"; print "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; if ( $u=='ray' ) print "\n"; print " $u\n"; // print "Close\n $u"; if ($filter<>'All') print "\n"; print "\n"; if ( strpos($filter,'Bookmark')<>False ) { $cbo1 = cbo("select subcat from contact where owner=\"$u\" and category=\"Bookmark\" group by 1", 'f1'); print "\n"; print tr(). "
 Sub-CatName/Link\n"; print tr(). "\n"; print "\n"; print "$cbo1"; print "\n"; print " \n"; } elseif ( strpos($filter,'Food')<>False ) { $cbo1 = cbo("select subcat from contact where owner=\"$u\" and category=\"Food\" group by 1", 'f1'); print "
 Sub-CatName/LinkPhone\n"; print tr(). "\n"; print "\n"; print "$cbo1"; print "\n"; print " \n"; } else { $cbo0 = cbo("select category from contact where owner=\"$u\" and category<>\"$prot\" group by 1", 'f0'); $cbo1 = cbo("select subcat from contact where owner=\"$u\" and category<>\"$prot\" group by 1", 'f1'); print "
 CategorySub-CatName/LinkPhoneWeb / eMailCompanyFaxPhone 2Fax 2
\n"; print "$cbo0$cbo1"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } $qry1 = $filter=='All' ? '' : $filter; $qry = "select category,subcat,name,phone,web,email,company,fax,phone2,fax2,sid,notes,flag,updated from contact where owner=\"$u\" and category<>\"$prot\" $qry1 order by category,subcat,name"; if ( !($res = mysql_db_query($db, $qry, $sql))) { die(Mysql_error($sql).' in '.$qry); } while ( $row = mysql_fetch_array($res, MYSQL_ASSOC) ) { $tip = "$note\n"; if ( strpos($filter,'Bookmark')<>False ) { $name = empty($row[name]) ? ' ' : $row[2]; print "$row[subcat]"; print empty($row[web]) ? $name : "$tip$row[flag] $name"; print "\n"; } elseif ( strpos($filter,'Food')<>False ) { print "$row[category]$row[subcat]$row[name]$row[phone]"; print "\n"; } else { print "$row[category]$row[subcat]$row[name]$row[phone]"; print empty($row[web]) ? ' ' : "$tip$row[flag] $row[web]"; print empty($row[web])||empty($row[email]) ? '' : '
'; print empty($row[email]) ? '' : "$row[email]"; print "
$row[company]$row[fax]$row[phone2]$row[fax2]\n"; } } print "
\n"; } //print ""; ?>