home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
sharewar
/
gdidbpro
/
data1.cab
/
Example_Files
/
projects
/
default
/
foodstore.scp
< prev
next >
Wrap
Text File
|
2000-05-26
|
4KB
|
138 lines
##########################################################
# GDIdb demo script (c) 1998 Global Data Industries
#
# In this basic example, the contents of the spreadsheet
# is merged with the site html using html table tags,
# producing a table similar to the spreadsheet itself.
##########################################################
##########################################################
# declare variable used by script
&defvar(?name?)
##########################################################
# Print the information screen
&cls
&print("Foodstore Demo Script")
&print("---------------------------------")
##########################################################
# get the name of the person running the script
&input(?name?,"Please enter your name")
##########################################################
# Declare the ODBC datasource
&datasource("Driver={Microsoft Excel Driver (*.xls)};DBQ=foodstore.xls")
##########################################################
# generate html
&print("Generating HTML...")
&html("index.html")
{
<HTML>
<HEAD>
<TITLE>The Essential Programmer's Online Foodstore</TITLE>
</HEAD>
<BODY BACKGROUND="burger.gif">
<IMG SRC="fries.gif" ALIGN=LEFT>
<IMG SRC="fries.gif" ALIGN=RIGHT>
<CENTER>
<BR><BR>
<FONT COLOR="\#B48424">
<H1>The Essential Programmer's<BR>
Online Foodstore</H1>
</FONT>
<BR CLEAR=LEFT>
<TABLE BORDER=0 WIDTH="80%">
<TR><TD><FONT FACE="Arial,Helvetica">
<P>Here at <B>The Essential Programmer's Online Foodstore,</B>
we <I>know</I> a serious coding session requires <I>full and professional</I>
support. That's why we've given you that support. Where you want it. Online.
When you want it. 24 Hours a day. Every day. (Unless we're at the beach)
<P>The Essential Programmer's Online Foodstore. More than just a luxury, we
<I>DARE</I> you to try programming without our URL in your bookmarks!
<BR><BR><BR>
<FONT COLOR=RED SIZE="+1">Site updated
# only include user's name if they actually bothered to enter it!
&if("",ne,"?name?")
{
by ?name?
}
at ?gdidbtime? on ?gdidbdate.dn? ?gdidbdate?.</FONT>
</FONT>
</TD></TR>
</TABLE>
</CENTER>
<BR><BR><BR>
<CENTER>
<IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif">
</CENTER>
<FONT SIZE="+3">Price list:</FONT><BR>
<TABLE WIDTH="100%">
<TR>
<TD><FONT SIZE="+2">Item</FONT></TD>
<TD><FONT SIZE="+2">Stock</FONT></TD>
<TD><FONT SIZE="+2">Cost</FONT></TD>
<TD><FONT SIZE="+2">Per</FONT></TD>
<TD><FONT SIZE="+2">VAT</FONT></TD>
<TD><FONT SIZE="+2">Delivery</FONT></TD>
<TD><FONT SIZE="+2">Total</FONT></TD>
</TR>
# loop through each row of the recordset, turning the spreadsheet
# table into a HTML table
&getdata("SELECT * FROM sheet")
{
<TR>
<TD>?Item?</TD>
<TD>?Stock?</TD>
<TD>ú?Cost?</TD>
<TD>?Per?</TD>
<TD>ú?VAT?</TD>
<TD>ú?Delivery?</TD>
<TD>ú?Total?</TD>
</TR>
}
</TABLE>
<CENTER>
<IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif">
</CENTER>
</BODY>
</HTML>
}
##########################################################
# print closing information
&cls
&print("Demo web site HTML generation complete! Click the Preview HTML button to see the results.")
&print
&print
# END OF SCRIPT