<%@ LANGUAGE = PerlScript %><% use Win32::ADO; use Win32::ASP qw(:strict); use Win32::ASP qw/SetCookie/; use strict; $Response->{Buffer} = 1; use constant adCmdStoredProc => 0x0004; use constant adInteger => 3; use constant adVarChar => 200; use constant adParamOutput => 0x0002; use constant adParamInput => 0x0001; use constant adOpenForwardOnly => 0; use constant adOpenDynamic => 2; use constant adOpenStatic => 3; use constant adLockOptimistic => 3; $Response->{Buffer} = 1; ### Read Application Variables ### my $mySQL = $Application->Contents('Connection'); my $MyConn = $Server->CreateObject("ADODB.Connection"); $MyConn->Open($mySQL); my $ProductID = $Request->QueryString("ProductID")->Item(1); my $Page = $Request->QueryString("Page")->Item(1); my $Category = $Request->QueryString("Category")->Item(1); &ShowPics if ($ProductID > 0 && $Page > 0 && $Category > 0); $Response->Redirect("../"); exit; sub ShowPics { my $IntPicQTY; my $AddRS = $MyConn->Execute("SELECT ProductName FROM ProductsTable WHERE ProductID = $ProductID"); my $ProductTitle = $AddRS->Fields("ProductName")->Value; $AddRS->Close; my $AddRS = $MyConn->Execute("SELECT PictureFile FROM AdditionalPics WHERE ProductID = $ProductID"); #my $rsInt = $Server->CreateObject("ADODB.Recordset"); #$rsInt->Open("SELECT * FROM InteriorPics WHERE RVID = $RVID", $MyConn, adOpenStatic, adLockOptimistic); &IMGHeader; $Response->Write("$ProductTitle - Additional Pictures\n"); %>
<% $Response->Write("

$ProductTitle - Additional Pictures


\n"); %> <% my $ColCount; my $PictureFile; $Response->Write("\n"); while (!$AddRS->EOF) { $PictureFile = $AddRS->Fields("PictureFile")->Value; if ($ColCount eq 2) { #End the row and start fresh $Response->Write("\n"); $Response->Write("\n"); $ColCount = 0; } $Response->Write("\n"); $ColCount++; $AddRS->MoveNext; } %>
\n"); #Write out the pic $Response->Write("\n"); $Response->Write("
<% if ($Category > 0 && $ProductID > 0) { %>
'">
<% } %>
<% &HTMLFooter; $MyConn->Close; $Response->End; exit; } %> <% sub IMGHeader { # Does header file exist my $HeaderFile = $Application->Contents('IMGHeader'); my $FullPath = $Application->Contents('FullPath'); my $HeaderPath = "$FullPath\\$HeaderFile"; my $FSYS = $Server->CreateObject("Scripting.FileSystemObject"); if ($FSYS->FileExists($HeaderPath)) { my $HTMLFile = $FSYS->OpenTextFile($HeaderPath); my $AllFile = $HTMLFile->ReadAll(); $Response->Write("$AllFile\n"); $FSYS->Close(); } else { my $subtitle = "Shopping Cart"; my $title = $Application->{'SiteTitle'}; if (length($subtitle) > 0) { $title .= ": $subtitle"; } %> <%= $title %> <% } ## } %> <% sub HTMLFooter { # Does Footer file exist my $FooterFile = $Application->Contents('HTMLFooter'); my $FullPath = $Application->Contents('FullPath'); my $FooterPath = "$FullPath\\$FooterFile"; my $FSYS = $Server->CreateObject("Scripting.FileSystemObject"); if ($FSYS->FileExists($FooterPath)) { my $HTMLFile = $FSYS->OpenTextFile($FooterPath); my $AllFile = $HTMLFile->ReadAll(); $Response->Write("$AllFile\n"); $FSYS->Close(); } else { %> <% } %>

HOME

E-Mail: <%=$Application->Contents('Email')%>

<%=$Application->Contents('Copyright')%>
Produced by 1st Internet Resources

<% } %>