| 1 |
<?php /** |
| 2 |
* @version 1.0 |
| 3 |
* @package Booking Calendar |
| 4 |
* @category Admin Panel - Dashboard functions |
| 5 |
* @author wpdevelop |
| 6 |
* |
| 7 |
* @web-site https://wpbookingcalendar.com/ |
| 8 |
* @email info@wpbookingcalendar.com |
| 9 |
* |
| 10 |
* @modified 2016-03-16 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit, if accessed directly |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* Get number of bookings for different parameters |
| 18 |
* |
| 19 |
* @return int[] |
| 20 |
*/ |
| 21 |
function wpbc_db_dashboard_get_bookings_count_arr(){ |
| 22 |
|
| 23 |
|
| 24 |
// <editor-fold defaultstate="collapsed" desc=" Get bookings for counting number of specific bookings " > |
| 25 |
$my_resources = array(); |
| 26 |
if ( class_exists( 'wpdev_bk_multiuser' ) ) { |
| 27 |
$is_superadmin = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'only_super_admin' ); |
| 28 |
if ( ! $is_superadmin ) { |
| 29 |
|
| 30 |
$bk_ids = apply_bk_filter( 'get_bk_resources_of_user', false ); |
| 31 |
|
| 32 |
if ( $bk_ids !== false ) { |
| 33 |
foreach ( $bk_ids as $bk_id ) { |
| 34 |
$my_resources[] = $bk_id->ID; |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
$my_resources = implode( ',', $my_resources ); |
| 40 |
|
| 41 |
global $wpdb; |
| 42 |
|
| 43 |
$trash_bookings = ' bk.trash != 1 '; //FixIn: 6.1.1.10 - check also below usage of {$trash_bookings} |
| 44 |
|
| 45 |
$sql_req = "SELECT DISTINCT bk.booking_id as id, dt.approved, dt.booking_date, bk.modification_date as m_date , bk.is_new as new |
| 46 |
FROM {$wpdb->prefix}bookingdates as dt |
| 47 |
INNER JOIN {$wpdb->prefix}booking as bk |
| 48 |
ON bk.booking_id = dt.booking_id " |
| 49 |
. " WHERE {$trash_bookings} " ; |
| 50 |
if ($my_resources!='') $sql_req .= " AND bk.booking_type IN ({$my_resources}) "; |
| 51 |
|
| 52 |
$sql_req .= "ORDER BY dt.booking_date" ; |
| 53 |
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared |
| 54 |
$sql_results = $wpdb->get_results( $sql_req ); |
| 55 |
|
| 56 |
// </editor-fold> |
| 57 |
|
| 58 |
|
| 59 |
// <editor-fold defaultstate="collapsed" desc=" Count bookings " > |
| 60 |
$bk_array = array(); |
| 61 |
if ( ! empty( $sql_results ) ) |
| 62 |
foreach ( $sql_results as $v ) { |
| 63 |
|
| 64 |
if ( !isset( $bk_array[$v->id] ) ) |
| 65 |
$bk_array[$v->id] = array( |
| 66 |
'dates' => array() |
| 67 |
, 'check_in_date' => array() |
| 68 |
, 'check_out_date' => array() |
| 69 |
, 'bk_today' => 0 |
| 70 |
, 'm_today' => 0 |
| 71 |
); |
| 72 |
$bk_array[$v->id]['id'] = $v->id; |
| 73 |
$bk_array[$v->id]['approved'] = $v->approved; |
| 74 |
$bk_array[$v->id]['dates'][] = $v->booking_date; |
| 75 |
|
| 76 |
if ( intval( substr( $v->booking_date, -1 ) ) == 1 ) { |
| 77 |
$bk_array[$v->id]['check_in_date'][] = $v->booking_date; |
| 78 |
} |
| 79 |
if ( intval( substr( $v->booking_date, -1 ) ) == 2 ) { |
| 80 |
$bk_array[$v->id]['check_out_date'][] = $v->booking_date; |
| 81 |
} |
| 82 |
$bk_array[$v->id]['m_date'] = $v->m_date; // Modification Booking date |
| 83 |
$bk_array[$v->id]['new'] = $v->new; |
| 84 |
if ( wpbc_is_today_date( $v->booking_date ) ) { |
| 85 |
$bk_array[ $v->id ]['bk_today'] = 1; |
| 86 |
} |
| 87 |
if ( wpbc_is_today_date( $v->m_date ) ) { |
| 88 |
$bk_array[ $v->id ]['m_today'] = 1; |
| 89 |
} |
| 90 |
} |
| 91 |
|
| 92 |
$counter = array( |
| 93 |
'all' => 0 |
| 94 |
, 'new' => 0 |
| 95 |
, 'pending' => 0 |
| 96 |
, 'approved' => 0 |
| 97 |
, 'booking_today' => 0 |
| 98 |
, 'was_made_today' => 0 |
| 99 |
, 'check_in_today' => 0 |
| 100 |
, 'check_out_today' => 0 |
| 101 |
, 'check_in_tomorrow' => 0 |
| 102 |
, 'check_out_tomorrow' => 0 |
| 103 |
); |
| 104 |
foreach ( $bk_array as $k => $v ) { |
| 105 |
|
| 106 |
$counter['all']++; |
| 107 |
if ( $v['new'] ) { |
| 108 |
$counter['new'] ++; |
| 109 |
} |
| 110 |
if ( $v['m_today'] ) { |
| 111 |
$counter['was_made_today'] ++; |
| 112 |
} |
| 113 |
if ( $v['bk_today'] ) { |
| 114 |
$counter['booking_today'] ++; |
| 115 |
} |
| 116 |
if ( $v['approved'] ) { |
| 117 |
$counter['approved'] ++; |
| 118 |
} else { |
| 119 |
$counter['pending'] ++; |
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
// Check in |
| 124 |
if ( ! empty( $v['check_in_date'] ) ) { |
| 125 |
foreach ( $v['check_in_date'] as $check_in ) { |
| 126 |
if ( wpbc_is_today_date( $check_in ) ) { |
| 127 |
$counter['check_in_today']++; |
| 128 |
} |
| 129 |
if ( wpbc_is_tomorrow_date( $check_in ) ) { |
| 130 |
$counter['check_in_tomorrow']++; |
| 131 |
} |
| 132 |
} |
| 133 |
} else { |
| 134 |
$check_in = $v['dates'][0]; |
| 135 |
if ( wpbc_is_today_date( $check_in ) ) { |
| 136 |
$counter['check_in_today']++; |
| 137 |
} |
| 138 |
if ( wpbc_is_tomorrow_date( $check_in ) ) { |
| 139 |
$counter['check_in_tomorrow']++; |
| 140 |
} |
| 141 |
} |
| 142 |
// Check out |
| 143 |
if ( ! empty( $v['check_out_date'] ) ) { |
| 144 |
foreach ( $v['check_out_date'] as $check_out ) { |
| 145 |
if ( wpbc_is_today_date( $check_out ) ) { |
| 146 |
$counter['check_out_today']++; |
| 147 |
} |
| 148 |
if ( wpbc_is_tomorrow_date( $check_out ) ) { |
| 149 |
$counter['check_out_tomorrow']++; |
| 150 |
} |
| 151 |
} |
| 152 |
} else { |
| 153 |
$check_out = $v['dates'][ ( count( $v['dates'] ) - 1 ) ]; |
| 154 |
if ( wpbc_is_today_date( $check_out ) ) { |
| 155 |
$counter['check_out_today']++; |
| 156 |
} |
| 157 |
if ( wpbc_is_tomorrow_date( $check_out ) ) { |
| 158 |
$counter['check_out_tomorrow']++; |
| 159 |
} |
| 160 |
} |
| 161 |
|
| 162 |
} |
| 163 |
// </editor-fold> |
| 164 |
|
| 165 |
|
| 166 |
return $counter; |
| 167 |
} |
| 168 |
|
| 169 |
|
| 170 |
//////////////////////////////////////////////////////////////////////////////// |
| 171 |
// D a s h b o a r d W i d g e t |
| 172 |
//////////////////////////////////////////////////////////////////////////////// |
| 173 |
|
| 174 |
/** Setup Widget for Dashboard */ |
| 175 |
function wpbc_dashboard_widget_setup(){ |
| 176 |
|
| 177 |
// Check, if we have permission to show Widget /////////////////////////// |
| 178 |
$is_user_activated = apply_bk_filter('multiuser_is_current_user_active', true ); // FixIn: 6.0.1.17. |
| 179 |
if ( ! $is_user_activated ) |
| 180 |
return false; |
| 181 |
|
| 182 |
$user_role = get_bk_option( 'booking_user_role_booking' ); |
| 183 |
if ( ! wpbc_is_current_user_have_this_role( $user_role ) ) |
| 184 |
return false; |
| 185 |
|
| 186 |
|
| 187 |
// Add Booking Calendar Widget to Dashboard /////////////////////////////// |
| 188 |
$bk_dashboard_widget_id = 'booking_dashboard_widget'; |
| 189 |
wp_add_dashboard_widget( $bk_dashboard_widget_id, sprintf( __( 'Booking Calendar', 'booking' ) ), 'wpbc_dashboard_widget_show', null ); |
| 190 |
|
| 191 |
|
| 192 |
// Sort Dashboard. Add Booking Calendar widget to top /////////////////////// |
| 193 |
global $wp_meta_boxes; |
| 194 |
$normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; |
| 195 |
if ( isset( $normal_dashboard[$bk_dashboard_widget_id] ) ) { |
| 196 |
// Backup and delete our new dashbaord widget from the end of the array |
| 197 |
$example_widget_backup = array( $bk_dashboard_widget_id => $normal_dashboard[$bk_dashboard_widget_id] ); |
| 198 |
unset( $normal_dashboard[$bk_dashboard_widget_id] ); |
| 199 |
} else |
| 200 |
$example_widget_backup = array(); |
| 201 |
|
| 202 |
// Sometimes, some other plugins can modify this item, so its can be not a array |
| 203 |
if ( is_array( $normal_dashboard ) ) { |
| 204 |
// Merge the two arrays together so our widget is at the beginning |
| 205 |
if ( is_array( $normal_dashboard ) ) |
| 206 |
$sorted_dashboard = array_merge( $example_widget_backup, $normal_dashboard ); |
| 207 |
else |
| 208 |
$sorted_dashboard = $example_widget_backup; |
| 209 |
// Save the sorted array back into the original metaboxes |
| 210 |
$wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; |
| 211 |
} |
| 212 |
} |
| 213 |
add_action( 'wp_dashboard_setup', 'wpbc_dashboard_widget_setup' ); |
| 214 |
|
| 215 |
|
| 216 |
/** Show Booking Dashboard Widget content */ |
| 217 |
function wpbc_dashboard_widget_show() { |
| 218 |
|
| 219 |
$is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8. |
| 220 |
$counter = $is_panel_visible ? wpbc_db_dashboard_get_bookings_count_arr() : array(); |
| 221 |
|
| 222 |
wpbc_dashboard_widget_css(); |
| 223 |
|
| 224 |
?> |
| 225 |
<div id="wpbc_dashboard_widget_container" ><?php |
| 226 |
|
| 227 |
|
| 228 |
wpbc_dashboard_section_statistic( $counter ); |
| 229 |
|
| 230 |
?><div style="clear:both;"></div><?php |
| 231 |
wpbc_dashboard_section_version(); |
| 232 |
|
| 233 |
wpbc_dashboard_section_support(); |
| 234 |
?><div style="clear:both;margin-bottom:20px;"></div><?php |
| 235 |
|
| 236 |
wpbc_dashboard_section_news(); |
| 237 |
|
| 238 |
/* |
| 239 |
?><div style="clear:both;"></div><?php |
| 240 |
|
| 241 |
|
| 242 |
wpbc_dashboard_section_video_f(); |
| 243 |
|
| 244 |
wpbc_dashboard_section_video_p(); |
| 245 |
*/ |
| 246 |
|
| 247 |
|
| 248 |
?><div style="clear:both;"></div> |
| 249 |
|
| 250 |
</div> |
| 251 |
<div style="clear:both;"></div> |
| 252 |
<?php |
| 253 |
} |
| 254 |
|
| 255 |
|
| 256 |
/** Get Info for Dashboard */ |
| 257 |
function wpbc_get_dashboard_info() { |
| 258 |
|
| 259 |
ob_start(); |
| 260 |
|
| 261 |
wpbc_dashboard_widget_show(); |
| 262 |
|
| 263 |
return ob_get_clean(); |
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
/** CSS for Dashboard Widget */ |
| 268 |
function wpbc_dashboard_widget_css() { |
| 269 |
|
| 270 |
?><style type="text/css"> |
| 271 |
#wpbc_dashboard_widget_container { |
| 272 |
width:100%; |
| 273 |
} |
| 274 |
#wpbc_dashboard_widget_container .wpbc_dashboard_section { |
| 275 |
float:left; |
| 276 |
margin:0px; |
| 277 |
padding:0px; |
| 278 |
width:49%; |
| 279 |
} |
| 280 |
#wpbc_dashboard_widget_container .wpbc_dashboard_section h4 { |
| 281 |
font-size: 14px; |
| 282 |
font-weight: 600; |
| 283 |
margin: 5px 0 15px; |
| 284 |
} |
| 285 |
#bk_upgrade_section p { |
| 286 |
font-size: 13px; |
| 287 |
line-height: 1.5em; |
| 288 |
margin: 15px 0 0; |
| 289 |
padding: 0; |
| 290 |
} |
| 291 |
#dashboard-widgets-wrap #wpbc_dashboard_widget_container .wpbc_dashboard_section { |
| 292 |
width:49%; |
| 293 |
} |
| 294 |
#dashboard-widgets-wrap #wpbc_dashboard_widget_container .bk_right { |
| 295 |
float:right |
| 296 |
} |
| 297 |
#dashboard-widgets-wrap #wpbc_dashboard_widget_container .border_orrange, |
| 298 |
#wpbc_dashboard_widget_container .border_orrange { |
| 299 |
background: #fffaf1 none repeat scroll 0 0; |
| 300 |
border-left: 3px solid #eeab26; |
| 301 |
clear: both; |
| 302 |
margin: 5px 5px 20px; |
| 303 |
padding: 10px 0; |
| 304 |
width: 99%; |
| 305 |
} |
| 306 |
#wpbc_dashboard_widget_container .bk_header { |
| 307 |
color: #555555; |
| 308 |
font-size: 13px; |
| 309 |
font-weight: 600; |
| 310 |
line-height: 1em; |
| 311 |
/* //FixIn: 8.1.3.10 */ |
| 312 |
padding:0 5px; |
| 313 |
} |
| 314 |
#wpbc_dashboard_widget_container .bk_table { |
| 315 |
background:transparent; |
| 316 |
/*border-bottom:none;*/ |
| 317 |
/*border-top:1px solid #ECECEC;*/ |
| 318 |
margin:6px 0 10px 6px; |
| 319 |
padding:2px 10px; |
| 320 |
width:95%; |
| 321 |
-border-radius:4px; |
| 322 |
-moz-border-radius:4px; |
| 323 |
-webkit-border-radius:4px; |
| 324 |
/*-moz-box-shadow:0 0 2px #C5C3C3;*/ |
| 325 |
/*-webkit-box-shadow:0 0 2px #C5C3C3;*/ |
| 326 |
/*-box-shadow:0 0 2px #C5C3C3;*/ |
| 327 |
border:none; |
| 328 |
box-shadow:none; |
| 329 |
} |
| 330 |
#wpbc_dashboard_widget_container .bk_table td{ |
| 331 |
border-bottom:1px solid #DDDDDD; |
| 332 |
line-height:19px; |
| 333 |
padding:4px 0px 4px 10px; |
| 334 |
font-size:13px; |
| 335 |
} |
| 336 |
#wpbc_dashboard_widget_container .bk_table tr td.first{ |
| 337 |
text-align:center; |
| 338 |
padding:4px 0px; |
| 339 |
} |
| 340 |
#wpbc_dashboard_widget_container .bk_table tr td a { |
| 341 |
text-decoration: none; |
| 342 |
} |
| 343 |
#wpbc_dashboard_widget_container .bk_table tr td a span{ |
| 344 |
font-size:18px; |
| 345 |
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; |
| 346 |
} |
| 347 |
#wpbc_dashboard_widget_container .bk_table td.bk_spec_font a{ |
| 348 |
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; |
| 349 |
font-size:14px; |
| 350 |
} |
| 351 |
#wpbc_dashboard_widget_container .bk_table td.bk_spec_font { |
| 352 |
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; |
| 353 |
font-size:13px; |
| 354 |
} |
| 355 |
#wpbc_dashboard_widget_container .bk_table td.pending a{ |
| 356 |
color:#E66F00; |
| 357 |
} |
| 358 |
#wpbc_dashboard_widget_container .bk_table td.new-bookings a{ |
| 359 |
color:red; |
| 360 |
} |
| 361 |
#wpbc_dashboard_widget_container .bk_table td.actual-bookings a{ |
| 362 |
color:green; |
| 363 |
} |
| 364 |
#bk_errror_loading { |
| 365 |
text-align: center; |
| 366 |
font-style: italic; |
| 367 |
font-size:11px; |
| 368 |
} |
| 369 |
#wpbc_dashboard_widget_container .bk_table tr:last-child td { |
| 370 |
border:none; |
| 371 |
} |
| 372 |
</style><?php |
| 373 |
} |
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
//////////////////////////////////////////////////////////////////////////////// |
| 379 |
// S e c t i o n s |
| 380 |
//////////////////////////////////////////////////////////////////////////////// |
| 381 |
|
| 382 |
// FixIn: 8.1.3.11. |
| 383 |
/** Dashboard Section - Video 1 */ |
| 384 |
function wpbc_dashboard_section_video_f() { |
| 385 |
return; |
| 386 |
?> |
| 387 |
<div id='wpbc_dashboard_section_video_f' class="wpbc_dashboard_section bk_left"> |
| 388 |
<span class="bk_header"><?php esc_html_e('Video guide' ,'booking'); ?> (free):</span> |
| 389 |
<?php wpbc_is_dismissed( 'wpbc_dashboard_section_video_f' ); //FixIn: 8.1.3.10 ?> |
| 390 |
<?php // Free ?> |
| 391 |
<div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dwLA5cpz1p2RrZOitLuVupR&start=28&rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div> |
| 392 |
</div> |
| 393 |
<?php |
| 394 |
} |
| 395 |
|
| 396 |
// FixIn: 8.1.3.11. |
| 397 |
/** Dashboard Section - Video 2 */ |
| 398 |
function wpbc_dashboard_section_video_p() { |
| 399 |
return; |
| 400 |
?> |
| 401 |
<div id='wpbc_dashboard_section_video_p' class="wpbc_dashboard_section bk_right"> |
| 402 |
<?php wpbc_is_dismissed( 'wpbc_dashboard_section_video_p' ); //FixIn: 8.1.3.10 ?> |
| 403 |
<span class="bk_header"><?php esc_html_e('Video guide' ,'booking'); ?> (premium):</span> |
| 404 |
<?php // Premium ?> |
| 405 |
<div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dyc_EO8L_1FKJyLpBuIv21_&rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div> |
| 406 |
</div> |
| 407 |
<?php |
| 408 |
} |
| 409 |
|
| 410 |
/** Dashboard Support Section */ |
| 411 |
function wpbc_dashboard_section_support() { |
| 412 |
?> |
| 413 |
<div id="wpbc_dashboard_section_support" class="wpbc_dashboard_section bk_right"> |
| 414 |
<span class="bk_header"><?php esc_html_e('Support' ,'booking'); ?>:</span> |
| 415 |
<?php wpbc_is_dismissed( 'wpbc_dashboard_section_support', array( 'css' => 'padding: 0 20px;' ) ); //FixIn: 8.1.3.10 ?> |
| 416 |
<?php /* ?> |
| 417 |
<?php // Free ?> |
| 418 |
<div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dwLA5cpz1p2RrZOitLuVupR&start=28&rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div> |
| 419 |
<?php // Premium ?> |
| 420 |
<div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dyc_EO8L_1FKJyLpBuIv21_&rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div> |
| 421 |
<?php */ ?> |
| 422 |
<table class="bk_table"> |
| 423 |
<tr class="first"> |
| 424 |
<td style="text-align:center;" class="bk_spec_font"><a href="<?php echo 'https://wpbookingcalendar.com/faq/#using'; //echo esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-getting-started' ), 'index.php' ) ) ); ?>" |
| 425 |
><?php esc_html_e('Getting Started' ,'booking'); ?></a> |
| 426 |
</td> |
| 427 |
</tr> |
| 428 |
<tr> |
| 429 |
<td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/wn/"><?php esc_html_e('What\'s New' ,'booking'); ?></a></td> |
| 430 |
</tr> |
| 431 |
<?php if ( class_exists('wpdev_bk_personal') ){ ?> |
| 432 |
<tr> |
| 433 |
<td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/request-update/"><?php esc_html_e('Request Update' ,'booking'); ?></a></td> |
| 434 |
</tr> |
| 435 |
<?php } ?> |
| 436 |
<tr> |
| 437 |
<td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/faq/"><?php esc_html_e('FAQ' ,'booking'); ?></a></td> |
| 438 |
</tr> |
| 439 |
<tr> |
| 440 |
<td style="text-align:center;" class="bk_spec_font"><a href="mailto:support@wpbookingcalendar.com"><?php esc_html_e('Contact email' ,'booking'); ?></a></td> |
| 441 |
</tr> |
| 442 |
<tr> |
| 443 |
<td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wordpress.org/plugins/booking/"><?php esc_html_e('Rate plugin (thanks:)' ,'booking'); ?></a></td> |
| 444 |
</tr> |
| 445 |
</table> |
| 446 |
</div> |
| 447 |
<?php |
| 448 |
} |
| 449 |
|
| 450 |
|
| 451 |
/** Dashboard News Section */ |
| 452 |
function wpbc_dashboard_section_news() { |
| 453 |
|
| 454 |
?><div id="wpbc_dashboard_section_news"><?php |
| 455 |
|
| 456 |
wp_nonce_field( 'wpbc_ajax_admin_nonce', "wpbc_admin_panel_nonce_dashboard", true, true ); // Nonce for Ajax |
| 457 |
|
| 458 |
?> |
| 459 |
<div style="width:95%;border:none;clear:both;margin:10px 6px;" id="bk_news_section"> |
| 460 |
<div style="width: 99%;margin-right:0;" > |
| 461 |
<span class="bk_header" style="padding: 0;">Booking Calendar News:</span><?php |
| 462 |
|
| 463 |
$is_panel_visible = wpbc_is_dismissed( 'wpbc_dashboard_section_news' ); // FixIn: 10.10.3.1. |
| 464 |
if ( $is_panel_visible ) { |
| 465 |
?><br/><br/> |
| 466 |
<div id="bk_news" class="rssSummary"> <span style="font-size:13px;text-align:center;">Loading...</span></div> |
| 467 |
<div id="ajax_bk_respond" class="rssSummary" style="display:none;"></div> |
| 468 |
<script type="text/javascript"> |
| 469 |
jQuery.ajax({ |
| 470 |
url: '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', |
| 471 |
type:'POST', |
| 472 |
success: function (data, textStatus){ if( textStatus == 'success' ) jQuery('#ajax_bk_respond').html( data ); }, |
| 473 |
error: function (XMLHttpRequest, textStatus, errorThrown){ window.status = 'Ajax sending Error status:' + textStatus; }, |
| 474 |
data:{ |
| 475 |
action: 'CHECK_BK_NEWS', |
| 476 |
wpbc_nonce: document.getElementById('wpbc_admin_panel_nonce_dashboard').value |
| 477 |
} |
| 478 |
}); |
| 479 |
</script> |
| 480 |
<?php } ?> |
| 481 |
</div> |
| 482 |
</div> |
| 483 |
|
| 484 |
</div> |
| 485 |
<?php |
| 486 |
} |
| 487 |
|
| 488 |
|
| 489 |
function wpbc_dashboard_info_get_version_type(){ |
| 490 |
$version = 'free'; |
| 491 |
$version = wpbc_get_plugin_version_type(); |
| 492 |
if ( wpbc_is_this_demo() ) { |
| 493 |
$version = 'free'; |
| 494 |
} |
| 495 |
return $version; |
| 496 |
} |
| 497 |
|
| 498 |
function wpbc_dashboard_info_get_version_type_readable() { |
| 499 |
|
| 500 |
$ver = wpbc_get_plugin_version_type(); |
| 501 |
if ( class_exists( 'wpdev_bk_multiuser' ) ) { |
| 502 |
$ver = 'multiUser'; |
| 503 |
} |
| 504 |
$ver = str_replace( '_m', ' Medium', $ver ); |
| 505 |
$ver = str_replace( '_l', ' Large', $ver ); |
| 506 |
$ver = str_replace( '_s', ' Small', $ver ); |
| 507 |
$ver = str_replace( 'biz', 'Business', $ver ); |
| 508 |
$ver = ucwords( $ver ); |
| 509 |
return $ver; |
| 510 |
} |
| 511 |
|
| 512 |
function wpbc_dashboard_info_get_version_type_sites() { |
| 513 |
|
| 514 |
$v_type = ''; |
| 515 |
if ( strpos( strtolower( WPDEV_BK_VERSION ), 'multisite' ) !== false ) { |
| 516 |
$v_type = '5'; |
| 517 |
} else if ( strpos( strtolower( WPDEV_BK_VERSION ), 'develop' ) !== false ) { |
| 518 |
$v_type = '2'; |
| 519 |
} |
| 520 |
|
| 521 |
if ( ! empty( $v_type ) ) { |
| 522 |
return ' ' . $v_type . ' ' . __( 'websites', 'booking' ); |
| 523 |
} else { |
| 524 |
return ' 1' . ' ' . __( 'website', 'booking' ); |
| 525 |
} |
| 526 |
} |
| 527 |
|
| 528 |
function wpbc_dashboard_info_get_version_number() { |
| 529 |
|
| 530 |
if ( substr( WPDEV_BK_VERSION, 0, 3 ) == '11.' ) { |
| 531 |
|
| 532 |
$show_version = substr( WPDEV_BK_VERSION, 3 ); |
| 533 |
|
| 534 |
if ( substr( $show_version, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) ) ) === WP_BK_VERSION_NUM ) { |
| 535 |
$show_version = substr( $show_version, 0, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) - 1 ) ); |
| 536 |
$show_version = str_replace( '.', ' ', $show_version ) . " <sup><strong style='font-size:12px;'>" . esc_attr( WP_BK_VERSION_NUM ) . "</strong></sup>"; |
| 537 |
} |
| 538 |
return $show_version; |
| 539 |
} else { |
| 540 |
return WPDEV_BK_VERSION; |
| 541 |
} |
| 542 |
} |
| 543 |
|
| 544 |
|
| 545 |
/** Dashboard Version Section */ |
| 546 |
function wpbc_dashboard_section_version() { |
| 547 |
|
| 548 |
|
| 549 |
$version = wpbc_dashboard_info_get_version_type(); |
| 550 |
|
| 551 |
/* |
| 552 |
|
| 553 |
Disbale hidded notice about Upgrade to higher version in paid versions |
| 554 |
// FixIn: 8.0.1.6. |
| 555 |
if ( ( $version !== 'free' ) && ( class_exists('wpdev_bk_multiuser') === false ) ) { ?> |
| 556 |
<div class="wpbc_dashboard_section border_orrange" id="bk_upgrade_section"> |
| 557 |
<div style="padding:0px 10px;width:96%;"> |
| 558 |
<h4><?php esc_html_e('Upgrade to higher versions' , 'booking' ); ?>:</h4> |
| 559 |
<p>Check additional advanced functionality, which exist in higher versions and can be interesting for you <a href="https://wpbookingcalendar.com/features/" target="_blank">here »</a></p> |
| 560 |
<p><a class="button button-primary" style="margin-top: 10px;font-weight: 600;" href="<?php echo wpbc_up_link(); ?>" target="_blank"><?php if ( wpbc_get_ver_sufix() == '' ) { esc_html_e('Purchase' ,'booking'); } else { esc_html_e('Upgrade Now' ,'booking'); } ?></a> </p> |
| 561 |
</div> |
| 562 |
</div> |
| 563 |
<div style="clear:both;"></div> |
| 564 |
<?php if ( wpbc_get_ver_sufix() != '' ) { ?> |
| 565 |
<script type="text/javascript"> |
| 566 |
jQuery(document).ready(function(){ |
| 567 |
jQuery('#bk_upgrade_section').animate({opacity:1},7000).fadeOut(2000); |
| 568 |
}); |
| 569 |
</script> |
| 570 |
<?php } ?> |
| 571 |
<?php } |
| 572 |
*/ |
| 573 |
?> |
| 574 |
<div id="wpbc_dashboard_section_current_version" class="wpbc_dashboard_section" > |
| 575 |
<span class="bk_header"><?php esc_html_e('Current version' ,'booking'); ?>:</span> |
| 576 |
<table class="bk_table"> |
| 577 |
<?php if ( wpbc_is_this_demo() ) { ?> |
| 578 |
<tr class="first"> |
| 579 |
<td></td> |
| 580 |
<td style="font-weight: 600; text-align: left;"><?php esc_html_e('Demo' ,'booking'); ?></td> |
| 581 |
</tr> |
| 582 |
<?php } ?> |
| 583 |
<tr class="first"> |
| 584 |
<td style="width:35%;text-align: right;;" class=""><?php esc_html_e('Version' ,'booking'); ?>:</td> |
| 585 |
<td style="color: #e50;font-size: 13px;font-weight: 600;text-align: left;text-shadow: 0 -1px 0 #eee;;" |
| 586 |
class="bk_spec_font"><?php |
| 587 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 588 |
echo wpbc_dashboard_info_get_version_number(); |
| 589 |
|
| 590 |
?></td> |
| 591 |
</tr> |
| 592 |
<?php if ($version != 'free') { ?> |
| 593 |
<tr> |
| 594 |
<td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Type' ,'booking'); ?>:</td> |
| 595 |
<td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php |
| 596 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 597 |
echo wpbc_dashboard_info_get_version_type_readable(); |
| 598 |
?></td> |
| 599 |
</tr> |
| 600 |
<tr> |
| 601 |
<td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Used for' ,'booking'); ?>:</td> |
| 602 |
<td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php |
| 603 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 604 |
echo wpbc_dashboard_info_get_version_type_sites(); |
| 605 |
?></td> |
| 606 |
</tr> |
| 607 |
<?php } ?> |
| 608 |
<tr> |
| 609 |
<td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Release date' ,'booking'); ?>:</td> |
| 610 |
<td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php |
| 611 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 612 |
echo wpbc_date_localized( gmdate( 'Y-m-d', filemtime( WPBC_FILE ) ) ); |
| 613 |
?></td> |
| 614 |
</tr> |
| 615 |
</table> |
| 616 |
<div id="wpbc_dashboard_section_current_version_upgrade"> |
| 617 |
|
| 618 |
<table class="bk_table" style="border:none;"> |
| 619 |
<tr> |
| 620 |
<td colspan="2" style="border:none;text-align:center;" class=""><?php |
| 621 |
?><?php wpbc_is_dismissed( 'wpbc_dashboard_section_current_version_upgrade' , array( 'css' => 'padding: 0 0px;' ) ); //FixIn: 8.1.3.10 ?><?php |
| 622 |
if ($version == 'free') { |
| 623 |
?><a class="button-primary button" style="font-weight:600;" target="_blank" href="https://wpbookingcalendar.com/features/"><?php esc_html_e('Check Premium Features' ,'booking'); ?></a><?php |
| 624 |
} elseif ( wpbc_get_ver_sufix() != '' ) { |
| 625 |
?><a class="button-primary button" href="<?php echo esc_url( wpbc_get_settings_url() . '&tab=upgrade' ); ?>"><?php esc_html_e('Upgrade' ,'booking'); ?></a><?php |
| 626 |
} else { |
| 627 |
?><a class="button-primary button" target="_blank" href="https://wpbookingcalendar.com/features/"><?php esc_html_e('Explore Premium Features' ,'booking'); ?></a><?php |
| 628 |
} |
| 629 |
?></td> |
| 630 |
</tr> |
| 631 |
</table> |
| 632 |
</div> |
| 633 |
</div> |
| 634 |
|
| 635 |
<?php |
| 636 |
} |
| 637 |
|
| 638 |
|
| 639 |
/** Dashboard Statistic Section */ |
| 640 |
function wpbc_dashboard_section_statistic( $counter ) { |
| 641 |
// FixIn: 9.3.1.7. |
| 642 |
$bk_admin_url = wpbc_get_bookings_url() . '&wh_approved='; |
| 643 |
?> |
| 644 |
<div id='wpbc_dashboard_section_statistic'> |
| 645 |
<?php |
| 646 |
$is_panel_visible = wpbc_is_dismissed( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8. |
| 647 |
if ( $is_panel_visible ) { |
| 648 |
?> |
| 649 |
<div class="wpbc_dashboard_section bk_right"> |
| 650 |
<span class="bk_header"><?php esc_html_e('Statistic' ,'booking'); ?>:</span> |
| 651 |
<table class="bk_table"> |
| 652 |
<tr> |
| 653 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>"><span><?php echo esc_html( $counter['booking_today'] ); ?></span></a> </td> |
| 654 |
<td class="actual-bookings"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Bookings for today' ,'booking'); ?></a> </td> |
| 655 |
</tr> |
| 656 |
<tr class="first"> |
| 657 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span><?php echo esc_html( $counter['was_made_today'] ); ?></span></a> </td> |
| 658 |
<td class="new-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('New booking(s) made today' ,'booking'); ?></a> </td> |
| 659 |
</tr> |
| 660 |
<tr class="first"> |
| 661 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['new'] ); ?></span></a> </td> |
| 662 |
<td class=""> <a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><?php esc_html_e('New (unverified) booking(s)' ,'booking'); ?></a></td> |
| 663 |
</tr> |
| 664 |
<tr> |
| 665 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['pending'] ); ?></span></a></td> |
| 666 |
<td class="pending"><a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Pending booking(s)' ,'booking'); ?></a></td> |
| 667 |
</tr> |
| 668 |
</table> |
| 669 |
</div> |
| 670 |
<div class="wpbc_dashboard_section" > |
| 671 |
<span class="bk_header"><?php esc_html_e('Agenda' ,'booking'); ?>:</span> |
| 672 |
<table class="bk_table"> |
| 673 |
<tr> |
| 674 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=10&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_in_today'] ); ?></span></a></td> |
| 675 |
<td class="pending"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=10&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check in - Today', 'booking'); ?></a></td> |
| 676 |
</tr> |
| 677 |
<tr> |
| 678 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=11&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_out_today'] ); ?></span></a></td> |
| 679 |
<td class=""><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=11&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check out - Today', 'booking'); ?></a></td> |
| 680 |
</tr> |
| 681 |
<tr> |
| 682 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=7&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_in_tomorrow'] ); ?></span></a></td> |
| 683 |
<td class="new-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=7&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check in - Tomorrow', 'booking'); ?></a></td> |
| 684 |
</tr> |
| 685 |
<tr> |
| 686 |
<td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=8&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_out_tomorrow'] ); ?></span></a></td> |
| 687 |
<td class="actual-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=8&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check out - Tomorrow', 'booking'); ?></a></td> |
| 688 |
</tr> |
| 689 |
|
| 690 |
</table> |
| 691 |
</div> |
| 692 |
<?php } ?> |
| 693 |
</div> |
| 694 |
<?php |
| 695 |
} |
| 696 |
|
| 697 |
|
| 698 |
// --------------------------------------------------------------------------------------------------------------------- |
| 699 |
// 9.8 |
| 700 |
// --------------------------------------------------------------------------------------------------------------------- |
| 701 |
|
| 702 |
/** Get Flex Dashboard */ |
| 703 |
function wpbc_get_flex_dashboard_info() { |
| 704 |
|
| 705 |
ob_start(); |
| 706 |
|
| 707 |
wpbc_flex_dashboard_show(); |
| 708 |
|
| 709 |
return ob_get_clean(); |
| 710 |
} |
| 711 |
|
| 712 |
|
| 713 |
/** Show Flex Dashboard Conatiner */ |
| 714 |
function wpbc_flex_dashboard_show(){ |
| 715 |
|
| 716 |
if ( |
| 717 |
( ! empty( $GLOBALS['pagenow'] ) ) |
| 718 |
&& ( is_admin() ) |
| 719 |
&& ( |
| 720 |
( 'index.php' === $GLOBALS['pagenow'] ) |
| 721 |
|| ( |
| 722 |
( 'admin.php' === $GLOBALS['pagenow'] ) |
| 723 |
&& ( ! empty( $_GET['page'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 724 |
&& ( 'wpbc-settings' === $_GET['page'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 725 |
&& ( ( ! isset( $_GET['tab'] ) ) || ( 'general' === $_GET['tab'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 726 |
) |
| 727 |
) |
| 728 |
) { |
| 729 |
|
| 730 |
} else { |
| 731 |
return; |
| 732 |
} |
| 733 |
|
| 734 |
|
| 735 |
$is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8. |
| 736 |
|
| 737 |
$counter = ( $is_panel_visible ) ? wpbc_db_dashboard_get_bookings_count_arr() : array(); |
| 738 |
|
| 739 |
wpbc_flex_dashboard_widget_css(); |
| 740 |
|
| 741 |
?><div class="wpbc_flex_dashboard_container" ><?php |
| 742 |
|
| 743 |
wpbc_flex_dashboard_section_statistic( $counter ); |
| 744 |
|
| 745 |
?></div><?php |
| 746 |
|
| 747 |
} |
| 748 |
|
| 749 |
|
| 750 |
/** |
| 751 |
* CSS for Flex Dashboard |
| 752 |
* @return void |
| 753 |
*/ |
| 754 |
function wpbc_flex_dashboard_widget_css(){ |
| 755 |
|
| 756 |
?><style type="text/css"> |
| 757 |
.wpbc_flex_dashboard_container{ |
| 758 |
display: flex; |
| 759 |
flex-flow: row wrap; |
| 760 |
justify-content: space-between; |
| 761 |
align-items: center; |
| 762 |
} |
| 763 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item{ |
| 764 |
flex: 1 1 auto; |
| 765 |
display: flex; |
| 766 |
flex-flow: row wrap; |
| 767 |
justify-content: center; |
| 768 |
align-items: center; |
| 769 |
margin: 0 10px; |
| 770 |
line-height: 2.1em; |
| 771 |
} |
| 772 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item:first-child{ |
| 773 |
margin-left: 0; |
| 774 |
} |
| 775 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item:last-child{ |
| 776 |
margin-right:0; |
| 777 |
justify-content: flex-end; |
| 778 |
} |
| 779 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_number, |
| 780 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text{ |
| 781 |
flex: 0 1 auto; |
| 782 |
padding: 0 5px; |
| 783 |
} |
| 784 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_number a, |
| 785 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text a{ |
| 786 |
text-decoration: none; |
| 787 |
outline:0; |
| 788 |
} |
| 789 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_number span{ |
| 790 |
font-size: 18px; |
| 791 |
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; |
| 792 |
} |
| 793 |
/* Colors */ |
| 794 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text_new *{ |
| 795 |
/*color: #135e96;*/ |
| 796 |
} |
| 797 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text_pending *{ |
| 798 |
color: #E66F00; |
| 799 |
} |
| 800 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text_was_made_today *{ |
| 801 |
color: red; |
| 802 |
} |
| 803 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_text_made_for_today *{ |
| 804 |
color: green; |
| 805 |
} |
| 806 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_number.wpbc_flex_dashboard_item_version_number * { |
| 807 |
color: #2b6900; |
| 808 |
color: #7812bd; |
| 809 |
font-size: 11px; |
| 810 |
text-shadow: none; |
| 811 |
} |
| 812 |
.wpbc_flex_dashboard_container .wpbc_flex_dashboard_item .wpbc_flex_dashboard_item_version_type * { |
| 813 |
color: #8f8f8f; |
| 814 |
font-size: 9px; |
| 815 |
text-shadow: none; |
| 816 |
} |
| 817 |
</style><?php |
| 818 |
} |
| 819 |
|
| 820 |
|
| 821 |
/** |
| 822 |
* Flex Dashboard Items |
| 823 |
* |
| 824 |
* @param $counter |
| 825 |
* |
| 826 |
* @return void |
| 827 |
*/ |
| 828 |
function wpbc_flex_dashboard_section_statistic( $counter ){ |
| 829 |
|
| 830 |
$bk_admin_url = wpbc_get_bookings_url();// . '&wh_approved='; |
| 831 |
|
| 832 |
if ( ! empty( $counter ) ) { |
| 833 |
|
| 834 |
// Was made today ----------------------------------------------------------------------------------------------------- |
| 835 |
?> |
| 836 |
<div class="wpbc_flex_dashboard_item"> |
| 837 |
<div class="wpbc_flex_dashboard_item_number"> |
| 838 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"> |
| 839 |
<span><?php echo esc_html( $counter['was_made_today'] ); ?></span> |
| 840 |
</a> |
| 841 |
</div> |
| 842 |
<div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_was_made_today"> |
| 843 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""> |
| 844 |
<?php esc_html_e('New booking(s) made today' ,'booking');?> |
| 845 |
</a> |
| 846 |
</div> |
| 847 |
</div> |
| 848 |
<?php |
| 849 |
|
| 850 |
// For today --------------------------------------------------------------------------------------------------- |
| 851 |
?> |
| 852 |
<div class="wpbc_flex_dashboard_item"> |
| 853 |
<div class="wpbc_flex_dashboard_item_number"> |
| 854 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>"> |
| 855 |
<span><?php echo esc_html( $counter['booking_today'] ); ?></span> |
| 856 |
</a> |
| 857 |
</div> |
| 858 |
<div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_made_for_today"> |
| 859 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>" class=""> |
| 860 |
<?php esc_html_e('Booking(s) for today' ,'booking');?> |
| 861 |
</a> |
| 862 |
</div> |
| 863 |
</div> |
| 864 |
<?php |
| 865 |
|
| 866 |
// Pending ----------------------------------------------------------------------------------------------------- |
| 867 |
?> |
| 868 |
<div class="wpbc_flex_dashboard_item"> |
| 869 |
<div class="wpbc_flex_dashboard_item_number"> |
| 870 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"> |
| 871 |
<span class=""><?php echo esc_html( $counter['pending'] ); ?></span> |
| 872 |
</a> |
| 873 |
</div> |
| 874 |
<div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_pending"> |
| 875 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""> |
| 876 |
<?php esc_html_e('Pending booking(s)' ,'booking');?> |
| 877 |
</a> |
| 878 |
</div> |
| 879 |
</div> |
| 880 |
<?php |
| 881 |
|
| 882 |
|
| 883 |
// New --------------------------------------------------------------------------------------------------------- |
| 884 |
?> |
| 885 |
<div class="wpbc_flex_dashboard_item"> |
| 886 |
<div class="wpbc_flex_dashboard_item_number"> |
| 887 |
<a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"> |
| 888 |
<span class=""><?php echo esc_html( $counter['new'] ); ?></span> |
| 889 |
</a> |
| 890 |
</div> |
| 891 |
<div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_new"> |
| 892 |
<a href="<?php echo esc_url( $bk_admin_url. '&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"> <?php esc_html_e( 'New (unverified) booking(s)', 'booking' ); ?> |
| 893 |
</a> |
| 894 |
</div> |
| 895 |
</div> |
| 896 |
<?php |
| 897 |
} |
| 898 |
|
| 899 |
// Version --------------------------------------------------------------------------------------------------------- |
| 900 |
?> |
| 901 |
<div class="wpbc_flex_dashboard_item"> |
| 902 |
<div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_version_type"> |
| 903 |
<a href="https://wpbookingcalendar.com/faq/difference-single-developer-multi-site/#<?php |
| 904 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 905 |
echo esc_attr( wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ) ); ?>"> |
| 906 |
<?php |
| 907 |
if ( class_exists( 'wpdev_bk_personal' ) ) { |
| 908 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 909 |
echo wpbc_dashboard_info_get_version_type_readable(); |
| 910 |
} |
| 911 |
if ( wpbc_is_this_demo() ) { |
| 912 |
echo ' (Demo)'; |
| 913 |
} else { |
| 914 |
if ( 'free' != wpbc_dashboard_info_get_version_type() ) { |
| 915 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 916 |
echo ' (' . __( 'for', 'booking' ) . ' ' . trim( wpbc_dashboard_info_get_version_type_sites() ) . ')'; |
| 917 |
} |
| 918 |
} |
| 919 |
?> |
| 920 |
</a> |
| 921 |
</div> |
| 922 |
<div class="wpbc_flex_dashboard_item_number wpbc_flex_dashboard_item_version_number"> |
| 923 |
<a href="https://wpbookingcalendar.com/changelog/#<?php |
| 924 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 925 |
echo wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ); ?>"> |
| 926 |
<span class=""><?php echo esc_attr(WP_BK_VERSION_NUM); ?></span> |
| 927 |
</a> |
| 928 |
</div> |
| 929 |
</div> |
| 930 |
<?php |
| 931 |
|
| 932 |
} |