<div class="content">
    <div class="page-index">
      <?php
        if ($result) {
            foreach ($result as $row) {
                $race_reg_msg = $home->reg_msg($row['id']);
                ?>
                <div class="card">
    <table class="table">
        <tr>
            <td><b>赛事名称</b></td> <td><a href="index.php?c=race&action=race_msg&id=<?php echo $row['id'] ?>" target="_blank"><?php echo  $row['race_title'] ?></a></td>
        </tr><tr>
            <td><b>开始时间</b></td> <td><?php echo $row['start_time']; ?></td></tr><tr>
            <td><b>状态</b></td>  <td>
                     <?php
                        //未审核 2审核未付费 3审核已付费 4 已付费未审核
                     if($race_reg_msg[0]['state']==1)
                     {
                        echo '未付款';
                    }
                    elseif($race_reg_msg[0]['state']==2)
                    {
                        echo '审核未付费';
                    }
                    elseif($race_reg_msg[0]['state']==3)
                    {
                        echo '报名成功';
                    }
                    elseif($race_reg_msg[0]['state']==4)
                    {
                        echo '已付费未审核';
                    }
                    elseif($race_reg_msg[0]['state']==5)
                    {
                        echo '审核不通过';
                    }

                    if($race_reg_msg[0]['state']==1 and $race_reg_msg[0]['sign_end_time']<date("Y-m-d h:i:s", time()) )
                        {

                            ?>
                            <br/>
                            <?php } ?>
                        </td></tr><tr>
            <td><b>操作</b></td> <td>
                            <a href="index.php?c=race&action=message&re_g_id=<?php echo $race_reg_msg[0]['id']?>&time=<?php echo time();?>" ><i class="fa fa-credit-card"></i>付款</a> 
                            <a href="index.php?c=race&action=my_reg_msg&race_id=<?php echo $row['id'] ?>">  <i class="fa fa-search"></i>查看 </a> 
                            <?php if($row['finish_time'])
                            {?>
                            <a href="index.php?c=race&action=race_cert_msg&regid=<?php echo $race_reg_msg[0]['id']?>"><i class="fa fa-certificate"></i>证书 </a>
                            <?php 
                        }?>
                        </td>
        </tr>
    </table>
</div>
                    <?php
                }
            } else {
                ?>
                <tr>
                    <td>nothing</td><td></td><td></td>
                </tr>
                  </table>
              </div>
                <?php
            }
            ?>
      </div>
    </div>