<?php
if(!defined('InEmpireBak'))
{
	exit();
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>阆告搰鏁告摎琛?/title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if(e.name=='bakstru'||e.name=='bakstrufour'||e.name=='beover'||e.name=='autoauf'||e.name=='baktype'||e.name=='bakdatatype')
		{
		continue;
	    }
	if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
function reverseCheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
  {
    var e = form.elements[i];
    if(e.name=='bakstru'||e.name=='bakstrufour'||e.name=='beover'||e.name=='autoauf'||e.name=='baktype'||e.name=='bakdatatype')
	{
		continue;
	}
	if (e.name != 'chkall')
	{
	   if(e.checked==true)
	   {
       		e.checked = false;
	   }
	   else
	   {
	  		e.checked = true;
	   }
	}
  }
}
function SelectCheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if(e.name=='bakstru'||e.name=='bakstrufour'||e.name=='beover'||e.name=='autoauf'||e.name=='baktype'||e.name=='bakdatatype')
		{
		continue;
	    }
	if (e.name != 'chkall')
	  	e.checked = true;
    }
  }
function check()
{
	var ok;
	ok=confirm("纰鸿獚瑕佸煼琛屾鎿崭綔?");
	return ok;
}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td width="51%">浣岖疆锛氩倷浠芥暩鎿?-&gt; <a href="ChangeDb.php">阆告搰鏁告摎搴?/a>(<b><?=$mydbname?></b>) -&gt; <a href="ChangeTable.php?mydbname=<?=$mydbname?>">阆告搰鍌欎唤琛?/a></td>
    <td width="49%"><div align="right"> </div></td>
  </tr>
  <tr> 
    <td height="25" colspan="2"><div align="center">鍌欎唤姝ラ锛氶夫鎿囨暩鎿氩韩 -&gt; <font color="#FF0000">阆告搰瑕佸倷浠界殑琛?/font> 
        -&gt; 闁嫔鍌欎唤 -&gt; 瀹屾垚</div></td>
  </tr>
</table>
<form name="ebakchangetb" method="post" action="phomebak.php" onsubmit="return check();">
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#0472BC">
    <tr> 
      <td height="25"><font color="#FFFFFF">鍌欎唤鍙冩暩瑷疆锛?
        <input name="phome" type="hidden" id="phome" value="DoEbak">
        <input name="mydbname" type="hidden" id="mydbname" value="<?=$mydbname?>">
        </font></td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
          <tr> 
            <td width="22%">&nbsp;</td>
            <td> [<a href="#ebak" onclick="javascript:window.open('ListSetbak.php?mydbname=<?=$mydbname?>&change=1','','width=550,height=380,scrollbars=yes');">灏庡叆瑷疆</a>]&nbsp;&nbsp;&nbsp;[<a href="#ebak" onclick="javascript:showsave.style.display='';">淇濆瓨瑷疆</a>]&nbsp;&nbsp;&nbsp;[<a href="#ebak" onclick="javascript:showreptable.style.display='';">镓归噺镟挎弥琛ㄥ悕</a>]</td>
          </tr>
          <tr id="showsave" style="display:none">
            <td>&nbsp;</td>
            <td>淇濆瓨鏂囦欢鍚?setsave/ 
              <input name="savename" type="text" id="savename" value="<?=$_GET['savefilename']?>">
              <input name="Submit4" type="submit" id="Submit4" onClick="document.ebakchangetb.phome.value='DoSave';document.ebakchangetb.action='phome.php';" value="淇濆瓨瑷疆">
              <font color="#666666">(鏂囦欢鍚嶈珛鐢ㄨ嫳鏂囧瓧姣?濡傦细test)</font></td>
          </tr>
		  <tr id="showreptable" style="display:none">
            <td>&nbsp;</td>
            <td> 铡熷瓧绗? 
              <input name="oldtablepre" type="text" id="oldtablepre" size="18">
              鏂板瓧绗?
              <input name="newtablepre" type="text" id="newtablepre" size="18"> 
              <input name="Submit4" type="submit" id="Submit4" onClick="document.ebakchangetb.phome.value='ReplaceTable';document.ebakchangetb.action='phome.php';" value="镟挎弥阆镐腑琛ㄥ悕">
            </td>
          </tr>
        </table>
        <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr> 
            <td width="22%"><input type="radio" name="baktype" value="0"<?=$dbaktype==0?' checked':''?>> 
              <strong>鎸夋枃浠跺ぇ灏忓倷浠?/strong> </td>
            <td width="78%" height="23"> 姣忕祫鍌欎唤澶у皬: 
              <input name="filesize" type="text" id="filesize" value="<?=$dfilesize?>" size="6">
              KB <font color="#666666">(1 MB = 1024 KB)</font></td>
          </tr>
          <tr> 
            <td><input type="radio" name="baktype" value="1"<?=$dbaktype==1?' checked':''?>> 
              <strong>鎸夎閷勬暩鍌欎唤</strong></td>
            <td height="23">姣忕祫鍌欎唤 
              <input name="bakline" type="text" id="bakline" value="<?=$dbakline?>" size="6">
              姊濊閷勶紝 
              <input name="autoauf" type="checkbox" id="autoauf" value="1"<?=$dautoauf==1?' checked':''?>>
              镊嫊璀桦垾镊瀛楁<font color="#666666">(姝ゆ柟寮忔晥鐜囨洿楂?</font></td>
          </tr>
          <tr> 
            <td>鍌欎唤鏁告摎搴祼妲?/td>
            <td height="23"><input name="bakstru" type="checkbox" id="bakstru" value="1"<?=$dbakstru==1?' checked':''?>>
              鏄?<font color="#666666">(娌掔壒娈婃儏娉侊紝璜嬮夫鎿?</font></td>
          </tr>
          <tr> 
            <td>鏁告摎绶ㄧ⒓</td>
            <td height="23"> <select name="dbchar" id="dbchar">
                <option value="auto"<?=$ddbchar=='auto'?' selected':''?>>镊嫊璀桦垾绶ㄧ⒓</option>
                <option value=""<?=$ddbchar==''?' selected':''?>>涓嶈ō缃?/option>
                <?php
				echo Ebak_ReturnDbCharList($ddbchar);
				?>
              </select> <font color="#666666">(寰瀖ysql4.0灏庡叆mysql4.1浠ヤ笂鐗堟湰闇€瑕侀夫鎿囧浐瀹氱法纰硷紝涓嶈兘阆歌嚜鍕?</font></td>
          </tr>
          <tr>
            <td>鏁告摎瀛樻斁镙煎纺</td>
            <td height="23"><input type="radio" name="bakdatatype" value="0"<?=$dbakdatatype==0?' checked':''?>>
              姝ｅ父
              <input type="radio" name="bakdatatype" value="1"<?=$dbakdatatype==1?' checked':''?>>
              鍗佸叚阃插埗鏂瑰纺<font color="#666666">(鍗佸叚阃插埗鍌欎唤鏂囦欢链冧綌鐢ㄦ洿澶氱殑绌洪枔)</font></td>
          </tr>
          <tr> 
            <td>瀛樻斁鐩寗</td>
            <td height="23"> 
              <?=$bakpath?>
              / 
              <input name="mypath" type="text" id="mypath" value="<?=$mypath?>" size="28"> 
              <font color="#666666"> 
              <input type="button" name="Submit2" value="阆告搰鐩寗" onclick="javascript:window.open('ChangePath.php?change=1&toform=ebakchangetb','','width=750,height=500,scrollbars=yes');">
              (鐩寗涓嶅瓨鍦紝绯荤当链冭嚜鍕曞缓绔?</font></td>
          </tr>
          <tr> 
            <td>鍌欎唤阆搁爡</td>
            <td height="23">灏庡叆鏂瑰纺: 
              <select name="insertf" id="select">
                <option value="replace"<?=$dinsertf=='replace'?' selected':''?>>REPLACE</option>
                <option value="insert"<?=$dinsertf=='insert'?' selected':''?>>INSERT</option>
              </select>
              , 
              <input name="beover" type="checkbox" id="beover" value="1"<?=$dbeover==1?' checked':''?>>
              瀹屾暣鎻掑叆锛?
              <input name="bakstrufour" type="checkbox" id="bakstrufour" value="1"<?=$dbakstrufour==1?' checked':''?>>
              <a title="闇€瑕佽绑鎻涙暩鎿氲〃绶ㄧ⒓鏅傞夫鎿?>杞夋垚MYSQL4.0镙煎纺</a>, 姣忕祫鍌欎唤闁挞殧锛?
              <input name="waitbaktime" type="text" id="waitbaktime" value="<?=$dwaitbaktime?>" size="2">
              绉?/td>
          </tr>
          <tr> 
            <td valign="top">鍌欎唤瑾槑<br> <font color="#666666">(绯荤当链幂敓鎴愪竴链媟eadme.txt)</font></td>
            <td height="23"><textarea name="readme" cols="80" rows="5" id="readme"><?=$dreadme?></textarea></td>
          </tr>
          <tr> 
            <td valign="top">铡婚櫎镊链肩殑瀛楁鍒楄〃锛?br> <font color="#666666">(镙煎纺锛?strong>琛ㄥ悕.瀛楁鍚?/strong><br>
              澶氩€嬭珛鐢?quot;,&quot;镙奸枊)</font></td>
            <td height="23"><textarea name="autofield" cols="80" rows="5" id="autofield"><?=$dautofield?></textarea></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr> 
      <td height="25">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="50%"><font color="#FFFFFF">阆告搰瑕佸倷浠界殑琛细( <a href="#ebak" onclick="SelectCheckAll(document.ebakchangetb)"><font color="#ffffff"><u>鍏ㄩ夫</u></font></a> 
              | <a href="#ebak" onclick="reverseCheckAll(document.ebakchangetb);"><font color="#ffffff"><u>鍙嶉夫</u></font></a> )</font></td>
            <td><div align="right"><font color="#FFFFFF">镆ヨ:</font> 
                <input name="keyboard" type="text" id="keyboard" value="<?=$keyboard?>">
                <input type="button" name="Submit32" value="椤ず鏁告摎琛? onclick="self.location.href='ChangeTable.php?sear=1&mydbname=<?=$mydbname?>&keyboard='+document.ebakchangetb.keyboard.value;">
              </div></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr bgcolor="#DBEAF5"> 
            <td width="5%" height="23"> <div align="center">阆告搰</div></td>
            <td width="27%" height="23" bgcolor="#DBEAF5"> 
              <div align="center">琛ㄥ悕(榛炴搳镆ョ湅瀛楁)</div></td>
            <td width="13%" height="23" bgcolor="#DBEAF5"> 
              <div align="center">椤炲瀷</div></td>
            <td width="15%" bgcolor="#DBEAF5">
<div align="center">绶ㄧ⒓</div></td>
            <td width="15%" height="23"> 
              <div align="center">瑷橀寗鏁?/div></td>
            <td width="14%" height="23"> 
              <div align="center">澶у皬</div></td>
            <td width="11%" height="23"> 
              <div align="center">纰庣墖</div></td>
          </tr>
          <?php
		  $tbchecked=' checked';
		  if($dtblist)
		  {
		  	$check=1;
		  }
		  $totaldatasize=0;//绺芥暩鎿氩ぇ灏?
		  $tablenum=0;//绺借〃鏁?
		  $datasize=0;//鏁告摎澶у皬
		  $rownum=0;//绺借閷勬暩
		  while($r=$empire->fetch($sql))
		  {
		  	$rownum+=$r[Rows];
		  	$tablenum++;
		  	$datasize=$r[Data_length]+$r[Index_length];
		  	$totaldatasize+=$r[Data_length]+$r[Index_length]+$r[Data_free];
			if($check==1)
			{
				if(strstr($dtblist,','.$r[Name].','))
				{
					$tbchecked=' checked';
				}
				else
				{
					$tbchecked='';
				}
			}
			$collation=$r[Collation]?$r[Collation]:'---';
		  ?>
          <tr id=tb<?=$r[Name]?>> 
            <td height="23"> <div align="center"> 
                <input name="tablename[]" type="checkbox" id="tablename[]" value="<?=$r[Name]?>" onclick="if(this.checked){tb<?=$r[Name]?>.style.backgroundColor='#F1F7FC';}else{tb<?=$r[Name]?>.style.backgroundColor='#ffffff';}"<?=$tbchecked?>>
              </div></td>
            <td height="23"> <div align="left"><a href="#ebak" onclick="window.open('ListField.php?mydbname=<?=$mydbname?>&mytbname=<?=$r[Name]?>','','width=660,height=500,scrollbars=yes');" title="榛炴搳镆ョ湅琛ㄥ瓧娈靛垪琛?> 
                <?=$r[Name]?>
                </a></div></td>
            <td height="23"> <div align="center">
                <?=$r[Type]?$r[Type]:$r[Engine]?>
              </div></td>
            <td><div align="center">
				<?=$collation?>
              </div></td>
            <td height="23"> <div align="right">
                <?=$r[Rows]?>
              </div></td>
            <td height="23"> <div align="right">
                <?=Ebak_ChangeSize($datasize)?>
              </div></td>
            <td height="23"> <div align="right">
                <?=Ebak_ChangeSize($r[Data_free])?>
              </div></td>
          </tr>
          <?
		  }
		  ?>
          <tr bgcolor="#DBEAF5"> 
            <td height="23"> <div align="center">
                <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)"<?=$check==0?' checked':''?>>
              </div></td>
            <td height="23"> <div align="center"> 
                <?=$tablenum?>
              </div></td>
            <td height="23"> <div align="center">---</div></td>
            <td><div align="center">---</div></td>
            <td height="23"> <div align="center">
                <?=$rownum?>
              </div></td>
            <td height="23" colspan="2"> <div align="center">
                <?=Ebak_ChangeSize($totaldatasize)?>
              </div></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td height="25">
<div align="center">
          <input type="submit" name="Submit" value="闁嫔鍌欎唤" onclick="document.ebakchangetb.phome.value='DoEbak';document.ebakchangetb.action='phomebak.php';">
          &nbsp;&nbsp; &nbsp;&nbsp;
          <input type="submit" name="Submit2" value="淇京鏁告摎琛? onclick="document.ebakchangetb.phome.value='DoRep';document.ebakchangetb.action='phome.php';">
          &nbsp;&nbsp; &nbsp;&nbsp; 
          <input type="submit" name="Submit22" value="鍎寲鏁告摎琛? onclick="document.ebakchangetb.phome.value='DoOpi';document.ebakchangetb.action='phome.php';">
        &nbsp;&nbsp; &nbsp;&nbsp; 
          <input type="submit" name="Submit22" value="鍒櫎鏁告摎琛? onclick="document.ebakchangetb.phome.value='DoDrop';document.ebakchangetb.action='phome.php';">
		&nbsp;&nbsp; &nbsp;&nbsp; 
          <input type="submit" name="Submit22" value="娓呯┖鏁告摎琛? onclick="document.ebakchangetb.phome.value='EmptyTable';document.ebakchangetb.action='phome.php';">
		</div></td>
    </tr>
  </table>
</form>
</body>
</html>