Stuart McLachlan
stuart at lexacorp.com.pg
Fri Sep 25 23:29:34 CDT 2009
On 26 Sep 2009 at 4:53, Max Wanadoo wrote:
> Stuart:
> Wow, that must have taken a whole lot of time to hand-craft those sites.
> They look very good.
>
It's not really as complicated as it looks. I leave the fancy design to my offsider at
Cybermasta.com. All the nice stuff such as the header, footer, sidebars, style sheets etc
goe in Server Side Includes or templates. I just do the grunt work on the data.
Basically, it's a matter of
Create a Table Definition
Loop through a recordset with a few Print # statements in the loop to embed each record in
a table row
Read/write the footer template.
Here's the relevant code for the Job Vacancies page:
Print #1, <!--#include file="Header.inc" -->"
'Define Table
Print #1, "<p align=center>"
Print #1, "<table width=90% cellpadding=2 cellspacing=0 border=0 class=normal_b>"
Print #1, "<COL width=""8%""><COL width=""27%""> <COL width=""25%""><col width =
""20%""><col width = ""10%""><col width = ""10%"">"
'Print Header Row
Print #1, "<tr bgcolor=""#000066"" class=normal_w>"
Print #1, "<td align=center><strong>Position No.</strong></td>"
Print #1, "<td align=center><strong>Position</strong></td>"
Print #1, "<td align=center><strong>Organization</strong></td>"
Print #1, "<td align=center><strong>Location</strong></td>"
Print #1, "<td align=center><strong>Closing Date</strong></td>"
Print #1, "<td align=center><strong> </strong></td>"
Print #1, "<td align=center><strong> </strong></td>"
Print #1, "<td align=center><strong> </strong></td>"
Print #1, "</tr>"
'Print Data Rows
Set rs = CurrentDb.OpenRecordset("SELECT * FROM qryWebJobs order by GpCode,
CLosingDate desc,OrganisationName,PositionTitle")
Do While Not rs.EOF
If strGpCode <> rs!gpcode Then 'show group header row
Print #1, "<tr bgcolor=""dddddd""><td colspan = ""8"" align=center><strong><br><a
Name=""OC" & rs!gpcode & """>" & rs!gpClass & "</a><br></strong></td></tr>"
strGpCode = rs!gpcode
End If
Print #1, "<tr>"
Print #1, "<td align=center valign=top>" & rs!Posnum & "</td>"
Print #1, "<td align=left valign=top>" & rs!PositionTitle & "</td>"
If rs!ShowClientName Then
Print #1, "<td align=left valign=top>" & rs!OrganisationName & "</td>"
Else
Print #1, "<td align=left valign=top>" & Nz(rs!GenericName, " ") & "</td>"
End If
Print #1, "<td align=left valign=top>" & rs!Location & "</td>"
Print #1, "<td align=left valign=top>" & IIf(rs!ClosingDate < Date, "Closed",
Format(rs!ClosingDate, "d mmm yy")) & "</td>"
Print #1, "<td align=left valign=top>" & IIf(rs!RestPNG, "PNG Citizens Only", " ") &
"</td>"
Print #1, "<td align=center valign=top><a href=""PDF_files/VI-PosDescr-" & rs!Posnum &
".pdf""><img src=""http://www.vanguardpng.com/images/job_details.gif"" width=""61""
height=""20"" border=""0"" alt=""job_details.gif - 450 Bytes""></a></td>"
Print #1, "<td align=center valign=top><a href=""docs/VI-Appln-" & rs!Posnum &
".doc""><img src=""http://www.vanguardpng.com/images/apply_for_job.gif"" width=""53""
height=""20"" border=""0"" alt=""apply_for_job.gif - 397 Bytes""></a></td>"
Print #1, "</td>"
Print #1, "</tr>"
rs.MoveNext
Loop 'End Vacancy Loop
Print #1, "</table>"
Print #1, <!--#include file="Footer.inc" -->"