Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( $hours_range != NULL ) {
- $start_time = strtotime( $start_time );
- $end_time = strtotime( $end_time );
- $open_diff = $start_time - $current_time;
- $end_diff = $end_time - $current_time;
- // echo $open_diff;
- // echo "<br />";
- // echo $end_diff;
- if ( $current_time >= $start_time && $current_time <= $end_time ) {
- /* ------------------------------ Closing Soon ------------------------------ */
- if ( $end_diff <= 7200 ) {
- $open_caption = "Closing soon";
- $opening_class = "closing_soon";
- } else {
- $open_caption = "Open now";
- $opening_class = "opening";
- }
- } else {
- /* ------------------------------ Opening Soon ------------------------------ */
- if ( $open_diff < 10800 && $open_diff > 0 ) {
- $open_caption = "Open soon";
- $opening_class = "open_soon";
- } elseif ( $end_time > 14400 && $end_diff < 0 ) {
- /* ------------------------------- Opening at ------------------------------- */
- $stime = '';
- if ( is_array( $strings ) ) {
- for ( $i = 0; $i < count( $strings ); $i++ ) {
- if ( strpos( $strings[$i], 'Closed' ) > 0 ) {
- $next_index = $i + 1;
- if ( !array_key_exists( $next_index, $strings ) ) {
- $next_index = 0;
- }
- break;
- } else {
- $next_index = 0;
- }
- }
- }
- $open_day = $strings[$next_index];
- // echo $open_day;
- $open_caption = "Opening at {$open_day}";
- $opening_class = "opening_at";
- } else {
- $open_caption = "Closed";
- $opening_class = "closed";
- }
- }
- } elseif ( $show_working_status != NULL ) {
- $open_caption = $show_working_status;
- $opening_class = "";
- } else {
- $open_caption = "No Data";
- $opening_class = "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement