Rimu and Recycled Rimu Furniture
Rimu and Wooden Furniture Centre, Auckland, NZ
346 Rosebank Road, Avondale (beside BOC Gas Company), Auckland
email: info@simplywood.co.nz ph: 09 8261044


    Featured Products:

rimu and other wooden furniture 346 Rosebank Road, Avondale, Auckland (beside BOC Gas Company) ph.: 09-8261044 e: info@simplywood.co.nz   w: www.simplywood.co.nz
Open 6 days : Mon - Fri 10 - 5; Sat 10 - 4; Holidays closed
Specializing in NZ made solid wooden furniture and New Zealand Made Rimu Furniture
And here is the code to produce this page: <%@ Page Language="VB" Debug="True" %> <%@ Register TagPrefix="myControl" TagName="Header" Src="Public_header.ascx" %> <%@ Register TagPrefix="myControl" TagName="Menu" Src="Public_Menu.ascx" %> <%@ Register TagPrefix="myControl" TagName="Footer" Src="Public_footer.ascx" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.IO" %> <script runat="server"> Public strConnection, strDatapath, connString As String Dim FileContent As String Dim myConn As OleDbConnection Dim myCmd As OleDbCommand Dim SelectStr As String Sub OpenMyConn(ByVal param_SQL As String) Try 'ConfigurationSettings.AppSettings("MyConnString") is set in web.config 'the following 2 lines to retrieve them from web.config ' these two string variables are Public strConnection = ConfigurationSettings.AppSettings("MyConnString") strDatapath = ConfigurationSettings.AppSettings("MyDataPath") connString = strConnection & Server.MapPath(strDatapath) myConn = New OleDbConnection(connString) myCmd = New OleDbCommand(param_SQL, myConn) myConn.Open() Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'Open conn Sub CloseMyConn() Try myConn.Close() myConn = Nothing myCmd = Nothing Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'Close conn ============== Sub ShowCategory(ByVal SomeString As String) Try 'show category data only Dim myDR As OleDbDataReader Dim tcol, maxcol, trow, maxrow As Integer Dim j, m As Integer 'index Dim ArrID As New ArrayList Dim ArrCat As New ArrayList Dim ArrDesc As New ArrayList j = 0 ' array index tcol = 0 'tcol=current column trow = 0 'trow=current row SelectStr = "SELECT * FROM tbl_Category WHERE Valid=-1 AND Keyword=-1 ORDER BY Category" OpenMyConn(SelectStr) myDR = myCmd.ExecuteReader 'Store myDR data into array While myDR.Read ArrID.Add(myDR("Cat_ID")) ArrDesc.Add(myDR("Cat_Descr")) ArrCat.Add(myDR("Category")) j = j + 1 ' j now is 1 more than array cells index but equals the number of cells End While maxcol = 1 'max column to display If (j) Mod (maxcol) = 0 Then 'if no remainder maxrow = Int((j) / maxcol) Else 'if any remainder maxrow = Int((j) / maxcol) + 1 End If ' if to display one column, then the modulo operation will never have remainder ' and will need to be added by 1 If maxcol = 1 Then maxrow = j 'create table for heading Response.Write("<table border='0'><tr><td class='white'><h3>Browse Product Categories:</h3></td></tr></table>") Response.Write("<div align='left'><table>") For trow = 0 To maxrow - 1 'row loop Response.Write("<tr>") 'start row For tcol = 0 To maxcol - 1 'column loop m = (maxrow * (tcol) + trow) 'm is the variable to replace j If m <= j - 1 Then Response.Write("<td class='white' valign='top'><li></td>") Response.Write("<td class='white'><a class='linkwhite' href='SearchProduct.aspx?Cat_ID=" & ArrID(m) & "'>" & SomeString & " " & (ArrCat(m)) & "</a>") 'the followingline is for the description Response.Write(", <a class='linkwhite' href='SearchProduct.aspx?Cat_ID=" & ArrID(m) & "'>" & ArrDesc(m) & "</a><br><br></td>") End If If tcol = maxcol - 1 Then Response.Write("</tr>") ' close row when reached max col Next Next Response.Write("</table></div>") 'close table myDR.Close() CloseMyConn() Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'end ShowCategory ============== Sub ShowFeaturedProducts() Try 'Dim myCmd As OleDbCommand Dim strSelect As String Dim myDR As OleDbDataReader 'myConn = New OleDbConnection(connString) ' Get all the records to show strSelect = "SELECT tbl_PriceList.*, 10*Int((cost*2.05)/10)+ 9 as RRP, " _ & "tbl_Supplier.ShortName, tbl_Supplier.SortOrder, tbl_Supplier.Supp_ID, " _ & "tbl_Material.*, tbl_Styles.*, tbl_Category.* " _ & "FROM tbl_Material INNER JOIN " _ & "(tbl_Styles INNER JOIN (tbl_Supplier INNER JOIN " _ & "(tbl_Category INNER JOIN tbl_PriceList " _ & "ON tbl_Category.Cat_ID=tbl_PriceList.Cat_ID) " _ & "ON tbl_Supplier.Supp_ID=tbl_PriceList.Supp_ID) " _ & " ON tbl_Styles.Style_ID=tbl_PriceList.Style_ID) " _ & " ON tbl_Material.Material_ID=tbl_PriceList.Material_ID " _ & " WHERE Featured=true " _ & " AND tbl_PriceList.Valid=true AND tbl_PriceList.Website=true " _ & " AND StartDate<=now() AND EndDate>=now() " _ & " ORDER BY Landscape, Enddate" 'Response.Write(strSelect) 'myCmd = New OleDbCommand(strSelect, myConn) ' Open the connection, execute the command, and close the connection. 'myConn.Open() OpenMyConn(strSelect) myDR = myCmd.ExecuteReader 'create table Dim tcol, maxcol, trow, maxrow As Integer Dim j, m As Integer 'index Dim ArrID As New ArrayList Dim ArrUrl As New ArrayList Dim ArrDesc As New ArrayList Dim arrSuppl As New ArrayList Dim arrMaterial As New ArrayList 'Dim ArrLndscp As New ArrayList j = 0 ' array index tcol = 0 'tcol=current column trow = 0 'trow=current row 'Store myDR data into array While myDR.Read ArrID.Add(myDR("Price_ID")) ArrDesc.Add(myDR("Description")) ArrUrl.Add(myDR("Img_ID")) arrSuppl.Add(myDR("Shortname")) arrMaterial.Add(myDR("Material")) 'ArrLndscp.Add(myDR("Landscape")) j = j + 1 ' j now is 1 more than array cells index but equals the number of cells End While If j >= 1 Then ' if there is no record found then skip the whole table thing 'Response.Write("J=" & j) maxcol = 3 'max column to display If (j) Mod (maxcol) = 0 Then 'if no remainder maxrow = Int((j) / maxcol) Else 'if any remainder maxrow = Int((j) / maxcol) + 1 End If ' if to display one column, then the modulo operation will never have remainder ' and will need to be added by 1 If maxcol = 1 Then maxrow = j 'create table Response.Write("<table border='1'><tr><td class='white' bgcolor='#EAC888' colspan='" & maxcol & "'>Recently completed customer orders:</td></tr>") m = 0 For trow = 0 To maxrow - 1 'row loop Response.Write("<tr bgcolor='#EAC888'>") 'start row For tcol = 0 To maxcol - 1 'column loop Response.Write("<td class='white' valign='bottom'><table cellpadding='0' bgcolor='#EAC888'>") 'm = (maxrow * (tcol) + trow) 'm is the variable to replace j 'Response.Write("m=" & m) 'If m <= j - 1 Then Response.Write("<tr><td><a href='ShowDetail.aspx?Item_ID=" & ArrID(m) & "'><img src='/apps/images/" & ArrUrl(m) & "' width='150' border='none'/></a></td></tr>") Response.Write("<tr height='40'><td class='brown'>" & arrMaterial(m) & " " & ArrDesc(m) & _ ", price $<a href='ShowDetail.aspx?Item_ID=" & ArrID(m) & "'>(more...)</a></td></tr>") 'Response.Write("<tr height='30'><td>" & ArrDesc(m) & "</td></tr>") Response.Write("<tr><td class='brown'><li>Product ID no:" & ArrID(m) & "</td></tr>") Response.Write("<tr height='10'><td> </td></tr>") Response.Write("</table></td>") If m < (j - 1) Then m = m + 1 Else Exit For End If 'End If If tcol = maxcol - 1 Then Response.Write("</tr>") ' close row when reached max col Next Next Response.Write("</table>") 'close table End If myDR.Close() CloseMyConn() Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'ShowFeaturedProducts =================== Sub ShowKeywords(ByVal SomeString As String) 'to be called in the HTML <head> section for keywords Try Dim myDR As OleDbDataReader Dim n As Integer n = 0 SelectStr = "SELECT * FROM tbl_Category WHERE Valid=-1 ORDER BY Category" OpenMyConn(SelectStr) myDR = myCmd.ExecuteReader Response.Write("<meta content = " & Chr(34)) While myDR.Read() n = n + 1 If n = 1 Then Response.Write(SomeString & " " & myDR("category")) Else Response.Write("," & SomeString & " " & myDR("category")) End If End While Response.Write(Chr(34) & " name = " & Chr(34) & "keywords" & Chr(34) & "/>" & Chr(13)) myDR.Close() CloseMyConn() Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'ShowKeywords ==================== Sub ShowDescription(ByVal SomeString As String) 'to be called in the HTML <head> section for description Try Dim myDR As OleDbDataReader Dim n As Integer n = 0 SelectStr = "SELECT * FROM tbl_Category WHERE Valid=-1 ORDER BY Category" OpenMyConn(SelectStr) myDR = myCmd.ExecuteReader Response.Write("<meta content = " & Chr(34)) While myDR.Read() n = n + 1 If n = 1 Then ' first category to include these words Response.Write("One stop shop for " & SomeString & " " & myDR("category")) Else 'second cat and so on Response.Write(", " & SomeString & " " & myDR("category")) End If End While Response.Write(Chr(34) & " name = " & Chr(34) & "description" & Chr(34) & "/>" & Chr(13)) myDR.Close() CloseMyConn() Catch ex As Exception Response.Redirect("Error.aspx") End Try End Sub 'ShowDescription ======================= </script>
Web hosting by Somee.com