Regarding your checkboxes:
Code:
print qq| <table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16" colspan="2">
<$font_color><b>Which traits are MOST important to you in a
relationship?</b></font></td></tr>
<tr
valign="top"><td width="32%" height="21">
|;
if ($rec{'Trust'}) {
print qq| <$font>$rec{'Trust'}<br>
|;
}
if ($rec{'Honestly'}) {
print qq| <$font>$rec{'Honestly'}<br>
|;
}
if ($rec{'Love'}) {
print qq| <$font>$rec{'Love'}<br>
|;
}
if ($rec{'Sex2'}) {
print qq| <$font>$rec{'Sex2'}
|;
}
print qq|</td></tr>
<td width="68%" height="21">
|;
if ($rec{'Companionship'}) {
print qq| <$font>$rec{'Companionship'}<br>
|;
}
if ($rec{'Faithfulness'}) {
print qq| <$font>$rec{'Faithfulness'}<br>
|;
}
if ($rec{'Passion'}) {
print qq| <$font>$rec{'Passion'}<br>
|;
}
if ($rec{'Communication'}) {
print qq| <$font>$rec{'Communication'}
|;
}
print qq|</td></tr>
</table>
I'm not sure how many levels of searching you want to allow. You can have as many as you want. Do you want a default user to search on, for example 5 fields, a registered user to search on 10 and the admin to search on all?
I'm going to assume that is what you want.
The easiest way to do this is to copy sub html_record_form and paste it just below the current one. You'll now have two identical subroutines. Change the name of the second subroutine to
sub html_registered_search_form {
Now go through the subroutine and delete all the fields you do not want registered users to search on. (By doing it this way, you don't have to retype all of the field names and you are less likely to make a mistake.)
Once you get that done, copy sub html_registered_search_form and paste it below the current one. Rename this new subroutine html_default_search_form. Again, go through and delete fields, this time just deleting the ones you don't want default users to search on.
In html_view_search, change
&html_record_form();
to
Code:
if ($per_admin) {
&html_record_form();
}
elsif ($db_userid eq "default") {
&html_default_search_form();
}
else {
&html_registered_search_form();
}
Make the same change in html_view_failure, except you'll need to keep the
%in part--
Code:
if ($per_admin) {
&html_record_form(%in);
}
elsif ($db_userid eq "default") {
&html_default_search_form(%in);
}
else {
&html_registered_search_form(%in);
}
You will probably only want registered users to be able to modify or delete their own records, right? So you have a field for the userid in each record. Because of this, you won't need to change the subroutine that's used for the modify or delete search. Instead, make an adjustment to sub html_footer:
Code:
if ($per_admin) {
print qq!| <A HREF="$db_script_link_url&delete_search=1">Delete</A>
| <A HREF="$db_script_link_url&modify_search=1">Modify</A> !;
}
else {
print qq!| <A HREF="$db_script_link_url&$db_cols[$auth_user_field]=$db_userid&delete_form=1">
Delete</A> ! if ($per_del);
print qq!| <A HREF="$db_script_link_url&$db_cols[$auth_user_field]=$db_userid&modify_form=1">
Modify</A> ! if ($per_mod);
}
Let me know if anything wasn't clear.
------------------
JPD
[This message has been edited by JPDeni (edited June 28, 1999).]