{#include file="header.html"#}
<body>

<!-- top menu -->
{#include file="top.html"#}
<!-- top menu -->

<!-- wrap -->
<div class="wrap">
	<!-- nav -->
	<div class="navlink"><a href="admincp.php">{#$cp_lang.cp#}</a>{#$navlink#}</div>
	<!-- msg -->
	<!-- main -->
	<div class="container">
		<table cellpadding="0" cellspacing="0">
		<tr>
		<td style="width:180px">
		<!-- sidebar -->
		<div class="sidebar">
		<div class="leftmenuheader">{#$cp_lang.database#}</div>
		{#foreach from=$menu item=item key=key name=outmenu#}
		<div class="leftmenubody">
			<div class="leftmenutitle" onClick="show_menu('leftmenuitem_','{#$smarty.foreach.outmenu.iteration#}');"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="leftmenuitem_icon_{#$smarty.foreach.outmenu.iteration#}" />&nbsp;&nbsp;{#$item.mName#}</div>
			<div class="leftmenuitem" id="leftmenuitem_{#$smarty.foreach.outmenu.iteration#}">
				{#foreach from=$item.mItems item=s_item key=s_key#}
				<li><a href="admincp.php?action={#$s_item#}">{#$s_key#}</a></li>
				{#/foreach#}
			</div>
		</div>
		{#/foreach#}
		</div>
		<!-- sidebar end -->
		</td>
		<td>
		<!-- content -->
		<div class="content">
			<!-- include -->
			{#if $type eq "export"#}
			<!-- tip -->
			<div class="msgbox">
				<div class="msgtitle">{#$cp_lang.operateTip#}</div>
				<div class="msgcontent">
					<li>{#$cp_lang.db_export_tip_1#}</li>
					<li>{#$cp_lang.db_export_tip_2#}</li>
					<li>{#$cp_lang.db_export_tip_3#}</li>
				</div>
			</div>
			<!-- tip end -->
			<!-- item -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.db_pbtable#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="export_pbtable">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_header">{#$cp_lang.db_tablename#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.db_tablerows#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.Data_length#}</td>
						<td width="*" class="tcell_header"><input type="button" value="{#$cp_lang.chose_all#}" class="submit" name="choseall" onclick="PBchoseAll(this.form)"></td>
					</tr>
					{#foreach from=$pbtable item=item name=pbtable#}
					<tr class="{#if $smarty.foreach.pbtable.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="left">{#$item[0]#}</td>
						<td align="center">{#$item[1]#}</td>
						<td align="center">{#$item[2]#}</td>
						<td align="center"><input type="checkbox" name="tablename[]" value="{#$item[0]#}" /></td>
					</tr>
					{#/foreach#}
					<tr>
						<td colspan="4" class="tcell_mult" style="text-align:left">{#$cp_lang.volume_size#}: <input class="forminput" type="text" value="2048" name="sizelimit" id="sizelimit" size="5" /></td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="4">
							<input class="hidden" name="filename" type="hidden" value="{#$filename#}">
							<input class="hidden" name="submitted" type="hidden" value="submitted">
							<input type="submit" value="{#$cp_lang.submit#}" class="submit" name="submit">
							<input type="reset" value="{#$cp_lang.reset#}" class="submit" name="reset">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- item -->
			{#if $showothertable == true#}
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','2');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_2" /></span>{#$cp_lang.db_othertable#}</div>
				<div class="tablecontent" id="tablecontent_2">
				<form action="{#$actionurl#}" method="post" name="form" id="export_othertable">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_header">{#$cp_lang.db_tablename#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.db_tablerows#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.Data_length#}</td>
						<td width="*" class="tcell_header"><input type="button" value="{#$cp_lang.chose_all#}" class="submit" name="choseall" onclick="PBchoseAll(this.form)"></td>
					</tr>
					{#foreach from=$othertable item=item name=othertable#}
					<tr class="{#if $smarty.foreach.othertable.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="center">{#$item[0]#}</td>
						<td align="center">{#$item[1]#}</td>
						<td align="center">{#$item[2]#}</td>
						<td align="center"><input type="checkbox" name="tablename[]" value="{#$item[0]#}" /></td>
					</tr>
					{#/foreach#}
					<tr>
						<td colspan="4" class="tcell_mult" style="text-align:left">{#$cp_lang.volume_size#}: <input class="forminput" type="text" value="2048" name="sizelimit" id="sizelimit" size="5" /></td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="4">
							<input class="hidden" name="filename" type="hidden" value="{#$filename#}">
							<input class="hidden" name="submitted" type="hidden" value="submitted">
							<input type="submit" value="{#$cp_lang.submit#}" class="submit" name="submit">
							<input type="reset" value="{#$cp_lang.reset#}" class="submit" name="reset">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			{#/if#}
			<!-- item -->
			{#elseif $type eq "import"#}
			<!-- tip -->
			<div class="msgbox">
				<div class="msgtitle">{#$cp_lang.operateTip#}</div>
				<div class="msgcontent">
					<li>{#$cp_lang.db_import_tip_1#}</li>
					<li>{#$cp_lang.db_import_tip_2#}</li>
					<li>{#$cp_lang.db_import_tip_3#}</li>
					<li>{#$cp_lang.db_import_tip_4#}</li>
				</div>
			</div>
			<!-- tip end -->
			<!-- item -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.db_import_list#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="5%" class="tcell_header">{#$cp_lang.id#}</td>
						<td width="35%" class="tcell_header">{#$cp_lang.filename#}</td>
						<td width="15%" class="tcell_header">{#$cp_lang.version#}</td>
						<td width="30%" class="tcell_header">{#$cp_lang.bakdate#}</td>
						<td width="5%" class="tcell_header">{#$cp_lang.volume#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.import#}</td>
						<td width="*" class="tcell_header"><input type="button" value="{#$cp_lang.chose_all#}" class="submit" name="choseall" onclick="PBchoseAll(this.form)"></td>
					</tr>
					{#foreach from=$bakfile item=item name=bak#}
					<tr class="{#if $smarty.foreach.bak.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="center">{#$smarty.foreach.bak.iteration#}</td>
						<td align="center"><a href="dbak/{#$item.filename#}">{#$item.filename#}</a></td>
						<td align="center">{#$item.version#}</td>
						<td align="center">{#$item.bakdate#}</td>
						<td align="center">{#$item.volume#}</td>
						<td align="center"><a href="admincp.php?action=database&type=checksqlfile&sqlfile={#$item.filename#}">{#$cp_lang.import#}</a></td>
						<td align="center"><input type="checkbox" name="dbfile[]" value="{#$item.filename#}" /></td>
					</tr>
					{#/foreach#}
					<tr>
						<td colspan="7" class="tcell_mult" style="text-align:left">{#$cp_lang.file_count#}: {#$filenum#}</td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="7">
							<input type="submit" value="{#$cp_lang.delchose#}" class="submit" name="submit">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- item -->
			<!-- list cate end -->
			{#elseif $type eq "checksqlfile"#}
			<!-- tip -->
			<!-- tip end -->
			<!-- item -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.check_import#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td class="tcell_two">
						<p class="desc">{#$cp_lang.check_import_intro#}</p></td>
					</tr>
					<tr>
						<td class="tcell_sub">
							<input class="hidden" name="bakin" type="hidden" value="1">
							<input type="submit" value="{#$cp_lang.check_import#}" class="submit" name="submit">
							<input type="button" onClick="history.go(-1)" value="{#$cp_lang.cancel#}" class="submit">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- item -->
			{#elseif $type eq "optimize"#}
			<!-- tip -->
			<!-- tip end -->
			<!-- item -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.optimize_db#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.repair_table#}</span><br />{#$cp_lang.repair_table_intro#}</td>
						<td width="50%" class="tcell_one"><input type="checkbox" value="1" name="repair" id="repair" checked="checked" /></td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.optimize_table#}</span><br />{#$cp_lang.optimize_table_intro#}</td>
						<td width="50%" class="tcell_two"><input type="checkbox" value="1" name="optimize" id="optimize" checked="checked" /></td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="2">
							<input class="hidden" name="submitted" type="hidden" value="submitted">
							<input type="submit" value="{#$cp_lang.submit#}" class="submit" name="submit">
							<input type="reset" value="{#$cp_lang.reset#}" class="submit" name="reset">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- item -->
			{#else#}
			<!-- tip -->
			<!-- tip end -->
			<!-- itme one -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.db_status#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.database_version#}</span></td>
						<td width="50%" class="tcell_one">{#$database.version#}</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.database_uptime#}</span></td>
						<td width="50%" class="tcell_two">{#$database.runtime#}</td>
					</tr>
					</table>
				</div>
			</div>
			<!-- itme two -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','2');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_2" /></span>{#$cp_lang.db_pbtable#}</div>
				<div class="tablecontent" id="tablecontent_2">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="15%" class="tcell_header">{#$cp_lang.db_tablename#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.db_tabletype#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.db_tablerows#}</td>
						<td width="30%" class="tcell_header">{#$cp_lang.Update_time#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.Data_length#}</td>
						<td width="*" class="tcell_header">{#$cp_lang.Data_free#}</td>
					</tr>
					{#foreach from=$pbtable item=item name=pbtable#}
					<tr class="{#if $smarty.foreach.pbtable.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="center">{#$item[0]#}</td>
						<td align="center">{#$item[1]#}</td>
						<td align="center">{#$item[2]#}</td>
						<td align="center">{#$item[3]#}</td>
						<td align="center">{#$item[4]#}</td>
						<td align="center">{#$item[5]#}</td>
					</tr>
					{#/foreach#}
					<tr>
						<td width="15%" class="tcell_mult">{#$cp_lang.db_tablenum#}: {#$pbtableinfo[0]#}</td>
						<td width="10%" class="tcell_mult">---</td>
						<td width="10%" class="tcell_mult">{#$cp_lang.db_tablerows#}: {#$pbtableinfo[1]#}</td>
						<td width="30%" class="tcell_mult">---</td>
						<td width="*" class="tcell_mult" colspan="2">{#$cp_lang.db_size#}: {#$pbtableinfo[2]#}</td>
					</tr>
					</table>
				</div>
			</div>
			<!-- itme three -->
			{#if $showothertable == true#}
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','3');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_3" /></span>{#$cp_lang.db_othertable#}</div>
				<div class="tablecontent" id="tablecontent_3">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="15%" class="tcell_header">{#$cp_lang.db_tablename#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.db_tabletype#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.db_tablerows#}</td>
						<td width="30%" class="tcell_header">{#$cp_lang.Update_time#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.Data_length#}</td>
						<td width="*" class="tcell_header">{#$cp_lang.Data_free#}</td>
					</tr>
					{#foreach from=$othertable item=item name=othertable#}
					<tr class="{#if $smarty.foreach.othertable.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="center">{#$item[0]#}</td>
						<td align="center">{#$item[1]#}</td>
						<td align="center">{#$item[2]#}</td>
						<td align="center">{#$item[3]#}</td>
						<td align="center">{#$item[4]#}</td>
						<td align="center">{#$item[5]#}</td>
					</tr>
					{#/foreach#}
					<tr>
						<td width="15%" class="tcell_mult">{#$cp_lang.db_tablenum#}: {#$othertableinfo[0]#}</td>
						<td width="10%" class="tcell_mult">---</td>
						<td width="10%" class="tcell_mult">{#$cp_lang.db_tablerows#}: {#$othertableinfo[1]#}</td>
						<td width="30%" class="tcell_mult">---</td>
						<td width="*" class="tcell_mult" colspan="2">{#$cp_lang.db_size#}: {#$othertableinfo[2]#}</td>
					</tr>
					</table>
				</div>
			</div>
			{#/if#}
			{#/if#}
			<!-- include -->
		</div>
		<!-- content -->
		</td>
		</tr>
		</table>
	</div>
</div>
<!-- wrap -->

{#include file="footer.html"#}