<!--#include file="../conn.asp" -->
<!--#include file="inc.asp" -->
<%
xinyanlei="book"
if session("username")="" then
response.Redirect("login.asp?action=err")
response.End()
else
diaryid=request.QueryString("diaryid")
set rs=server.CreateObject("adodb.Recordset")
sql="Select * From diary where diaryid="&diaryid
Rs.Open sql,conn,1,1
userid=rs("userid")
if session("userid")=userid then
username=session("username")
userid=session("usreid")
else
%>
<script language='Javascript'>alert("您无权修改其他用户的信息!");history.back();</script>
<%
response.end
end if
end if

userid=session("userid")
set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diaryuser where userid="&userid&""
Rs.Open Sql2,conn,1,1
IF Not Rs.Eof Then
amount=rs("amount")
gongao=rs("gongao")
rs.close
end if

diaryid=request.QueryString("diaryid")

set rs=server.CreateObject("adodb.Recordset")
sql="Select * From diary where diaryid="&diaryid
Rs.Open sql,conn,1,1
title=rs("title")
content=rs("content")
tq=rs("tq")
bg=rs("bg")
mtype=rs("mtype")
display=rs("display")
typeid=rs("typeid")
xq=rs("xq")
rs.close
set rs=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>心情日记本·分享你我的心情</title>
<meta name="keywords" content="日记,日记,日记,日记,日记,免费,免费,免费,免费,日记,心情日记,网络日记,免费日记,隐私日记,交换日记,粉可爱留言本、日记本申请">
<link href="<%=alltubg%>css.css" rel="stylesheet" type="text/css">
<script src="<%=alltubg%>alt.js"></script>
<script language="JavaScript">
function CheckForm()
{
    if (document.WriteForm.title.value.length <2 || document.WriteForm.title.value.length >30) {
		alert("请填写标题.二到三十位");
		document.WriteForm.title.focus();
		return false;
	}

	if (document.WriteForm.tq[0].checked == false&&document.WriteForm.tq[1].checked == false&&document.WriteForm.tq[2].checked == false&&document.WriteForm.tq[3].checked == false&&document.WriteForm.tq[4].checked == false&&document.WriteForm.tq[5].checked == false&&document.WriteForm.tq[6].checked == false&&document.WriteForm.tq[7].checked == false&&document.WriteForm.tq[8].checked == false&&document.WriteForm.tq[9].checked == false) {
		alert("请选择天气.");
		return false;
	}

	if (document.WriteForm.Content.value.length == 0) {
		alert("请输入日记内容.");
		document.WriteForm.Content.focus();
		return false;
	}
	return true;
}
</script>
<script language="javascript">
	function SwitchCover(nCover,nBookID,sImageType)
	{
		if(nCover==-1)
			WriteForm.preview.src="<%=alltubg%>"+nBookID+"."+sImageType
		else
			WriteForm.preview.src="<%=alltubg%>"+nCover+""
	
		}
			function SwitchCovertq(nCover,nBookID,sImageType)
	{
			WriteForm.tqpre.src="<%=alltubg%>"+nCover+""
	}
	function SetCurrentCover(nCover)
	{
		bookcover=document.all("bookcover")
		for(var i=0;i<bookcover.options.length;i++)
		{
			if(bookcover(i).value==nCover)
			{
				bookcover(i).selected=true;
				return;
			}
		}
	}
	
</script>
<script charset="utf-8" src="<%=diarydir%>e/kindeditor.js"></script>
			<script>			
			KE.show({
				id : 'content',
				resizeMode : 0,
				allowPreviewEmoticons : false,
				allowUpload : false,
				items : [
		 'fullscreen', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
		'justifyleft', 'justifycenter', 'justifyright','plainpaste', 'wordpaste','-',
		 'insertorderedlist', 'insertunorderedlist', 'indent','outdent', 'subscript',
		'superscript','title', 'fontname', 'fontsize', 'textcolor', '-','bgcolor', 'bold','italic', 'underline', 'strikethrough', 'removeformat', 
		'image','flash','media', 'advtable', 'hr', '-','emoticons', 'emoticonshq','emoticonsbz','emoticonsww','emoticonslv','emoticonsle','emoticonsjz','emoticonsjj','link', 'unlink','qimage' ]
			});
		</script>
</head>
<body background="<%=bgrnd%>" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
<form language="javascript" name="WriteForm" method="post" action="ok.asp?action=edit" onSubmit="return CheckForm()">
<table width="985" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td> <!--#include file="head.asp" -->
      <table width="985" border="0" cellspacing="0" cellpadding="0" height="452">
        <tr> 
          <td width="20">&nbsp;</td>
          <td height="452" background="<%=alltubg%>bg1.gif" width="703"> 
            <table width="703" border="0" cellspacing="0" cellpadding="0" height="452">
              <tr> 
                <td height="5" width="56"></td>
                <td width="288"></td>
                <td rowspan="3" width="21"></td>
                <td width="284"></td>
                <td width="57"></td>
              </tr>
              <tr> 
                <td height="380" width="56">&nbsp;</td>
                <td width="288" valign="top"> 
                  <table border="0" width="288" id="table6" cellspacing="0" cellpadding="0" height="100%">
                    <tr> 
                      <td height="15" width="288" colspan="2"> <img border="0" src="<%=alltubg%>ADDNEW.gif" width="250" height="55"></td>
                    </tr>
                    <tr> 
                      
                <td height="69" width="288" colspan="2" align="center"> <img id="preview" src="<%=alltubg%><%=bg%>" height="69"></td>
</tr>
                      <tr> 
                        <td width="288" height="4" colspan="2"> <img border="0" src="<%=alltubg%>linebg.gif" width="4" height="1"></td>
                      </tr>
<tr> 
                      <td width="86" height="19">&nbsp; <img border="0" src="<%=alltubg%>bt.gif" width="60" height="13"></td>
                      <td width="202" height="19"> 
                        <input name="title" type="text" id="title3" value=<%=title%> size="20">
                      </td>
                    </tr>
                      <tr> 
                        <td width="86" height="19"> &nbsp; <img border="0" src="<%=alltubg%>fl.gif" width="60" height="13"></td>
                        <td width="208" height="19"> 					  
                  <select name="list" style="width:120px" size="1">
<%
set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diarytype where userid="&userid&" order by id"
Rs.Open Sql2,conn,1,1
do while not rs.eof
%> 
                    <option value="<%=rs("id")%>$<%=rs("type")%>" <%if typeid=rs("id") then response.Write("selected")%>><%=rs("type")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
set sql2=nothing
%>
                  </select>
                        </td>
                      </tr>
                    <tr> 
                      <td width="86" height="19">&nbsp; <img border="0" src="<%=alltubg%>display.gif" width="60" height="13"></td>
                      <td width="202" height="19">公开 
                        <input name="display" type="radio" value="1" <%if display=1 then response.Write("checked")%>>
                        　 秘密 
                        <input type="radio" name="display" value="0" <%if display=0 then response.Write("checked")%>>
                      </td>
                    </tr>
<tr> 
                <td width="86" height="19"> </td>
                <td width="208" height="19"> 
                  <input name="mtype" type="radio" value="1"  <%if mtype="1" then response.Write("checked")%> onClick="InitPeitu(1);SwitchCover('play/bg/01.jpg',6913,'jpg')" checked>
                  精致型&nbsp; 
                  <input type="radio" name="mtype" value="2"  <%if mtype="2" then response.Write("checked")%> onClick="InitPeitu(2);SwitchCover('play/bg/01.jpg',6913,'jpg')">
                  宽阔型 </td>
              </tr>
              <tr> 
                <td width="86" height="19" align="center"><img border="0" src="<%=alltubg%>mb.gif"></td>
                <td width="208" height="19"> 
                  <input type="radio" name="mtype" value="3" <%if mtype="3" then response.Write("checked")%> onClick="InitPeitu(3);SwitchCover('play/lr/01.jpg',6913,'jpg')">
                  左图型&nbsp; 
                  <input type="radio" name="mtype" value="4" <%if mtype="4" then response.Write("checked")%> onClick="InitPeitu(4);SwitchCover('play/lr/01.jpg',6913,'jpg')">
                  右图型</td>
              </tr>
              <tr> 
                <td width="86" height="19">&nbsp;</td>
                <td width="208" height="19"> 
                  <input type="radio" name="mtype" value="5" <%if mtype="5" then response.Write("checked")%> onClick="InitPeitu(5);SwitchCover('play/jd/51.jpg',6913,'jpg')">
                  经典型</td>
              </tr>
                    <tr> 
                      <td width="86" height="19">&nbsp; <img border="0" src="<%=alltubg%>xq.gif" width="60" height="12"></td>
                      <td width="202" height="19"> 
                        <select name="xq" class="input" id="xq" style="width:120px" size="1">
 <%
set rs=server.CreateObject("adodb.Recordset")
sql2="select * from xqlist order by xqorder"
Rs.Open Sql2,conn,1,1
do while not rs.eof
%>
<option value="<%=rs("xqorder")%>" <%if rs("xqorder")=CInt(xq) then response.Write("selected")%>><%=rs("xqname")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
set sql2=nothing
%>					  
                        </select>
                      </td>
                    </tr>
                    <tr> 
                      <td width="86" height="19">&nbsp; <img border="0" src="<%=alltubg%>bg.gif" width="60" height="13"></td>
                      <td width="202" height="19"> 
                        <select name="bg" class="input" id="bg" style="width:120px" onChange="SwitchCover(this.value,6913,'jpg')">
                          <option value="play/bg/01.jpg" <%if bg="play/bg/01.jpg" then response.Write("selected")%>>夕阳桥梁</option>
                          <option value="play/bg/02.jpg" <%if bg="play/bg/02.jpg" then response.Write("selected")%>>沙滩少女</option>
                          <option value="play/bg/03.jpg" <%if bg="play/bg/03.jpg" then response.Write("selected")%>>心灵翘动</option>
                          <option value="play/bg/04.jpg" <%if bg="play/bg/04.jpg" then response.Write("selected")%>>甜蜜一刻</option>
                          <option value="play/bg/05.jpg" <%if bg="play/bg/05.jpg" then response.Write("selected")%>>心灵孤独</option>
                          <option value="play/bg/06.jpg" <%if bg="play/bg/06.jpg" then response.Write("selected")%>>海边小车</option>
                          <option value="play/bg/07.jpg" <%if bg="play/bg/07.jpg" then response.Write("selected")%>>月色清照</option>
                          <option value="play/bg/08.jpg" <%if bg="play/bg/08.jpg" then response.Write("selected")%>>候鸟飞翔</option>
                          <option value="play/bg/09.jpg" <%if bg="play/bg/09.jpg" then response.Write("selected")%>>美好童年</option>
                          <option value="play/bg/10.jpg" <%if bg="play/bg/10.jpg" then response.Write("selected")%>>心灵相伴</option>
                          <option value="play/bg/11.jpg" <%if bg="play/bg/11.jpg" then response.Write("selected")%>>童真年代</option>
                          <option value="play/bg/12.jpg" <%if bg="play/bg/12.jpg" then response.Write("selected")%>>树林小路</option>
                          <option value="play/bg/13.jpg" <%if bg="play/bg/13.jpg" then response.Write("selected")%>>飘进心灵</option>
                          <option value="play/bg/14.jpg" <%if bg="play/bg/14.jpg" then response.Write("selected")%>>勇往直前</option>
                          <option value="play/bg/15.jpg" <%if bg="play/bg/15.jpg" then response.Write("selected")%>>黄色情结</option>
                          <option value="play/bg/16.jpg" <%if bg="play/bg/16.jpg" then response.Write("selected")%>>花言巧语</option>
                          <option value="play/bg/17.jpg" <%if bg="play/bg/17.jpg" then response.Write("selected")%>>古堡河畔</option>
                          <option value="play/bg/18.jpg" <%if bg="play/bg/18.jpg" then response.Write("selected")%>>思念</option>
                          <option value="play/bg/19.jpg" <%if bg="play/bg/19.jpg" then response.Write("selected")%>>快乐飞起</option>
                          <option value="play/bg/20.jpg" <%if bg="play/bg/20.jpg" then response.Write("selected")%>>疑惑</option>
                          <option value="play/bg/21.jpg" <%if bg="play/bg/21.jpg" then response.Write("selected")%>>下一站</option>
                          <option value="play/bg/22.jpg" <%if bg="play/bg/22.jpg" then response.Write("selected")%>>放飞快乐</option>
                          <option value="play/bg/23.jpg" <%if bg="play/bg/23.jpg" then response.Write("selected")%>>流星物语</option>
                          <option value="play/bg/24.jpg" <%if bg="play/bg/24.jpg" then response.Write("selected")%>>星空夜城</option>
                          <option value="play/bg/25.jpg" <%if bg="play/bg/25.jpg" then response.Write("selected")%>>迷失方向</option>
                          <option value="play/bg/26.jpg" <%if bg="play/bg/26.jpg" then response.Write("selected")%>>水果</option>
                          <option value="play/bg/27.jpg" <%if bg="play/bg/27.jpg" then response.Write("selected")%>>一生一世</option>
                          <option value="play/bg/28.jpg" <%if bg="play/bg/28.jpg" then response.Write("selected")%>>花中寄语</option>
                          <option value="play/bg/29.jpg" <%if bg="play/bg/29.jpg" then response.Write("selected")%>>黄金海岸</option>
                          <option value="play/bg/30.jpg" <%if bg="play/bg/30.jpg" then response.Write("selected")%>>栈桥黄昏</option>
                          <option value="play/bg/31.jpg" <%if bg="play/bg/31.jpg" then response.Write("selected")%>>独依窗台</option>
                          <option value="play/bg/32.jpg" <%if bg="play/bg/32.jpg" then response.Write("selected")%>>心爱宝宝</option>
                          <option value="play/bg/33.jpg" <%if bg="play/bg/33.jpg" then response.Write("selected")%>>秋千之恋</option>
                        </select>
                  <script type="text/javascript">
InitPeitu(<%=mtype%>,'<%=bg%>');
</script>
                      </td>
                    </tr>
                    <tr> 
                      <td width="86" height="19">&nbsp; <img border="0" src="<%=alltubg%>tq.gif" width="60" height="12"></td>
                      <td width="202" height="19"> 
<select name="tq" class="input" id="tq" style="width:120px" onChange="SwitchCovertq(this.value,6913,'jpg')">					
<option value="tq/1.gif" <% if tq="tq/1.gif" then response.Write("selected") %>>晴天</option>
<option value="tq/2.gif" <% if tq="tq/2.gif" then response.Write("selected") %>>阴晴</option>
<option value="tq/3.gif" <% if tq="tq/3.gif" then response.Write("selected") %>>多云</option>
<option value="tq/4.gif" <% if tq="tq/4.gif" then response.Write("selected") %>>下雨</option>
<option value="tq/5.gif" <% if tq="tq/5.gif" then response.Write("selected") %>>闪电</option>
<option value="tq/6.gif" <% if tq="tq/6.gif" then response.Write("selected") %>>有风</option>
<option value="tq/7.gif" <% if tq="tq/7.gif" then response.Write("selected") %>>冰雹</option>
<option value="tq/8.gif" <% if tq="tq/8.gif" then response.Write("selected") %>>彩虹</option>
<option value="tq/9.gif" <% if tq="tq/9.gif" then response.Write("selected") %>>下雪</option>
<option value="tq/10.gif" <% if tq="tq/10.gif" then response.Write("selected") %>>雪晴</option>
</select>&nbsp;<img id="tqpre" name="tqpre" src="<%=alltubg%>tq/1.gif" alt="今天天气晴" width="13" height="13" align="absmiddle">						
 </td>
                    </tr>
                    <tr> 
                      
                <td width="288" colspan="2">&nbsp; </td>
                    </tr>
                  </table>
                </td>
                <td align="center">
                  <table border="0" width="100%" id="table7" cellspacing="0" cellpadding="0" height="100%">
                    <tr> 
                      <td height="15"></td>
                    </tr>
                    <tr> 
                      <td align="center"> 
                          <textarea id="Content"  name="Content" style="width:280px;height:300px;"><%=content%></textarea>
                          <input name="diaryid" type="hidden" id="diaryid" value="<%=diaryid%>">
                      </td>
                    </tr>
                    <tr> 
                      <td> 
                        <p align="center"> 
                          <input type="submit" name="Submit" value=" 写 好 了 ">
                          &nbsp; 
                          <input type="reset" name="Submit2" value=" 重 新 来 ">
                      </td>
                    </tr>
                    <tr> 
                      <td width="284" height="20"></td>
                    </tr>
                  </table>
                </td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td height="67">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
          <td width="272"> 
            <!--#include file="right1.asp" -->
          </td>
        </tr>
      </table>
      <!--#include file="bottom.asp" -->
    </td>
  </tr>
  <tr> 
    <td></td>
  </tr>
</table>
</form>
</body>

</html>



