<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">
                                    <form class="form-horizontal J_ajaxForm" role="form" method="post" action="gameupdate/actionEdit">
                                        <input type="hidden" name="id" value="<?php echo $id;?>">
                                        <div class="modal-body">
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">更新设备:</label>
                                                <div class="col-sm-9">
                                                    <label class="radio-inline">
                                                    <?php if($gu_device == 'android') { ?>
                                                        <input type="radio" name="gu_device" value="1" checked="checked"> Android
                                                    <?php } ?>
                                                    <?php if($gu_device == 'ios') { ?>
                                                        <input type="radio" name="gu_device" value="2" checked="checked"> IOS
                                                    <?php } ?>
                                                    <?php if($gu_device == 'vivo') { ?>
                                                        <input type="radio" name="gu_device" value="3" checked="checked"> VIVO
                                                    <?php } ?>
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">版本:</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control" placeholder="版本" name="gu_version" value="<?php echo $gu_version?>">
                                                </div>
                                            </div>
                                            <?php if($titleContentList){
                                                foreach ($titleContentList as $info) {
                                            ?>
                                            <div class="langContent">
                                                <div class="form-group">
                                                    <label class="col-sm-3 control-label">更新提示语言:</label>
                                                    <div class="col-sm-9">
                                                        <input type="text" value="<?php echo $info['lang'];?>" class="form-control gulang" placeholder="更新提示语言:zh,th,en,tw" name="gu_lang[]">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-3 control-label">更新标题:</label>
                                                    <div class="col-sm-9">
                                                        <input type="text" value="<?php echo $info['title'];?>" class="form-control gulang" placeholder="更新标题" name="gu_title[]">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-3 control-label">更新内容:</label>
                                                    <div class="col-sm-9">
                                                        <textarea class="form-control" rows="5" placeholder="更新内容" name="gu_content[]"><?php echo $info['content'];?></textarea>
                                                    </div>
                                                </div>
                                                <hr />
                                            </div>
                                            <?php } }else{ ?>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">更新标题:</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control" placeholder="更新标题" name="gu_title" value="<?php echo $gu_title?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">更新内容:</label>
                                                <div class="col-sm-9">
                                                    <textarea class="form-control" rows="5" placeholder="更新内容" name="gu_content"><?php echo $gu_content?></textarea>
                                                </div>
                                            </div>
                                            <?php } ?>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否显示提示:</label>
                                                <div class="col-sm-9">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gu_tips" <?php if($gu_tips == 1) { echo 'checked="checked"';}?> value="1"> 是
                                                    </label>
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gu_tips" value="0" <?php if($gu_tips == 0) { echo 'checked="checked"';}?>> 否
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否强制更新:</label>
                                                <div class="col-sm-9">
                                                    <label class="radio-inline">
                                                      <input type="radio" name="gu_force" <?php if($gu_force == 1) { echo 'checked="checked"';}?> value="1"> 是
                                                    </label>
                                                    <label class="radio-inline">
                                                      <input type="radio" name="gu_force" value="0" <?php if($gu_force == 0) { echo 'checked="checked"';}?>> 否
                                                    </label>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否消息中心:</label>
                                                <div class="col-sm-9">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gh_news" <?php if($gh_news == 1) { echo 'checked="checked"';}?> value="1"> 是
                                                    </label>
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gh_news" value="0" <?php if($gh_news == 0) { echo 'checked="checked"';}?>> 否
                                                    </label>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否奖励更新:</label>
                                                <div class="col-sm-9">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gu_isReward" <?php if($gu_isReward == 1) { echo 'checked="checked"';}?> value="1"> 是
                                                    </label>
                                                    <label class="radio-inline">
                                                        <input type="radio" name="gu_isReward"  <?php if($gu_isReward == 0) { echo 'checked="checked"';}?> value="0">否
                                                    </label>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">更新奖励:</label>
                                                <div class="col-sm-9">
                                                    <div class="col-sm-6">
                                                        <label class="col-sm-3 control-label">体力:</label>
                                                        <div class="col-sm-9">
                                                            <input type="number" class="form-control" value="<?php echo $gu_reward['spins']; ?>" name="gu_reward[spins]">
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-6">
                                                        <label class="col-sm-3 control-label">金币:</label>
                                                        <div class="col-sm-9">
                                                            <input type="number" class="form-control" value="<?php echo $gu_reward['money']; ?>" name="gu_reward[money]">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default goback" data-dismiss="modal">返回</button>
                                            <button type="button" class="btn btn-primary J_ajaxSubmitBtn">更新</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript">
    $('.goback').click(function(){
       history.go(-1);
    });

    $("input[name='gu_device']").click(function(){
        var device = $(this).val(),
            androidPackage = $('.android-package'),
            iosPackage = $('.ios-package');

        if ( device == 1 ) {
            iosPackage.addClass('hide');
            androidPackage.removeClass('hide');
        }else{
            androidPackage.addClass('hide');
            iosPackage.removeClass('hide');
        }
    });

    //全选/全不选
    $('#android-checkall').change(function () {
        if($(this).is(':checked')) {//已经是全选的状态
            $('.android-check').attr('checked', true);
        }else {
            $('.android-check').attr('checked', false);
        }
    });
    //全选/全不选
    $('#ios-checkall').change(function () {
        if($(this).is(':checked')) {//已经是全选的状态
            $('.ios-check').attr('checked', true);
        }else {
            $('.ios-check').attr('checked', false);
        }
    });

</script>