PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / 5.5.2
LatePoint – Calendar Booking Plugin for Appointments and Events v5.5.2
5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / views / settings / work_periods.php
latepoint / lib / views / settings Last commit date
custom_day_schedule_form.php 1 year ago default_form_fields.php 1 year ago general.php 1 month ago generate_instant_booking_page.php 1 year ago get_pro.php 1 year ago import_modal.php 1 year ago notifications.php 1 year ago pages.php 1 year ago payments.php 1 year ago premium_modal.php 1 year ago steps_order_modal.php 5 months ago version_5_intro.php 1 year ago work_periods.php 1 year ago
work_periods.php
92 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5 ?>
6 <div class="latepoint-settings-w os-form-w">
7 <form action="" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('settings', 'update_work_periods')); ?>">
8 <?php wp_nonce_field('update_work_periods'); ?>
9 <div class="white-box">
10 <div class="white-box-header">
11 <div class="os-form-sub-header"><h3><?php esc_html_e('General Weekly Schedule', 'latepoint'); ?></h3></div>
12 </div>
13 <div class="white-box-content">
14 <div class="weekday-schedules-w">
15 <?php OsWorkPeriodsHelper::generate_work_periods([], new \LatePoint\Misc\Filter()); ?>
16 </div>
17 <div class="os-form-buttons">
18 <?php echo OsFormHelper::button('submit', __('Save Weekly Schedule', 'latepoint'), 'submit', ['class' => 'latepoint-btn']); ?>
19 </div>
20 </div>
21 </div>
22 </form>
23 <div class="white-box">
24 <div class="white-box-header">
25 <div class="os-form-sub-header"><h3><?php esc_html_e('Days With Custom Schedules', 'latepoint'); ?></h3></div>
26 </div>
27 <div class="white-box-content">
28 <?php OsWorkPeriodsHelper::generate_days_with_custom_schedule(); ?>
29 </div>
30 </div>
31 <div class="white-box">
32 <div class="white-box-header">
33 <div class="os-form-sub-header"><h3><?php esc_html_e('Holidays & Days Off', 'latepoint'); ?></h3></div>
34 </div>
35 <div class="white-box-content">
36 <?php OsWorkPeriodsHelper::generate_off_days(); ?>
37 </div>
38 </div>
39 <div class="full-screen-year-calendar-w">
40 <div class="full-screen-year-calendar">
41 <div class="fsy-header">
42 <h2><?php esc_html_e('Select Date', 'latepoint'); ?></h2>
43 </div>
44 <div class="full-screen-year-calendar-months">
45 <?php $year = OsTimeHelper::today_date('Y') + 1; ?>
46 <?php for ($i = 1; $i <= 12; $i++) {
47 echo '<div class="fsy-month">';
48 echo '<div class="fsy-month-name">' . esc_html(OsUtilHelper::get_month_name_by_number($i)) . '</div>';
49 $target_date = new OsWpDateTime($year . '-' . $i . '-01');
50 $calendar_start = clone $target_date;
51 $calendar_start->modify('first day of this month');
52 $calendar_end = clone $target_date;
53 $calendar_end->modify('last day of this month');
54
55 $weekday_for_first_day_of_month = $calendar_start->format('N') - 1;
56 $weekday_for_last_day_of_month = $calendar_end->format('N') - 1;
57
58 if ($weekday_for_first_day_of_month > 0) {
59 $calendar_start->modify('-' . $weekday_for_first_day_of_month . ' days');
60 }
61
62 if ($weekday_for_last_day_of_month < 7) {
63 $days_to_add = 7 - $weekday_for_last_day_of_month;
64 if($days_to_add > 0){
65 $calendar_end->modify('+' . $days_to_add . ' days');
66 }
67 }
68
69 echo '<div class="os-monthly-calendar-days-w" data-calendar-year="' . esc_attr($target_date->format('Y')) . '" data-calendar-month="' . esc_attr($target_date->format('n')) . '" data-calendar-month-label="' . esc_attr(OsUtilHelper::get_month_name_by_number($target_date->format('n'))) . '">
70 <div class="os-monthly-calendar-days">';
71 for ($day_date = clone $calendar_start; $day_date <= $calendar_end; $day_date->modify('+1 day')) {
72 $is_today = ($day_date->format('Y-m-d') == OsTimeHelper::today_date('Y-m-d')) ? true : false;
73 $is_day_in_past = ($day_date->format('Y-m-d') < OsTimeHelper::today_date('Y-m-d')) ? true : false;
74 $day_class = 'os-day os-day-current week-day-' . strtolower($day_date->format('N'));
75 if ($is_today) $day_class .= ' os-today';
76 if ($is_day_in_past) $day_class .= ' os-day-passed'; ?>
77 <div class="<?php echo esc_attr($day_class); ?>" data-date="<?php echo esc_attr($day_date->format('Y-m-d')); ?>">
78 <div class="os-day-box">
79 <div class="os-day-number"><?php echo esc_html($day_date->format('j')); ?></div>
80 </div>
81 </div><?php
82 }
83 echo '</div></div>';
84 echo '</div>';
85 } ?>
86 </div>
87 </div>
88 </div>
89 <?php
90
91 ?>
92 </div>