<?php
/**
 * Leave request submitted (to admin) email body.
 *
 * @package MerchantKits\AttendanceManager
 *
 * @var array $leave    Leave row.
 * @var array $employee Employee row.
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$name   = isset( $employee ) ? MKAM_Employee::full_name( $employee ) : '';
$policy = isset( $leave['leave_type'] ) ? MKAM_Leave::get_policy( $leave['leave_type'] ) : null;
$label  = $policy ? $policy['label'] : ( $leave['leave_type'] ?? '' );
$url    = admin_url( 'admin.php?page=mkam-leaves&action=view&id=' . ( $leave['id'] ?? 0 ) );
?>
<p><?php esc_html_e( 'A new leave request has been submitted.', 'merchantkits-attendance-manager' ); ?></p>
<ul>
	<li><strong><?php esc_html_e( 'Employee:', 'merchantkits-attendance-manager' ); ?></strong> <?php echo esc_html( $name ); ?></li>
	<li><strong><?php esc_html_e( 'Type:', 'merchantkits-attendance-manager' ); ?></strong> <?php echo esc_html( $label ); ?></li>
	<li><strong><?php esc_html_e( 'Dates:', 'merchantkits-attendance-manager' ); ?></strong> <?php echo esc_html( ( $leave['start_date'] ?? '' ) . ' → ' . ( $leave['end_date'] ?? '' ) ); ?></li>
	<li><strong><?php esc_html_e( 'Days:', 'merchantkits-attendance-manager' ); ?></strong> <?php echo esc_html( $leave['total_days'] ?? '' ); ?></li>
	<li><strong><?php esc_html_e( 'Reason:', 'merchantkits-attendance-manager' ); ?></strong> <?php echo esc_html( $leave['reason'] ?? '' ); ?></li>
</ul>
<p><a href="<?php echo esc_url( $url ); ?>" style="background:#2563eb;color:#fff;padding:10px 18px;text-decoration:none;border-radius:4px;display:inline-block;"><?php esc_html_e( 'Review Request', 'merchantkits-attendance-manager' ); ?></a></p>
