<%@ page language="C#" autoeventwireup="true" inherits="admin_product_addproduct, webpages" enableeventvalidation="false" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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 runat="server">
    <title>无标题页</title>
<meta name="Author"  content="webpages CMS" />
<link rel="stylesheet" href="../master.css" type="text/css">
<script language="javascript">
//jb函数会根据不同的浏览器初始化个xmlhttp对象
function jb( )
{
    var A=null;
    try
    {
        A=new ActiveXObject( "Msxml2.XMLHTTP" );
    }
    catch( e )
    {
        try
        {
            A=new ActiveXObject( "Microsoft.XMLHTTP" );
        }
        catch( oc )
        {
            A=null
        }
    }
    if (!A && typeof XMLHttpRequest != "undefined")
    {
        A=new XMLHttpRequest( )
    }
    return A
}
//下面Go函数是父列表框改变的时候调用,参数是选择的条目
function Go( obj )
{
    //得到选择框的下拉列表的value
    var svalue = obj.value;
    //定义要处理数据的页面
    var weburl = "addproduct.aspx?parent_id="+svalue;
    //初始化个xmlhttp对象
    var xmlhttp = jb( );
    //提交数据,第一个参数最好为get,第三个参数最好为true
    xmlhttp.open( "get",weburl,true );
    // alert( xmlhttp.responseText );
    //如果已经成功的返回了数据
    xmlhttp.onreadystatechange=function( )
    {
        if( xmlhttp.readyState==4 )//4代表成功返回数据
        {
            var result = xmlhttp.responseText;
            //得到服务器返回的数据
            //先清空dListChild的所有下拉项
            document.getElementById( "dListChild" ).length = 0;
            //给dListChild加个全部型号的,注意是Option不是option
            document.getElementById( "dListChild" ).options.add( new Option( "选择分类","0" ) );
            if( result!="" )//如果返回的数据不是空
            {
                //把收到的字符串按照,分割成数组
                var allArray = result.split( "," );
                //循环这个数组,注意是从1开始,因为收到的字符串第一个字符是,号,所以分割后第一个数组为空
                for( var i=1;
                i<allArray.length;
                i++ )
                {
                    //在把这个字符串按照|分割成数组
                    var 
                    thisArray = allArray[i].split( "|" );
                    //为dListChild添加条目
                    document.getElementById( "dListChild" ).options.add( new Option( thisArray[1].toString( ),
                    thisArray[0].toString( ) ) );
                }
            }
        }
    }
    //发送数据,请注意顺序和参数,参数一定为null或者""
    xmlhttp.send( null );
}
</script>

<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>  
    <form id="form1" runat="server">
    <div>

        <asp:Label ID="Label1" runat="server"></asp:Label>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" >
<tr><td>
<!--开始表格 -->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D1EAFE" >
  <tr>
    <td colspan="2" align="center"><strong>发布产品</strong></td>
    </tr>
  <tr>
    <td width="120" align="right">产品类别： <span class="STYLE1">*</span>&nbsp;</td>
    <td >&nbsp;<asp:DropDownList onchange="Go(this)" id="dListParent" runat="server" DataSourceID="SqlDataSource1" DataTextField="class" DataValueField="id"></asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" />
<asp:DropDownList id="dListChild" runat="server"></asp:DropDownList>
	</td>
  </tr>
  <tr>
    <td align="right">产品名称： <span class="STYLE1">*</span>&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="proname" runat="server"></asp:TextBox>&nbsp; 颜色：<asp:DropDownList
        ID="titlecolor" runat="server">
        <asp:ListItem Value="#FF0000">红色</asp:ListItem>
        <asp:ListItem Value="#0000FF">蓝色</asp:ListItem>
        <asp:ListItem Value="#000000">黑色</asp:ListItem>
        <asp:ListItem Value="#FFFFFF">白色</asp:ListItem>
    </asp:DropDownList>(后续版功能，暂无)</td>
  </tr>
  <tr>
    <td align="right">产品规格：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="proguige" runat="server"></asp:TextBox></td>
  </tr>
  <tr>
    <td align="right">产品价格：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="projiage" runat="server"></asp:TextBox>&nbsp;&nbsp;单位：<asp:TextBox
            ID="TextBox4" runat="server" Width="40px">元</asp:TextBox></td>
  </tr>
  <tr>
    <td align="right">发布时间：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="date1" runat="server"></asp:TextBox></td>
  </tr>
  <tr>
    <td align="right">产品图片： <span class="STYLE1">*</span>&nbsp;</td>
    <td>&nbsp;<asp:FileUpload ID="FileUpload1" runat="server" Width="346px" /></td>
  </tr>
  <tr>
    <td align="right">关键字：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="Nkey" runat="server"></asp:TextBox></td>
  </tr>
  <tr>
    <td align="right">描述：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<asp:TextBox ID="miaoshu" runat="server" Height="76px" Width="350px" TextMode="MultiLine"></asp:TextBox></td>
  </tr>
  <tr>
    <td align="right">其它设置：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;暂无</td>
  </tr>
  <tr>
    <td align="right">产品简介：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<FCKeditorV2:FCKeditor ID="Content" runat="server" Height="400" Width="700"> </FCKeditorV2:FCKeditor></td>
  </tr>
  <tr>
    <td align="right">详细介绍：&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;<FCKeditorV2:FCKeditor ID="Content1" runat="server" Height="400" Width="700"> </FCKeditorV2:FCKeditor></td>
  </tr>
  <tr>
    <td align="right" style="height: 50px">&nbsp;</td>
    <td align="left" style="height: 50px">&nbsp; &nbsp;&nbsp; &nbsp;<asp:CheckBox ID="tuijian" runat="server" Text="推荐" />
        &nbsp; &nbsp; &nbsp;
        <asp:CheckBox ID="shenghe" runat="server" Text="审核" />
        &nbsp; &nbsp;<asp:CheckBox ID="shiping" runat="server" Text="是否有视频" />
        &nbsp; &nbsp;&nbsp;<asp:Button id="Button1" runat="server" Text="确定" OnClick="Button1_Click"></asp:Button></td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<!--结束表格 -->
</td></tr></table>		
		
	  </div>
    </form>
</body>
</html>
