} // Exit if accessed directly $start_of_week = (int) get_option('start_of_week'); ?> <form method="post" action="<?php echo esc_url(add_query_arg('type', '_hours')); ?> " class="ab-settings-form" id="business-hours"> <?php $form = new AB_BusinessHoursForm(); ?> <table class="form-inline"> <tbody> <?php for ($i = 0; $i < 7; $i++) { $day = strtolower(AB_DateTimeUtils::getWeekDayByNumber(($i + $start_of_week) % 7)); ?> <tr> <td> <label><?php _e(ucfirst($day)); ?> </label> </td> <td> <?php echo $form->renderField('ab_settings_' . $day); ?> <span> <?php _e('to', 'bookly'); ?>
<tbody> <?php foreach ($schedule_items as $item) { ?> <?php $day_is_not_available = null === $item->get('start_time'); ?> <tr data-id="<?php echo $item->get('day_index'); ?> " data-staff_schedule_item_id="<?php echo $item->get('id'); ?> " class="staff-schedule-item-row"> <td class="first"><label><?php _e(AB_DateTimeUtils::getWeekDayByNumber($item->get('day_index') - 1)); ?> </label></td> <td class="working-intervals"> <?php $workingStart = new AB_TimeChoiceWidget(array('empty_value' => __('OFF', 'bookly'), 'exclude_last_slot' => true)); $working_start_choices = $workingStart->render("start_time[{$item->get('day_index')}]", $item->get('start_time'), array('class' => 'working-start form-control')); $workingEnd = new AB_TimeChoiceWidget(array('use_empty' => false)); $working_end_choices_attributes = array('class' => 'working-end form-control hide-on-non-working-day'); if ($day_is_not_available) { $working_end_choices_attributes['style'] = 'display:none'; } $working_end_choices = $workingEnd->render("end_time[{$item->get('day_index')}]", $item->get('end_time'), $working_end_choices_attributes); echo $working_start_choices . ' <span class="hide-on-non-working-day"' . ($day_is_not_available ? ' style="display: none"' : '') . '>' . __('to', 'bookly') . '</span> ' . $working_end_choices; ?> <input type="hidden" name="days[<?php