<%@ page language="C#" autoeventwireup="true" inherits="admin_shop_taoedit, s1.chapk.com" validaterequest="false" %>

<!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>-</title>
    <link rel="stylesheet" href="../css/table.css" type="text/css" media="all" /> 
 <script charset="utf-8" src="../editor/jquery.js"></script>
<script charset="utf-8" src="../editor/kindeditor.js"></script>
<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
<script>
        
			KindEditor.ready(function(K) {
			    var editor = K.create('textarea[name="s_details"]', {
			        uploadJson : '../editor/asp.net/upload_json.ashx',
			        fileManagerJson : '../editor/asp.net/file_manager_json.ashx',
					allowFileManager : true
				});
			});

function fhMessageBox(oId)
{
    var str = window.showModalDialog("../shop/dialog.aspx?Lb=0&Id=0",window,"dialogWidth:800px; dialogHeight:600px; status:0; help:0");
        if(str!=null && str!=""){
            insertText(str,oId);
        }
}			
function insertText(str,oId)
{
        if(str!=null && str!=""){
            var parr=str.split(',');
            document.getElementById(oId).innerHTML='<div class="pbox"><div class="pimg"><img src="'+parr[1]+'" /></div><div class="pprice">商城价:￥<span>'+parr[3]+'</span></div><div class="pprice">搭配价:<span><input type="text" name="pjg" value="'+parr[3]+'" style="width:80px" /><input type="hidden" name="pid" value="'+parr[0]+'" /></span></div></div>';
        }
}
function delFile(oId)
{
    document.getElementById(oId).innerHTML='';
}
</script>       
</head>
<body>
    <form id="form1" runat="server">
<div class="my_alt">添加套餐</div>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tb">               
            <tr>
                <td class="tl">套餐标题：</td>
                <td class="tr"><asp:TextBox ID="s_mc" runat="server" Width="500px"></asp:TextBox> 限定在30个汉字内 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入套餐标题" ControlToValidate="s_mc"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td class="tl">搭配商品：</td>
                <td class="tr">
                    <table cellpadding="0" cellspacing="0" border="0" width="100%" class="tb">
                    <tr>
                    <td class="tl"><input type="button" value="选择商品" onclick="fhMessageBox('imglist1')" /><br /><input type="button" value="删除商品" onclick="delFile('imglist1')" /></td><td class="tr"><div id="imglist1"><%=cplist[0]%></div></td>
                    </tr> 
                    <tr>
                    <td class="tl"><input type="button" value="选择商品" onclick="fhMessageBox('imglist2')" /><br /><input type="button" value="删除商品" onclick="delFile('imglist2')" /></td><td class="tr"><div id="imglist2"><%=cplist[1]%></div></td>
                    </tr>
                    <tr>
                    <td class="tl"><input type="button" value="选择商品" onclick="fhMessageBox('imglist3')" /><br /><input type="button" value="删除商品" onclick="delFile('imglist3')" /></td><td class="tr"><div id="imglist3"><%=cplist[2]%></div></td>
                    </tr>   
                    <tr>
                    <td class="tl"><input type="button" value="选择商品" onclick="fhMessageBox('imglist4')" /><br /><input type="button" value="删除商品" onclick="delFile('imglist4')" /></td><td class="tr"><div id="imglist4"><%=cplist[3]%></div></td>
                    </tr>   
                    <tr>
                    <td class="tl"><input type="button" value="选择商品" onclick="fhMessageBox('imglist5')" /><br /><input type="button" value="删除商品" onclick="delFile('imglist5')" /></td><td class="tr"><div id="imglist5"><%=cplist[4]%></div></td>
                    </tr>                                                               
                    </table>             
                
                </td>
            </tr>   
            <tr>
                <td class="tl">套餐描述：</td>
                <td class="tr">
                <textarea id="s_details" runat="server" name="s_details" style="width:800px;height:300px;"></textarea>
                </td>
            </tr>
            <tr>
                <td class="tl">运费：</td>
                <td class="tr">
                    <asp:TextBox id="s_fre" runat="server" Width="100px"></asp:TextBox> 填写0为免运费
                </td>
            </tr>   
            <tr>
                <td class="tl"></td>
                <td class="tr"><asp:Button ID="btn_ok" runat="server" Text=" 保存 " OnClick="btn_ok_Click" /><asp:Label id="lab_id" runat="server" Visible="False"></asp:Label></td>
            </tr>                                                                       
</table>            

    </form>
</body>
</html>
