<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$available_pay_types =  Wiaas_Package_Pricing::get_available_pay_types();

foreach ( $pricing_rules as $name => $pricing_rule ) {
	$pay_type = $available_pay_types[$name];
	?>
	<div id="wiaas-pricing-rule-<?php echo $name; ?>" class="wiaas-pricing-rule form-field">
		<div class="section">
			<h4 class="first"><?php echo $pay_type['title']; ?>
				<a href="#" data-name="<?php echo $name; ?>"
				   class="delete_wiaas_pricing_rule">
					REMOVE
				</a>
			</h4>
		</div>
		<div class="clear"></div>
		<table>
			<tbody>
			<tr>
				<td class="wiaas_label_container">
					<?php _e( 'Minimal fixed price:', 'wiaas' ); ?>
				</td>
				<td>
					<input
						id="wiaas_minimal_fixed_price_<?php echo $name; ?>"
						data-name="<?php echo $name; ?>"
						name="wiaas_pricing_rules[<?php echo $name; ?>][minimal_fixed_price]"
						value="<?php echo $pricing_rule['minimal_fixed_price'] ?>"
						type="text" />
				</td>
				<td></td>
			</tr>
			<?php require 'html-package-pricing-rule-recurrent-price.php'; ?>
			<?php require 'html-package-pricing-rule-principal-amount.php'; ?>
			<?php require 'html-package-pricing-rule-services-price.php'; ?>
			<tr>
				<td class="wiaas_label_container">
					<?php _e( 'Max contract period:', 'wiaas' ); ?>
				</td>
				<td>
								 <span id="wiaas_max_contract_period_<?php echo $name; ?>">
									<?php echo $pay_type['max_contract_period'] . ' ' . $pay_type['period_unit'] ?>
								</span>
				</td>
				<td></td>
			</tr>
			</tbody>
		</table>
	</div>
	<?php
}

?>


