📄 diary_modify_self.asp
字号:
<%@ Language=VBScript %>
<% If request("TheDate")="" Then
TheDate = FormatDateTime(now(),2)
else
TheDate=request("TheDate")
end if
if request("WhoseDiary")="" then
WhoseDiary=Session("UserTrueName")
else
WhoseDiary=request("WhoseDiary")
end if
ContentCounter=10
x=split("星期日,星期一,星期二,星期三,星期四,星期五,星期六",",")
%>
<html>
<head>
<title>完成工作周报</title>
<!--#include file= "../dbase.asp"-->
<link href="../mstyle.css" rel="stylesheet" type="text/css">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" Content="Microsoft Visual Studio.NET 7.0">
<style type="text/css">
<!--
.text {font-family: 宋体, Arial Narrow, Times New Roman; font-size: 9pt;
BACKGROUND-IMAGE: url(images/Txt_bg.jpg); border-width: 1;border-color: #444444;
OVERFLOW: auto; WIDTH: 450px;
LINE-HEIGHT: 1.25; HEIGHT: 300; px;}
-->
</style>
</head>
<% sql="SELECT n_ID, d_Time, v_WorkAddress, v_Weather, t_DiaryContent, v_UserTrueName, v_State, "&_
" v_DepartmentName, i_DiaryWeek, isnull(m_fee,0) as m_fee , "&_
" isnull(v_SupplyUserTrueName,'') as v_SupplyUserTrueName"&_
" FROM hxdf_diary_content "&_
" WHERE (d_Time = CONVERT(DATETIME, '"& TheDate &"', 102)) AND "&_
" (v_UserTrueName = '"& WhoseDiary &"')"
dim rs
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
'Response.Write sql
if rs.eof then
WorkDate=TheDate
Weather="晴"
DiaryContent=""
WorkAddress=Session("WorkPlace")
fee=0
SupplyUserTrueName=""
'UserTrueName=WhoseDiary
'DepartmentName=
else
WorkDate=rs("d_Time")
Weather=rs("v_Weather")
DiaryContent=rs("t_DiaryContent")
WorkAddress=rs("v_WorkAddress")
fee=rs("m_fee")
SupplyUserTrueName=rs("v_SupplyUserTrueName")
end if
rs.Close()%>
<body bgcolor="#F1F1F1">
<form name="Form1" method="post" action="diary_save_self.asp" LANGUAGE="javascript" onsubmit="return Form1_onsubmit();" ID="Form1">
<div align="center">
<input type="text" class="noline" name="DiaryYear" value="<%=year(WorkDate)%>" style="cursor: default; WIDTH: 40px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #f1f1f1" readonly ID="Text1">年
<IMG src="images/MO.gif"><b> <font size="+1" face="楷体_GB2312, 宋体, 隶书, 黑体">工
作 日 志</font> </b><IMG src="images/MO.gif">
第<input type="text" class="noline" size=2 name="DiaryWeek" value="<%=DatePart("ww",WorkDate)%>" style="cursor: default; WIDTH: 20px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #f1f1f1" readonly ID="Text2">
周</div>
<table border="0" cellpadding="0" align="center" style="HEIGHT: 356px; width: 317px;" bordercolorlight="#ffffff" bordercolordark="#ffffff" cellspacing id="Table1">
<tr bgcolor="#ffcccc">
<td colspan="2" bordercolordark="#ffffff" bordercolorlight="#eeeeee" align="center">
<table border="0" width="100%" ID="Table2">
<tr align="center">
<td align="left">日 期:
<input id="DiaryTime" name="DiaryTime" type="text" value="<%=FormatDateTime(WorkDate,2)%>" readonly class="downline" style="cursor: default; WIDTH: 74px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #ffcccc">
</td>
<td align="right">天 气:
<input ID="Weather" name="Weather" type="text" value="<%=Weather%>" class="downline" style="WIDTH: 74px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #ffcccc"></td>
</tr>
<tr align="center">
<td align="left"> 关键字:
<input id="WorkAddress" name="WorkAddress" type="text" value="<%=WorkAddress%>" class="downline" style="WIDTH: 74px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #ffcccc" size="10">
</td>
<td align="right">费用(元):
<input id="fee" name="fee" value="<%=fee%>" type="text" class="downline" style="WIDTH: 74px; HEIGHT: 17px; TEXT-ALIGN: center; background-color: #ffcccc">
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" bordercolordark="#ffffff" valign="top" align="center"> <TEXTAREA ID="DiaryContent" name="DiaryContent" rows="14" cols="100" class="text" language="javascript" onkeyup="CountWord(this);"><%=DiaryContent%></TEXTAREA>
</td>
</tr>
<tr bgcolor="#eeeeee" align="middle">
<td colspan="2" bordercolordark="#ffffff" align="center" height="25"> <table width="100%">
<tr>
<% for i = 1 to 7
if i <= WeekDay(now)+1 then
if i = WeekDay(WorkDate) then%>
<td align='center' style="background-color: ffcc99; cursor: default; " title='<%=DateAdd("d", i-Weekday(WorkDate), WorkDate) %>' onclick='self.location.href="diary_modify_self.asp?TheDate=<%=DateAdd("d", i-Weekday(WorkDate), WorkDate)%>"'><b><%= x(i-1) %></b></td>
<%else%>
<td align='center' style="background-color: ffcccc; cursor: default; " title='<%=DateAdd("d", i-Weekday(WorkDate), WorkDate) %>' onclick='self.location.href="diary_modify_self.asp?TheDate=<%=DateAdd("d", i-Weekday(WorkDate), WorkDate)%>"'><%= x(i-1) %></td>
<%end if
else%>
<td align='center' style="background-color: 99cccc; cursor: default; " title='<%=DateAdd("d", i-Weekday(WorkDate), WorkDate) %>'><%= x(i-1) %></td>
<%
end if
next%>
</tr>
</table></td>
</tr>
<tr bgcolor="#eeeeee" align="middle">
<td colspan="2" bordercolordark="#ffffff" align="center" height="25"> 您已经输入
<label id="WordCount" name="WordCount" style="color: #111111"> <%=len(DiaryContent)%>
</label>
字(包括换行等特殊符号) </td>
</tr>
<tr bgcolor="#cde7e7">
<td width="50%" align="center" bordercolordark="#ffffff" bgcolor="#f1f1f1">
<input type="submit" ID="Submit1" name="Submit1" value=" 提 交 " <%if len(DiaryContent) < ContentCounter then response.Write("disabled")%> >
</td>
<td bordercolordark="#ffffff" bgcolor="#f1f1f1" width="50%" align="center">
<input type="button" id="Reset1" name="Reset1" value=" 重 写 " onClick="Reset_onclick(DiaryContent);">
</td>
</tr>
</table>
</form>
<script language="javascript">
<!--
function Reset_onclick(tag){
window.Form1.reset();
CountWord(tag);
}
function CountWord(tag) {
var TextCount;
TextCount=tag.value.length;
WordCount.innerText = TextCount;
if ((TextCount < 0) || (TextCount > <%=ContentCounter%>)) {
window.Form1.Submit1.disabled = false;
}
else {
window.Form1.Submit1.disabled = true;
}
}
function Form1_onsubmit() {
if(window.Form1.DiaryContent.value == ''){
alert('日志内容不能为空');
window.Form1.DiaryContent.focus();
return false;
}
else if (window.Form1.WorkAddress.value == ''){
alert('请输入当日工作地点的主关键字。');
window.Form1.WorkAddress.focus();
return false;
}
else if (window.Form1.Weather.value == ''){
alert('请输入今天的天气。');
window.Form1.Weather.focus();
return false;
}
else return true;
}
// language=javascript onClick="ChoiceDate('calendar.asp?form=Form1&field=Time');"
function ChoiceDate(url){
window.open(url,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=190,height=140,top=' + window.event.screenY + ',left='+window.event.screenX );
}
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -