<%@ Page Language="C#" AutoEventWireup="true" Codebehind="appedit.aspx.cs" Inherits="JuSNS.Web.dev.appedit" %>

<!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 id="ptitle" runat="server">编辑应用程序</title>

    <script language="javascript" type="text/javascript" src="../js/ajax.js"></script>

    <script language="javascript" type="text/javascript" src="../js/public.js"></script>

    <link href="../template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css"
        id="skinpath" type="text/css" rel="stylesheet" />
</head>
<body>
    <!--头部-->
    <%=this.GetHtmlShort()%>
    <div id="divhead">
        <%=this.GetHtmlHead()%>
    </div>
    <div id="divbody">
        <div id="body_first">
            <div class="body_menu">
                <%=this.GetHtmlLeft()%>
            </div>
        </div>
        <div id="body_sec">
            <div id="body_mid">
                <div class="body_frame">
                    <div class="body_frame_otherinfo">
                        <div class="title">
                            <div class="l">
                                <img src="../../template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/acc.gif"
                                    align="absmiddle" />
                                <span class="shenlan bold font14 ocolor">应用程序开发者</span></div>
                            <div class="r">
                                <a href="javascript:window.history.back();" title="返回上一页">返回上一页</a></div>
                            <div class="c">
                            </div>
                        </div>
                        <div class="nav-menu">
                            <ul>
                                <li><a href="index.aspx">我的程序</a></li>
                                <li><a href="appnew.aspx">添加程序</a></li>
                                <li class="current"><a href="javascript:void(0);">编辑我的程序</a></li>
                                <li><a href="../help?r=developer" target="_blank">帮助文档</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="body_sec_all">

                        <script type="text/javascript">
                            function chkform()
                            {
                                var form=document.forms["form1"];
                                if(form.appname.value=="")
                                {
                                    alert("应用程序名称不能为空！");
                                    form.appname.focus();
                                    return false;
                                }
                                if(form.url.value==""||form.url.value.indexOf("http")==-1)
                                {
                                    alert("请填写正确的URL！");
                                    form.url.focus();
                                    return false;
                                }
                                return true;
                            }
                        </script>

                        <form id="form1" runat="Server" onsubmit="return chkform();">
                            <div id="errmsg" runat="Server">
                            </div>
                            <div id="sucmsg" runat="Server">
                            </div>
                            <!--主题内容中-->
                            <div class="content">
                                <label class="f-label">
                                    应用名称：</label>
                                <input type="text" name="appname" class="f-text" value="<%# theappinfo.AppName %>"
                                    style="width:300px" />
                            </div>
                            <div class="content">
                                <label class="f-label">
                                    URL：</label>
                                <input type="text" name="url" class="f-text" value="<%# theappinfo.Url %>" style="width: 300px" />
                            </div>
                            <div class="content">
                                <label class="f-label">
                                    分类：</label>
                                <select name="apptype">
                                    <option value="1" <% if(theappinfo.Type==1){Response.Write("selected");} %>>生活娱乐</option>
                                    <option value="2" <% if(theappinfo.Type==2){Response.Write("selected");} %>>新闻资讯</option>
                                    <option value="3" <% if(theappinfo.Type==3){Response.Write("selected");} %>>实用工具</option>
                                    <option value="4" <% if(theappinfo.Type==4){Response.Write("selected");} %>>休闲游戏</option>
                                    <option value="5" <% if(theappinfo.Type==5){Response.Write("selected");} %>>其它</option>
                                </select>
                            </div>
                            <div class="content">
                                <label class="f-label">
                                    简介：</label>
                                <textarea name="description" style="width: 500px; height: 100px;"><%# theappinfo.Description %></textarea>
                            </div>
                            <% if(!string.IsNullOrEmpty(theappinfo.Icon)){
                                  %>
                                  <div class="content">
                                  <label class="f-label"></label>
                                  <img src="<%# GetAppIcon(theappinfo.Icon) %>" alt="图标" />
                                  </div>
                                  <%
                               } %>
                            <div class="content">
                                <label class="f-label">
                                    图标：</label>
                                <asp:FileUpload ID="icon" runat="Server" CssClass="f-text" />
                            </div>
                            <% if (!string.IsNullOrEmpty(theappinfo.MidIcon))
                               {
                                  %>
                                  <div class="content">
                                  <label class="f-label"></label>
                                  <img src="<%# GetAppIcon(theappinfo.MidIcon) %>" alt="中图" />
                                  </div>
                                  <%
                               } %>
                            <div class="content">
                                <label class="f-label">
                                    中图：</label>
                                <asp:FileUpload ID="micon" runat="Server" CssClass="f-text" />
                            </div>
                            <% if (!string.IsNullOrEmpty(theappinfo.BigIcon))
                               {
                                  %>
                                  <div class="content">
                                  <label class="f-label"></label>
                                  <img src="<%# GetAppIcon(theappinfo.BigIcon) %>" alt="大图" />
                                  </div>
                                  <%
                               } %>
                            <div class="content">
                                <label class="f-label">
                                    大图：</label>
                                <asp:FileUpload ID="bicon" runat="Server" CssClass="f-text" />
                            </div>
                            <div class="content">
                                <label class="f-label">
                                </label>
                                <input type="hidden" name="hid" value="<%# theappinfo.AppID %>" />
                                <asp:Button ID="submit" runat="server" Text="修改应用程序信息" CssClass="f-button" OnClick="submit_click" />
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <!--底部-->
            <div class="divbottom">
                <%=this.GetHtmlFoot()%>
            </div>
        </div>
    </div>
</body>
</html>
