📄 admin_tv.asp
字号:
<!--#include file="admin_conn.asp"-->
<!--#include file="../include/admin_setting.asp"-->
<!--#include file="admin_function.asp"-->
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
Call admin_top()
Call navMenu()
if getPopedom("tvAdmin")=false then
popedomMsg
else
Select Case Request.QueryString("action")
Case "maosin_appTV"
Call appTV()
Case "maosin_appsave"
Call appsave()
Case "maosin_mdftv"
Call modifyTV()
Case "maosin_mdfsava"
Call modifysava()
Case "maosin_deltv"
Call deleteTV()
Case "adminClass"
Call classList()
Case else
Call tvlist()
End Select
end if
Call admin_foot()
Sub navMenu()%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr><td colspan="2" class="td_titleT">网络电视管理</td></tr>
<tr><td width="95" height="30" class="td_bgcolor">管理快捷导航:</td><td class="td_bgcolor"><a href="admin_tv.asp">网络电视管理</a> | <a href="admin_tv.asp?action=maosin_appTV">添加电视节目/分类</a> | <a href="admin_tv.asp?action=adminClass">分类管理</a></td></tr>
</table>
<%
table(5)
End Sub
Sub tvlist()%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr class="td_titleT">
<td width="50" height="17" align="center" valign="middle">编号ID</td>
<td width="*" align="center" valign="middle">电视名称</td>
<td width="80" align="center" valign="middle">播放类型</td>
<td width="80" align="center" valign="middle">观看次数</td>
<td width="130" align="center" valign="middle">加入时间</td>
<td width="100" align="center" valign="middle">操作选项</td>
</tr>
<%
set crs=server.createobject("adodb.recordset")
crs.open "select id,tvName,tvType,tvClick,joinDate,rootid from ms_tv where sflag=1 order by rootid,tvName asc",connstr,1,1
if not crs.bof and not crs.eof then
nextpage=pagetitle(crs,20,"admin_tv.asp?","个电视")
lineNo=1
do while not crs.eof and lineNo<=crs.PageSize
if crs(5)=0 then
tvname="<font style=""color:#00648A;font-weight:bold;"">"&crs(1)&"</font>"
else
tvname="["&className(crs(5))&"] "&crs(1)
end if
%>
<tr class="td_bgcolor" align="center" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)">
<td height="16" align="center" valign="middle"><%=crs(0)%></td>
<td align="left" valign="middle"><%=tvname%></td>
<td align="center" valign="middle"><%=crs(2)%></td>
<td align="center" valign="middle"><%=crs(3)%></td>
<td align="center" valign="middle"><%=crs(4)%></td>
<td align="center" valign="middle"><a href="?action=maosin_mdftv&id=<%=crs(0)%>">编辑</a> <a href="?action=maosin_deltv&id=<%=crs(0)%>">删除</a></td>
</tr>
<%
lineNo=lineNo+1
crs.movenext
loop
%>
<tr valign="middle" class="td_titleB"><td height="17" colspan="6"><%=nextpage%></td></tr>
<%else%>
<tr valign="middle" class="td_bgcolor"><td height="17" colspan="6">当前没有添加任何电视频道</td></tr>
<%end if%>
</table>
<%
crs.close
set crs=nothing
End Sub
function className(rootid)
dim rs
set rs=conn.execute("select tvName from ms_tv where id="&rootid&" and sflag=0 order by rootid asc")
if not rs.eof and not rs.bof then
classname=rs(0)
end if
rs.close
set rs=nothing
end function
Sub classList()%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr class="td_titleT">
<td width="50" height="17" align="center" valign="middle">编号ID</td>
<td width="*" align="center" valign="middle">分类名称</td>
<td width="130" align="center" valign="middle">加入时间</td>
<td width="100" align="center" valign="middle">操作选项</td>
</tr>
<%dim rs
set rs=conn.execute("select id,tvName,joinDate from ms_tv where rootid=0 and sflag=0")
do while not rs.eof%>
<tr class="td_bgcolor" align="center" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)">
<td height="16" align="center" valign="middle"><%=rs(0)%></td>
<td align="left" valign="middle"><%=rs(1)%></td>
<td align="center" valign="middle"><%=rs(2)%></td>
<td align="center" valign="middle"><a href="?action=maosin_mdftv&id=<%=rs(0)%>">编辑</a> <a href="?action=maosin_deltv&id=<%=rs(0)%>">删除</a></td>
</tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</table>
<%End Sub
Sub appTV()%>
<script language="javascript">
function IsClass(objValue){
var Value=objValue.checked;
if (Value){
ctitle.innerText="分类名称";
showcontent.style.display="none";
}else{
ctitle.innerText="电视名称";
showcontent.style.display="block";
}
}
</script>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr align="center" valign="middle">
<td height="22" colspan="2" class="td_titleT">添加电视节目</td>
</tr>
<form action="?action=maosin_appsave" name="form1" method="post">
<tr class="td_bgcolor">
<td width="120" height="22" align="right" valign="middle"><span id="ctitle">电视名称</span>:</td>
<td width="*" valign="middle"><input type="text" name="tvName" size="30" class="wenbenkang"> <input type="checkbox" value="true" name="isclass" id="isclass" onClick="IsClass(this)"><label for="isclass">作为分类</label></td>
</tr>
<tbody id="showcontent">
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">所属类别:</td>
<td valign="top"><select name="rootID"><option value="">请选择所属分类</option><option value="0">根目录</option>
<%dim rs
set rs=conn.execute("select id,tvName from ms_tv where rootid=0 and sflag=0")
do while not rs.eof
response.write("<option value="""&rs(0)&""">"&rs(1)&"</option>")
rs.movenext
loop
rs.close
set rs=nothing%>
</select></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">播放类型:</td>
<td valign="top"><select name="tvType"><option value="">请选择播放类型</option><option value="real">real类型</option><option value="medio">medio类型</option><option value="html">html类型</option></select></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">播放地址:</td>
<td valign="top"><input type="text" name="tvUrl" size="30" class="wenbenkang"></td>
</tr>
</tbody>
<tr>
<td height="22" colspan="2" align="center" valign="middle" class="td_titleB">
<input type="submit" name="Submit" value="确定增加">
<input type="reset" name="Submit2" value="重新填写"> </td>
</tr>
</form>
</table>
<%End Sub
Sub modifyTV()
dim rs,id
id=trim(Request("id"))
if isInteger(id)=false then
adminShowMsg "出错信息","ID参数应为数字整型参数"
exit sub
end if
set rs=conn.execute("select id,tvName,tvUrl,tvType,rootID,sflag from ms_tv where id="&id)
if rs.eof and rs.bof then
adminShowMsg "出错信息","没有频道,或此频道已经删除了"
exit sub
end if
%>
<script language="javascript">
function IsClass(objValue){
var Value=objValue.checked;
if (Value){
ctitle.innerText="分类名称";
showcontent.style.display="none";
}else{
ctitle.innerText="电视名称";
showcontent.style.display="block";
}
}
function isTran(Value){
if (Value==1){
showcontent.style.display="none";
}else{
showcontent.style.display="block";
}
}
</script>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr align="center" valign="middle">
<td height="22" colspan="2" class="td_titleT">修改电视节目</td>
</tr>
<form action="?action=maosin_mdfsava" name="form1" method="post">
<tr class="td_bgcolor">
<td width="120" height="22" align="right" valign="middle"><span id="ctitle">电视名称</span>:</td>
<td width="*" valign="middle"><input type="text" name="tvName" size="30" class="wenbenkang" value="<%=rs(1)%>"><input type="hidden" name="id" value="<%=rs(0)%>">
<input type="checkbox" value="true" name="isclass" id="isclass" onClick="IsClass(this)" <%if rs(5)=0 then%>checked<%end if%>><label for="isclass">作为分类</label></td>
</tr>
<tbody id="showcontent">
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">所属类别:</td>
<td valign="top"><select name="rootID"><option value="">请选择所属分类</option><option value="0" <%if rs(4)=0 and rs(5)=1 then%>selected<%end if%>>根目录</option>
<%dim crs
set crs=conn.execute("select id,tvName from ms_tv where rootid=0 and sflag=0")
do while not crs.eof
if crs(0)=rs(4) then
response.write("<option value="""&crs(0)&""" selected>"&crs(1)&"</option>")
else
response.write("<option value="""&crs(0)&""">"&crs(1)&"</option>")
end if
crs.movenext
loop
crs.close
set crs=nothing%>
</select></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">播放类型:</td>
<td valign="top"><select name="tvType"><option value="">请选择播放类型</option><option value="real"<%if rs(3)="real" then%> selected <%end if%>>real类型</option><option value="medio"<%if rs(3)="medio" then%> selected <%end if%>>medio类型</option><option value="html"<%if rs(3)="html" then%> selected <%end if%>>html类型</option></select></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">播放地址:</td>
<td valign="top"><input type="text" name="tvUrl" size="30" class="wenbenkang" value="<%=rs(2)%>"></td>
</tr>
</tbody>
<tr>
<td height="22" colspan="2" align="center" valign="middle" class="td_titleB">
<input type="submit" name="Submit" value="保存修改">
<input type="reset" name="Submit2" value="重新填写"> </td>
</tr>
</form>
</table>
<script language="javascript"><%if rs(5)=0 then%> isTran(1) <%end if%></script>
<%
rs.close
set rs=nothing
End Sub
Sub appsave()
dim tvName,rootID,tvType,tvUrl,isclass,sql,errMsg
tvName=trim(Request("tvName"))
rootID=trim(Request("rootID"))
tvType=trim(Request("tvType"))
tvUrl=trim(Request("tvUrl"))
isclass=trim(Request("isclass"))
tvName=chkFormStr(tvName)
if tvName="" then
errMsg="<li>电视名称或分类名称不能为空</li>"
end if
if isclass<>"true" then
if not isInteger(rootID) then
errMsg=errMsg&"<li>分类ID不字数字整型参数或为空</li>"
end if
if tvType="" then
errMsg=errMsg&"<li>请选择播放类型</li>"
end if
if tvUrl="" then
errMsg=errMsg&"<li>播放地址不能为空</li>"
end if
end if
if errMsg<>"" then
adminShowMsg "出错信息",errMsg
exit sub
end if
if isclass="true" then
sql="insert into ms_tv(tvName,tvUrl,tvType,rootID,sflag,joinDate) values('"&tvName&"','"&tvUrl&"','"&tvType&"',0,0,#"&now()&"#)"
else
sql="insert into ms_tv(tvName,tvUrl,tvType,rootID,sflag,joinDate) values('"&tvName&"','"&tvUrl&"','"&tvType&"',"&rootid&",1,#"&now()&"#)"
end if
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,频道已添加成功</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回网络电视管理页......</b><meta http-equiv=refresh content=3;url=admin_tv.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub modifysava()
dim id,tvName,rootID,tvType,tvUrl,isclass,sql
id=trim(Request("id"))
tvName=trim(Request("tvName"))
rootID=trim(Request("rootID"))
tvType=trim(Request("tvType"))
tvUrl=trim(Request("tvUrl"))
isclass=trim(Request("isclass"))
tvName=chkFormStr(tvName)
if tvName="" then
errMsg="<li>电视名称或分类名称不能为空</li>"
end if
if isclass<>"true" then
if not isInteger(rootID) then
errMsg=errMsg&"<li>分类ID不字数字整型参数或为空</li>"
end if
if tvType="" then
errMsg=errMsg&"<li>请选择播放类型</li>"
end if
if tvUrl="" then
errMsg=errMsg&"<li>播放地址不能为空</li>"
end if
end if
if errMsg<>"" then
adminShowMsg "出错信息",errMsg
exit sub
end if
if isclass="true" then
sql="update ms_tv set tvName='"&tvName&"',tvUrl='"&tvUrl&"',tvType='"&tvType&"',rootid=0,sflag=0 where id="&id
else
sql="update ms_tv set tvName='"&tvName&"',tvUrl='"&tvUrl&"',tvType='"&tvType&"',rootid="&rootid&",sflag=1 where id="&id
end if
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,频道已修改成功了</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回频道管理页......</b><meta http-equiv=refresh content=3;url=admin_tv.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub deleteTV()
if getPopedom("channelAdmin")=false then
popedomMsg
exit sub
end if
dim id
id=Request.QueryString("id")
if not isInteger(id) then
adminShowMsg "操作出错","参数应为数字型"
exit sub
end if
sql="delete from ms_tv where id="&id
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,已成功删除一条频道信息</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回网络电视管理页......</b><meta http-equiv=refresh content=3;url=admin_tv.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -