<!doctype html>
<html class="no-js">
<head>

<include file="Common/head" />

</head>
<body>

<include file="Common/header" />

<div class="am-cf admin">

    <!-- sidebar start -->
    <include file="Common/sidebar" nav="$nav"/>
    <!-- sidebar end -->

    <!-- Start right Content here -->
        <div class="content-page" style="background: white;">
            <!-- Start content -->
            <div class="content">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">Mini Game Management</strong> / <small>Scratch & Win</small> / <small>Prize List</small> 
                </div>
            </div>
            <hr style="margin-top:0px;">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-12">
                    <legend>{$op}</legend>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                            <a class="am-btn am-btn-secondary" href="javascript:;" onClick="javascript:location.href='{:U('sc_index')}'">Return to Prize List</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form am-form-horizontal" action="" method="POST" enctype="multipart/form-data" id="goodsForm">
                          <div class="am-form">
                          <input type="hidden" name="id" value="{$info.id}" />

                            <div class="am-form-group" style="width:220px;">
                              <label>Product Name</label>
                              <input type="text" name="goods_name" value="{$info.goods_name}">
                            </div>

                            <label>Image </label>
                            <div class="am-form-group">
                              <img src="__UPLOADS__/{$info.img}" id="img_preview" onerror="this.src='__PUBLIC__/img/add.png'" style="width: 120px; height: 100px">
                              <input type="file" name="img" value="" accept="image/jpg,image/jpeg,image/png" >
                            </div>

                            <div class="am-form-group">
                                <label>Prize Winnable?</label><br>
                                <label class="am-radio-inline">
                                  <input type="radio" name="status" value="1" data-am-ucheck <?php if ($info['status'] == 1) : ?>checked<?php endif;?>> Yes
                                </label>
                                <label class="am-radio-inline">
                                  <input type="radio" name="status" value="2" data-am-ucheck <?php if ($info['status'] == 2) : ?>checked<?php endif;?>> No
                                </label>
                            </div>

                            <hr>
                            <button type="submit" class="am-btn am-btn-primary" id="comfirm">Confirm</button>
                            <button type="button" class="am-btn am-btn-primary" onclick="javascript:location.reload();">Refresh</button>
                            <hr>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- content end -->
</div>

<include file="Common/footer" />

<script src="__PUBLIC__/assets/js/laytpl.js" type="text/javascript" charset="utf-8" async defer></script>
<script type="text/javascript">
        $("#img_preview").on('click',function(){
            $("input[name=img]").click();
        });
        $("input[name=img]").on('change', function() {
            var reader = new FileReader();
            reader.onload = function(e){
                $('#img_preview').attr('src', e.target.result);
            }
            if(this.files[0]){
                reader.readAsDataURL(this.files[0]);
            }else{
                $('#img_preview').attr('src','');
            }
        });
</script>

</body>
</html>