<%@ Language="VBScript" %> パノラマコンテンツ <% '***************************************************************** ' 携帯用コンテンツ表示ASP (mobile.asp) ' ' ' [呼び出し方法] ' http://XXXX/mobile.asp?Id=xxx ' ' Id : varchar : 閲覧する物件のID ' ' [リターンコード] ' ' 0 : 正常終了 ' 1 : アプリが動作しない携帯電話です ' 2 : 指定したIDの物件が存在しません ' 3 : データベース接続異常 ' 4 : 不明なエラー ' '***************************************************************** '******************* '* 変数定義 *  '******************* Dim strID ' As String Dim iSpotNum ' As Integer Dim PhoneType ' As String Dim AppliName ' As String Dim strM1Text ' As String '******************* '* パラメータ取得 * '******************* ' 物件ID strID = Request.QueryString("Id") if(strId = Null Or (Len(strId) > 50)) then ErrorMessage(2) end if 'Response.Write strID + "
" ' SpotNum 'strTmp = Request.QueryString("SpotNum") 'iSpotNum = CInt(strTmp) 'if (strTmp = Null) then ' iSpotNum = 0 'end if 'Response.Write strTmp + "
" '************************** '* 携帯端末の種類チェック * '************************** myAgent = Request.ServerVariables("HTTP_USER_AGENT") '-------------------------------AU------------------------------ if (InStr(1, myAgent, "KDDI",1) > 0) then PhoneType = "KDDI" '----------------------------Docomo----------------------------- elseif (InStr(1, myAgent, "Docomo", 1) > 0) then if ( (InStr(1, myAgent, "900",1) > 0) or (InStr(1, myAgent, "901",1) > 0) or (InStr(1, myAgent, "902",1) > 0) or (InStr(1, myAgent, "903",1) > 0) or (InStr(1, myAgent, "700",1) > 0) or (InStr(1, myAgent, "701",1) > 0) or (InStr(1, myAgent, "702",1) > 0) or (InStr(1, myAgent, "703",1) > 0) ) then PhoneType = "FOMA" AppliName = "PS3900i.jam" else PhoneType = "MOVA" AppliName = "PS3.jam" end if '----------------------------それ以外----------------------------- else PhoneType = "Nothing" end if ' コンテンツが閲覧できない端末の場合 if(PhoneType = "Nothing") then ErrorMessage(1) end if '************************ '* データベースアクセス * '************************ ' データベース接続 ConnectDB() ' 該当物件IDがあるか確認 strSQL = "SELECT * FROM pano_m_bukken WHERE M1_ID='"& strID &"' and M1_INVALID = 0" 'Response.Write strSQL +"
" Set objRS = adoConn.Execute(strSQL) if Err.Number <> 0 then DisConnectDB() ErrorMessage(3) end if if(objRS.EOF) then '該当物件が無い DisConnectDB() Err.Clear ErrorMessage(2) end if strM1Code = objRS("M1_CODE") strM1Text = replace(objRS("M1_TEXT"),vbcrlf,"
") 'objRS.close() 'Set objRS = Nothing ' 該当SpotNumがあるか確認 'strSQL = "SELECT * FROM pano_m_spot WHERE (M2_ID='"& strID &"' AND M2_NUMBER='"&strTmp&"')" 'Response.Write strSQL +"
" 'Set objRS = adoConn.Execute(strSQL) 'if(objRS.EOF) then '該当SpotNumが無い ' DisConnectDB() ' Err.Clear ' ErrorMessage(2) 'end if dim userid,iLen userid = objRS("M1_ID") iLen = Instr(userid, "_") userid = Left(userid,iLen-1) '******************** '*   HTML表示   * '******************** strPath = Right(IMAGES_URL_PATH, Len(IMAGES_URL_PATH)-7) if(PhoneType = "MOVA" Or PhoneType = "FOMA") then Response.Write ""&strM1Text&"" Response.Write "" Response.Write "物件コード:" & strM1Code & "
" Response.Write "物件名:" & strM1Text 'Response.Write "
" & strPath & userid & "/" &objRS("M1_ID")&"/mproj1.txt" Response.Write "
パノラマ画像へ
" Response.Write "パノラマアプリが入ってない場合はここからダウンロードしてから、この画面に戻ってください。" elseif(PhoneType = "KDDI") then Response.Write "物件コード:" & strM1Code & "
" Response.Write "物件名:" & strM1Text & "
" Response.Write "パノラマ画像へ
" Response.Write "パノラマアプリが入ってない場合はここからダウンロードしてから、この画面に戻ってください。" else Response.Write "ダウンロードページ


" end if if(PhoneType = "MOVA" Or PhoneType = "FOMA" Or PhoneType = "KDDI") then Response.Write "
" strSQL = "Select * from pano_m_user where M3_USERID ='" & userid & "'" Set objRecordSet2 = adoConn.execute(strSQL) if (objRecordSet2.EOF) then username = "" postalcode = "" address1 = "" address2 = "" phone = "" email = "" else username = objRecordSet2("M3_USERNAME") postalcode = objRecordSet2("M3_POSTALCODE") address1 = objRecordSet2("M3_ADDRESS1") address2 = objRecordSet2("M3_ADDRESS2") phone = replace(objRecordSet2("M3_PHONE"),"-","") email = objRecordSet2("M3_EMAIL") end if Response.Write "
" & username & "
" & email & "
" Response.Write "TEL:" & phone & "
" end if objRS.close() Set objRS = Nothing ' データベース切断 DisConnectDB() '******************** '*  エラー表示   * '******************** Sub ErrorMessage(Num) Response.Write "
" if(Num = 1) then Response.Write "
現在ご使用の携帯電話から、このコンテンツはご覧いただけません。

" elseif(Num = 2) then Response.Write "

指定された物件が見つかりません。

" Response.Write "物件IDの確認の上、再度アクセスしてください。" elseif(Num = 3) then Response.Write "

データベースに正しくアクセスできません。

" Response.Write "物件IDを確認の上、再度アクセスしてください。" elseif(Num = 4) then Response.Write "

不明なエラーが発生しました。

" Response.Write "サーバー管理者に連絡して下さい。" end if Response.Write "


" Response.End end sub %>