<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" role="form" method="post" action="gift/actionEdit">
                                        <input type="hidden" name="gid" value="<?php echo $gid;?>">
                                        <div class="modal-body">
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">当前图片:</label>
                                                <div class="col-sm-3">
                                                    <?php
                                                        if ($info['zipfile'] == 1){
                                                    ?>
                                                    <input type="text" name="" class="form-control" value="<?php echo $info['img'];?>" readonly>
                                                    <?php }else{?>
                                                    <img class="giftimg" src="<?php echo $baseUrl.'/gift/'.$info['img'];?>" width="90px;" height="90px;" />
                                                    <?php } ?>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">中文名称:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="中文名称" name="cname" value="<?php echo $info['cname'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">泰文:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="泰文" name="ename" value="<?php echo $info['ename'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否VIP礼物: </label>
                                                <div class="col-sm-3">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="vipgift" value="0" <?php if($info['isvip'] != 1)echo 'checked="checked"';?>> 否
                                                    </label>
                                                    <label class="radio-inline">
                                                        <input type="radio" name="vipgift" value="1" <?php if($info['isvip'] == 1)echo 'checked="checked"';?>> 是
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">礼物类型:</label>
                                                <div class="col-sm-3">
                                                    <?php foreach ($giftType as $v => $n) {?>
                                                        <label class="radio-inline">
                                                            <input type="radio" name="type" cname="gifttype" value="<?php echo $v;?>" <?php if($v == $info['type']){ echo "checked";}?> > <?php echo $n;?>
                                                        </label>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                            <div class="form-group vipgifttype">
                                                <label class="col-sm-3 control-label">VIP礼物类型*:</label>
                                                <div class="col-sm-3">
                                                    <?php foreach ($vipgiftType as $vv => $vn) {?>
                                                        <label class="radio-inline">
                                                            <input type="radio" name="type" cname="gifttype" <?php if($vv == $info['type']) echo 'checked'; ?> value="<?php echo $vv;?>"  > <?php echo $vn;?>
                                                        </label>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">价格:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="价格" name="price" value="<?php echo $info['price'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">礼物图片</label>
                                                <div class="col-sm-9">
                                                    <input type="file" name="giftfile">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">属性:</label>
                                                <div class="col-sm-3">
                                                    <?php foreach ($giftProperty as $v => $n) {?>
                                                        <label class="radio-inline">
                                                            <input type="radio" name="prop" <?php if($v == $info['property']){ echo "checked";}?> value="<?php echo $v;?>"> <?php echo $n;?>
                                                        </label>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">有效天数:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="有效天数" name="expire" value="<?php echo $info['expire'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">排序:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="排序" name="gsort" value="<?php echo $info['gsort'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">参数:</label>
                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" placeholder="可不填(不要使用?开头)" name="urldesc" value="<?php echo $info['urldesc'];?>">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">是否显示*:</label>
                                                <div class="col-sm-3">
                                                    <label class="radio-inline">
                                                        <input type="radio" name="isShow" <?php if($info['isShow'] == 1) echo 'checked';?>  value="1"> 是
                                                    </label>
                                                    <label class="radio-inline">

                                                        <input type="radio" name="isShow" <?php if($info['isShow'] != 1) echo 'checked';?>  value="2"> 否
                                                    </label>
                                                </div>
                                            </div>

                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-3">
                                                <button type="button" class="btn btn-info goback">返回</button>
                                                <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

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

    $("input[name='vipgift']").click(function () {
        var v = $(this).val();
        if ( v == 1){//VIP
            $('.vipgifttype').removeClass('hide');
            $('.commongifttype').addClass('hide');
        }else{
            $('.vipgifttype').addClass('hide');
            $('.commongifttype').removeClass('hide');
        }
    });

</script>