<!--#include file="../inc/DAL.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/page.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
if request.form("Method")="AddGift" then
    ConfigRS.OPEN "select top 1 * from [i_User_Gift]" , DB_CONN , 1 , 3
    ConfigRS.addnew()
    ConfigRS("i_User_Gift_Class")=request.form("Gift_Class")
    ConfigRS("i_User_Gift_Name")=request.form("Gift_Name")
    ConfigRS("i_User_Gift_Price")=request.form("Gift_Price")
    ConfigRS("i_User_Gift_ShowType")=request.form("Gift_ShowType")
    ConfigRS("i_User_Gift_PlayTime")=request.form("Gift_PlayTime")
    ConfigRS("i_User_Gift_SwfUrl")=request.form("Gift_SwfUrl")
    ConfigRS("i_User_Gift_Enable")=request.form("i_User_Gift_Enable")
    ConfigRS("i_User_Gift_Sort")=request.form("i_User_Gift_Sort")
    ConfigRS.update()
    ConfigRS.close()
    RW "<script>location.href='Gift_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
end if

if request.QueryString("Method")="Del" then 
    DB_CONN.EXECUTE("delete from [i_User_Gift] where [i_User_Gift_ID]="&request.QueryString("ID"))
    RW "<script>location.href='Gift_Manage.asp?t="&request.QueryString("t")&"';</script>":response.end()
end if

if request.QueryString("t")="0" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Gift] where [i_User_Gift_Enable]=0 order by [i_User_Gift_Sort] ")
elseif request.QueryString("t")="1" then
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Gift] where [i_User_Gift_Enable]=1 order by [i_User_Gift_Sort] ")
else
    Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Gift] order by [i_User_Gift_Sort] ,[i_User_Gift_Enable] desc")
end if
ConfigRS.pagesize=20
if isempty(request("page")) or request("page")="" then curpage=1 else curpage=Cint(request("page")) end if
if not ConfigRS.eof then ConfigRS.absolutepage = curpage

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ImChat v1.5 Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
<link href="/i/v2/css/level.css" rel="stylesheet" type="text/css" />
<style>
.JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
.JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
</style>
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>礼物管理&nbsp;&nbsp;&nbsp;<a href="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a>&nbsp;&nbsp;&nbsp;<a href="Gift_Manage.asp?t=0" style="text-decoration:none;">普通礼物</a>&nbsp;&nbsp;&nbsp;<a href="Gift_Manage.asp?t=1" style="text-decoration:none;">推荐礼物</a>&nbsp;&nbsp;&nbsp;<a href="GiftPost_Manage.asp?t=1" style="text-decoration:none;">礼物赠送记录</a>&nbsp;&nbsp;&nbsp;<a href="/f/CreatGiftList.asp?ac=CreatGiftList" style="text-decoration:none;">生成静态文件</a></h2>
    </div>
    <div class="contentbox">
        <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
            <th colspan="10">礼物列表</th>
            <tr>
                <td>ID</td>
                <td>图片</td>
                <td>名称</td>
                <td>展示类型</td>
                <td>播放时长</td>
                <td>动画文件</td>
                <td>价格</td>
                <td>推荐</td>
                <td>排序</td>
                <td>操作</td>
            </tr>
            <%
            dim iPage 
            while (not ConfigRS.eof and iPage<ConfigRS.pagesize )
            %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_ID")%></td>
                <td>&nbsp;<img class="<%=ConfigRS("i_User_Gift_Class")%> gift-icon" src="/images/pixel.gif"></td>
                <td>&nbsp;<%=vbsUnEscape(ConfigRS("i_User_Gift_Name"))%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_ShowType")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_PlayTime")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_SwfUrl")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_Price")%></td>
                <td>&nbsp;<%if ConfigRS("i_User_Gift_Enable")="0" then RW "否" else RW "<font color=red>是</font>" end if%></td>
                <td>&nbsp;<%=ConfigRS("i_User_Gift_Sort")%></td>
                <td>&nbsp;<a href="?Method=Del&t=<%=request.QueryString("t")%>&ID=<%=ConfigRS("i_User_Gift_ID")%>" onclick="return confirm('确认要删除吗?');">删除</a>&nbsp;&nbsp;<a href="EditGift.asp?Gift_ID=<%=ConfigRS("i_User_Gift_ID")%>&t=<%=request.QueryString("t")%>">编辑</a>
                </td>
            </tr>
            <%
            iPage=iPage+1
            ConfigRS.MoveNext
            wend
            %>
            <tr>
                <td colspan="10"><%=ExportPageInfo(ConfigRS,curpage,iPage,"Gift_Manage.asp?1=1"&replace(Request.QueryString,"page","1")&"&")%></td>
            </tr>
        </table>
        
        <form action="#" method="post" >
            <table class="CB" width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td width="350">
                        <label for="Gift_Class"><strong>礼物对应的Css样式名:</strong></label>
                        <input type="text" id="Gift_Class" name="Gift_Class" class="inputbox" value=""/>
                    </td>
                    <td>
                        <label for="Gift_Name"><strong>礼物名称:</strong></label>
                        <input type="text" id="Gift_Name" name="Gift_Name" class="inputbox" value=""/>
                    </td>
                </tr>
                <tr>
                    <td width="350">
                        <label for="Gift_Price"><strong>礼物价格(数字):</strong></label>
                        <input type="text" id="Gift_Price" name="Gift_Price" class="inputbox" value="10"/>
                    </td>
                    <td>
                        <label for="i_User_Gift_Enable"><strong>是否推荐:(推荐礼物显示在用户列表下)</strong></label>
                        <select id="i_User_Gift_Enable" name="i_User_Gift_Enable">
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td width="350">
                        <label for="Gift_ShowType"><strong>展示类型(数字:0,1,2,3):</strong></label>
                        <input type="text" id="Gift_ShowType" name="Gift_ShowType" class="inputbox" value="0"/>
                    </td>
                    <td>
                        <label for="Gift_PlayTime"><strong>播放时长(数字):</strong></label>
                        <input type="text" id="Gift_PlayTime" name="Gift_PlayTime" class="inputbox" value="3"/>
                    </td>
                </tr>
                <tr>
					<td width="350">
                        <label for="Gift_SwfUrl"><strong>动画文件(swf):</strong></label>
                        <input type="text" id="Gift_SwfUrl" name="Gift_SwfUrl" class="inputbox" value=""/>
                    </td>
                    <td>
                        <label for="i_User_Gift_Sort"><strong>排序(数字):</strong></label>
                        <input type="text" id="i_User_Gift_Sort" name="i_User_Gift_Sort" class="inputbox" value="0"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="hidden" value="AddGift" name="Method"/>
                        <input type="submit" value="新增" class="btn" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>
