<?php

settings_fields('rtwwpcp_footer_setting');

$rtwwpcp_get_setting = get_option('rtwwpcp_footer_setting_opt');

?>

<table class="wp-list-table form-table rtwwpcp-table">

	<tbody>

		<tr>

			<th><?php esc_html_e('Remove Footer', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td>

				<input type="checkbox" id="rtwwpcp_remove_footer" name="rtwwpcp_footer_setting_opt[remove_footer]" value="1" <?php echo isset( $rtwwpcp_get_setting['remove_footer'] ) && $rtwwpcp_get_setting['remove_footer'] == 1 ? esc_html('checked="checked"') : ''; ?> />

				<div class="descr"><?php esc_html_e('Check it if you want to remove footer from generated PDF.', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></div>

			</td>

		</tr>

		<tr id="rtwwpcp_hide_footer" class="<?php if( isset( $rtwwpcp_get_setting['remove_footer'] )) { echo esc_attr('display_none'); } ?>" />

			<th><?php esc_html_e('Footer Html', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td>

				<?php

				$rtwwpcp_content = isset( $rtwwpcp_get_setting['rtw_footer_html'] ) ? $rtwwpcp_get_setting['rtw_footer_html'] : '';

				$rtwwpcp_setting = array(

					'wpautop' => true,

					'media_buttons' => true,

					'textarea_name' => 'rtwwpcp_footer_setting_opt[rtw_footer_html]',

					'textarea_rows' => 7

				);

				wp_editor($rtwwpcp_content, 'rtw_wcfp_footer_editor', $rtwwpcp_setting );

				?>

			</td>

		</tr>

		<tr>

			<th class="descr"><?php esc_html_e('Footer Top Margin', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td class="descr_2"><input type="number" min="0" name="rtwwpcp_footer_setting_opt[footer_top_margin]" value="<?php echo esc_attr(isset( $rtwwpcp_get_setting['footer_top_margin'] )) ? $rtwwpcp_get_setting['footer_top_margin'] : '15'; ?>" />

				<div class="descr"><?php esc_html_e('Enter your required top margin (By default 15)', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></div>

			</td>

		</tr>

		<tr>

			<th class="descr"><?php esc_html_e('Footer Section Font', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td class="descr_2">

				<select name="rtwwpcp_footer_setting_opt[footer_font_family]">

					<?php 

					foreach ( $rtwwpcp_fonts as $rtwwpcp_key => $rtwwpcp_value ) 

					{ 

						?>

						<option value="<?php echo esc_attr($rtwwpcp_value);?>" <?php echo isset( $rtwwpcp_get_setting['footer_font_family'] ) && $rtwwpcp_get_setting['footer_font_family'] == $rtwwpcp_value ? esc_html('selected="selected"') : '';?>><?php echo esc_html($rtwwpcp_key);?></option>

						<?php

					}

					?>

				</select>

			</td>

		</tr>

		<tr>

			<th class="descr"><?php esc_html_e('Footer Section Font Size', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td class="descr_2">

				<input type="number" min="0" name="rtwwpcp_footer_setting_opt[footer_font_size]"

				value="<?php echo esc_attr(isset( $rtwwpcp_get_setting['footer_font_size'] )) ? $rtwwpcp_get_setting['footer_font_size'] : '15'; ?>" />

				<div class="descr"><?php esc_html_e('Enter your required font size for Pdf Footer(By default 15)', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></div>

			</td>

		</tr>

	</tbody>	

</table>