<?php
/**
 * General Settings Section
 *
 * This file renders the "General Settings" section in the Pixelio Cart Abandon Recovery More plugin.
 * It includes checkboxes and input fields to configure abandoned cart emails, promo codes, timing,
 * admin notifications, and data removal options.
 *
 * @package PixelioCartAbandonRecoveryMore\Admin\Views
 */

use PixelioCartAbandonRecoveryMore\Includes\Utils\Pixelio_Cart_Abandon_Recovery_More_Util;
use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Checkbox;
use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Input_Text;
use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Section_Title;

if ( ! defined( 'ABSPATH' ) ) exit;
?>
	<div
		class="pixelio-cart-abandon-recovery-more-page-section pixelio-cart-abandon-recovery-more-page-section-container">
<?php


$pixelio_cart_abandon_recovery_more_general_title_section = new Pixelio_Cart_Abandon_Recovery_More_Section_Title( esc_html( __( 'General settings', 'rivio-ai-cart-recovery-marketing-email-automation' ) ) );
$pixelio_cart_abandon_recovery_more_general_title_section->pixelio_cart_abandon_recovery_more_get_views();


?>


<?php
$pixelio_cart_abandon_recovery_more_first_two_checkbox_array = array(
	'abandon' => array(
		'label'       => __( 'Activate Abandoned Cart Emails', 'rivio-ai-cart-recovery-marketing-email-automation'),
		'description' => __( 'Enable sending emails to recover abandoned carts. If you want to customize the popup style, temporarily activate the exit popup and adjust its design.', 'rivio-ai-cart-recovery-marketing-email-automation'),
		'name'        => 'pixelio-cart-abandon-recovery-more-abandon-checkbox',
		'dependency'  => '',
		'onshow'      => 'pixelio-cart-abandon-recovery-more-use-promo-code-checkbox,pixelio-cart-abandon-recovery-more-abandon-cart-timing',
	),
);
foreach ( $pixelio_cart_abandon_recovery_more_first_two_checkbox_array as $pixelio_cart_abandon_recovery_more_key => $pixelio_cart_abandon_recovery_more_value ) {
	$pixelio_cart_abandon_recovery_more_checkbox = new Pixelio_Cart_Abandon_Recovery_More_Checkbox( $pixelio_cart_abandon_recovery_more_value['label'], $pixelio_cart_abandon_recovery_more_value['description'], $pixelio_cart_abandon_recovery_more_value['name'], false, false, false, '', '', $pixelio_cart_abandon_recovery_more_value['dependency'], false, '', '', $pixelio_cart_abandon_recovery_more_value['onshow'] );
	$pixelio_cart_abandon_recovery_more_checkbox->pixelio_cart_abandon_recovery_more_get_views();
	$pixelio_cart_abandon_recovery_more_saved_settings[] = $pixelio_cart_abandon_recovery_more_checkbox->get_saved_value();
}

$pixelio_cart_abandon_recovery_more_abandon_cart_timing = new Pixelio_Cart_Abandon_Recovery_More_Input_Text(
	__( 'Abandoned Cart Timing', 'rivio-ai-cart-recovery-marketing-email-automation' ),
	esc_attr( __( 'Set the time limit (in minutes) after which a cart is considered abandoned. If left blank, our algorithm will optimize it automatically.', 'rivio-ai-cart-recovery-marketing-email-automation' ) ),
	esc_attr( __( 'Please provide a limit in min', 'rivio-ai-cart-recovery-marketing-email-automation' ) ),
	'pixelio-cart-abandon-recovery-more-abandon-cart-timing',
	'pixelio-cart-abandon-recovery-more-abandon-checkbox',
	0
);
$pixelio_cart_abandon_recovery_more_abandon_cart_timing->pixelio_cart_abandon_recovery_more_get_views();
$pixelio_cart_abandon_recovery_more_saved_settings[] = $pixelio_cart_abandon_recovery_more_abandon_cart_timing->get_saved_value();

$pixelio_cart_abandon_recovery_more_email_to_checkbox = new Pixelio_Cart_Abandon_Recovery_More_Checkbox(
	esc_html( __( 'Send Admin Notification', 'rivio-ai-cart-recovery-marketing-email-automation' ) ),
	esc_attr( __( 'Enable sending an email to the website administrator whenever a cart is successfully recovered.', 'rivio-ai-cart-recovery-marketing-email-automation' ) ),
	'pixelio-cart-abandon-recovery-more-send-email-to-checkbox'
);
$pixelio_cart_abandon_recovery_more_email_to_checkbox->pixelio_cart_abandon_recovery_more_get_views();
$pixelio_cart_abandon_recovery_more_saved_settings[] = $pixelio_cart_abandon_recovery_more_email_to_checkbox->get_saved_value();



$pixelio_cart_abandon_recovery_more_remove_expired_coupon_checkbox = new Pixelio_Cart_Abandon_Recovery_More_Checkbox(
	__( 'Delete All Data on deactivation', 'rivio-ai-cart-recovery-marketing-email-automation' ),
	esc_attr( __( 'Do you want to remove all plugin data when it\'s deactivated ?', 'rivio-ai-cart-recovery-marketing-email-automation' ) ),
	'pixelio-cart-abandon-recovery-more-remove-all-data-uninstall-checkbox'
);
$pixelio_cart_abandon_recovery_more_remove_expired_coupon_checkbox->pixelio_cart_abandon_recovery_more_get_views();

?>

	</div><?php
