<extend name="Public/base" />
<block name="css">
    <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
    <link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
    <style>
        #form .txt_area.download_url {width:400px;}
        .tabcon1711 .table_radio2 .table_btn {width:215px;}
        .bnt_add,.bnt_remove,.bnt_save{
            height: 30px;
            width: 20px;
            font-size: 20px;
            line-height: 10px;
            color: #3399ff;
            background: none;
            border: none;
            margin-left: 20px;
            cursor: pointer;
        }
        .bnt_remove{
            color: #F70909;
        }
        .bnt_save{
            color: #4DB361;
        }
    </style>
    <style>
        .select2-container--default .select2-selection--single {
                color: #000;
            resize: none;
            border-width: 1px;
            border-style: solid;
            border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
            box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
            height:28px;border-radius:3px;font-size:12px;
        }
        .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height:35px;
            line-height:28px;
        }
        .select2-container--default .select2-selection--single .select2-selection__arrow {
            height:26px;
        }
        .select2-container--default .select2-search--dropdown .select2-search__field {
          height:26px;line-height:26px;font-size:12px;
        }
        .select2-results__option[aria-selected] {font-size:12px;}
    </style>
</block>
<!-- 管理员用户组新增和编辑页面 -->
<block name="body">
    <script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
    <script src="__STATIC__/layer/extend/layer.ext.js" type="text/javascript"></script>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>

    <form action="{:U('Game/devide_warn_edit')}" enctype="application/x-www-form-urlencoded" method="POST"
            class="form-horizontal form_info_ml">
        <div class="formtitle"><span>预警编辑</span></div>
        <ul class="form_info ">
            <input type="hidden" name="id" value="{$warnInfo.id}" />
            <li>
                <label>预警对象</label>
                <select id="partner_id" name="partner_id" class="select_gallery">
                    <?php foreach ($partners as $p):?>
                    <option value="{$p['id']}" <?php if ($p['id'] == $warnInfo['id']):?>selected<?php endif;?> >{$p.partner}</option>
                    <?php endforeach;?>
                </select>
            </li>
            <li>
                <label>预付金额</label>
                <input name="advance_amount" type="text" class="txt" placeholder="预付金额" value="{$warnInfo.advance_amount}" /><span style="color: red;">*</span>
            </li>
            <li>
                <label>预警金额</label>
                <input name="warming_amount" type="text" class="txt" placeholder="预警金额" value="{$warnInfo.warming_amount}" /><span style="color: red;">*</span>
            </li>
            <li>
                <label>预警金额频率</label>
                <input name="warn_frequency" type="text" class="txt" placeholder="当达到预警值时,每扣除多少流水短信提醒一次" value="{$warnInfo.warn_frequency}" /><span style="color: red;">*</span>
            </li>
            <?php if ($warnInfo['phones']):?>
            <?php foreach ($warnInfo['phones'] as $k => $phone):?>
            <?php if ($k == 0):?>
            <li class="warn-phone">
                <label>手机号</label>
                <input type="text" class="txt table_text_input" name="phones[]" value="{$phone}" placeholder=""><span style="color: red;">*</span>
                <button type="button" class="bnt_add">✚</button>
            </li>
            <?php else:?>
            <li class="warn-phone">
                <label>通知手机号</label>
                <input type="text" class="txt table_text_input" name="phones[]" value="{$phone}" placeholder="">
                <button type="button" class="bnt_remove">✖</button>
            </li>
            <?php endif;?>
            <?php endforeach;?>
            <?php else:?>
            <li class="warn-phone">
                <label>手机号</label>
                <input type="text" class="txt table_text_input" name="phones[]" value="" placeholder=""><span style="color: red;">*</span>
                <button type="button" class="bnt_add">✚</button>
            </li>
            <?php endif;?>
            <li>
                <label>&nbsp;</label><input type="submit" id="submit" value="确认保存" target-form="form-horizontal" class="form_btn ajax-post">
                <input type="button"  value="返 回" target-form="form-horizontal" class="form_btn ajax-post" onclick="javascript:void(window.history.go(-1))">
            </li>
        </ul>
    </form>
		
		<div class="common_settings">
			<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
			<form class="addShortcutIcon">
				<input type="hidden" name="title" value="{$m_title}">
				<input type="hidden" name="url" value="AuthManager/index">
			</form>
			<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
		</div>
		
</block>
<block name="script">
    <script type="text/javascript">
    highlight_subnav('{:U('Game/devide_warn_list')}');
    $(".bnt_add").bind("click",function(){
            var a=  '<li class="warn-phone"><label>手机号</label><input type="text" class="txt table_text_input" name="phones[]" value="" placeholder=""><button type="button" class="bnt_remove">✖</button></li>';
            $(".warn-phone:last").after(a);
        });
    $(document).on('click', '.bnt_remove', function(){
        $(this).parents('li').remove();
    });
    </script>
</block>