<?php

settings_fields('rtwwpcp_header_setting');

$rtwwpcp_get_setting = get_option('rtwwpcp_header_setting_opt');

?>

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

	<tbody>

		<tr>

			<th><?php esc_html_e('Remove Header From First & Last Page Only', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></th>

			<td>

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

				<div class="descr"><?php esc_html_e('Check it if you want to remove header from first & last page only.', 'rtwwpcp-woocommerce-pdf-catalog-pro');?></div>

			</td>

		</tr>

		<tr>

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

			<td>

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

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

			</td>

		</tr>

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

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

			<td>

				<?php

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

				$rtwwpcp_setting = array(

					'wpautop' => true,

					'media_buttons' => true,

					'textarea_name' => 'rtwwpcp_header_setting_opt[rtw_header_html]',

					'textarea_rows' => 7

				);

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

				?>

			</td>

		</tr>

		<tr>

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

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

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

			</td>

		</tr>

		<tr>

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

			<td class="descr_2">

				<select name="rtwwpcp_header_setting_opt[header_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['header_font_family'] ) && $rtwwpcp_get_setting['header_font_family'] == $rtwwpcp_value ? 'selected="selected"' : '';?>><?php echo esc_html($rtwwpcp_key);?></option>

						<?php

					}

					?>

				</select>

			</td>

		</tr>

		<tr>

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

			<td class="descr_2">

				<input type="number" min="0" name="rtwwpcp_header_setting_opt[header_font_size]"

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

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

			</td>

		</tr>

	</tbody>	

</table>