<% IF SESSION("SYSTEM_ID") = "" Then 'Time out %> <% Response.End End If Dim oUploadForm Set oUploadForm = oGetUploadObject() '//Upload Component Descrition Call oGetUploadDesc(oUploadForm) Dim category Dim prod_name Dim inter_cd Dim price_YN Dim old_price Dim curr_price Dim period Dim departure Dim minimun_capacity Dim txt_keyword Dim txt_description Dim txt_optional1 Dim txt_optional2 Dim txt_optional3 Dim txt_schedule Dim order_by Dim active_YN '----------------------------------------------- category = Trim(oUploadForm("category")) prod_name = Trim(oUploadForm("prod_name")) prod_name = Replace(prod_name,"'","''") inter_cd = Trim(oUploadForm("inter_cd")) price_YN = Trim(oUploadForm("price_YN")) curr_price = Trim(oUploadForm("curr_price")) If curr_price = "" Then curr_price = 0 End If old_price = Trim(oUploadForm("old_price")) If old_price = "" Then old_price = 0 End If period = Trim(oUploadForm("period")) departure = Trim(oUploadForm("departure")) minimun_capacity = Trim(oUploadForm("minimun_capacity")) txt_keyword = Trim(oUploadForm("txt_keyword")) txt_keyword = Replace(txt_keyword,"'","''") txt_description = Trim(oUploadForm("txt_description")) txt_description = Replace(txt_description,"'","''") txt_optional1 = Trim(oUploadForm("txt_optional1")) txt_optional1 = Replace(txt_optional1,"'","''") txt_optional2 = Trim(oUploadForm("txt_optional2")) txt_optional2 = Replace(txt_optional2,"'","''") txt_optional3 = Trim(oUploadForm("txt_optional3")) txt_optional3 = Replace(txt_optional3,"'","''") txt_schedule = Trim(oUploadForm("txt_schedule")) txt_schedule = Replace(txt_schedule,"'","''") order_by = Trim(oUploadForm("order_by")) active_YN = Trim(oUploadForm("active_YN")) Dim objQuery Set objQuery = GetDBConn() Dim prod_cd IF prod_name <> "" Then Dim arrMainKey arrMainKey = funcGetProdKey(objQuery) Dim strSequence IF isArray(arrMainKey) Then IF Trim(arrMainKey(0, 0)) <> "" Then strSequence = Right(Trim(arrMainKey(0, 0)), 3) strSequence = Cint(strSequence) + 1 Select Case Len(strSequence) Case 1 strSequence = "000" & Cstr(strSequence) Case 2 strSequence = "00" & Cstr(strSequence) Case 3 strSequence = "0" & Cstr(strSequence) End Select Else strSequence = "0001" End IF Else strSequence = "0001" End IF prod_cd = "PC" & strSequence End IF Call CloseDBConn(objQuery) Dim image_s Dim image_m Dim image_l_1 Dim image_l_2 Dim image_l_3 Dim image_l_4 Dim image_l_5 image_s = funcGetUploadFileObject(oUploadForm, "image_s", PRODUCT_PHISYCAL_PATH) image_m = funcGetUploadFileObject(oUploadForm, "image_m", PRODUCT_PHISYCAL_PATH) image_l_1 = funcGetUploadFileObject(oUploadForm, "image_l_1", PRODUCT_PHISYCAL_PATH) image_l_2 = funcGetUploadFileObject(oUploadForm, "image_l_2", PRODUCT_PHISYCAL_PATH) image_l_3 = funcGetUploadFileObject(oUploadForm, "image_l_3", PRODUCT_PHISYCAL_PATH) image_l_4 = funcGetUploadFileObject(oUploadForm, "image_l_4", PRODUCT_PHISYCAL_PATH) image_l_5 = funcGetUploadFileObject(oUploadForm, "image_l_5", PRODUCT_PHISYCAL_PATH) Dim objModify Set objModify = New objDB_Modify Dim arrFieldName(25) Dim arrFieldValue(25) arrFieldName(0) = "S:prod_cd" arrFieldName(1) = "S:category" arrFieldName(2) = "S:prod_name" arrFieldName(3) = "S:inter_cd" arrFieldName(4) = "S:price_YN" arrFieldName(5) = "N:old_price" arrFieldName(6) = "N:curr_price" arrFieldName(7) = "S:period" arrFieldName(8) = "S:minimun_capacity" arrFieldName(9) = "S:txt_keyword" arrFieldName(10) = "S:txt_description" arrFieldName(11) = "S:txt_optional1" arrFieldName(12) = "S:txt_optional2" arrFieldName(13) = "S:txt_optional3" arrFieldName(14) = "S:txt_schedule" arrFieldName(15) = "N:order_by" arrFieldName(16) = "S:active_YN" arrFieldName(17) = "S:image_s" arrFieldName(18) = "S:image_m" arrFieldName(19) = "S:image_l_1" arrFieldName(20) = "S:image_l_2" arrFieldName(21) = "S:image_l_3" arrFieldName(22) = "S:image_l_4" arrFieldName(23) = "S:image_l_5" arrFieldName(24) = "S:image_path" arrFieldName(25) = "S:departure" arrFieldValue(0) = prod_cd arrFieldValue(1) = category arrFieldValue(2) = prod_name arrFieldValue(3) = inter_cd arrFieldValue(4) = price_YN arrFieldValue(5) = old_price arrFieldValue(6) = curr_price arrFieldValue(7) = period arrFieldValue(8) = minimun_capacity arrFieldValue(9) = txt_keyword arrFieldValue(10) = txt_description arrFieldValue(11) = txt_optional1 arrFieldValue(12) = txt_optional2 arrFieldValue(13) = txt_optional3 arrFieldValue(14) = txt_schedule arrFieldValue(15) = order_by arrFieldValue(16) = active_YN arrFieldValue(17) = image_s arrFieldValue(18) = image_m arrFieldValue(19) = image_l_1 arrFieldValue(20) = image_l_2 arrFieldValue(21) = image_l_3 arrFieldValue(22) = image_l_4 arrFieldValue(23) = image_l_5 arrFieldValue(24) = PRODUCT_WEB_PATH arrFieldValue(25) = departure CALL objModify.subExecInsert("E_Product", arrFieldName, arrFieldValue) Set objModify = Nothing Set oUploadForm = Nothing Function funcGetProdKey(byRef objQuery) Dim sQuery sQuery = " SELECT MAX(prod_cd) " &_ " FROM E_Product " 'Response.write sQuery funcGetProdKey = arrGetDBResult(objQuery, sQuery) End Function ReFresh("service_m.asp") %>