Gossamer Forum
Home : Products : DBMan : Customization :

generic DB name in html.pl files?

Quote Reply
generic DB name in html.pl files?
I have 6 .cfg and .db files and I want to use 1 html.pl file PER .cfg/.db

HOWEVER, in the footer and main index of the default .cfg (and a different version of each of the other 5 .cfg's) (And I really don't want to have to have 6 html.pl files for EACH client dataset!) I use

$db_script_url?db=demofa&uid=$db_uid">

which is specific to each DB --- How can I make this a variable for the DB like it is for the user id???

so it would be

$db_script_url?db=$db_fa&uid=$db_uid">

Where would I need to make changes?

Where would I need to define what $db_fa is equal to?

I'm assuming the definitions would be in the .cfg file

and that I need to add code to each html.pl file as well as db.cgi ???

Alternatively, could I have separate files for the footer and menu and call them from a single html.pl for each database? (That would still be six more files for each client, but it would be a LOT less information and less difficult to maintain!)

Just not sure how to proceed. Thanks for any help!

Lynette



PS This is an example of the Code that needs to change in the sub html_footer of each of my 6 html.pl files:

sub html_footer {
# --------------------------------------------------------
print qq!<P align=center><FONT FACE='Verdana, Arial, Helvetica' Size=1>!;
print qq!| <A HREF="$db_script_link_url">Main Menu</A> !;
print qq!| <A HREF="$db_script_url?db=demofa&uid=$db_uid">Fixed Assets (Inventory)</A> ! if ($per_fa_add);
print qq!| <A HREF="$db_script_url?db=demostruc&uid=$db_uid">Structures</A> |<BR>! if ($per_cap_add);
print qq!| <A HREF="$db_script_url?db=demoimp&uid=$db_uid">Improvements to Land</A> ! if ($per_imp_add);
print qq!| <A HREF="$db_script_url?db=demoland&uid=$db_uid">Land Parcels</A> |<br>! if ($per_lnd_add);
print qq!| <A HREF="$db_script_url?db=demorpt&uid=$db_uid">Reports</A> |<br>! if ($per_reports);
print qq!| <A HREF="$db_script_link_url&site_admin_display=1">User Admin</A> ! if ($per_siteadmin);
print qq!| <A HREF="$db_script_link_url&admin_display=1">AVS Admin</A> ! if ($per_avsadmin);
print qq!| <A HREF="$db_script_link_url&change_password_form=1">Change Password</A> ! unless ($db_userid eq "default");
print qq!| <A HREF="$db_script_link_url&change_email_form=1">Change Email</A> ! unless ($db_userid eq "default");
print qq!| <A HREF="$db_script_link_url&logoff=1">Log Off</A> !;
print qq!|</font></p>!;

}
Lynette
Hollister, Ca

Last edited by:

ltillner: May 1, 2003, 3:15 PM
Quote Reply
Re: [ltillner] generic DB name in html.pl files? In reply to
I figured this out! Here's what you do if you have multiple clients each having a set of multiple DB's but you want to use only one html.pl file or files:

In the .cfg file for each .db of each client add:

#Database names used to call another client specific database from within one master html.pl file(s)

$db_1 = "thisdbname1"

$db_2 = "thisdbname2"

etc.

Then in each html.pl file change the links to the external db's called from sub_footer and anywhere else you call them (I use a main menu defined in my clientdef.cfg)

change the link which would normally look like:

print qq!| <A HREF="$db_script_url?db=thisdbname2&uid=$db_uid">Fixed Assets (Inventory)</A> ! if ($per_fa_add);


to this:

print qq!| <A HREF="$db_script_url?db=$db_2&uid=$db_uid">Fixed Assets (Inventory)</A> ! if ($per_fa_add);


And that does it.

HTH some one else!
Lynette
Hollister, Ca