%@ LANGUAGE=VBScript %>
<% Response.Buffer = True %>
<%
IF Session("Common_Access") < 1 THEN
'msgbox "Invalid User Name OR Password",48,"Warning"
Response.Clear
'error logon warning
Response.Redirect "Default.asp"
END IF
v_name = Request.Form("c_name")
v_brand = Request.Form("c_brand")
v_desc = Request.Form("c_desc")
v_spec = Request.Form("c_spec")
v_Category = Request.Form("c_Category")
v_packing = Request.Form("c_packing")
v_price = Request.Form("c_price")
v_capacity = Request.Form("c_capacity")
v_minorder = Request.Form("c_minorder")
IF TRIM(v_packing) = "" THEN
v_packing = "NULL"
END IF
IF TRIM(v_price) = "" THEN
v_price = "NULL"
END IF
IF TRIM(v_capacity) = "" THEN
v_capacity = "NULL"
END IF
IF TRIM(v_minorder) = "" THEN
v_minorder = "NULL"
END IF
Set IndustryNetSQL = Server.CreateObject("ADODB.Connection")
IndustryNetSQL.Open "thaiindustry", "tinhosting", "tinhosting"
sql = "SELECT * FROM usermember " & _
"WHERE username = '"& session("UserName") & "'"
Set RS = IndustryNetSQL.Execute(sql)
v_userid = RS("UserID")
sql_c = "SELECT * FROM company " & _
"WHERE userID = '"& v_userid & "'"
Set RS_c = IndustryNetSQL.Execute(sql_c)
v_companyID = RS_c("CompanyID")
'update USERMEMBER user_type to PRODUCT_FREE
'--------
sql_user = "UPDATE Usermember "&_
"SET Ulevel =" & 3 & " " &_
"WHERE userid ='" & v_userid & "'"
Set RS_user = IndustryNetSQL.Execute(sql_user)
sql_use2 = "SELECT * FROM Usermember "&_
"WHERE userid ='" & v_userid & "'"
Set RS_use2 = IndustryNetSQL.Execute(sql_use2)
Session("Common_Access") = RS_use2("ulevel")
'--------
v_prodtype = "FREE"
sql1 = "INSERT INTO Products "&_
"(ProductName, BrandName, ProductDescription,"&_
" CompanyID, Specification, Packing, "&_
" Price, Capacity, MinOrder, "&_
" prod_type, Prod_create_d, Prod_update_d) "&_
"VALUES('"& v_name &"','"& v_brand &"','"& v_desc &"','"&_
v_companyID &"','"& v_spec &"','"& v_packing &"','"&_
v_price &"','"& v_capacity &"','"& v_minorder &"','"&_
v_prodtype &"','"& now &"','"& now &"')"
Set RS1 = IndustryNetSQL.Execute(sql1)
%>
Welcome to Thai Industry Network
|
|
|
<%= FormatDateTime (date, vbLongDate) %>
|
|
|
|
|
|
|
| User Member |
<%=RS("FName")& " " %><%=RS("LName")& " " %> |
|
| Company Infomation Manager [Add] |
|
|