<?php
/*
@author waychar
@技术支持 150572314@qq.com
@copyright 2018 waychar.cn 声明：本代码可以用于学习交流使用及要商业化用途
*/
require_once 'model/home.php';

$user_id = $_COOKIE['id'];
$table_type = 3;
$id_type = get($_GET['id_type']);
$url = get($_GET['url']);
$home = new home();

if ($action == '') {
    require_once 'model/race.php';
    $race= new race();

    $sql  ="select * from race where display = 1 order by id desc limit 0,1";
    $result =$home->get_data($sql);
    include 'view/top.php';
    include 'view/index.php';
    include 'view/bottom.php';
}
elseif($action=='admin_login')
{
    $href="index.php?c=race";
    $title="后台登陆";
    include 'view/admin_login.php';
}
elseif( $action == 'index')
{
    check_session();
    require_once  'model/race.php';
    $race = new race();
    $title="个人中心";
    $back_url="index.php?c=home";
    $result = $home->reg_list();
    include 'view/top.php';
    include 'view/home_index.php';
    include 'view/bottom.php';
}
//my setting 
//basic
elseif ($action == "my_setting_basic") {
    check_session();
    include 'view/top.php';
    include 'view/home_my_setting_password.php';
    include 'view/bottom.php';
}
//my setting
//changepassword
elseif ($action == "my_setting_password") {
    check_session();
    include 'view/top.php';
    include 'view/home_my_setting_password.php';
    include 'view/bottom.php';
}
elseif($action=="admin_login_out")
{
    setcookie("admin_check","no");
    go("index.php?c=home&action=admin_login");
}

///employ end
exit();
?>
