<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
 * GFB 4 Block Data Reports
 *
 * @package GFB.
 */

if ( is_user_logged_in() ) {
	if ( current_user_can( 'apbgf-staff' ) && ! current_user_can( 'manage_options' ) ) {
		return false;
	}
}
?>

<div class="main-reports--div">
	<div class="reports--content">
		<div class="top--heading">
			<h2><?php echo esc_html__('Dashboard', 'appointment-and-booking-for-gravity-forms'); ?></h2>
		</div>
	</div>
	<div class="reports-top-tabs">
		<div class="reports-tab-boxes">
			<div class="reports-tabs-sec">
				<ul class="reports-tab-list">
					<li>
					<span class="reports-tab-icon">
						<img src="<?php echo esc_url( APBGF_IMAGE_URL ); ?>customer.png" alt="">
					</span>
					<span class="reports-tab-contents">
						<h6><?php echo esc_html__('Total Customers', 'appointment-and-booking-for-gravity-forms'); ?></h6>
						<h3><?php echo esc_html( wp_count_posts('apbgf-customer')->publish ?? 0 ); ?></h3>
					</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="reports-tab-boxes">
			<div class="reports-tabs-sec">
				<ul class="reports-tab-list">
					<li>
					<span class="reports-tab-icon">
						<img src="<?php echo esc_url( APBGF_IMAGE_URL ); ?>services.png" alt="">
					</span>
						<span class="reports-tab-contents">
						<h6><?php echo esc_html__('Total Services', 'appointment-and-booking-for-gravity-forms'); ?></h6>
						<h3><?php echo esc_html( wp_count_posts('apbgf-service')->publish ?? 0 ); ?></h3>
					</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="reports-tab-boxes">
			<div class="reports-tabs-sec">
				<ul class="reports-tab-list">
					<li>
					<span class="reports-tab-icon">
						<img src="<?php echo esc_url( APBGF_IMAGE_URL ); ?>Stuff.png" alt="">
					</span>
						<span class="reports-tab-contents">
						<h6><?php echo esc_html__('Total Staff', 'appointment-and-booking-for-gravity-forms'); ?></h6>
						<h3><?php echo esc_html( wp_count_posts('apbgf-staff')->publish ) ; ?></h3>
					</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="reports-tab-boxes" >
			<div class="reports-tabs-sec">
				<ul class="reports-tab-list">
					<li>
					<span class="reports-tab-icon">
						<img src="<?php echo esc_url( APBGF_IMAGE_URL ); ?>Today-Collection.png" alt="">
					</span>
						<span class="reports-tab-contents">
						<h6><?php echo esc_html__('Total Collection', 'appointment-and-booking-for-gravity-forms'); ?></h6>
						<h3><?php apbgf_price_format(APBGF_Appointment::apbgf_total_collection(), true, true); ?></h3>
					</span>
					</li>
				</ul>
			</div>
		</div>
	</div>
</div>