<?php include 'view/admin_top.php'; ?>
<script type="text/javascript" src="plug-in/utf8-php/ueditor.config.js"></script>
<script type="text/javascript" src="plug-in/utf8-php/ueditor.all.js"></script>
<div style="width: 96%; margin-right: auto; margin-left: auto">
<?php include 'view/article_top.php'; ?>
<form action="index.php?c=article&action=article_<?php echo $action; ?>&id=<?php echo $id; ?>" method="post"
      enctype="application/x-www-form-urlencoded" id="form">
    <table class="table">
        <tr>
            <td width="100">标题</td>
            <td><input type="text" value="<?php echo $result[0]['title'] ?>" name="title" placeholder="请填写标题"/></td>
        </tr>
         <tr>
            <td>类别</td>
             <td>
                
                 <?php 
                 echo  core_option($news_type , "menu", $result[0]['menu']);
                 if($_GET['race_id'])
                 {
                    $race_id = $_GET['race_id'];
                 }
                 elseif($result[0]['race_id'])
                 {
                    $race_id = $result[0]['race_id'];
                 }
                 ?>
                 <input type="hidden" name="race_id" value="<?php echo $race_id?>" >
             </td>
         </tr>
        <tr>
            <td>封面图</td>
            <td>
                <a onclick="setting('img_url')" href="#" class="btn btn-primary btn-lg"> 上传封面 </a>
                <div id="img_url_div">
                    <?php if ($result[0]['img_url'])
                    {?>
                        <img src="<?php echo $result[0]['img_url'] ?>" style="max-width: 200px"/>
                    <?php }?>
                    <input type="hidden" value="<?php echo $result[0]['img_url'] ?>" name="img_url" placeholder="一年内完赛照片">

                </div>
            </td>
        </tr>
        <tr>
            <Td>微信连接</Td>
            <td>
                <input type="text" value="<?php echo $result[0]['wx_url']?>" name="wx_url" placeholder="微信链接"> *填写微信的文章链接，前台页面将自动转跳之微信公众号文章
            </td>
        </tr>
    </table>
    <br/>
    <script id="contant_c" name="contant_c" type="text/plain">
						<?php echo $result[0]['contant'] ?>

                </script>
    <textarea style="display:none" name="contant_c_texteare" id="contant_c_texteare"></textarea>
    <script type="text/javascript">
        var editor = UE.getEditor('contant_c');
        $("#form").submit(function () {
            $("#contant_c_texteare").val(UE.getEditor('contant_c').getContent());
        })
    </script>
<br/>
    <input type="submit" value="保存" style="width:100%" class="btn btn-primary btn-lg"/>
</form>
<br/><br/></div>
<script language="javascript">
        function setting(id) {
            $("#frame_main").show();
            $("#f_i",parent.document.body).attr("src","plug-in/updateApi.php?image_id="+id)
        }
    function change(v)
    {
        $("#end_time").val(v);
    }
</script>
<div id="tips"></div>
<div id="frame_main">
    <div id="frame">
        <iframe id="f_i" frameborder="0" width="500" height="200"></iframe>
    </div>
    <div id="close_frame"><a href="javascript:void(0)" onclick="frame_close()">X</a></div>
</div>