<!--#include file="Inc/syscode_photo.asp"-->


<%
if CheckUserLogined()=False then
	response.Redirect "User_Login.asp"
end if

PhotoID=trim(request("PhotoID"))
if PhotoID="" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>请指定要修改的图片ID</li>"
	call WriteErrMsg()
	call CloseConn()
	response.end
else
	PhotoID=CLng(PhotoID)
end if
sql="select * from Photo where PhotoID=" & PhotoID & ""
Set rsPhoto= Server.CreateObject("ADODB.Recordset")
rsPhoto.open sql,conn,1,1
if rsPhoto.bof and rsPhoto.eof then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>找不到图片</li>"
else

end if
if FoundErr=True then
	call WriteErrMsg()
else
	ClassID=rsPhoto("ClassID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="MicroPhoto FrontPage 3.0">
<title>修改图片</title>
<link rel="stylesheet" type="text/css" href="new/css.css">
<script language = "JavaScript">
function CheckForm()
{
  if (document.myform.ClassID.value=="")
  {
    alert("图片所属栏目不能指定为含有子栏目的栏目！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.ClassID.value==0)
  {
    alert("图片所属栏目不能指定为外部栏目！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.ClassID.value=="-1")
  {
    alert("你没有在此栏目添加软件的权限，请选择其他栏目！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.PhotoName.value=="")
  {
    alert("图片名称不能为空！");
	document.myform.PhotoName.focus();
	return false;
  }
  if (document.myform.Keyword.value=="")
  {
    alert("关键字不能为空！");
	document.myform.Keyword.focus();
	return false;
  }
  if (document.myform.PhotoUrl_Thumb.value=="")
  {
    alert("缩略图地址不能为空！");
	document.myform.PhotoUrl_Thumb.focus();
	return false;
  }
  if (document.myform.PhotoSize_Thumb.value=="")
  {
    alert("缩略图文件大小不能为空！");
	document.myform.PhotoSize_Thumb.focus();
	return false;
  }
  if (document.myform.PhotoUrl.value=="")
  {
    alert("原始图片地址不能为空！");
	document.myform.PhotoUrl.focus();
	return false;
  }
  if (document.myform.PhotoSize.value=="")
  {
    alert("原始图片文件大小不能为空！");
	document.myform.PhotoSize.focus();
	return false;
  }
}
</script>
<style type="text/css">
<!--
body {
	background-color: #f2f2f2;
}
-->
</style></head>
<body>

  <!--#include file="top.asp"-->
  <table width="875" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="f2f2f2" class="tde">
    <tr valign="top">
      <td  class="tda">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tdcc">
          <tr>
            <td valign="top">
              <table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" background="isky/topbg.jpg">
                <tr>
                  <td><div align="right"><img src="isky/isky.com.jpg" width="95" height="5"></div></td>
                </tr>
              </table>
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="8">
                <tr>
                  <td valign="top">
                    <table width="100%" height="26" border="0" align="center" class="4" cellpadding="0" cellspacing="0" background="new/ccd.jpg">
                      <tr>
                        <td height="12"><table  width="100%" height="22" border="0" align="center" cellpadding="0" cellspacing="0"">
                            <tr>
                              <td width="18" height="15"><div align="right"><img src="new/ee.gif" width="10" height="12"> </div></td>
                              <td width="195" style="FILTER: dropshadow(color=#ffffff,offx=1,offy=1);color:#333333"><table width="100%" height="1" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td height="1"></td>
                                  </tr>
                                </table>
                                  <strong>&nbsp;作品搜索</strong></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                    <table width="100%" height="8" border="0" align="center"  cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="8"></td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0"  class="4">
                      <tr>
                        <td valign="top" class="2">
                          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="7">
                            <tr>
                              <td height="15"> <span >
                                <% call ShowSearchForm("photo_search.asp",1) %>
                              </span> </td>
                            </tr>
                          </table>
                          <table width="237" height="1" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td height="6"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                    <table width="100%" height="8" border="0" align="center"  cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="8"></td>
                      </tr>
                    </table>
                    <table width="100%" height="26" border="0" align="center" class="4" cellpadding="0" cellspacing="0" background="new/ccd.jpg">
                      <tr>
                        <td height="12">
                          <table  width="100%" height="22" border="0" align="center" cellpadding="0" cellspacing="0"">
                            <tr>
                              <td width="18" height="15">
                                <div align="right"><img src="new/ee.gif" width="10" height="12"> </div></td>
                              <td width="195" style="FILTER: dropshadow(color=#ffffff,offx=1,offy=1);color:#333333">
                                <table width="100%" height="1" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td height="1"></td>
                                  </tr>
                                </table>
                                <strong>&nbsp;热门作品</strong></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                    <table width="100%" height="8" border="0" align="center"  cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="8"></td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0"  class="4">
                      <tr>
                        <td valign="top" class="2">
                          <table width="100%" height="5" border="0" align="center" cellpadding="0" cellspacing="7">
                            <tr>
                              <td height="5">
                                <% call showhot(10,26) %>
                              </td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                    <p>&nbsp;</p></td>
                  <td width="2" background="isky/line.jpg">&nbsp;</td>
                  <td valign="top">
				  
					<form method="POST" name="myform" onSubmit="return CheckForm();" action="User_PhotoSave.asp" target="_self">
                    <table width="100%" height="23" border="0" align="center"  cellpadding="0" cellspacing="0"  class=3>
                      <tr>
                        <td height="20" background="isky/topbg.jpg"><div align="center"> --- &nbsp;&nbsp;<strong>修改图片</strong>&nbsp;&nbsp;---</div></td>
                      </tr>
                    </table>
					  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr align="center">
                        <td>
                          <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td height="33" align="right"><strong>擂台主题：</strong></td>
                              <td colspan="2">
                                <input name="ClassID" type="hidden"
           id="ClassID" value="<%= ClassID %>">
                                <font color="#FF0000"><b>
                                <%
   dim sqlclassd,rsclassd
		sqlclassd="select ClassName from PhotoClass where CLassID=" & rsPhoto("ClassId")
	Set rsclassd= Server.CreateObject("ADODB.Recordset")
	rsclassd.open sqlclassd,conn,1,1
		
		if rsclassd.bof and rsclassd.eof then
			response.write "请指定要发布的擂台主题!!!"
			
		else
			response.write rsclassd("ClassName")
			end if
		rsclassd.close
	set rsclassd=nothing
	
		%>
</b></font></td>
                            </tr>
                            <tr bgcolor="#FFFFFF">
                              <td align="right"><strong>作品名称：</strong></td>
                              <td colspan="2"><input name="PhotoName" type="text" id="PhotoName" value="<%=rsPhoto("PhotoName")%>" size="50" maxlength="255">
                                  <font color="#FF0000"> &nbsp;* 每组图片最多可上传4张</font>
                                  <input name="Keyword" type="hidden"
           id="Keyword" value="d">
                                  <strong>
                                  <input name="AuthorHomepage" type="hidden"
           id="AuthorHomepage" value="http://" size="28" maxlength="100">
                                  <input name="AuthorEmail" type="hidden" id="AuthorEmail" size="28" maxlength="100">
                                  <input name="Author" type="hidden"
           id="Author" size="17" maxlength="100" >
                                </strong></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right"><strong>缩略图：</strong></td>
                              <td width="18">
                                <input name="PhotoUrl_Thumb" type="text" id="PhotoUrl_Thumb" value="<%=rsPhoto("PhotoUrl_Thumb")%>" size="31" maxlength="200"></td>
                              <td width="291"><iframe style="top:2px" ID="UploadFiles" src="upload_Photos.asp?PhotoUrlID=0" frameborder=0 scrolling=no width="290" height="25"></iframe></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right"><strong>图片一：</strong></td>
                              <td>
                                <input name="PhotoUrl" type="text" id="PhotoUrl" value="<%=rsPhoto("PhotoUrl")%>" size="31" maxlength="200"></td>
                              <td><iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=1" frameborder=0 scrolling=no width="290" height="25"></iframe></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right"><strong>图片二：</strong></td>
                              <td>
                                <input name="PhotoUrl2" type="text" id="PhotoUrl2" value="<%=rsPhoto("PhotoUrl2")%>" size="31" maxlength="200">
                              </td>
                              <td><iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=2" frameborder=0 scrolling=no width="290" height="25"></iframe></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right"><strong>图片三：</strong></td>
                              <td>
                                <input name="PhotoUrl3" type="text" id="PhotoUrl3" value="<%=rsPhoto("PhotoUrl3")%>" size="31" maxlength="200">
                              </td>
                              <td><iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=3" frameborder=0 scrolling=no width="290" height="25"></iframe></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right"><strong>图片四：</strong></td>
                              <td>
                                <input name="PhotoUrl4" type="text" id="PhotoUrl4" value="<%=rsPhoto("PhotoUrl4")%>" size="31" maxlength="200">
                              </td>
                              <td><iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=4" frameborder=0 scrolling=no width="290" height="25"></iframe></td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td align="right" valign="middle"><strong>作品描述：</strong><br>
                              支持UBB &nbsp;</td>
                              <td colspan="2">
                                <textarea name="PhotoIntro" cols="64" rows="7" id="PhotoIntro"><%=rsPhoto("PhotoIntro")%></textarea>
                              </td>
                            </tr>
                            <tr bgcolor="#FFFFFF" class="tdbg">
                              <td height="40" align="right"><strong>图片大小：</strong></td>
                              <td colspan="2">&nbsp;图片一：
                                  <input name="PhotoSize" type="text" id="PhotoSize" value="<%=rsPhoto("PhotoSize")%>" size="1" maxlength="10">
                              K&nbsp;&nbsp;图片二：
                              <input name="PhotoSize2" type="text" id="PhotoSize2" value="<%=rsPhoto("PhotoSize2")%>" size="1" maxlength="10">
                              K &nbsp;图片三：
                              <input name="PhotoSize3" type="text" id="PhotoSize3" value="<%=rsPhoto("PhotoSize3")%>" size="1" maxlength="10">
                              K &nbsp; 图片四：
                              <input name="PhotoSize4" type="text" id="PhotoSize4" value="<%=rsPhoto("PhotoSize4")%>" size="1" maxlength="10">
                              K </td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                      <div align="center">
                      <p>
                        <input name="PhotoID" type="hidden" id="PhotoID2" value="<%=PhotoID%>">
                        <input name="Action" type="hidden" id="Action2" value="Modify">
                        <input
  name="Add" type="submit"  id="Add" value=" 保 存 " style="cursor:hand;">
&nbsp;
                      <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='User_PhotoManage.asp'" style="cursor:hand;">
                      </p>
                  </div></form></td>
                </tr>
              </table>
              <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                <tr>
                  <td></td>
                </tr>
            </table></td>
          </tr>
        </table>
        <table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" background="isky/topbg.jpg">
          <tr>
            <td><div align="right"><img src="isky/isky.com.jpg" width="95" height="5"></div></td>
          </tr>
        </table>
        <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#B9B9B9">
          <tr>
            <td></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <table width="875" height="4" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="dddddd">
    <tr>
      <td height="4
	"></td>
    </tr>
  </table>
  <!--#include file="end.asp"-->
  <div align="center"></div>

</body>
</html>
<%
end if
rsPhoto.close
set rsPhoto=nothing
call CloseConn()
%>
