<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
				<li><a class="default-tab current" href="#tab1">Backup</a></li>
				<li><a href="#tab2" class="">Reduction</a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content" style="margin-left:10px;">
			<div class="tab-content default-tab" id="tab1">
				<form id="_action_form" action="admin/tool/database_backup_process/" method="post">
					<fieldset>
					<ul>
					<li style="line-height:22px;">Data backup function will be exported TanyaCMS database content available phpMyAdmin exported data file to import.</li>
					<li style="line-height:22px;">Exported data files can be downloaded directly, or visit the FTP to system/<?php echo $this->backup_dir;?>/ folder download.</li>
					</ul>
					<label>Sub-volume backup - single roll length (unit: KB):
					<input type="text" class="text-input small-int" name="size" value="1024">
					</label>
					<label>Backup file name:
					<input type="text" class="text-input small-int" name="filename" value="<?php echo date("Ymd_") . random(8);?>">
					.sql</input>
					</label>
					<p>
						<input class="button" type="submit" value="Start Backup" />
					</p>
					</fieldset>
				</form>
				<div class="clear"></div>
			</div>
			<div class="tab-content" id="tab2" style="display:none;">
				<form id="_action_form" action="admin/maintain/database_backup/" method="post">
					<fieldset>
					<ul>
					<li style="line-height:22px; color:#ff0000;">Restore data recovery database will make the site to the backup data state, please exercise caution.</li>
					<li style="line-height:22px; color:#ff0000;">Sites during the restore process errors, do not interrupt the restore operation.</li>
					<li style="line-height:22px;">If an error occurs during the restore process, please log in to FTP system/<?php echo $this->backup_dir;?>/ download the appropriate data file folder, and then through phpMyAdmin imported.</li>
					</ul>
					<?php if($this->list){ ?>
					<table>
						<thead>
							<tr>
								<!--th style="width:20px;"></th-->
								<th style="width:380px;">File Name</th>
								<th>Time</th>
								<th>Vol. Number</th>
								<th></th>
							</tr>
						</thead>
						<tfoot>
							<tr>
								<td colspan="7">
									<!--input type="checkbox" class="check-all">
									Delete?
									&nbsp;&nbsp;&nbsp;&nbsp;
									<input type="button" value="  Submit  " onclick="ajax_post($('#mem_groups'), _form_process);" class="button"-->
								</td>
							</tr>
						</tfoot>
						<tbody>
							<?php foreach($this->list as $key => $val){ ?>
							<tr class="alt-row">
								<!--td><input type="checkbox" value="313" name="question_ids[]"></td-->
								<td><?php echo $key; ?></td>
								<td><?php echo date("Y-m-d H:i:s", $val['time']);?></td>
								<td><?php echo $val['page'];?></td>
								<td><a target=_blank href="admin/db_import/filename-<?php echo rawurlencode($this->backup_dir . '/' . $key); ?>">Reduction</a> </td>
							</tr>
							<?php } ?>
						</tbody>
					</table>
					<?php }else{ ?>
						No backup records
					<?php } ?>
					</fieldset>
				</form>
				<div class="clear"></div>
			</div>
		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="Close" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>