function srvc_book_rticket_to_string($rticket)
{
    $str = " " . $rticket->guid->to_string();
    $str .= "-" . "{$rticket->num}" . "人";
    $str .= "-" . "{$rticket->large_board}" . "大" . "{$rticket->medium_board}" . "中" . "{$rticket->small_board}" . "小";
    $str .= "-" . $rticket->visit_date;
    $str .= "-" . minutes_to_clock_str($rticket->visit_mins_slot);
    return $str;
}
示例#2
0
                        {
                            anchor_ref.style.textDecoration = "line-through";
                        }
                    }
                }
            }
        });
        
        function try_to_reload()
        {
            window.location.reload();
        }
        </script>
    </head>
    <body>
        <h3>休业日期</h3>
        <?php 
for ($k = 0; $k < 7 * 4; $k++) {
    $clock_cur = time() + $k * SEC_PER_DAY;
    $date_str = date("Ymd", $clock_cur);
    echo "<span id=\"S_label_{$date_str}\">" . $date_str . "</span>";
    echo "  " . "<a href=\"javascript:book_do_block('{$date_str}',try_to_reload())\">锁定全天</a>" . " | " . "<a href=\"javascript:book_do_unblock('{$date_str}',try_to_reload())\">恢复全天</a>";
    for ($cur_hour = OPEN_HOUR_BEGIN; $cur_hour <= OPEN_HOUR_END; $cur_hour += OPEN_HOUR_SLOT) {
        $ts_str = minutes_to_clock_str($cur_hour);
        echo " | <a href=\"javascript:book_do_block_ts('{$date_str}','{$cur_hour}',try_to_reload())\" id=\"A_{$date_str}" . "_" . "{$cur_hour}\">{$ts_str}</a>";
    }
    echo "</br>";
}
?>
    </body>
</html>
示例#3
0
                    <span class="value" id="J-input-date"><?php 
echo $right_now_day;
?>
</span>
                    <i class="caret"></i>
                    <select class="select-overlay" id="J-date-select" onchange="javascript:on_select_changed('J-date-select', 'J-input-date');on_date_changed('J-date-select','J-time-select');">
                        <?php 
foreach ($available_days_display as $date_val => $str) {
    echo "<option value='{$date_val}'>{$str}</option>";
}
?>
                    </select>
                </div>
                <div class="time-sel J-time-trigger">
                    <span class="value" id="J-input-time"><?php 
echo minutes_to_clock_str(OPEN_HOUR_BEGIN);
?>
</span>
                    <i class="caret"></i>
                    <select class="select-overlay" id="J-time-select" onchange="javascript:on_select_changed('J-time-select', 'J-input-time')">
                    </select>
                </div>
            </div>
            <div class="msg msg-full hide">该时间段已订满,请换个时间</div>
        </section>
                        
        <section class="contact">
            <div class="row-group">
                <div class="row">
                    <div class="input">
                        <input id="J-input-phone" type="tel" placeholder="请输入手机号" />
示例#4
0
function impl_book_query_schedule($prev_n, $next_n, &$result_arr)
{
    $begin_day = time() - $prev_n * SEC_PER_DAY;
    for ($k = 0; $k < $prev_n + $next_n; $k++) {
        $cur = $begin_day + $k * SEC_PER_DAY;
        $subdir = date("Ymd", $cur);
        $dir = __impl_book_file_dir_4_name($subdir);
        if (!is_dir($dir)) {
            continue;
        }
        $dh = opendir($dir);
        if ($dh == false) {
            continue;
        }
        // all slots in one array
        $all_slots = array();
        while (($fname = readdir($dh)) != false) {
            $fpath = $dir . "/" . $fname;
            // skip folders
            if (is_dir($fpath)) {
                continue;
            }
            // file-name without ext
            $minutes_slot = pathinfo($fpath, PATHINFO_FILENAME);
            $visit_clock = minutes_to_clock_str($minutes_slot);
            // read from file
            $json_str = file_get_contents($fpath);
            // decode and check
            $json = json_decode($json_str, true);
            if ($json == null || !is_array($json) || !array_key_exists(KEY_FILE_JSON_RTICKET_COUNT, $json) || !array_key_exists(KEY_FILE_JSON_RTICKET_LIST, $json)) {
                continue;
            }
            // total guest number
            $count_rtickets = $json[KEY_FILE_JSON_RTICKET_COUNT];
            if ($count_rtickets <= 0) {
                continue;
            }
            // put all reservations of this slot in one array
            $slot_inf = array();
            // go through each reservation
            $arr_rtickets = $json[KEY_FILE_JSON_RTICKET_LIST];
            foreach ($arr_rtickets as $arr_rt) {
                $rticket = new ReservationTicket(null, 0, "", "");
                if (!$rticket->from_array($arr_rt)) {
                    continue;
                }
                $guid = $rticket->guid;
                $guid_str = $guid->to_string();
                $guest_num = $rticket->num;
                $ttoken = $rticket->trade_token;
                $small_b = $rticket->small_board;
                $medium_b = $rticket->medium_board;
                $large_b = $rticket->large_board;
                // e.g. [N] ==> #2, PHONE_138xxxxxxxx
                $slot_inf[] = array("GUEST_NUM" => $guest_num, "GUID_STR" => $guid_str, "BOARD_S" => $small_b, "BOARD_M" => $medium_b, "BOARD_L" => $large_b, "T_TOKEN" => $ttoken);
            }
            // e.g. 15:30 ==> [ xxx ]
            $all_slots[] = array("CLOCK" => $visit_clock, "COUNT" => $count_rtickets, "VISITORs" => $slot_inf);
        }
        closedir($dh);
        // e.g. 20160210 ==> [ xxx ]
        $result_arr[] = array("DATE" => $subdir, "SLOTS" => $all_slots);
    }
    return BOOK_CODE_OK;
}