<extend name="Public/base" />

<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
    <style>
    .tabcon1711 .select2-container--default .select2-selection--single{
    font-size: 12px;    
    color: #555;
    vertical-align: middle;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ccc;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    -webkit-transition: border linear .2s, box-shadow linear .2s;
    -moz-transition: border linear .2s, box-shadow linear .2s;
    -o-transition: border linear .2s, box-shadow linear .2s;
    transition: border linear .2s, box-shadow linear .2s;height:30px;}
    .tabcon1711 .select2-container--default .select2-selection--single .select2-selection__rendered {line-height: 30px;}
    .tabcon1711 .select2-container--default .select2-selection--single .select2-selection__arrow {height:30px;}
    .tabcon1711 .select2-container--default .select2-search--dropdown .select2-search__field {
      height:26px;line-height:26px;font-size:12px;
    }
    .tabcon1711 .select2-results__option[aria-selected] {font-size:12px;}
    </style>
    <div class="cf main-place top_nav_list navtab_list">
        <div class="fr">
          <a  <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if>  href="{:U('Provide/bdfirstpay',array('type'=>1))}">给玩家发放</a>
          <a <if condition="I('type') eq 2"> class="tabchose" </if> href="{:U('Provide/lists',array('type'=>2))}">玩家发放记录</a>
        </div>
        <h3 class="page_title">绑币发放</h3>
        <p class="description_text">说明:此功能是为给玩家发放绑定平台币功能</p>
    </div>
    
    
    <!-- 标签页导航 -->
    <div class="tab-wrap">

       <div class="tab-content tabcon1711">
        <!-- 表单 -->
           <table border="0" cellspacing="0" cellpadding="0">

           <tbody>
           <tr>
               <td class="l">发放方式</td>
               <td class="r table_radio">
               <span class="form_radio">
                   <label>
                       <input name="radia" type="radio"  class="inp_radio" value="1" checked />  单用户
                   </label>
                   <label>
                       <input name="radia"  type="radio"  class="inp_radio" value="2"  /> 多用户
                   </label>
                   <label>
                       <input  name="radia" type="radio"  class="inp_radio" value="3"  /> 批量发放
                   </label></span>
               </td>

           </tr>
           </tbody>
               </table>
          <!-- 基础文档模型 -->
          <div id="tab1" class="tab-pane tab_pane in tab1 ">
          <form id="form1" action="{:U('bdfirstpay')}" method="post" class="form-horizontal single">
          <table border="0" cellspacing="0" cellpadding="0">
            <tbody>

              <tr>
                  <td class="l">游戏名称</td>
                  <input type="hidden" name="type" value="1">
                  <td class="r">
                    <select id="game_id" name="game_id" class="select_2">
                      <option value="">请选择游戏</option>
                     <volist name=":get_game_list()" id="vo">
                      <option value="{$vo.id}">{$vo.game_name}</option>
                     </volist>
                    </select>
                  </td>
              </tr>              
              <tr>
                  <td class="l">玩家账号</td>
                <td class="r">
                   <input type="text" class="txt" name="account" value="" placeholder="只能输入一个账号">
                </td>
              </tr>
              <tr>
                <td class="l">发放数量</td>
                <td class="r">
                   <input type="text" class="txt" name="amount" value="" placeholder="请输入大于0的整数">
                </td>
              </tr>
                                        
            </tbody>
          </table>
              <input type="hidden" name="type" value="1">
          </form>
          <div class="form-item cf">
              <button class="submit_btn ajax-post mlspacing" id="submit1" type="submit" target-form="single">
                  保存
              </button>
              <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
                  返回
              </a>
          </div>
          
          
          </div>
          <div id="tab3" class="tab-pane  tab3" style="display: none">
          <form id="form2" action="{:U('bdfirstpay')}" method="post" class="form-horizontal batch" enctype="multipart/form-data">
          <table border="0" cellspacing="0" cellpadding="0">
            <tbody>
              <tr>
                <td class="l">Excel模板</td>
                <td class="r">
                   <a href="/Uploads/excel/绑币发放模板.xls">下载模板</a>
                </td>
              </tr>
              <tr>
                <td class="l">导入模板</td>
                <td class="r">
                   <input type="file" name="excelData" value=""  >
                </td>
              </tr>                            
            </tbody>
          </table>
              <input type="hidden" name="type" value="2">
          </form>
          <div class="form-item cf">
              <button class="submit_btn  mlspacing" id="submit2" type="submit" target-form="batch">
                  保存
              </button>
              <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
                  返回
              </a>
          </div>
          
          
          </div>
          <div id="tab2" class="tab-pane  tab2" style="display: none" >
          <form id="form3" action="{:U('bdfirstpay')}" method="post" class="form-horizontal multi">
          <table border="0" cellspacing="0" cellpadding="0">
            <tbody>
              <tr>
                  <td class="l">游戏名称</td>
                  <td class="r">
                    <select id="game_id1" name="game_id" class="select_2">
                      <option value="">请选择游戏</option>
                     <volist name=":get_game_list()" id="vo">
                      <option value="{$vo.id}">{$vo.game_name}</option>
                     </volist>
                    </select>
                  </td>
              </tr>
              
              <tr>
                <td class="l">玩家账号</td>
                <td class="r" >
                  <textarea name="pay_names" id="pay_names" cols="32" rows="20" placeholder="一行一个账号"></textarea>
                </td>
              </tr>
              <tr>
                <td class="l">发放数量</td>
                <td class="r" >
                   <input type="text" class="txt" name="amount" value="" placeholder="请输入大于0的整数">
                </td>
              </tr>                               
            </tbody>
          </table>
              <input type="hidden" name="type" value="3">
          </form>
          <div class="form-item cf">
              <button class="submit_btn ajax-post mlspacing" id="submit3" type="submit" target-form="multi">
                  保存
              </button>
              <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
                  返回
              </a>
          </div>
          
          </div>
        
      </div>
    </div>
		
		<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="Provide/bdfirstpay">
			</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">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/jquery.form.js"></script>
<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    
    <script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript">
// $(function(){
    //导航高亮
    highlight_subnav('{:U('Provide/bdfirstpay')}');

    $('.time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
//    showTab();
    $();
    $('.inp_radio').change(function () {
        $('input[name="type"]').val($(this).val());
        $("#tab"+$(this).val()).show();
        $("#tab"+$(this).val()).siblings('div').hide();

    })


    $("#moneynum").blur(function(){
        $("#coinnums").html($("#moneynum").val());
        $("#coinnum").val(  $("#coinnums").html());
    })

   $('.jstabnav li').each(function() {
        var tab = $('.jstabnav li.current').attr('data-tab'),
        taht=$('#'+tab);
        if ($(this).hasClass('current')) {
          taht.find('input,select,textarea,checkbox').prop('disabled',false);
        } else {
          taht.siblings().find('input,select,textarea,checkbox').prop('disabled',true);
        }

    });
    $('.jstabnav li').on('click',function() {
       var tab = $(this).attr('data-tab'),
       taht=$('#'+tab);
       taht.find('input,select,textarea,checkbox').prop('disabled',false);
       taht.siblings().find('input,select,textarea,checkbox').prop('disabled',true);
    });
  
    $("#submit2").click(function(){
      $('#form2').ajaxSubmit({
					url:"{:U('bdfirstpay')}",
					type:'POST',
					cache:false,
					contentType:false,  
					processData:false,
					mimeType: 'multipart/form-data',
					dataType:'json',
					//data:new FormData($("#form1")[0]),
					success:function(data){
						if (data.status == 1) {
							layer.msg(data.info);
							setTimeout(function() {
								if (data.url) {
									window.location.href = data.url;
								} else {
									window.location.reload();
								}
							},3000);
						} else {
							layer.msg(data.info);
						}
					},error:function(){
							layer.msg('服务器故障,请稍候再试');
					}
			});			
    });
    $(".select_2").select2();

</script>
</block>