public function index() { /** @var WP_Locale $wp_locale */ global $wp_locale; $this->enqueueStyles(array('backend' => array('css/bookly.main-backend.css', 'bootstrap/css/bootstrap.min.css', 'css/daterangepicker.css', 'css/bootstrap-select.min.css'))); $this->enqueueScripts(array('backend' => array('bootstrap/js/bootstrap.min.js' => array('jquery'), 'js/moment.min.js', 'js/daterangepicker.js' => array('jquery'), 'js/bootstrap-select.min.js'))); wp_localize_script('ab-daterangepicker.js', 'BooklyL10n', array('today' => __('Today', 'bookly'), 'yesterday' => __('Yesterday', 'bookly'), 'last_7' => __('Last 7 Days', 'bookly'), 'last_30' => __('Last 30 Days', 'bookly'), 'this_month' => __('This Month', 'bookly'), 'last_month' => __('Last Month', 'bookly'), 'custom_range' => __('Custom Range', 'bookly'), 'apply' => __('Apply', 'bookly'), 'cancel' => __('Cancel', 'bookly'), 'to' => __('To', 'bookly'), 'from' => __('From', 'bookly'), 'months' => array_values($wp_locale->month), 'days' => array_values($wp_locale->weekday_abbrev), 'startOfWeek' => (int) get_option('start_of_week'), 'mjsDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_MOMENT_JS))); $request = array('range' => date('Y-m-d', strtotime('-30 days')) . ' - ' . date('Y-m-d'), 'order_by' => 'created', 'sort_order' => 'desc'); $this->collection = $this->createQuery($request)->fetchArray(); $payments = array(); $customers = array(); $providers = array(); $services = array(); foreach ($this->collection as $key => $value) { $payments[] = $value['type']; $customers[] = $value['customer']; $providers[] = $value['provider']; $services[] = $value['service']; } $this->types = array_unique($payments); $this->customers = array_unique($customers); $this->providers = array_unique($providers); $this->services = array_unique($services); $this->render('index'); }
public function index() { /** @var WP_Locale $wp_locale */ global $wp_locale; $this->enqueueStyles(array('frontend' => array('css/intlTelInput.css'), 'backend' => array('css/jquery-ui-theme/jquery-ui.min.css', 'css/bookly.main-backend.css', 'bootstrap/css/bootstrap.min.css', 'css/daterangepicker.css', 'css/bootstrap-select.min.css', 'css/chosen.min.css'))); $this->enqueueScripts(array('backend' => array('bootstrap/js/bootstrap.min.js' => array('jquery'), 'js/angular-1.3.11.min.js', 'js/angular-sanitize.min.js', 'js/angular-ui-utils-0.2.1.min.js', 'js/ng-new_customer_dialog.js' => array('ab-intlTelInput.min.js', 'ab-angular-1.3.11.min.js'), 'js/angular-ui-date-0.0.7.js', 'js/moment.min.js', 'js/daterangepicker.js' => array('jquery'), 'js/bootstrap-select.min.js', 'js/chosen.jquery.min.js' => array('jquery')), 'frontend' => array('js/intlTelInput.min.js'), 'module' => array('js/ng-app.js' => array('jquery', 'ab-angular-1.3.11.min.js', 'ab-angular-ui-utils-0.2.1.min.js', 'ab-angular-ui-date-0.0.7.js', 'jquery-ui-datepicker')))); wp_localize_script('ab-ng-app.js', 'BooklyL10n', array('are_you_sure' => __('Are you sure?', 'bookly'), 'today' => __('Today', 'bookly'), 'yesterday' => __('Yesterday', 'bookly'), 'last_7' => __('Last 7 Days', 'bookly'), 'last_30' => __('Last 30 Days', 'bookly'), 'this_month' => __('This Month', 'bookly'), 'next_month' => __('Next Month', 'bookly'), 'custom_range' => __('Custom Range', 'bookly'), 'apply' => __('Apply', 'bookly'), 'cancel' => __('Cancel', 'bookly'), 'to' => __('To', 'bookly'), 'from' => __('From', 'bookly'), 'editAppointment' => __('Edit appointment', 'bookly'), 'newAppointment' => __('New appointment', 'bookly'), 'months' => array_values($wp_locale->month), 'days' => array_values($wp_locale->weekday_abbrev), 'shortMonths' => array_values($wp_locale->month_abbrev), 'shortDays' => array_values($wp_locale->weekday_abbrev), 'dpDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_JQUERY_DATEPICKER), 'mjsDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_MOMENT_JS), 'startOfWeek' => (int) get_option('start_of_week'), 'country' => get_option('ab_settings_phone_default_country'), 'intlTelInput_utils' => plugins_url('intlTelInput.utils.js', AB_PATH . '/frontend/resources/js/intlTelInput.utils.js'))); $this->render('index'); }
/** * Default Action */ public function index() { /** @var WP_Locale $wp_locale */ global $wp_locale; $this->enqueueStyles(array('frontend' => array('css/intlTelInput.css', 'css/ladda.min.css', 'css/bookly-main.css', 'css/ab-columnizer.css', 'css/picker.classic.css', 'css/picker.classic.date.css', 'css/ab-picker.css'), 'backend' => array('css/bookly.main-backend.css', 'bootstrap/css/bootstrap.min.css', 'bootstrap/css/bootstrap-editable.css'), 'wp' => array('wp-color-picker'), 'module' => array('css/appearance.css'))); $this->enqueueScripts(array('backend' => array('bootstrap/js/bootstrap.min.js' => array('jquery'), 'bootstrap/js/bootstrap-editable.min.js' => array('jquery')), 'frontend' => array('js/picker.js' => array('jquery'), 'js/picker.date.js' => array('jquery'), 'js/spin.min.js' => array('jquery'), 'js/ladda.min.js' => array('jquery'), 'js/intlTelInput.min.js' => array('ab-picker.date.js')), 'wp' => array('wp-color-picker'), 'module' => array('js/appearance.js' => array('jquery')))); wp_localize_script('ab-picker.date.js', 'BooklyL10n', array('today' => __('Today', 'bookly'), 'months' => array_values($wp_locale->month), 'days' => array_values($wp_locale->weekday_abbrev), 'nextMonth' => __('Next month', 'bookly'), 'prevMonth' => __('Previous month', 'bookly'), 'date_format' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_PICKADATE), 'start_of_week' => (int) get_option('start_of_week'), 'intlTelInput_utils' => plugins_url('intlTelInput.utils.js', AB_PATH . '/frontend/resources/js/intlTelInput.utils.js'))); // Initialize steps (tabs). $this->steps = array(1 => get_option('ab_appearance_text_step_service'), 2 => get_option('ab_appearance_text_step_time'), 3 => get_option('ab_appearance_text_step_details'), 4 => get_option('ab_appearance_text_step_payment'), 5 => get_option('ab_appearance_text_step_done')); // Render general layout. $this->render('index'); }
public function index() { /** @var WP_Locale $wp_locale */ global $wp_locale; $this->enqueueStyles(array('frontend' => array('css/intlTelInput.css'), 'module' => array('css/calendar.css', 'css/fullcalendar.min.css'), 'backend' => array('css/chosen.min.css', 'css/jquery-ui-theme/jquery-ui.min.css', 'css/bookly.main-backend.css', 'bootstrap/css/bootstrap.min.css'))); $this->enqueueScripts(array('backend' => array('js/angular-1.3.11.min.js' => array('jquery'), 'js/angular-ui-date-0.0.7.js' => array('ab-angular-1.3.11.min.js'), 'js/ng-new_customer_dialog.js' => array('ab-angular-1.3.11.min.js'), 'js/moment.min.js' => array('jquery'), 'bootstrap/js/bootstrap.min.js' => array('jquery'), 'js/chosen.jquery.min.js' => array('jquery')), 'module' => array('js/ng-app.js' => array('ab-angular-ui-date-0.0.7.js', 'jquery-ui-datepicker', 'jquery-ui-widget', 'jquery-ui-dialog'), 'js/fullcalendar.min.js' => array('ab-moment.min.js'), 'js/fc-multistaff-view.js' => array('ab-fullcalendar.min.js'), 'js/calendar.js' => array('ab-fc-multistaff-view.js', 'ab-intlTelInput.min.js')), 'frontend' => array('js/intlTelInput.min.js' => array('jquery')))); $slot_length_minutes = get_option('ab_settings_time_slot_length', '15'); $slot = new DateInterval('PT' . $slot_length_minutes . 'M'); $this->staff_members = AB_Utils::isCurrentUserAdmin() ? AB_Staff::query()->sortBy('position')->find() : AB_Staff::query()->where('wp_user_id', get_current_user_id())->find(); wp_localize_script('ab-calendar.js', 'BooklyL10n', array('slotDuration' => $slot->format('%H:%I:%S'), 'shortMonths' => array_values($wp_locale->month_abbrev), 'longMonths' => array_values($wp_locale->month), 'shortDays' => array_values($wp_locale->weekday_abbrev), 'longDays' => array_values($wp_locale->weekday), 'AM' => $wp_locale->meridiem['AM'], 'PM' => $wp_locale->meridiem['PM'], 'dpDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_JQUERY_DATEPICKER), 'mjsDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_MOMENT_JS), 'mjsTimeFormat' => AB_DateTimeUtils::convertFormat('time', AB_DateTimeUtils::FORMAT_MOMENT_JS), 'today' => __('Today', 'bookly'), 'week' => __('Week', 'bookly'), 'day' => __('Day', 'bookly'), 'month' => __('Month', 'bookly'), 'allDay' => __('All Day', 'bookly'), 'noStaffSelected' => __('No staff selected', 'bookly'), 'newAppointment' => __('New appointment', 'bookly'), 'editAppointment' => __('Edit appointment', 'bookly'), 'are_you_sure' => __('Are you sure?', 'bookly'), 'startOfWeek' => (int) get_option('start_of_week'), 'country' => get_option('ab_settings_phone_default_country'), 'intlTelInput_utils' => plugins_url('intlTelInput.utils.js', AB_PATH . '/frontend/resources/js/intlTelInput.utils.js'))); $this->render('calendar'); }
public function index() { global $wp_locale; $this->enqueueStyles(array('frontend' => array('css/intlTelInput.css', 'css/ladda.min.css'), 'backend' => array('css/bookly.main-backend.css', 'bootstrap/css/bootstrap.min.css', 'css/daterangepicker.css'), 'module' => array('css/sms.css', 'css/flags.css'))); $this->enqueueScripts(array('backend' => array('bootstrap/js/bootstrap.min.js' => array('jquery'), 'js/moment.min.js', 'js/daterangepicker.js' => array('jquery')), 'module' => array('js/sms.js' => array('jquery')), 'frontend' => array('js/intlTelInput.min.js' => array('ab-daterangepicker.js'), 'js/spin.min.js' => array('jquery'), 'js/ladda.min.js' => array('jquery')))); $this->is_logged_in = false; $this->prices = array(); $this->form = new AB_NotificationsForm('sms'); $this->sms = new AB_SMS(); $errors = array(); $messages = array(); switch ($this->getParameter('paypal_result')) { case 'success': $messages[] = __('Your payment has been accepted for processing.', 'bookly'); break; case 'cancel': $errors[] = __('Your payment has been interrupted.', 'bookly'); break; } if ($this->hasParameter('form-login')) { $this->is_logged_in = $this->sms->login($this->getParameter('username'), $this->getParameter('password')); } elseif ($this->hasParameter('form-logout')) { $this->sms->logout(); } elseif ($this->hasParameter('form-registration')) { if ($this->getParameter('accept_tos', false)) { $this->is_logged_in = $this->sms->register($this->getParameter('username'), $this->getParameter('password'), $this->getParameter('password_repeat')); } else { $errors[] = __('Please accept terms and conditions.', 'bookly'); } } else { $this->is_logged_in = $this->sms->loadProfile(); } if (!$this->is_logged_in) { if ($response = $this->sms->getPriceList()) { $this->prices = $response->list; } if ($_SERVER['REQUEST_METHOD'] == 'GET') { // Hide authentication errors on auto login. $this->sms->clearErrors(); } } if ($this->hasParameter('form-notifications')) { update_option('ab_sms_administrator_phone', $this->getParameter('ab_sms_administrator_phone')); $this->form->bind($this->getPostParameters(), $_FILES); $this->form->save(); $messages[] = __('Notification settings were updated successfully.', 'bookly'); } wp_localize_script('ab-daterangepicker.js', 'BooklyL10n', array('today' => __('Today', 'bookly'), 'yesterday' => __('Yesterday', 'bookly'), 'last_7' => __('Last 7 Days', 'bookly'), 'last_30' => __('Last 30 Days', 'bookly'), 'this_month' => __('This Month', 'bookly'), 'last_month' => __('Last Month', 'bookly'), 'custom_range' => __('Custom Range', 'bookly'), 'apply' => __('Apply', 'bookly'), 'cancel' => __('Cancel', 'bookly'), 'to' => __('To', 'bookly'), 'from' => __('From', 'bookly'), 'months' => array_values($wp_locale->month), 'days' => array_values($wp_locale->weekday_abbrev), 'startOfWeek' => (int) get_option('start_of_week'), 'mjsDateFormat' => AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_MOMENT_JS), 'current_tab' => 'notifications', 'country' => get_option('ab_settings_phone_default_country'), 'intlTelInput_utils' => plugins_url('intlTelInput.utils.js', AB_PATH . '/frontend/resources/js/intlTelInput.utils.js'), 'passwords_no_same' => __('Passwords must be the same.', 'bookly'), 'input_old_password' => __('Please enter old password.', 'bookly'))); $this->render('index', array('errors' => array_merge($errors, $this->sms->getErrors()), 'messages' => $messages)); }
?> , form_id : <?php echo json_encode($form_id); ?> , start_of_week : <?php echo (int) get_option('start_of_week'); ?> , date_min : <?php echo json_encode(AB_BookingConfiguration::getDateMin()); ?> , date_format : <?php echo json_encode(AB_DateTimeUtils::convertFormat('date', AB_DateTimeUtils::FORMAT_PICKADATE)); ?> , custom_fields : <?php echo get_option('ab_custom_fields'); ?> , show_calendar : <?php echo intval(get_option('ab_appearance_show_calendar')); ?> , woocommerce : <?php echo intval(get_option('ab_woocommerce') && get_option('ab_woocommerce_product') && class_exists('WooCommerce')); ?> , woocommerce_cart_url : <?php