<% Upper_Patch " " dim Supplier_id flag=true login=request.form("login") password=request.form("password") dim db connection set rs13=server.createobject("adodb.recordset") s2="select * from directory_inquiry where Supplier_id="&session("myid")&" " rs13.open s2 , db, 3 set rs12=server.createobject("adodb.recordset") s2="select * from product_inquiry where Supplier_id="&session("myid")&" " rs12.open s2 , db, 3 set r=server.createobject("adodb.recordset") if session("myid")<>"" then s="select supplier_id from supplier where supplier_id="& session("myid") r.open s, db, 3 dispdetails response.write "" else validation1 'to ensure that the login and password have been entered set r=server.createobject("adodb.recordset") if flag then validation2 if flag then validation3 if flag then dispdetails response.write "" end if Bottom_Patch %> <% Sub validation1 response.write "" if len(login)=0 or len(password)=0 then flag=false else for i=1 to 15 if strcomp(len(login), space(i), 1)=0 or strcomp(len(password), space(i), 1)=0 then exit for next if i<=15 then flag=false end if if not flag then response.write "

You have not entered the Login Name and/or Password." response.write "
Please enter the data." dispform end if End Sub %> <% sub dispform response.write "

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Login Name:" response.write "
Password:" response.write "
 " response.write "  
" response.write "" response.write "Not registered in directory? Free

" response.write "Forgot Your Password?


" end sub %> <% Sub validation2 connection s="select supplier_id from login where login_name='"&login&"' and password='"&password&"'" r.open s, db, 3 if r.recordcount=0 then flag=false response.write "

" response.write "" response.write "Invalid login name and/or password" response.write "
Please re-enter the data" dispform end if End Sub %> <% Sub dispdetails connection accessdb="temp.mdb" tempDSN="DRIVER={Microsoft Access Driver (*.mdb)};" tempDSN=tempDSN & "DBQ=" & server.mappath(accessdb) set db1=server.createobject("adodb.connection") db1.open tempDSN if session("myid")="" then session("myid")=r("supplier_id") end if s="select company_name,supplier_id,Contact_person from supplier where supplier_id ="&r("supplier_id") set r1=server.createobject("adodb.recordset") r1.open s, db, 3 set ra1=server.createobject("adodb.recordset") s="select prod_Id,product_name,date_added from product where supplier_id="&r1("supplier_id")&" order by date_added desc" set r2=server.createobject("adodb.recordset") r2.open s, db, 3 count=r2.recordcount response.write "
" response.write "Home >> " response.write "Update Your Products :
" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "

" response.write "  Inbox ("&rs13.recordcount&")
" response.write "  View Product Inquiry ("&rs12.recordcount&")
" response.write "  Update Listing
" response.write "  Update Products
" response.write "  Add More Products
" response.write "  Change Password
" response.write "  Logout
" response.write "
" response.write "
" response.write ""&r1("company_name")&"

" if len(r1("Contact_person")) > 2 then response.write "     Dear "&r1("Contact_person")&"," else response.write "     Dear Member," end if if count=0 then response.write "

You have no product registered with us." exit sub end if response.write "
     Listed below is your product range registered with us." response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" for i=1 to count flag=true ra1.open "select * from del_product where supplier_id ="&r("supplier_id"),db1,3 for j=1 to ra1.recordcount if ra1("prod_id")=r2("prod_id") then flag=false exit for end if ra1.movenext next ra1.close if flag then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" end if r2.movenext next response.write "" response.write "" r1.close r2.close set r1=nothing set r2=nothing db.close set db=nothing response.write "" response.write "" response.write "
" response.write "To delete a Product, select the corresponding checkbox and click on 'Delete'
To Update Product Click on Corresponding Product Name" response.write "
" response.write "Product Addtion Date" response.write "Product Name" response.write "Select to Delete
" response.write r2("date_added")&"" response.write r2("product_name")&"
" response.write "            
" End Sub %> <% Sub validation3 connection accessdb="temp.mdb" tempDSN="DRIVER={Microsoft Access Driver (*.mdb)};" tempDSN=tempDSN & "DBQ=" & server.mappath(accessdb) set db1=server.createobject("adodb.connection") db1.open tempDSN s="select company_name,supplier_id from supplier where supplier_id ="&r("supplier_id") set r1=server.createobject("adodb.recordset") r1.open s, db, 3 set ra1=server.createobject("adodb.recordset") s="select prod_Id,product_name,date_added from product where supplier_id="&r1("supplier_id")&" order by date_added desc" set r2=server.createobject("adodb.recordset") r2.open s, db, 3 count=r2.recordcount response.write "

" ra1.open "select * from del_product where supplier_id ="&r("supplier_id"),db1,3 if count = ra1.recordcount then flag= false response.write "

" response.write ""&r1("company_name")&"" response.write "
" response.write "
|    Add Products    |    Change Password    |

" response.write "

You have still not listed any product with us. We have a large number of buyers looking out for a wide range of products in various categories. Some one could be specifically looking out for your product range. So click on Add Product to add your entire product range now and open the doors to unlimited business opportunities.
" exit sub end if ra1.close r1.close r2.close set r1=nothing set r2=nothing db.close set db=nothing End Sub %>