<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>支付限制</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>名称</th>
                                                <th>内容</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
<!--                                                <tr>-->
<!--                                                    <td>强制关闭第三方支付版本</td>-->
<!--                                                    <td><input type="text" name="limitversion" value="--><?php //echo $v;?><!--" class="form-control" ></td>-->
<!--                                                    <td><button class="btn btn-success tj" inputtype="limitversion">提交</button></td>-->
<!--                                                </tr>-->
                                                <tr>
                                                    <td>强制关闭第三方支付的SID</td>
                                                    <td><input type="text" name="limitsid" value="<?php echo $s;?>" class="form-control"></td>
                                                    <td><button class="btn btn-success tj" inputtype="limitsid">提交</button></td>
                                                </tr>
                                                <?php
                                                    foreach ($sidlist as $sid => $info){
                                                ?>
                                                    <tr>
                                                        <td><?php echo $sid.'_'.$info['packname']; echo $sid % 2 == 1 ? '_安卓' : '_苹果';?></td>
                                                        <td><input type="text" name="limitversion:<?php echo $sid;?>" value="<?php echo $info['version'];?>" class="form-control"></td>
                                                        <td><button class="btn btn-success tj" inputtype="limitversion:<?php echo $sid;?>">提交</button></td>
                                                    </tr>
                                                <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript">
    $('.tj').click(function () {
        if (confirm('确认更新吗?')){
            var typename = $(this).attr('inputtype');
            var typeval = $("input[name='"+typename+"']").val();

            $.post(
                "<?php echo base_url("payment/actionSwitch")?>",
                {name:typename, val:typeval},
                function () {
                    alert('更新成功');
                }
            );
        }
    });
</script>