<?php
/**
 * Settings Page Template for Pixelio Cart Abandon Recovery More
 *
 * This file contains the main form for the plugin settings page.
 * It includes all sections (general, frontend, product, GDPR) and
 * handles the saving of all plugin options via API call.
 *
 * PHP version 8.x
 *
 * @package   PixelioCartAbandonRecoveryMore
 */

use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Header;
use PixelioCartAbandonRecoveryMore\Admin\Wrapper\Pixelio_Cart_Abandon_Recovery_More_Wordpress_Wrapper;
use PixelioCartAbandonRecoveryMore\Includes\Utils\Pixelio_Cart_Abandon_Recovery_More_Util;
if ( ! defined( 'ABSPATH' ) ) exit;
$pixelio_util = new Pixelio_Cart_Abandon_Recovery_More_Util(new Pixelio_Cart_Abandon_Recovery_More_Wordpress_Wrapper());
$pixelio_cart_abandon_recovery_more_header = new Pixelio_Cart_Abandon_Recovery_More_Header($pixelio_util);
$pixelio_cart_abandon_recovery_more_header->pixelio_cart_abandon_recovery_more_get_views();
$pixelio_cart_abandon_recovery_more_saved_settings = array();
?>

	<div id="pixelio-cart-abandon-recovery-more-page-body">
		<form action="" method="POST" id="pixelio-cart-abandon-recovery-more-general-settings-form">
			<div id="pixelio-cart-abandon-recovery-more-right-sidebar">

				<?php require_once plugin_dir_path( __FILE__ ) . 'sections/settings/pixelio-cart-abandon-recovery-more-general-settings-sections.php'; ?>
				<?php require_once plugin_dir_path( __FILE__ ) . 'sections/settings/pixelio-cart-abandon-recovery-more-frontend-settings-sections.php'; ?>
				<?php require_once plugin_dir_path( __FILE__ ) . 'sections/settings/pixelio-cart-abandon-recovery-more-product-settings-sections.php'; ?>
				<?php require_once plugin_dir_path( __FILE__ ) . 'sections/settings/pixelio-cart-abandon-recovery-more-gdpr-settings-sections.php'; ?>
				<?php //require_once plugin_dir_path( __FILE__ ) . 'sections/settings/pixelio-cart-abandon-recovery-more-experimental-settings-sections.php'; ?>


				<button type="submit"
						class="pixelio-cart-abandon-recovery-more-gradient pixelio-cart-abandon-recovery-more-pixelio-style-button"
						id="pixelio-cart-abandon-recovery-more-save-button"><?php esc_html_e( 'Save', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></button>
			</div>
		</form>
	</div>

<?php
$pixelio_cart_abandon_recovery_more_all_options = array();

foreach ( $pixelio_cart_abandon_recovery_more_saved_settings as $pixelio_cart_abandon_recovery_more_field_array ) {
	if ( count( $pixelio_cart_abandon_recovery_more_field_array ) > 0 ) {
		$pixelio_cart_abandon_recovery_more_all_options = array_merge( $pixelio_cart_abandon_recovery_more_all_options, $pixelio_cart_abandon_recovery_more_field_array );
	}
}

$pixelio_cart_abandon_recovery_more_body = $pixelio_util->pixelio_cart_abandon_recovery_more_call_api( $pixelio_util->pixelio_cart_abandon_recovery_more_get_url() . 'save_settings',"POST",  array( 'settings' => $pixelio_cart_abandon_recovery_more_all_options ) );

