<form action="" method="post" class="pj-form form">
	<input type="hidden" name="id" value="<?php echo pjSanitize::html($tpl['_get']->toString('id')); ?>" />
	<input type="hidden" name="uuid" value="<?php echo pjSanitize::html($tpl['_get']->toString('uuid')); ?>" />
	<?php
	$titles = __('error_titles', true);
	$bodies = __('error_bodies', true);
	// Handle missing PIN09 translations without showing PHP warnings.
	$title = isset($titles['PIN09']) ? $titles['PIN09'] : 'Email invoice';
	$body = isset($bodies['PIN09']) ? $bodies['PIN09'] : 'Please check the email address below before sending the invoice to the customer.';
	
    // Manual notice rendering to match standard design
    ?>
    <div class="alert alert-info" style="margin-bottom: 20px; padding: 15px; border: 1px solid #bce8f1; border-radius: 4px; color: #31708f; background-color: #d9edf7;">
        <strong><?php echo htmlspecialchars($title); ?></strong><br>
        <?php echo htmlspecialchars($body); ?>
    </div>
    
	<?php
	if (isset($tpl['arr']) && !empty($tpl['arr']))
	{
		?>
		<p>
			<label class="title" style="width: 170px;"><span class="bold"><?php __('plugin_invoice_i_email'); ?></span><br />(<?php __('plugin_invoice_billing_info'); ?>)</label>
			<input type="checkbox" name="b_send" value="1" checked="checked" class="align_top" style="margin: 9px 5px 0 0; display: none;" />
			<span class="pj-form-field-custom pj-form-field-custom-before">
				<span class="pj-form-field-before"><abbr class="pj-form-field-icon-email"></abbr></span>
				<input type="text" name="b_email" class="pj-form-field email w250" value="<?php echo htmlspecialchars(stripslashes((string)@$tpl['arr']['b_email'])); ?>" />
			</span>
		</p>
		<?php
		if (isset($tpl['config_arr']['si_include']) && (int) $tpl['config_arr']['si_include'] === 1 && isset($tpl['config_arr']['si_email']) && (int) $tpl['config_arr']['si_email'] === 1)
		{
			?>
			<p>
				<label class="title" style="width: 170px;"><span class="bold"><?php __('plugin_invoice_i_email'); ?></span><br />(<?php __('plugin_invoice_shipping_info'); ?>)</label>
				<input type="checkbox" name="s_send" value="1" checked="checked" class="align_top" style="margin: 9px 5px 0 0; display: none;" />
				<span class="pj-form-field-custom pj-form-field-custom-before">
					<span class="pj-form-field-before"><abbr class="pj-form-field-icon-email"></abbr></span>
					<input type="text" name="s_email" class="pj-form-field email w250" value="<?php echo htmlspecialchars(stripslashes((string)@$tpl['arr']['s_email'])); ?>" />
				</span>
			</p>
			<?php
		}
	} else {
        ?>
        <div style="padding: 20px; color: #8a6d3b; background-color: #fcf8e3; border: 1px solid #faebcc; border-radius: 4px;">Invoice not found for the supplied identifiers.</div>
        <?php
    }
	?>
</form>
