<img src="<?php echo $img[0][0]?>" width="100%" style="margin-top: 50px">
<div class="content" style="margin-top: 20px">
    <div class="page-index">
    <div class="list-block">
      <ul>
            <li class="item-content">
                  <div class="item-inner">
                        <div class="item-title">举办地址</div>
                        <div class="item-after"><?php echo $result[0]['place'] ?>
                    </div>
                </div>
            </li>
            <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">开始时间</div>
                    <div class="item-after"><?php echo $result[0]['start_time'] ?></div>
                </div>
            </li>

            <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">结束时间</div>
                    <div class="item-after"><?php echo $result[0]['end_times'] ?></div>
                </div>
            </li>

            <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">
                    报名开始时间</div>
                    <div class="item-after"><?php echo $result[0]['sign_start_time'] ?></div>
                </div>
            </li>
            <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">报名结束时间</div>
                    <div class="item-after"><?php echo $result[0]['sign_end_time'] ?></div>
                </div>
            </li>
        </ul>
    </div>
    <div class="page-index">
    <?php
    if ($race_group_result) {
        foreach ($race_group_result as $row) {
    ?>
        <div class="card">
          <div class="card-header"><?php echo  $row['title'] ?></div>
          <div class="card-content">
            <div class="card-content-inner"><?php echo  $row['distance']; ?>公里</div>
        </div>
        <div class="card-footer">
            <font color="red" size="+3"><?php echo  $row['price'] ?>元</font> &nbsp;
            <?php
            if(time() > strtotime($result[0]['sign_start_time']) and time()< strtotime($result[0]['sign_end_time']))
            { 
                if($row['reg_mount']<=$row['mount']){
                    if($result[0]['race_title']=='1'){
                        ?>
                        <a href="index.php?c=race&action=reg&race_id=<?php echo $id?>&group_id=<?php echo  $row['id']?>"  style="" class="reg"><i class="fa fa-pencil"></i>报名</a>
                        <?php
                    }
                    else
                    {
                        echo "已经关闭报名";
                    }
                }
                else{
                    echo "名额已满";
                }
            }else{
                echo "不能报名";
            }
            ?>
            </div>
        <?php
        }
        ?>
        </div>
        <?php
    }
    ?>
    </div>
    <div class="card">
        <div id="race_content">
        loading...
        </div>
    </div>
</div>
</div>

<nav>
    <div id="nav_price">
        <center><?php echo $result[0]['low_price']?>元起</center>
    </div>
    <div id="nav_button">
    <center>
        <a>报 名</a>
    </center>
</div>
</nav>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script type="text/javascript">
    $("#race_content").load("index.php?c=ajax&action=race_msg&id=<?php echo $id?>");
</script>
<style type="text/css">
    #nav_price{float: left; width: 55%; color: orange; font-weight: 200; font-size: 2em; padding-top: 3px}
    #nav_button{background: orange; float: right; width: 40%; text-align: center}
    #nav_button a{color: white; width: 100%}
</style>
