<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: media.asp
' Version:3.0
' Date: 2005-11-5
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
stats="在线电影"
call nav()
if founderr then
	call head_var("","")
	call Mslove_error()
else
	call head_var("在线电影","media.asp")
	if request("action")="" then
call main()
elseif request("action")="add" then
call add()
elseif request("action")="addsave" then
call addsave()
end if
if founderr=true then call Mslove_error()
end if
call activeonline()
call footer()

sub main()%>


    <TABLE width=750 height=1 border=0 align="center" cellPadding=0 
cellSpacing=0 borderColor=#111111 bgColor=#ffffff style="BORDER-COLLAPSE: collapse">
      <TBODY>
        <TR> 
          <TD vAlign=bottom width="179%" background=images/media/line.gif 
    height=16><SPACER width="5" type="block" /></TD>
        </TR>
      </TBODY>
    </TABLE>
    
<TABLE width=750 height=33 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
        <TR> 
          <TD width=48 background=images/media/top_003.jpg>&nbsp;</TD>
          <TD width=702 background=images/media/top_003.jpg> <TABLE height=32 cellSpacing=0 cellPadding=0 width=621 border=0>
          <TBODY>
                <TR> 
                  
              <TD height="32"> 
                <DIV align=center><A href="media.asp"><FONT 
            color=#cccccc>首 页</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=1"><FONT 
            color=#cccccc>动作片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=2"><FONT 
            color=#cccccc>喜剧片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=3"><FONT 
            color=#cccccc>爱情片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=4"><FONT 
            color=#cccccc>恐怖片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=5"><FONT 
            color=#cccccc>战争片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=6"><FONT 
            color=#cccccc>科幻片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=7"><FONT 
            color=#cccccc>综艺片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=8"><FONT 
            color=#cccccc>动画片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=9"><FONT 
            color=#cccccc>连续剧</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=10"><FONT 
            color=#cccccc>剧情片</FONT></A><FONT color=#cccccc>|</FONT> <A 
            href="media_list.asp?typeid=11"><FONT 
            color=#cccccc>其他</FONT></A> 
        <FONT color=#cccccc>|</font> <a href="media.asp?action=add"><FONT color=#cccccc>发布</FONT></a></DIV></TD>
                </TR>
              </TBODY>
            </TABLE></TD>
        </TR>
      </TBODY>
    </TABLE>
  <table width="750" align=center cellpadding=0 cellspacing=0>
    <TR>
     <TD width="100%" bgColor=#f3f3f3><IFRAME marginWidth=0 
                  marginHeight=0 src="media_top.asp" frameBorder=0 
                  width=750 scrolling=no 
          height=165></IFRAME></TD></TR>
  </table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
  <tr>
    <td background="images/media/top_003.jpg">&nbsp;</td>
  </tr>
</table>
<table width="750" align=center cellpadding=0 cellspacing=0>
  <TR> 
    <TD width="27%" height="300" valign="top" bgColor=#f3f3f3>
	<TABLE cellSpacing=0 cellPadding=0 width=194 border=0 style="border-right:#999999 1px solid;height:100%"><TBODY>
        <TR> 
          <TD width=194 bgColor=#cecece height=22><IMG 
                        src="images/media/y5.jpg" border=0></TD>
        </TR>
        <TR> 
            <TD width="194" valign="top"> 
              <TABLE style="BORDER-COLLAPSE: collapse" 
                        borderColor=#111111 cellSpacing=0 cellPadding=0 
                        width=194 border=0>
                <TBODY>
                <TR>
                  <TD width=194 height=1> 
				<TABLE cellSpacing=1 cellPadding=0 width=195 border=0>
                      <TBODY>
					  <%sql="select top 20 ID,Title,Hits from [Ms_media] where Checked=1 order by hits desc"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
i=0
do while not rs.eof
i=i+1%>
                        <TR> 
                          <TD width=151 height=18><%=i%>．<a href=media_view.asp?id=<%=rs(0)%>><%=rs(1)%></a></TD>
                          <TD width=40><%=rs(2)%></TD>
                        </TR>
<%rs.movenext
loop
else
response.Write("<TR><TD height=20>暂时无影片</TD></TR>")
end if
rs.close%>
                      </TBODY>
                    </TABLE>
					</TD>
                  </SPAN></TR>
                <TR> 
                    <TD width="50%">&nbsp;</TD>
              </TR>
              </span></TABLE>
            </TD>
        </TR></TBODY>
      </TABLE></TD>
    <TD width="73%" valign="top" bgColor=#f3f3f3> 
      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
        <TBODY>
          <%dim it
		for it=1 to 8%>
          <TR> 
            <TD vAlign=top align=middle width=45 height=70><IMG height=40 
                  src="images/media/movie<%=it%>.jpg" width=20></TD>
            <TD vAlign=top width=575 height=70> <TABLE cellSpacing=0 cellPadding=0 width=460 align=center 
                  border=0>
                <TBODY>
                  <TR> 
                    <%sql="select top 12 ID,Title from [Ms_media] where typeid="&it&" and Checked=1 order by addtime desc"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
i=0
do while not rs.eof
i=i+1%>
                    <TD width=115 height=25><a href=media_view.asp?id=<%=rs(0)%>><%=rs(1)%></a></TD>
                    <%if i>0 and i mod 4=0 then
					response.Write("</tr><tr>")
					end if
					rs.movenext
					loop
					end if
					rs.close%>
                  </TR>
                </TBODY>
              </TABLE></TD>
          </TR>
		  <%next%>
        </TBODY>
      </TABLE></TD>
  </TR>
</table>
<%
end sub

sub add()
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有<a href=login.asp>登陆</a>，不能发布。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！"
	FoundErr=True
end if
if FoundErr=True then exit sub
%>
<script language = 'JavaScript'>
function selectPaginationType(){
  document.theForm.PaginationType.value=2;
}
function CheckForm(){
  var CurrentMode=editor.CurrentMode;
  if (CurrentMode==0){
    document.theForm.Content.value=editor.HtmlEdit.document.body.innerHTML; 
  }
  else if(CurrentMode==1){
   document.theForm.Content.value=editor.HtmlEdit.document.body.innerText;
  }
  else{
    alert('预览状态不能保存！请先回到编辑状态后再保存');
    editor.HtmlEdit.focus();
     return false;
  }
if (document.theForm.Title.value==''){
     alert('影片名称不能为空！');
     document.theForm.Title.focus();
     return false;
  }
    if (document.theForm.Content.value==''){
      alert('影片简介不能为空！');
      editor.HtmlEdit.focus();
      return false;
    }
}
</script>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
  <form action="?action=addsave" method=POST onSubmit='return CheckForm();' name="theForm">
    <tr align="left"> 
      <th height="28" colspan="2"  class=tablebody1>发布电影</th>
    </tr>
    <tr align="center"> 
      <td width="16%"  class=tablebody2>影片名称： </td>
      <td width="84%" align="left"  class=tablebody2><input name="Title" type="text" id="Title"></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>领衔主演：</td>
      <td align="left"  class=tablebody2><input name="Audors" type="text" id="Audors"></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>影片类型：</td>
      <td align="left"  class=tablebody2><select name="Typeid" id="Typeid">
          <option value="1">爱情片</option>
          <option value="2">战争片</option>
          <option value="3">动作片</option>
          <option value="4">喜剧片</option>
          <option value="5">科幻片</option>
          <option value="6">恐怖片</option>
          <option value="7">动画片</option>
          <option value="8">剧情片</option>
          <option value="9">综艺片</option>
          <option value="10">连续剧</option>
          <option value="11">其他类</option>
        </select></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>出产地区：</td>
      <td align="left"  class=tablebody2><input name="Address" type="text" id="Address" maxlength="100"></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>影片长度：</td>
      <td align="left"  class=tablebody2><input name="Howlong" type="text" id="Howlong" size="10">
        分钟</td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>推荐级别：</td>
      <td align="left"  class=tablebody2><select name="Viewtj" id="Viewtj">
          <option value="1">一星</option>
          <option value="2">二星</option>
          <option value="3" selected>三星</option>
          <option value="4">四星</option>
          <option value="5">五星</option>
        </select></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>播放格式：</td>
      <td align="left"  class=tablebody2><select name="Files" id="Files">
          <option value="rm">rm</option>
          <option value="wmv" selected>wmv</option>
          <option value="Avi">Avi</option>
          <option value="mpg">mpg</option>
          <option value="wma">wma</option>
        </select></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>影片图片：</td>
      <td align="left"  class=tablebody2><input name="Mediapic" type="text" id="Mediapic" size="30" maxlength="150"></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>影片地址：</td>
      <td align="left"  class=tablebody2><input name="Mediaurl" type="text" id="Mediaurl" size="40" maxlength="200"></td>
    </tr>
    <tr align="center"> 
      <td  class=tablebody2>影片属性：</td>
      <td align="left"  class=tablebody2>金币： <input name="View_mo" type="text" id="View_mo" value="0" size="5">
        经验： <input name="View_ep" type="text" id="View_ep" value="0" size="5">
        魅力： <input name="View_cp" type="text" id="View_cp" value="0" size="5">
        请输入数字型，会员播放你可以得到的哦！</td>
    </tr>
    <tr align="center"> 
      <td align="center"  class=tablebody1>影片简介：</td>
      <td align="left"  class=tablebody1><textarea name='Content' style='display:none'></textarea> 
        <iframe id='editor' src='editor.asp' frameborder=0 scrolling=no width='520' height='405'></iframe></td>
    </tr>
    <tr align="center"> 
      <td colspan="2"  class=tablebody1> 
        <input class=2 type=Submit value="保存" name=Submit> 
        &nbsp; <input class=2 type="reset" name="Clear" value="清除">
      </td>
    </tr>
  </form>
</table>
<%end sub

sub addsave()
if Not ChkPost then'查检提交数据
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从外部提交发言。"
   	FoundErr=True
end if
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有<a href=login.asp>登陆</a>，不能发布。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！"
	exit sub
end if
dim Title,Typeid,Content,Audors,Address
dim Howlong,Viewtj,Files,Mediapic,Mediaurl
dim View_mo,View_ep,View_cp
Typeid=Checkstr(Request.Form("Typeid"))
Audors=Checkstr(Request.Form("Audors"))
Title=Checkstr(trim(request.Form("Title")))
Address=Checkstr(trim(request.Form("Address")))
Howlong=Checkstr(trim(request.Form("Howlong")))
Mediapic=Checkstr(trim(request.Form("Mediapic")))
Content=Checkstr(request.form("Content"))
Mediaurl=Checkstr(trim(request.Form("Mediaurl")))
View_mo=Checkstr(trim(request.Form("View_mo")))
View_ep=Checkstr(trim(request.Form("View_ep")))
View_cp=Checkstr(trim(request.Form("View_cp")))
if Typeid="" or not isInteger(Typeid) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法参数。"
else
Typeid=clng(Typeid)
end if
if Title="" then
	FoundErr=True
	ErrMsg=ErrMsg+"<Br>"+"<li>影片不应为空。"
elseif strLength(Title)>100 then
	FoundErr=True
	ErrMsg=ErrMsg+"<Br>"+"<li>影片长度不能超过100"
end if
if Audors<>"" and strLength(Audors)>100 then
		FoundErr=True
		ErrMsg=ErrMsg+"<Br>"+"<li>领衔主演不大于100"
	end if
	if Address<>"" and strLength(Address)>100 then
		FoundErr=True
		ErrMsg=ErrMsg+"<Br>"+"<li>出产地区不大于100"
	end if
	if Howlong<>"" and strLength(Howlong)>10 then
		FoundErr=True
		ErrMsg=ErrMsg+"<Br>"+"<li>影片长度不大于10"
	end if
	if View_mo="" or not isInteger(View_mo) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>金币不能为空的数字型数字。"
end if
if View_ep="" or not isInteger(View_ep) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>经验不能为空的数字型数字。"
end if
if View_cp="" or not isInteger(View_cp) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>魅力不能为空的数字型数字。"
end if
if Mediaurl="" or strLength(Mediaurl)>200 then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>影片文件地址不能为空。"
end if
if founderr=true then call Mslove_error()
sql="insert into Ms_media (Title,Mediapic,Mediaurl,Files,Content,Typeid,Username,Audors,Address,Howlong,Viewtj,View_mo,View_ep,View_cp,Addtime,Checked) values  ('"&Title&"','"&Mediapic&"','"&Mediaurl&"','"&request("Files")&"','"&Content&"',"&Typeid&",'"&trim(membername)&"','"&Audors&"','"&Address&"',"&Howlong&","&request("Viewtj")&","&View_mo&","&View_ep&","&View_cp&",now(),0)"
conn.execute(sql)
	sucmsg=sucmsg+"<br>"+"<li>您已成功发布影片。"
	call Mslove_suc()
end sub%>