<% @language="vbscript" %> <% Sub AddItemToCart(iItemID, iItemCount) If dictCart.Exists(iItemID) Then dictCart(iItemID) = dictCart(iItemID) + iItemCount Else dictCart.Add iItemID, 1 End If 'Response.Write iItemCount & " of item # " & iItemID & " have been added to your cart.

" & vbCrLf End Sub Sub RemoveItemFromCart(iItemID, iItemCount) If dictCart.Exists(iItemID) Then If dictCart(iItemID) <= iItemCount Then dictCart.Remove iItemID Else dictCart(iItemID) = dictCart(iItemID) - iItemCount End If 'Response.Write iItemCount & " of item # " & iItemID & " have been removed from your cart.

" & vbCrLf Else Response.Write "Couldn't find any of that item your cart.

" & vbCrLf End If End Sub function Counter(sql) Dim con, objRS1 set objRS1 = server.CreateObject("ADODB.RecordSet") set con = server.CreateObject("ADODB.Connection") con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" con.Open Set objRS1 = con.Execute(sql) if objRS1.EOF and objRS1.BOF and objRS1.Recordcount<=0 then 'response.write("Sorry, No Products found foe search, please search Another.") exit function else dim ii ii=0 objRS1.movefirst do while not objRS1.eof objRS1.movenext ii= ii + 1 loop end if objRS1.close response.write counter counter = ii End function sub head() %>

<% end sub sub footer() %>


Developed by e-Soft Solutions

<% end sub sub filler() %>

<% end sub Sub ShowCatalog(pg) 'display search option call head dim dbProducts Set dbProducts = Server.CreateObject("ADODB.Connection") dbProducts.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/products.mdb") dbProducts.Open() %>

Search For    in Category

<% Dim aParameters ' as Variant (Array) dim bParameters Dim I dim pgitems pgitems = 9 ' Defualt Page size Dim iItemCount ' Number of items we sell dim cat txt = request("txtsearch") cat = request("category") if session("back") <> 0 then if session("last1") <> "" then txt=session("last1") end if if session("last2") <> "" then cat=session("last2") end if session("back")=0 else end if session("last1") = txt session("last2") = cat if cat <> "" then if txt <> "" then sqls="select * from productDetail where [productGroup] like '%" & cat & "%'" & " and ([productName] like '%" & txt & "%' Or [productDetails] like '%" & txt & "%'" & " Or [keywords] like '%" & txt & "%') order by productDate desc, productid desc" else sqls="select * from productDetail where [productGroup] like '" & cat & "'" & " order by ProductDate Desc, productid desc" end if else if txt <> "" then sqls="select * from productDetail where [productName] like '%" & txt & "%' Or [productGroup] like '%" & txt & "%'" & " Or [productDetails] like '%" & txt & "%'" & " Or [keywords] like '%" & txt & "%' order by productDate desc, productid desc" else sqls="select * from productDetail order by productDate desc, productid desc" end if end if iItemCount = counter(sqls) ctr = iItemcount/pgitems if ctr<=0 then else Response.Write "

Go to Page No : " i = 1 do while i <= ctr+1 if cint(pg)=cint(i) then response.write i response.write " " else %> &category=<%= request.querystring("category") %>"><%= i %> <% end if i=i+1 loop end if Dim con, objRS1 set objRS = server.CreateObject("ADODB.RecordSet") set objRS2 = server.CreateObject("ADODB.RecordSet") set con = server.CreateObject("ADODB.Connection") con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" con.Open i = 1 on error resume next if cat <> "" then if txt <> "" then sqls="select * from productDetail where [productGroup] like '%" & cat & "%'" & " and ([productName] like '%" & txt & "%' Or [productDetails] like '%" & txt & "%'" & " Or [keywords] like '%" & txt & "%') order by productDate desc, productid desc" else sqls="select * from productDetail where [productGroup] like '" & cat & "'" & " order by ProductDate Desc, productid desc" end if else if txt <> "" then sqls="select * from productDetail where [productName] like '%" & txt & "%' Or [productGroup] like '%" & txt & "%'" & " Or [productDetails] like '%" & txt & "%'" & " Or [keywords] like '%" & txt & "%' order by productDate desc, productid desc" else sqls="select * from productDetail order by productDate desc, productid desc" end if end if Set objRS = con.Execute(sqls) Set objRS2 = con.Execute(sqls) 'response.write objRS.Recordcount if objRS.EOF and objRS.BOF and objRS.Recordcount <= 0 then response.write("Sorry, No Products found for the search, please search Another.") exit sub else dim ii ii=0 end if %>

My Inquiry Cart

<% dim z if page=0 then page=1 else page = page end if c = (page-1) * pgitems z = page * pgitems 'response.write c 'response.write z dim f dim last dim g Dim Ar1(1000) Dim Ar2(1000) Dim Ar3(1000) Dim Ar4(1000) Dim Ar5(1000) Dim Ar6(1000) Dim Ar7(1000) Dim Ar8(1000) Dim Ar9(1000) Dim Ar10(1000) Dim Ar11(1000) Dim Ar12(1000) dim k last=1 f=1 k=0 do while not objRS2.eof ar1(k)=objRS2("Productid") ar2(k)=objRS2("Productname") ar3(k)=objRS2("Productweight") ar4(k)=objRS2("ProductDetails") ar5(k)=objRS2("ProductThumb") ar6(k)=objRS2("Productimage") ar7(k)=objRS2("productGroup") ar8(k)=objRS2("productlength") ar9(k)=objRS2("productorigin") ar10(k)=objRS2("productavailability") ar11(k)=objRS2("productquality") ar12(k)=objRS2("productweightunit") objRS2.movenext k=k+1 loop ar1(k)="End" dim l l=0 Do while ar1(l) <> "End" if l > c-1 and l < z-1 then %> <% if ar1(l+1)="End" then filler exit do end if %>
<%= ar4(l) %>

<% if ar1(l) <> "" then %> Add for Inquiry <% else %> Can't Add! <% end if %>

 

Name   : <%= ar2(l) %>

 

Group : <%= ar7(l) %>

 

Details : <%= ar4(l) %>

<%= ar4(l+1) %>

<% if ar1(l+1) <> "" then %> Add for Inquiry <% else %> Can't Add! <% end if %>

 

Name   : <%= ar2(l+1) %>

 

Group : <%= ar7(l+1) %>

 

Details : <%= ar4(l+1) %>

<% if ar1(l+2)="End" then filler exit do end if %>

<%= ar4(l+2) %>

<% if ar1(l+2) <> "" then %> Add for Inquiry <% else %> Can't Add! <% end if %>

 

Name  : <%= ar2(l+2) %>

 

Group : <%= ar7(l+2) %>

 

Details : <%= ar4(l+2) %>

<% l=l+3 else l=l+1 end if loop %>
<% End Sub Sub ShowItemsInCartFRomData() call head Dim Key Dim aParameters ' as Variant (Array) Dim sTotal, sShipping %>


Your Inquiry Cart

<% Dim objCN1, objRS1 set objRS1 = server.CreateObject("ADODB.RecordSet") set objCN1 = server.CreateObject("ADODB.Connection") objCN1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" objCN1.Open sTotal = 0 For Each Key in dictCart strSQL1 = "SELECT * FROM Productdetail where productId="+ cstr(key) + ";" Set objRS1 = objCN1.Execute(strSQL1) %> <% Next %>

Item Name

Remove Item

Length

Weight

Image

Details

<%= objRS1("Productname") %> <%= objRS1("Productlength") %> <%= objRs1("productweight") %> <%= objRS1("productweightunit") %> /<%= objRS1("productthumb") %>" height="100" width="100" align="left"> <%= objRS1("productdetails") %>
<% End Sub Sub PlaceOrder() Dim Key Dim objCN1, objRS1 set objRS1 = server.CreateObject("ADODB.RecordSet") set objCN1 = server.CreateObject("ADODB.Connection") objCN1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" objCN1.Open %>
<% sTotal = 0 For Each Key in dictCart strSQL1 = "SELECT * FROM Productdetail where productid="+ cstr(key) + ";" Set objRS1 = objCN1.Execute(strSQL1) %> <% Next createorder %>

Product # -Name

Product Group

Details

Weight

Thumbnail Image

<%= Key %> - <%= objRS1("productname") %> <%= objRS1("productgroup") %> <%= objRS1("productdetails") %> <%= objRS1("productweight") %> <%= objRS1("productweightunit") %>

/<%= objRS1("productthumb") %>" height="100" width="100" align="left">

<% End Sub Function CreateOrder() '************************** 'Main Logic '************************** On Error Resume Next Dim sBody sch = "http://schemas.microsoft.com/cdo/configuration/" '*****Please don't edit this line.***** set cdoConfig = Server.CreateObject("CDO.Configuration") if Err then response.write "Unable to create object" else end if cdoConfig.Fields.Item(sch & "sendusing") = 2 cdoConfig.Fields.Item(sch & "smtpserver") = "localhost" cdoConfig.fields.update set cdoMessage = Server.CreateObject("CDO.Message") set cdoMessage.Configuration = cdoConfig semail = request("email") sname =request("name") sadd =request("address") sphone1 =request("phone") sphone2 =request("phone1") 'response.write semail + sname + sadd + sphone1 + sphone2 cdoMessage.From = semail cdoMessage.To = "khawadcreations@gmail.com" cdoMessage.bcc = "nirajdugar@gmail.com" cdoMessage.Subject = "Shopping Cart Enquiry" Dim Key Dim objCN1, objRS1 set objRS1 = server.CreateObject("ADODB.RecordSet") set objCN1 = server.CreateObject("ADODB.Connection") objCN1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" objCN1.Open dim st st="" st = st + "
" st = st + "
" st = st + "" st = st + "" st = st +"" st = st +"" st = st +"" st = st +"" st = st +"" st = st +"" st = st +"" st = st +"" sTotal = 0 For Each Key in dictCart dim h strSQL1 = "SELECT * FROM Productdetail where productid="+ cstr(key) + ";" Set objRS1 = objCN1.Execute(strSQL1) h=cstr(request(objRS1("productname"))) st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" st = st + "" Next st = st + "
Item NameGroupDetailsWeightLengthPriceSpecial Inquiry
" + cstr(objRS1("productname")) +"" + cstr(objRS1("productgroup")) + "" + cstr(objRS1("productdetails")) + "" + cstr(objRS1("productweight")) + " " + cstr(objRS1("productweightunit")) + ""+ cstr(objRS1("productlength")) + ""+ cstr(objRS1("productPriceFrom")) + "-" + cstr(objRS1("productPriceTo")) + ""+ h +"

" st = st + "" st = st + "" st = st + "" 'response.write st cdoMessage.HTMLBody = st On Error Resume Next cdoMessage.Send if Err then response.write "Sorry! Unable to Send." else response.write "Confirmation --- Mail Sent to Shop Cart Owner" end if Set cdoMessage = Nothing Set cdoConfig = Nothing End Function Function Loggedin() End Function %> <% ' ***** Begin the infamous runtime script ***** ' Declare our Vars Dim dictCart ' as dictionary Dim sAction ' as string Dim iItemID ' as integer Dim iItemCount ' as integer loggedin ' Get a reference to the cart if it exists otherwise create it If IsObject(Session("cart")) Then Set dictCart = Session("cart") Else ' We use a dictionary so we can name our keys to correspond to our ' item numbers and then use their value to hold the quantity. An ' array would also work, but would be a little more complex and ' probably not as easy for readers to follow. Set dictCart = Server.CreateObject("Scripting.Dictionary") End If ' Get all the parameters passed to the script sAction = CStr(Request.QueryString("action")) iItemID = CInt(Request.QueryString("item")) iItemCount = CInt(Request.QueryString("count")) page=Request.Querystring("Page") if page="" then page=1 end if %>
------------------------------
Inquiry By : " + cstr(sname) + "
Living at : " + cstr(sadd) + "
With Phone : " + cstr(sphone1) + cstr("-") + cstr(sphone2) + "
<% if sAction="" then showcatalog(page) %>

My Inquiry Cart


<% response.end end if ' Select action based on user input Select Case sAction Case "add" session("back")=1 'response.write iItemid 'response.write iItemcount if itemid="NOITEM" then showcatalog(page) else AddItemToCart iItemID, iItemCount ShowItemsInCartfromdata end if %>
<% set objRS1 = server.CreateObject("ADODB.RecordSet") set objCN1 = server.CreateObject("ADODB.Connection") objCN1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("database/products.mdb") & ";Persist Security Info=False" objCN1.Open %> <% For Each Key in dictCart strSQL1 = "SELECT * FROM Productdetail where productid="+ cstr(key) + ";" Set objRS1 = objCN1.Execute(strSQL1) fg=len(objRs1("Productname")) %>
<% next %>
 Please fill in the particular Details Below

Any Comments for - <%= objRs1("Productname") %> :

" size="37"> 
 

<% call footer Case "del" RemoveItemFromCart iItemID, iItemCount ShowItemsInCartfromdata %>

<% call footer Case "viewcart" session("back")=1 ShowItemsInCartfromdata %>
<% call footer Case "checkout" head PlaceOrder Session("back")=0 %>

Thanks for the Enquiry! We'll send you more details soon.

Happy Surfing


<% if not isempty(dictCart) and not isnull(dictCart) then dictCart = Empty else end if session("cart") = Empty call footer %> <% case "txtSearch" head ShowCatalog(page) call footer Case Else ' Shop head ShowCatalog(page) call footer End Select ' Return cart to Session for storage if isObject(dictCart) then Set Session("cart") = dictCart end if %>