if ( empty(get_included_files()) ) die("Direct access forbidden");
//sort custom items largest to smallest
arsort($conf['sizes'][$conf_key]);
if ($conf['bak_conf'][$conf_key]['hour'] == 0) {
} else if ($conf['bak_conf'][$conf_key]['hour'] == 12) {
} else if ($conf['bak_conf'][$conf_key]['hour'] > 12) {
$hour = $conf['bak_conf'][$conf_key]['hour'] - 12;
// after midnight, before noon
$hour = $conf['bak_conf'][$conf_key]['hour'];
<div class="panel panel-default"> <!-- settings tab <?php echo($section); ?> section -->
<div class="panel-heading">
<div class="col-sm-3"> <!-- backup type col -->
data-parent="#settings_accordion"
href="#settings_<?php echo($conf_key); ?>_collapse">
<span class="arw">►</span> <?php echo($section); ?>
<div class="col-sm-3 text-center"> <!-- schedule col -->
<h4 class="panel-title" id="sched_descr_<?php echo($conf_key); ?>">?</h4>
<div class="col-sm-3 text-center"> <!-- data backed up col -->
<h4 class="panel-title" id="mode_descr_<?php echo($conf_key); ?>">?</h4>
<div class="col-sm-3 text-right"> <!-- current usage in GB -->
<span class="usage_gb_<?php echo($conf_key); ?>">?</span>GB
<div id="settings_<?php echo($conf_key); ?>_collapse" class="panel-collapse collapse">
<?php if (array_key_exists($conf_key, $conf['completed']) && $conf['completed'][$conf_key]): ?>
<p><strong>Backups Available</strong></p>
<div class="well backups-available">
<?php foreach($conf['completed'][$conf_key] as $snap): ?>
<span class="fix-locale-stamp"><?= $snap['time'] ?></span>
<?php if ($conf_key == 'homedir'): ?>
<a onclick="goto_restore(this);" data-geo="<?= $snap['geo'] ?>" data-baktype="<?= $conf_key ?>" data-snap="<?= $snap['snap'] ?>" href="#">Restore</a>
<a onclick="goto_restore(this);" data-geo="<?= $snap['geo'] ?>" data-baktype="<?= $conf_key ?>" data-snap="<?= $snap['time'] ?>" href="#">Restore</a>
<p><strong>Enable or Disable Backups</strong></p>
class="hidden oldval-enable"
data-oldval="<?php echo($conf['bak_conf'][$conf_key]['enable'] ? 'y' : 'n'); ?>"
data-enableid="<?php echo("{$conf_key}_enabled"); ?>"
<?php show_switch("{$conf_key}_enabled", $conf['bak_conf'][$conf_key]['enable']);
Once Disabled, your "Backups Available" that are 30 days old or older will eventually be deleted.
If you'd like to keep your available backups, then before disabling, we recommend
restoring them to an alternate folder and downloading those files.
Once Disabled, your "Backups Available" that are 30 days old or older will eventually be deleted.
If you'd like to keep your available backups, then before disabling, we recommend
<a href="{$article_alt_folder}" target="_blank">restoring them to an alternate folder</a>
and downloading those files.
<div id="settings_form_alert_<?php echo($conf_key); ?>" class="alert alert-warning">
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>Any <?php echo($section); ?> backups older than 30 days will be deleted.</p>
<div id="settings_form_<?php echo($conf_key); ?>" class="settings-form">
<p><strong>Schedule Backups</strong></p>
<div class="well"> <!-- schedule backups section -->
<p>How often do you want your backups queued? We maintain the
<strong><?php echo($conf['retention']); ?> most recent</strong>
backups, and the oldest copy gets replaced when each scheduled backup performs. Once queued,
the backups will be performed as soon as server workload allows.
if (! $conf['is_child']) {
$msg = "The number of retained backups is based on unused space";
if (! $conf['is_shared']) {
$msg = $msg . " on the server";
$msg = $msg . " and will be between 2 and 10.";
<div class="radio"> <!-- by interval -->
type="radio" class="sched_radio" value="interval" name="scheduling_<?php echo($conf_key); ?>"
<?php if ($conf['bak_conf'][$conf_key]['use_interval']) { echo('data-oldval="y" checked="checked"');} ?>
<div class="form-group row indent-sched" id="sched_interval_form_<?php echo($conf_key); ?>">
<input id="sched_interval_<?php echo($conf_key); ?>" type="number" min="1" max="30" value="<?php echo($conf['bak_conf'][$conf_key]['interval']); ?>"
class="form-control input-sm frm-sm sched_interval_input" data-error-id="#interval-error-<?php echo($conf_key); ?>" />
<div class="alert alert-danger interval-error" id="interval-error-<?php echo($conf_key); ?>">
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>The Backup Interval needs to be 1 Day or longer.</p>
<div class="radio"> <!-- by day/time -->
type="radio" class="sched_radio" value="daily" name="scheduling_<?php echo($conf_key); ?>"
<?php if (! $conf['bak_conf'][$conf_key]['use_interval']) { echo('data-oldval="y" checked="checked"');} ?>
<div id="sched_daytime_form_<?php echo($conf_key); ?>">
<div class="row indent-sched" id="scheduling_days_<?php echo($conf_key); ?>">
<?php $days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
$day_short = array('M', 'Tu', 'W', 'Th', 'F', 'Sa', 'Su');
foreach(array_values($days) as $index => $day): ?>
<label class="checkbox-inline">
<input type="checkbox" <?php
if (in_array($index, $conf['bak_conf'][$conf_key]['days'])) {
echo ('checked="checked" data-oldval="y"');
echo ('data-oldval="n"');
?> value="<?php echo($index); ?>"
data-short="<?php echo($day_short[$index]); ?>" class="sched_days_checkbox"
><?php echo($day); ?></input>
<div class="row indent-sched sched-time">
id="scheduling_hour_<?php echo($conf_key); ?>"
type="number" value="<?php echo($hour); ?>"
min="1" max="12" data-oldval="<?php echo($hour); ?>"
class="form-control input-sm frm-sm sched_hour"
<select class="form-control input-sm frm-sm sched_meridiem" id="scheduling_meridiem_<?php echo($conf_key); ?>">
<option<?php if ($meridiem == 'AM'){ echo(' data-oldval="y" selected="selected"'); } ?>>AM</option>
<option<?php if ($meridiem == 'PM'){ echo(' data-oldval="y" selected="selected"'); } ?>>PM</option>
<p><strong>Data Included in Backup</strong></p>
<div class="well"> <!-- custom backups section -->
<p>What data do you want included in your backups?</p>
type="radio" class="custom_radio" value="all" name="mode_<?php echo($conf_key); ?>"
<?php if (is_null($conf['bak_conf'][$conf_key]['mode'])){ echo('data-oldval="y" checked="checked"'); } ?>>
<?php if ($conf_key == 'homedir'): ?>
All home directory folders
<?php elseif (array_keys(['pgsql', 'mysql'], $conf_key)): ?>
<?php echo("All {$section} databases"); ?>
<?php if ($conf_key == 'homedir'): ?>
type="radio" class="custom_radio" value="whitelist" name="mode_<?php echo($conf_key); ?>"
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist'){ echo('data-oldval="y" checked="checked"'); } ?>>
Backup selected folders - When you create new folders they <strong><em>will not be</em></strong>
backed up until also selected.</label>
<?php help_popover("If you're not active in the root directory, choose backup selected folders."); ?>
<div id="custom_hide_whitelist_homedir">
if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist') {
$browser_selected = $conf['bak_conf'][$conf_key]['custom'];
<?php browser_widget('homedir-include-browser', $conf['home_path'], 'recalculate_usage', 'listdir', false, $browser_selected); ?>
<?php selected_total_widget('homedir', $amp_url, $conf['is_child']) ?>
type="radio" class="custom_radio" value="whitelist" name="mode_<?php echo($conf_key); ?>"
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist'){ echo('data-oldval="y" checked="checked"'); } ?>>
Backup selected databases - When you create new databases they <strong><em>will not be</em></strong> backed up until also selected.</label>
<div id="custom_hide_whitelist_<?php echo($conf_key); ?>">
<?php db_custom_select_widget('whitelist', $conf_key, $conf['sizes'][$conf_key], $conf['bak_conf'][$conf_key], $amp_url); ?>
<?php selected_total_widget($conf_key, $amp_url, $conf['is_child']) ?>
<?php if ($conf_key == 'homedir'): ?>
<label><input type="radio" class="custom_radio" value="blacklist" name="mode_homedir"
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist'){ echo('data-oldval="y" checked="checked"'); } ?>>
Exclude selected folders - When you create new folders they <strong><em>will be</em></strong>
<?php help_popover('If you are active in the root directory, we recommend excluding the selected folders.'); ?>
<div id="custom_hide_blacklist_homedir">
if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist') {
$browser_selected = $conf['bak_conf'][$conf_key]['custom'];
<?php browser_widget('homedir-exclude-browser', $conf['home_path'], 'recalculate_usage', 'listdir', false, $browser_selected); ?>
<?php selected_total_widget('homedir', $amp_url, $conf['is_child']) ?>
type="radio" class="custom_radio" value="blacklist" name="mode_<?php echo($conf_key); ?>"
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist'){ echo('data-oldval="y" checked="checked"'); } ?>>
Exclude selected databases - When you create new databases they <strong><em>will be</em></strong> backed up.</label>
<div id="custom_hide_blacklist_<?php echo($conf_key); ?>">
<?php db_custom_select_widget('blacklist', $conf_key, $conf['sizes'][$conf_key], $conf['bak_conf'][$conf_key], $amp_url); ?>
<?php selected_total_widget($conf_key, $amp_url, $conf['is_child']) ?>
<div class="row settings-btn-row">
<button id="<?php echo($conf_key); ?>-apply-btn" onclick="apply_settings('<?php echo($conf_key); ?>', this);" class="col-sm-2 btn btn-primary">Apply Changes</button>
<span class="cancel-link"><a onclick="cancel_settings(this);" href="#">Cancel</a></span>
<?php error_box("{$conf_key}-apply-msg", "alert error-msg apply-msg"); ?>