Gossamer Forum
Home : Products : DBMan : Installation :

Simple HTML query/htlm.pl update agita

Quote Reply
Simple HTML query/htlm.pl update agita
Okay, just some simple HTML questions if that's allowed. It's related to trying to update output form in DBMan.

1. Even though my Search fields always Come up bold, can I make my "primary" field (Name) ALWAYS appear in bold or a different color when searched?
I have a database that is viewable to non-registered users from a proprietary home page. Since I am the only administrator, I'm the only one who sees the Modify/Add etc. views. So:

2. In html.pl, what is the difference between the code in html_page_top and Record Layout? Does one affect the layout of the Search output, and the other the admin output?

3. Is it possible to change the COLOR of the VIEW RECORDS button? <INPUT TYPE="submit" NAME="VIEW RECORDS" vALUE="vIEW reCORDS"
Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
Hi,
I'm here for help myself, but it seems like the regulars are busy today.

Perhaps I can help you a little bit.

The page top is just that. The head and body tags, plus the top of the table (navy blue out of the box).

You can define how your forms will look with standard html tags.

sub_html footer is the bottom -the menu items.Format these any way you like around the <A HREF></A> tags-between the print commands.

sub html_search_options is the bottom of the search form.

Record Layou is the long and short (JPD' friendly html.pl) record display. Again, use your standard HTML formatting betwen print commands.

I don't think that there is any html to change the buttons, but you can use alternate images in place of the buttons. I think I saw some reference to that in here somewhere.

Hope that helps
Fred

Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
Sorry to be late in responding. I was up until 4am, so I've only been awake for a little while.

Quote:
Even though my Search fields always Come up bold, can I make my "primary" field (Name) ALWAYS appear in bold or a different color when searched?

Do you want it to be in a different color when someone searches on the Name field, or do you just want the Name field to be bold or in a different color all the time? If the latter, all you need to do is change things in html_record. (You'll also have to not use autogenerate.)

If you have created your own html_record, you could post a portion of it here and tell me what you want to do and I will show you how to do it.

Fred answered your other questions very well. Smile (Thanks Fred!)


------------------
JPD





Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
Sorry to be so dim, but perhaps I didnt explain myself well enough:

Yes, I want one field to always appear in a different color, BUT I haven't writtne my own html_record. If I turn OFF autogenerate, what part of html.pl will my newly created html_record replace? Where do I put it? in my DBMan directory or is it part of html.pl

Fred, you said: "You can define how your forms will look with standard html tags. " but, it seems that I'd have to create my own record_html per JPD's remarks? Guess I'm not sure WHERE to put the <HTML> tags.

Also, in the Record Layout, with all the print commands, must I change the "original" 'ID', 'Title', 'Category' fields to match my database? changing the Record Layout portion doesn't seem to DO anything??

One final thing, my search result output (the page you get after a succsesful search won't line up agains the top left as I'd like it to. I've tried every HTML tag I know within the table (and outside) I can't understand what's pushing it downwards?

Thanks again for your help!!

www.bestweb.net/~cyborgny/tob/cgi-bin/dbman/main.html
Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
 
Quote:
If I turn OFF autogenerate, what part of html.pl will my newly created html_record replace?

Basically, auto_generate does exactly that, it creates the records and forms dynamically from your database definition. If you turn auto_generate off, it uses the subroutines in html.pl to display, so they'll have to be modified to suit the fields in your database.

Quote:
it seems that I'd have to create my own record_html per JPD's remarks? Guess I'm not sure WHERE to put the <HTML> tags

If you mean the actual <html> and </html> tags, you don't have to, dbMan will do that for you. You just have to edit the html between the "print qq~" and "~;" 's in the subroutines in html.pl to look like what you want, using the html you would use to create a normal page, and ensuring that it matches up with your database definition.

Quote:
must I change the "original" 'ID', 'Title', 'Category' fields to match my database? changing the Record Layout portion doesn't seem to DO anything??

Yes, to set up the database with the fields you want, you have to go into the .cfg file and edit the db_defintion, according to the spec that Alex gives you. He's also created a handy tool to do this for you, at gossamer-threads.com/scripts/dbman/build.cgi .

Sorry, I really must be off, but if you have any more questions, don't be afraid to ask.

adam
Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
Hey Cyborg

I looked at your search results, and found
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="100" WIDTH="640" HEIGHT="480" ALIGN="left" VALIGN="TOP">

<TR>
<TD WIDTH="202" ALIGN="LEFT" VALIGN="TOP">

You should adjust the CELLSPACING way down from 100.
The <TR> tag should probably have a rowspan="2" <TR rowspan="2">. Which will make the copy longer/narrower.
Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
Let's see if I can add to the confusion. Smile

You need to make your own sub html_record_form and sub html_record. These subroutines are in html.pl.

This is the basic sub html_record that you would use for your database:

Code:
sub html_record_form {
my (%rec) = @_;

print qq|
<table border=0>
<tr><td align=right valign=top width=20%><$font>Name:</font></td>
<td width=80%><input type=text name="Name" value="$rec{'Name'}" size="40" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Address:</font></td>
<td><input type=text name="Address" value="$rec{'Address'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>CrossStreets:</font></td>
<td><input type=text name="CrossStreets" value="$rec{'CrossStreets'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>SubwayStop:</font></td>
<td><input type=text name="SubwayStop" value="$rec{'SubwayStop'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Neighborhood:</font></td>
<td>|; print &build_select_field("Neighborhood","$rec{'Neighborhood'}"); print qq|</td></tr>
<tr><td align=right valign=top><$font>Phone:</font></td>
<td><input type=text name="Phone" value="$rec{'Phone'}" size="10" maxlength="10"></td></tr>
<tr><td align=right valign=top><$font>Price:</font></td>
<td>|; print &build_select_field("Price","$rec{'Price'}"); print qq|</td></tr>
<tr><td align=right valign=top><$font>Avg.Price:</font></td>
<td><input type=text name="Avg.Price" value="$rec{'Avg.Price'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Cuisine:</font></td>
<td><input type=text name="Cuisine" value="$rec{'Cuisine'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Ambience:</font></td>
<td><input type=text name="Ambience" value="$rec{'Ambience'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Reservations:</font></td>
<td><input type=text name="Reservations" value="$rec{'Reservations'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Alchohol:</font></td>
<td><input type=text name="Alchohol" value="$rec{'Alchohol'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Smoking:</font></td>
<td><input type=text name="Smoking" value="$rec{'Smoking'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Days/Hours:</font></td>
<td><input type=text name="Days/Hours" value="$rec{'Days/Hours'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Comments:</font></td>
<td><textarea name="Comments" rows=4 cols=40>$rec{'Comments'}</textarea></td></tr>
<tr><td align=right valign=top><$font>Links:</font></td>
<td><input type=text name="Links" value="$rec{'Links'}" size="20" maxlength="50"></td></tr>
<tr><td align=right valign=top><$font>Zip:</font></td>
<td><input type=text name="Zip" value="$rec{'Zip'}" size="10" maxlength="50"></td></tr>
</TABLE>
|;
}

If you copy the above and paste it over the matching subroutine in html.pl, you will end up with the same form that you got when you used autogenerate. But now you can make changes to it.

You also should make your own html_record. Here it is:

Code:
sub html_record {
my (%rec) = @_;

print qq|
<table border=0>
<tr><td align=right valign=top width=20%><$font_color>Name:</font></td>
<td width=80%><$font>$rec{'Name'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Address:</font></td>
<td><$font>$rec{'Address'}</font></td></tr>
<tr><td align=right valign=top><$font_color>CrossStreets:</font></td>
<td><$font>$rec{'CrossStreets'}"</font></td></tr>
<tr><td align=right valign=top><$font_color>SubwayStop:</font></td>
<td><$font>$rec{'SubwayStop'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Neighborhood:</font></td>
<td><$font>$rec{'Neighborhood'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Phone:</font></td>
<td><$font>$rec{'Phone'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Price:</font></td>
<td><$font>$rec{'Price'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Avg.Price:</font></td>
<td><$font>$rec{'Avg.Price'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Cuisine:</font></td>
<td><$font>$rec{'Cuisine'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Ambience:</font></td>
<td$rec{'Ambience'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Reservations:</font></td>
<td><$font>$rec{'Reservations'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Alchohol:</font></td>
<td><$font>$rec{'Alchohol'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Smoking:</font></td>
<td><$font>$rec{'Smoking'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Days/Hours:</font></td>
<td><$font>$rec{'Days/Hours'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Comments:</font></td>
<td><$font>$rec{'Comments'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Links:</font></td>
<td><$font>$rec{'Links'}</font></td></tr>
<tr><td align=right valign=top><$font_color>Zip:</font></td>
<td><$font>$rec{'Zip'}</font></td></tr>
</TABLE>
|;
}

Again, this is the same display you get when you use autogenerate. But you can work with it now.

I have tested these to make sure there aren't any syntax errors. Just be sure to match up the first line of the subroutine
sub html_record_form {

and the last line of the subroutine
}

with the lines from the subroutines I've posted here.




------------------
JPD





Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
OOOHhhhhhhhh!!!! Thank you so much every suggestions helped and for the most part worked beautifully. Don't know how to thank you all!

EXCEPT!!! Now I'm having MUCH TROUBLE modifying my records?? I must have screwed something up, but doesn't seem too bad since everything else seems to work. Any ideas?

When I search, sometimes I get 5 results, but only " in the found field ?? Thanks again.

------------------
Catalyst for the new millenium
Quote Reply
Re: Simple HTML query/htlm.pl update agita In reply to
I took all of the information for the subroutines from your website and the form that was autogenerated. I think there may be some problems with some of your fields, though.

I really can't work on it any more today, though. I have to get to work. Smile


------------------
JPD