📄 datetimecfg.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Dim strMode
Dim strDateFormat
Dim strYearFormat
Dim intTimeFormat
Dim strDateSeporator
Dim saryMonth(12)
Dim strMorningID
Dim strAfternoonID
Dim intMonthLoopCounter
strMode = Request.Form("mode")
strSQL = "SELECT timesdtm.* From timesdtm;"
rsConn.CursorType = 2
rsConn.LockType = 3
rsConn.Open strSQL, adoCon
If strMode = "postBack" Then
With rsConn
.Fields("dtfmt") = Request.Form("dateFormat")
.Fields("yearfmt") = Request.Form("yearFormat")
.Fields("tmfmt") = Request.Form("timeFormat")
.Fields("Seporator") = Request.Form("seporator")
.Fields("am") = Request.Form("am")
.Fields("pm") = Request.Form("pm")
For intMonthLoopCounter = 1 to 12
.Fields("Month" & intMonthLoopCounter) = Request.Form("month" & intMonthLoopCounter)
Next
.Update
.Requery
End With
End If
If NOT rsConn.EOF Then
strDateFormat = rsConn("dtfmt")
strYearFormat = rsConn("yearfmt")
intTimeFormat = CInt(rsConn("tmfmt"))
strDateSeporator = rsConn("Seporator")
strMorningID = rsConn("am")
strAfternoonID = rsConn("pm")
For intMonthLoopCounter = 1 to 12
saryMonth(intMonthLoopCounter) = rsConn.Fields("Month" & intMonthLoopCounter)
Next
End If
rsConn.Close
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>时间日起设置</title>
<script language="JavaScript">
<!-- Hide from older browsers...
function CheckForm () {
var errorMsg = "";
var errorMsgLong = "";
for (var count = 3; count <= 15; ++count){
if (document.frmDateTime.elements[count].value == ""){
var monthName;
if (count == 3) {monthName = "January\t";}
else if (count == 4) {monthName = "February\t";}
else if (count == 5) {monthName = "March\t";}
else if (count == 6) {monthName = "April\t";}
else if (count == 7) {monthName = "May\t";}
else if (count == 8) {monthName = "June\t";}
else if (count == 9) {monthName = "July\t";}
else if (count == 10) {monthName = "August\t";}
else if (count == 11) {monthName = "September";}
else if (count == 12) {monthName = "October\t";}
else if (count == 13) {monthName = "Nevember";}
else if (count == 14) {monthName = "December";}
errorMsg += "\n\t" + monthName + " \t- 请输入 " + 月份;
}
}
if ((errorMsg != "") || (errorMsgLong != "")){
msg = "___________________________________________________________________\n\n";
msg += "提交失败.\n";
msg += "请修改后重新提交.\n";
msg += "___________________________________________________________________\n\n";
msg += "需要修改的部分: -\n";
errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
return false;
}
return true;
}
// -->
</script>
<link href="includes/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p class="text"><span class="heading">论坛日期时间设置</span><br>
<br>
<a href="menu.asp" target="_self">返回到管理主菜单</a><br />
</p>
</div>
<form method="post" name="frmDateTime" action="datetimecfg.asp" onSubmit="return CheckForm();">
<table width="550" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000000" height="277">
<tr>
<td height="234" width="680"> <table width="100%" border="0" align="center" height="233" cellpadding="4" cellspacing="1">
<tr align="left" bgcolor="#CCCCCC">
<td height="30" colspan="2" class="lgText">日期设置</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="12" align="left" class="text">日期格式:</td>
<td height="12" width="41%" valign="top">
<select name="dateFormat">
<option value="dd/mm/yy" <% If strDateFormat = "dd/mm/yy" Then Response.Write("selected") %>>日/月/年</option>
<option value="mm/dd/yy" <% If strDateFormat = "mm/dd/yy" Then Response.Write("selected") %>>月/日/年</option>
<option value="yy/mm/dd" <% If strDateFormat = "yy/mm/dd" Then Response.Write("selected") %>>年/月/日</option>
<option value="yy/dd/mm" <% If strDateFormat = "yy/dd/mm" Then Response.Write("selected") %>>年/日/月</option>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="12" align="left" class="text">分隔符:<br />
<span class="smText">例如: 12/12/2003, 12-12-2003, 等.</span></td>
<td height="12" width="41%" valign="top">
<select name="seporator">
<option value=" " <% If strDateSeporator = " " Then Response.Write("selected") %>><space></option>
<option value="/" <% If strDateSeporator = "/" Then Response.Write("selected") %>>/</option>
<option value="\" <% If strDateSeporator = "\" Then Response.Write("selected") %>>\</option>
<option value="-" <% If strDateSeporator = "-" Then Response.Write("selected") %>>-</option>
<option value=" - " <% If strDateSeporator = " - " Then Response.Write("selected") %>> - </option>
<option value="." <% If strDateSeporator = "." Then Response.Write("selected") %>>.</option>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="12" align="left" class="text">年份格式:<br />
<span class="smText">四位或者两位</span></td>
<td height="12" width="41%" valign="top">
<select name="yearFormat">
<option value="long" <% If strYearFormat = "long" Then Response.Write("selected") %>>yyyy</option>
<option value="short" <% If strYearFormat = "short" Then Response.Write("selected") %>>yy</option>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="2" align="left" class="text">一月*:<br />
<span class="smText"> 例如: 01, 1, Jan, etc. </span></td>
<td width="41%" valign="top" height="2">
<input type="text" name="month1" maxlength="15" value="<% = saryMonth(1) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">二月*:<br />
</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month2" maxlength="15" value="<% = saryMonth(2) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">三月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month3" maxlength="15" value="<% = saryMonth(3) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">四月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month4" maxlength="15" value="<% = saryMonth(4) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">五月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month5" maxlength="15" value="<% = saryMonth(5) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">六月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month6" maxlength="15" value="<% = saryMonth(6) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">七月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month7" maxlength="15" value="<% = saryMonth(7) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">八月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month8" maxlength="15" value="<% = saryMonth(8) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">九月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month9" maxlength="15" value="<% = saryMonth(9) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">十月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month10" maxlength="15" value="<% = saryMonth(10) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">十一月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month11" maxlength="15" value="<% = saryMonth(11) %>" size="15" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="23" align="left" class="text">十二月*:</td>
<td height="23" width="41%" valign="top">
<input type="text" name="month12" maxlength="15" value="<% = saryMonth(12) %>" size="15" >
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="23" colspan="2" align="left" class="lgText">时间设置</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="7" align="left" class="text">时间格式:<br />
<span class="smText">12进制或者24进制</span></td>
<td height="7" width="41%" valign="top">
<select name="timeFormat">
<option value="12" <% If intTimeFormat = 12 Then Response.Write("selected") %>>12小时制</option>
<option value="24" <% If intTimeFormat = 24 Then Response.Write("selected") %>>24小时制</option>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="13" align="left" class="text">12进制的上午的格式:<br />
<span class="smText">例如: am</span></td>
<td height="13" width="41%" valign="top">
<input type="text" name="am" maxlength="5" value="<% = strMorningID %>" size="5" >
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="59%" height="13" align="left" class="text">12进制的下午的格式:<br />
<span class="smText">例如: pm</span></td>
<td height="13" width="41%" valign="top">
<input type="text" name="pm" maxlength="5" value="<% = strAfternoonID %>" size="5" >
</td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td valign="top" height="2" colspan="2" > <p>
<input type="hidden" name="mode" value="postBack">
<input type="submit" name="Submit" value="确定">
<input type="reset" name="Reset" value="清除">
</p></td>
</tr>
</table></td>
</tr>
</table>
<div align="center"><br />
</div>
</form>
<br />
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -