Ejemplo n.º 1
0
        $ci_timezone = "UM8";
    }
    $ci->config->set_item('time_reference', 'local');
    $ci->load->helper('date');
    $offset = (int) timezones($ci_timezone);
    $hour = date("G") + $offset;
    $server_time = mktime($hour, date("i"), date("s"));
    $server_time_formatted = date("G:i", $server_time);
    $server_day = date("w", $server_time);
    $currentTime = $server_time_formatted;
    $finish_time = $finish[$k];
    //debug - set a time here to restate $currentTime
    //$currentTime = "17:00";
    //echo $currentTime.' - '.$b.' - '.$finish_time;
    if (verify_time($currentTime, $b, $finish_time) == 1 and verify_day($k, $server_day)) {
        $response->addRedirect($choice_array[$k]);
        $response->Respond();
        $oops = false;
        $do_fallback = false;
        //echo "passed check ";
        break;
    } elseif (verify_time($currentTime, $b, $finish_time) == 0 or !verify_day($k, $server_day)) {
        $do_fallback = true;
        $oops = true;
        //echo "failed check ";
    }
}
if ($oops == true and $do_fallback == true) {
    $response->addRedirect($fallback);
    $response->Respond();
}
Ejemplo n.º 2
0
        $ci_timezone = "UM8";
    }
    $ci->config->set_item('time_reference', 'local');
    $ci->load->helper('date');
    $offset = (int) timezones($ci_timezone);
    $hour = date("G") + $offset;
    $server_time = mktime($hour, date("i"), date("s"));
    $server_time_formatted = date("G:i", $server_time);
    $server_day_formatted = date("l", $server_time);
    $currentTime = $server_time_formatted;
    $finish_time = $finish[$k];
    //debug - set a time here to restate $currentTime
    //$currentTime = "17:00";
    //echo $currentTime.' - '.$b.' - '.$finish_time;
    if (verify_time($currentTime, $b, $finish_time) == 1 and verify_day($k, $server_day_formatted) == 1) {
        $response->addRedirect($choice_array[$k]);
        $response->Respond();
        $oops = false;
        $do_fallback = false;
        //echo "passed check ";
        break;
    } elseif (verify_time($currentTime, $b, $finish_time) == 0 or verify_day($k, $server_day_formatted) == 0) {
        $do_fallback = true;
        $oops = true;
        //echo "failed check ";
    }
}
if ($oops == true and $do_fallback == true) {
    $response->addRedirect($fallback);
    $response->Respond();
}