<?php
/**
 * Main Scoring Rules page template
 *
 * @link       https://personalizewp.com/
 * @since      3.2.0 Merged into PWP
 * @since      1.1.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin
 */

namespace PersonalizeWP\Admin;

use PersonalizeWP\Admin\PageScoringRules;
use PersonalizeWP\Admin\ListTableScoringRules;

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

?>
	<main>
		<nav class="header-nav">
			<ul class="nav-list">
				<li>
					<a class="nav-link is-active" href="<?php esc_url( admin_url( PageScoringRules::$index_url ) ); ?>"><?php esc_html_e( 'Lead Scoring', 'personalizewp' ); ?></a>
				</li>
			</ul>
		</nav>

		<?php
		$scoring_rules = new ListTableScoringRules();
		$scoring_rules->prepare_items();
		?>
		<form id="scoring-rules-filter" method="get">
			<div class="with-sidebar scoring-rules" data-direction="rtl">
				<div class="section-description">
					<p><?php esc_html_e( 'When visitors meet predefined rules within PersonalizeWP, they will automatically gain points which will help you to gauge lead quality. You can set specific thresholds to identify promising opportunities, implement point expiration or assign negative points for accurate lead recognition.', 'personalizewp' ); ?></p>
				</div>
				<div class="sidebar table-actions">
					<a class="primary btn create" href="<?php echo esc_url( PageScoringRules::$create_url ); ?>"><?php esc_html_e( 'Create Scoring Rule', 'personalizewp' ); ?></a>
					<?php
					$scoring_rules->search_box( __( 'Search Scoring Rules', 'personalizewp' ), 'search-scoring-rules' );
					?>
				</div>
			</div>

			<?php
			$scoring_rules->display();
			?>
		</form>
	</main>

<?php
require_once __DIR__ . '/_modal-delete.php';
