home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
221.214.14.186
/
221.214.14.186.tar
/
221.214.14.186
/
wh
/
lyb
/
photodiaryFix.asp
< prev
next >
Wrap
Text File
|
2008-04-03
|
15KB
|
297 lines
<%@LANGUAGE="VBSCRIPT"%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Contents.Remove("MM_Username")
Session.Contents.Remove("MM_UserAuthorization")
MM_logoutRedirectPage = "photodiary.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<!--#include file="Connections/lyb.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_lyb_STRING
MM_editTable = "diarydata"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "photodiaryAdmin.asp"
MM_fieldsStr = "pd_date|value|pd_subject|value|pd_weather|value|pd_content|value|rePic|value|pd_photocontent|value"
MM_columnsStr = "pd_date|',none,NULL|pd_subject|',none,''|pd_weather|',none,''|pd_content|',none,''|pd_photo|',none,''|pd_photocontent|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim lyb__MMColParam
lyb__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
lyb__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim lyb
Dim lyb_numRows
Set lyb = Server.CreateObject("ADODB.Recordset")
lyb.ActiveConnection = MM_lyb_STRING
lyb.Source = "SELECT * FROM diarydata WHERE id = " + Replace(lyb__MMColParam, "'", "''") + ""
lyb.CursorType = 0
lyb.CursorLocation = 2
lyb.LockType = 1
lyb.Open()
lyb_numRows = 0
%>
<html>
<head>
<title>╩²╫╓╚╒╝╟╣▄└φ</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- Fireworks MX Dreamweaver MX target. Created Thu Feb 27 23:51:44 GMT+0800 (úñxúñ_?DíñCRE?!) 2003-->
<style type="text/css">
<!--
.dotline {
border: 1px dashed #666666;
}
* {
font-size: 12px;
}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
<tr valign="top">
<td width="180" background="images/diary_back.gif"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="106"><img name="diary_r1_c1" src="images/diary_r1_c1.gif" width="180" height="106" border="0" alt=""></td>
</tr>
<tr>
<td> <table width="90%" height="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="15"><font size="2"> </font></td>
<td><font color="#FF3300" size="2">¿ï <strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">ADMIN</font></strong></font>
<hr align="left" width="100%" size="1" noshade class="dotline">
<font size="2"> <a href="photodiaryAdd.asp">╠φ╝╙╩²╫╓╚╒╝╟</a></font>
<hr align="left" width="100%" size="1" noshade class="dotline">
<font size="2"> <a href="photodiaryAdmin.asp">╣▄└φ╩²╫╓╚╒╝╟</a></font>
<hr align="left" width="100%" size="1" noshade class="dotline">
<font size="2"><a href="<%= MM_Logout %>">╫ó╧·╣▄└φ╜τ├µ</a></font>
<hr align="left" width="100%" size="1" noshade class="dotline"></td>
</tr>
</table></td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" background="images/diary_r1_c4.gif">íí</td>
</tr>
<tr>
<td><font color="#FF0000" size="3"><strong>╨▐╕─╩²╫╓╚╒╝╟</strong></font>
<hr size="1" noshade> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1" style="margin=0px;">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="80" align="right" bgcolor="#999999"><strong><font color="#FFFFFF" size="2">╚╒╞┌ú║</font></strong></td>
<td valign="top"><font size="2">
<input name="pd_date" type="text" id="pd_date" value="<%=(lyb.Fields.Item("pd_date").Value)%>" size="20">
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#999999"><strong><font color="#FFFFFF" size="2">╓≈╠Γú║</font></strong></td>
<td valign="top"><font size="2">
<input name="pd_subject" type="text" id="pd_subject" value="<%=(lyb.Fields.Item("pd_subject").Value)%>" size="20">
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#999999"><strong><font color="#FFFFFF" size="2">╜±╠∞╠∞╞°ú║</font></strong></td>
<td valign="top"><font size="2">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather01.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather01.gif" checked>
<img src="images/weather01.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather02.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather02.gif">
<img src="images/weather02.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather03.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather03.gif">
<img src="images/weather03.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather04.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather04.gif">
<img src="images/weather04.gif" width="30" height="25" align="absmiddle"><br>
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather05.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather05.gif">
<img src="images/weather05.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather06.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather06.gif">
<img src="images/weather06.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather07.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather07.gif">
<img src="images/weather07.gif" width="30" height="25" align="absmiddle">
<input <%If (CStr((lyb.Fields.Item("pd_weather").Value)) = CStr("weather08.gif")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="pd_weather" type="radio" value="weather08.gif">
<img src="images/weather08.gif" width="30" height="25" align="absmiddle"></font></td>
</tr>
<tr>
<td align="right" valign="top" bgcolor="#999999"><strong><font color="#FFFFFF" size="2">╚╒╝╟─┌╚▌ú║</font></strong></td>
<td valign="top"><p><font size="2">
<textarea style="display:none"name="pd_content" cols="45" rows="10" id="pd_content"><%=(lyb.Fields.Item("pd_content").Value)%></textarea>
<IFRAME ID="eWebEditor1" SRC="edit/ewebeditor.asp?id=pd_content&style=s_blue" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME>
</font></p>
<p> </p></td>
</tr>
<tr>
<td align="right" valign="top" bgcolor="#999999"><strong><font color="#FFFFFF" size="2">╔╧┤½═╝╞¼<br>
╝░╦╡├≈ú║</font></strong></td>
<td valign="top"><font size="2">
<img src="images/photo/<%=(lyb.Fields.Item("pd_photo").Value)%>" alt="╒Γ╩╟╧╘╩╛╔╧┤½╘ñ└└═╝╞¼╡─╬╗╓├" name="showImg" id="showImg" onClick='javascript:alert("╒Γ╩╟╧╘╩╛╔╧┤½╘ñ└└═╝╞¼╡─╬╗╓├");'>
<input type="button" name="Submit" value="╔╧┤½═╝╞¼" onClick="window.open('fupload.asp?useForm=form1&prevImg=showImg&upUrl=images/photo&ImgS=300&ImgW=400&ImgH=340&reItem=rePic','fileUpload','width=400,height=180')">
<input name="rePic" type="hidden" id="rePic" size="4">
<textarea name="pd_photocontent" cols="45" rows="2" id="pd_photocontent"><%=(lyb.Fields.Item("pd_photocontent").Value)%></textarea>
</font></td>
</tr>
</table>
<input type="submit" name="Submit2" value="╦═│÷">
<input type="reset" name="Submit3" value="╓╪╔Φ">
<input type="button" name="Submit4" value="╗╪╔╧╥╗╥│" onClick="window.history.back();">
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= lyb.Fields.Item("id").Value %>">
</form></td>
</tr>
</table></td>
</tr>
</table></td>
<td><img name="diary_r1_c5" src="images/diary_r1_c5.gif" width="12" height="29" border="0" alt=""></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="12"><table width="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="8"><img src="images/spacer.gif" width="8" height="12"></td>
<td width="12"><img name="diary_r4_c1" src="images/diary_r4_c1.gif" width="12" height="12" border="0" alt=""></td>
</tr>
</table></td>
<td height="12"><img src="images/spacer.gif" width="1" height="12"></td>
<td width="12" height="12"><img name="diary_r4_c5" src="images/diary_r4_c5.gif" width="12" height="12" border="0" alt=""></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
lyb.Close()
Set lyb = Nothing
%>