<style>
.bootstrap-filestyle .btn {
	border-left:none;
	border-radius: 0px;
}
</style>
<p style="margin-bottom:25px;"><?=Dict::_('TXTCONTROLBASE')?></p>
<form method="POST" enctype="multipart/form-data">
	<div class="panel panel-default">
		<div class="panel-body text-center" style="padding-bottom: 0px;">
			<div class="row">
				<div class="form-group col-lg-3 col-sm-6">
					<div class="input-group">
						<span class="input-group-addon"><i class="fa fa-fw fa-cloud" aria-hidden="true"></i></span>
						<span class="input-group-btn" style="width:100%;">
							<div class="btn-group" style="width:100%;">
								<button type="submit" name="NewBackup" class="btn btn-block btn-success" style="color:#fff;">Создать резервную копию</button>
							</div>
						</span>
					</div>
				</div>
				<div class="form-group col-lg-4 col-sm-6">
					<div class="input-group">
						<input type="file" name="upload_file" class="filestyle" data-icon="true">
						<span class="input-group-btn">
							<div class="btn-group">
								<button type="submit" name="LoadBackup" class="btn btn-block btn-primary" title="Загрузить BackUP" style="color:#fff;"><i class="fa fa-fw fa-cloud-upload" aria-hidden="true"></i></button>
							</div>
						</span>
					</div>
				</div>
				<div class="form-group col-lg-3 col-sm-6">
					<div class="input-group">
						<select class="form-control" name="SelData">
							<option value="">- Данные для удаления -</option>
							<? if (file_exists($baseU) and file_exists($fileU)) { ?>
							<option value="users"><?=Dict::_('USERS')?> (<?php echo format_size(filesize($baseU)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseT)) { ?>
							<option value="tasks"><?=Dict::_('TASKS')?> (<?php echo format_size(filesize($baseT)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseC) and file_exists($fileC)) { ?>
							<option value="clients"><?=Dict::_('CLIENTS')?> (<?php echo format_size(filesize($baseC)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseR) and file_exists($fileR)) { ?>
							<option value="requests"><?=Dict::_('REQUESTS')?> (<?php echo format_size(filesize($baseR)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseD) and file_exists($fileD)) { ?>
							<option value="deals"><?=Dict::_('DEALS')?> (<?php echo format_size(filesize($baseD)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseP)) { ?>
							<option value="payments"><?=Dict::_('PAYMENTS')?> (<?php echo format_size(filesize($baseP)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseL)) { ?>
							<option value="logs"><?=Dict::_('LOGS')?> (<?php echo format_size(filesize($baseL)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseB)) { ?>
							<option value="block"><?=Dict::_('BLOCK')?> (<?php echo format_size(filesize($baseB)); ?>)</option>
							<? } ?>
							<? if (file_exists($fileN)) { ?>
							<option value="notes"><?=Dict::_('NOTES')?> (<?php echo format_size(dir_size('../crmdata/database/notebooks/')); ?>)</option>
							<? } ?>
							<? if (file_exists($baseE)) { ?>
							<option value="events"><?=Dict::_('EVENTS')?> (<?php echo format_size(filesize($baseE)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseV)) { ?>
							<option value="vacations"><?=Dict::_('VACATIONS')?> (<?php echo format_size(filesize($baseV)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseLT) and file_exists($fileLT)) { ?>
							<option value="letters"><?=Dict::_('LETTERS')?> (<?php echo format_size(filesize($baseLT)); ?>)</option>
							<? } ?>
							<? if (file_exists($baseQ) and file_exists($fileQ)) { ?>
							<option value="messages"><?=Dict::_('CHAT')?> (<?php echo format_size(filesize($baseQ)); ?>)</option>
							<? } ?>
							<option value="uploads"><?=Dict::_('TTLUPLOADS')?> (<?php echo format_size(dir_size('../crmdata/upload/')); ?>)</option>
							<option value="backups"><?=Dict::_('BACKUPS')?> (<?php echo format_size(dir_size('../backups/')); ?>)</option>
						</select>
						<span class="input-group-btn">
							<div class="btn-group">
								<button type="submit" name="ClearSelData" onclick="return confirm('Вы уверены, что хотите очистить выбранные данные?')" title="Очистить выбранные данные" class="btn btn-block btn-default"><i class="fa fa-fw fa-trash" aria-hidden="true"></i></button>
							</div>
						</span>
					</div>
				</div>
				<div class="form-group col-lg-2 col-sm-6">
					<div class="btn-group" style="width:100%;">
						<button type="submit" name="ClearAllData" onclick="return confirm('Вы уверены, что хотите очистить все данные CRM, в том числе и резервные копии?')" class="btn btn-block btn-danger" style="color:#fff;">Удалить всё</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<? include_once(ROOT . '/functions/func_zip_backup.php'); ?>
</form>