<?php defined('ABSPATH') || exit; ?>
<h2><?php esc_html_e('Automatic Backups – Schedule', 'iv1-wp-tools'); ?></h2>

<div id="iv1wpt-settings-schedule-result" style="margin:15px 0;"></div>

<?php wp_nonce_field('iv1wpt_schedule_nonce'); ?>
<table class="form-table">
	<tr><th><label for="files_schedule"><?php esc_html_e('File backup', 'iv1-wp-tools'); ?></label></th><td><select name="files_schedule" id="files_schedule"><?php foreach ($schedules_available as $key => $label): ?><option value="<?php echo esc_attr($key); ?>" <?php selected($schedule_opts['files_schedule'], $key); ?>><?php echo esc_html($label); ?></option><?php endforeach; ?></select></td></tr>
	<tr><th><label for="db_schedule"><?php esc_html_e('Database backup', 'iv1-wp-tools'); ?></label></th><td><select name="db_schedule" id="db_schedule"><?php foreach ($schedules_available as $key => $label): ?><option value="<?php echo esc_attr($key); ?>" <?php selected($schedule_opts['db_schedule'], $key); ?>><?php echo esc_html($label); ?></option><?php endforeach; ?></select></td></tr>
	<tr><th><label for="retention_files"><?php esc_html_e('Retention files', 'iv1-wp-tools'); ?></label></th><td><input type="number" name="retention_files" id="retention_files" value="<?php echo esc_attr($schedule_opts['retention_files']); ?>" min="1" max="90" style="width:80px;"> <span class="description"><?php esc_html_e('backups to keep', 'iv1-wp-tools'); ?></span></td></tr>
	<tr><th><label for="retention_db"><?php esc_html_e('Retention database', 'iv1-wp-tools'); ?></label></th><td><input type="number" name="retention_db" id="retention_db" value="<?php echo esc_attr($schedule_opts['retention_db']); ?>" min="1" max="90" style="width:80px;"> <span class="description"><?php esc_html_e('backups to keep', 'iv1-wp-tools'); ?></span></td></tr>
	<tr><th><label for="exclude_patterns"><?php esc_html_e('Exclude patterns', 'iv1-wp-tools'); ?></label></th><td><textarea name="exclude_patterns" id="exclude_patterns" rows="5" class="large-text code" style="max-width:400px;"><?php echo esc_textarea($schedule_opts['exclude_patterns']); ?></textarea><p class="description"><?php esc_html_e('One pattern per line. Paths containing this pattern will be skipped.', 'iv1-wp-tools'); ?></p></td></tr>
</table>
<p class="submit" style="margin-top:8px;">
	<button type="button" id="iv1wpt_schedule_save" class="button button-primary"><?php esc_attr_e("Save schedule", "iv1-wp-tools"); ?></button>
</p>



