<?php defined('ABSPATH') || exit; ?>
<h2><?php esc_html_e('FTP/FTPS Upload after Backup', 'iv1-wp-tools'); ?></h2>

<?php wp_nonce_field('iv1wpt_ftp_nonce'); ?>
<table class="form-table">
	<tr><th><label for="ftp_enabled"><?php esc_html_e('Enable upload', 'iv1-wp-tools'); ?></label></th><td><input type="checkbox" name="ftp_enabled" id="ftp_enabled" value="1" <?php checked($ftp_settings['enabled']); ?>></td></tr>
	<tr><th><label for="ftp_host"><?php esc_html_e('Server / Host', 'iv1-wp-tools'); ?></label></th><td><input type="text" name="ftp_host" id="ftp_host" value="<?php echo esc_attr($ftp_settings['host']); ?>" class="regular-text"></td></tr>
	<tr><th><label for="ftp_port"><?php esc_html_e('Port', 'iv1-wp-tools'); ?></label></th><td><input type="number" name="ftp_port" id="ftp_port" value="<?php echo esc_attr($ftp_settings['port']?:21); ?>" style="width:120px;"></td></tr>
	<tr><th><label for="ftp_username"><?php esc_html_e('Username', 'iv1-wp-tools'); ?></label></th><td><input type="text" name="ftp_username" id="ftp_username" value="<?php echo esc_attr($ftp_settings['username']); ?>" class="regular-text"></td></tr>
	<tr><th><label for="ftp_password"><?php esc_html_e('Password', 'iv1-wp-tools'); ?></label></th><td><input type="password" name="ftp_password" id="ftp_password" class="regular-text" autocomplete="new-password"><p class="description"><?php esc_html_e('Only enter if you want to change it.', 'iv1-wp-tools'); ?></p></td></tr>
	<tr><th><label for="use_ftps"><?php esc_html_e('Use FTPS (TLS)', 'iv1-wp-tools'); ?></label></th><td><input type="checkbox" name="use_ftps" id="use_ftps" value="1" <?php checked($ftp_settings['use_ftps']); ?>> <span class="description"><?php esc_html_e('(recommended)', 'iv1-wp-tools'); ?></span></td></tr>
	<tr><th><label for="ftp_passive"><?php esc_html_e('Passive mode', 'iv1-wp-tools'); ?></label></th><td><input type="checkbox" name="ftp_passive" id="ftp_passive" value="1" <?php checked($ftp_settings['passive'],true,true); ?>></td></tr>
	<tr><th><label for="ftp_remote_dir"><?php esc_html_e('Remote directory', 'iv1-wp-tools'); ?></label></th><td><input type="text" name="ftp_remote_dir" id="ftp_remote_dir" value="<?php echo esc_attr($ftp_settings['remote_dir']); ?>" class="regular-text"></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 FTP settings", "iv1-wp-tools"); ?></button>
</p>