<?php
/**
 * Scoring rule edit page template
 *
 * @link       https://personalizewp.com/
 * @since      3.2.0 Merged into PWP
 * @since      1.1.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin
 *
 * @var PersonalizeWP\Model\Scoring_Rule $score_rule The instance of the Scoring Rule class.
 */

namespace PersonalizeWP\Admin;

use PersonalizeWP\Admin\PageScoringRules;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

?>

	<main class="section entity-panel">
		<nav class="entity-panel__nav">
			<a href="<?php echo esc_url( admin_url( PageScoringRules::$index_url ) ); ?>" class="back">&larr; <?php esc_html_e( 'Back', 'personalizewp' ); ?></a>
		</nav>

		<header class="entity-panel__header">
			<h2 class="section-title"><?php esc_html_e( 'Edit scoring rule', 'personalizewp' ); ?></h2>
		</header>

		<section class="pwp-panel">
			<div class="section-description">
				<p><?php esc_html_e( 'Edit your scoring rule using the options below. Once the scoring rule has been modified, visitors will have the score value applied automatically when they match the conditions you have chosen.', 'personalizewp' ); ?></p>
			</div>
			<form id="pwp-form" data-pwp action="<?php echo esc_url( admin_url( PageScoringRules::$edit_url . (int) $score_rule->ID ) ); ?>" method="post" accept-charset="UTF-8">
				<input type="hidden" name="pwp_form[id]" value="<?php echo (int) $score_rule->ID; ?>" />
				<?php
					wp_nonce_field( 'edit-scoring-rule-' . (int) $score_rule->ID );
					require_once __DIR__ . '/_form.php';
				?>
			</form>
		</section>
	</main>

