<?php //phpcs:ignore
/**
 * File: Ecre_Shortcodes.php
 * Description: This file contains the Ecre_Shortcodes class, responsible for defining and rendering Ecre_Shortcodes.
 *
 * @package EchoRewardsPro
 */

namespace ECRE;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}


if ( ! class_exists( 'Ecre_Shortcodes' ) ) {
	/**
	 * Class Ecre_Shortcodes
	 *
	 * This class defines and renders Ecre_Shortcodes for Echo Rewards Pro plugin.
	 */
	class Ecre_Shortcodes {
		/**
		 * Constructor method.
		 *
		 * Initializes the Ecre_Shortcodes class and registers Ecre_Shortcodes.
		 */
		public function __construct() {
			$this->register_shortcodes();
		}

		/**
		 * Register all custom Ecre_Shortcodes.
		 */
		public function register_shortcodes() {
			add_shortcode( 'ecre-referral-card', array( $this, 'ecre_referral_card_render' ) );
			add_shortcode( 'ecre-email-invite', array( $this, 'ecre_email_invite_render' ) );
			add_shortcode( 'ecre-reward-coupons-table', array( $this, 'ecre_reward_coupons_table_render' ) );
			add_shortcode( 'ecre-invitation-tracking-table', array( $this, 'ecre_invitation_tracking_table_render' ) );
		}

		/**
		 * Render the referral card shortcode.
		 *
		 * This function renders the referral card shortcode, displaying the referral coupon
		 * code and related information. It checks the referral status, generates the coupon
		 * message, and handles social sharing options if enabled.
		 *
		 * @since 1.0.0
		 *
		 * @return string The HTML content generated by the function.
		 */
		public function ecre_referral_card_render() {
			ob_start();
			?>
			<div class="ecre_referral_card_shortcode"></div>
			<?php
			return ob_get_clean();
		}

		/**
		 * Render the email invite shortcode.
		 *
		 * This function renders the email invite shortcode, generating HTML content
		 * for the email invitation. It retrieves necessary data and processes it to
		 * create the email invite layout.
		 *
		 * @since 1.0.0
		 *
		 * @return string The HTML content generated by the function.
		 */
		public function ecre_email_invite_render() {
			ob_start();
			?>
			<div class="ecre_referral_email_invite_shortcode"></div>
			<?php
			return ob_get_clean();
		}

		/**
		 * Render the reward coupons table shortcode.
		 *
		 * This function renders the reward coupons table shortcode, generating HTML
		 * content for displaying reward coupons in a table format. It retrieves
		 * necessary data and processes it to create the table layout.
		 *
		 * @since 1.0.0
		 *
		 * @return string The HTML content generated by the function.
		 */
		public function ecre_reward_coupons_table_render() {
			ob_start();
			?>
			<div class="ecre_reward_table_shortcode"></div>
			<?php
			return ob_get_clean();
		}

		/**
		 * Render the invitation tracking table shortcode.
		 *
		 * This function renders the invitation tracking table shortcode, generating HTML
		 * content for displaying invitation tracking information in a tabular format. It
		 * retrieves necessary data and processes it to create the table layout.
		 *
		 * @since 1.0.0
		 *
		 * @return string The HTML content generated by the function.
		 */
		public function ecre_invitation_tracking_table_render() {
			ob_start();
			?>
			<div class="ecre_invition_table_shortcode"></div>
			<?php
			return ob_get_clean();
		}
	}
}
