Beispiel #1
0
    }
    date_default_timezone_set('Asia/Shanghai');
    $arr = explode('-', date('Y-m-d'));
    $ld = new Lunar($arr[0], $arr[1], $arr[2]);
    $nl = $ld->display();
    $sql = 'SELECT COUNT(user_id) FROM ' . $GLOBALS['ecs']->table('users') . " WHERE SUBSTR(birthday,6)='{$nl}' {$authority}";
    $today_count = $GLOBALS['db']->getOne($sql);
    $smarty->assign('today_count', $today_count);
    //未来四天生日的顾客的数量
    $now = '';
    for ($i = 1; $i < 5; $i++) {
        $time = strtotime("now") + 24 * 60 * 60 * $i;
        $date = date('Y-m-d', $time);
        $arr = explode('-', $date);
        $ld = new Lunar($arr[0], $arr[1], $arr[2]);
        $nl = $ld->display();
        $now = $now . ',\'' . $nl . '\'';
    }
    $now = ltrim($now, ',');
    $sql = 'SELECT COUNT(user_id) FROM ' . $GLOBALS['ecs']->table('users') . " WHERE (SUBSTR(birthday,6)) IN ({$now}) {$authority}";
    $count_5 = $GLOBALS['db']->getOne($sql);
    $smarty->assign('count_5', $count_5);
    //END: 顾客生日统计 //
    $smarty->display('start.htm');
} elseif ($_REQUEST['act'] == 'main_api') {
    require_once ROOT_PATH . '/includes/lib_base.php';
    $data = read_static_cache('api_str');
    if ($data === false || API_TIME < date('Y-m-d H:i:s', time() - 43200)) {
        include_once ROOT_PATH . 'includes/cls_transport.php';
        $ecs_version = VERSION;
        $ecs_lang = $_CFG['lang'];