<?php
require_once(''../sadm/func1/func1.php'');
require_once(''../sadm/func2/func2.php'');
$act = RequestS("act","",24);
$msg = "";
if(strlen($act)>3){
set_time_limit(0);
$dok = 0;
$arr = @file("./dbreset/dbMy_Table_Stru.txt") or die ("can NOT open file dbMy_Table_Stru.txt");
$cnt = count($arr);
for ($i=0;$i<$cnt;$i++){
$iSql = $arr[$i]; if($i==0){ $iSql = substr($iSql,8); }
mysql_query($iSql,$conn);
if(mysql_affected_rows()==0) { $dok++; }
}
$msg = "导入表结构:($dok)个语句执行成功! ";
$sAll = RequestS("sAll","",2400);
$sDel = RequestS("sDel","",2400);
$sMust = RequestS("sMust","",2400);
$sUser1 = RequestS("sUser1","",2400);
$sUser2 = RequestS("sUser2","",2400);
$dok = 0;
$doj = 0;
$b = explode(";","sMust;sUser1;sUser2");
$b[0] = $sMust;
$b[1] = $sUser1;
$b[2] = $sUser2;
for($k=0;$k<3;$k++){
$a = get_aTab($b[$k]);
for($j=0;$j<count($a);$j++){
$arr = @file("./dbreset/dbMy_Data_$a[$j].txt") or die ("can NOT open file dbMy_Data_$a[$j].txt");
$cnt = count($arr);
$s0 = substr($arr[0],8);
$doi = 0;
for ($i=1;$i<$cnt;$i++){
$iSql = $s0.$arr[$i];
mysql_query($iSql,$conn);
if(mysql_affected_rows()==1) { $doi++; $doj++; }
}
if($doi>0) { $dok++; }
}
}
$msg .= "导入数据:($dok)个表成功导入了数据; ";
$msg .= "共导入数据:($doj)条! ";
}
function get_aTab($Tabs)
{
$Tabs = str_replace("\r\n",";",$Tabs);
$Tabs = str_replace("\r",";",$Tabs);
$Tabs = str_replace("\n",";",$Tabs);
$Tabs = str_replace(";;",";",$Tabs);
return explode(";",$Tabs);
}
?>
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Setup 3 --- Import Database</title>
<style type="text/css">
<!--
body, td, th {
font-size: 12px;
}
table td, table th {
background-color:#FFF
}
-->
</style>
</head>
<body>
<table width="640" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<form name="fm01" method="post" action="?">
<tr>
<td colspan="3" align="left" style="line-height:180%;">注意:<?php echo $msg; ?><br>
1. ...!</td>
</tr>
<tr>
<th>项目</th>
<th>设置值</th>
<th>注意</th>
</tr>
<tr>
<td align="center">Import Tables</td>
<td><textarea name="sAll" cols="48" rows="5" id="sAll" wrap="soft" readonly>AdmLogs
AdmPara
AdmSyst
AdmUser_12345
BBSInfo
BPKTitle
BPKView
BPKVote
DocsLogs
DocsNews
DocsRemark
GboInfo
GboLink
GboSend
InfoHead
InfoNews
InfoOuter
InfoPhoto
InfoPics
Member_ABCDE
MemCard
MemSyst
OnlPage
OnlView
OrdInfo
OrdItem
OrdPara
TradeCorp
TradeGbook
TradeInfo
TradePara
TradeType
VoteInfo
VoteItem
VoteLogs
WebInfo
WebType
WebTyps</textarea></td>
<td>Structure</td>
</tr>
<tr>
<td align="center">Import Data(0)</td>
<td><textarea name="sMust" cols="22" rows="5" id="sMust" wrap="soft" readonly>AdmPara
AdmSyst
AdmUser_12345
MemSyst
WebInfo
WebType
WebTyps</textarea>
<textarea name="sDel" cols="22" rows="5" id="sDel" wrap="soft" readonly>[ Ignore Tables ]
AdmLogs
DocsLogs
OnlPage
OnlView
OrdInfo
OrdItem
OrdPara
VoteLogs</textarea></td>
<td>Must</td>
</tr>
<tr>
<td align="center">Import Data(1)</td>
<td><textarea name="sUser1" cols="48" rows="5" id="sUser1">BPKTitle
BBSInfo
DocsNews
GboInfo
GboLink
InfoNews
InfoPics
TradeCorp</textarea></td>
<td>Select1</td>
</tr>
<tr>
<td align="center">Import Data(2)<br>
[<a href="#" onClick="setUser(''Clear'')">Clear</a>]<br>
[<a href="#" onClick="setUser(''Reset'')">Reset</a>]</td>
<td><textarea name="sUser2" cols="48" rows="5" id="sUser2">BPKView
BPKVote
DocsRemark
GboSend
InfoHead
InfoOuter
InfoPhoto
Member_ABCDE
MemCard
TradeGbook
TradeInfo
TradePara
TradeType
VoteInfo
VoteItem</textarea></td>
<td>Select2</td>
</tr>
<tr>
<td align="center"><a href="?">重载本页</a></td>
<td align="left"><input type="button" name="button2" id="button2" value="确认执行" onClick="chkData()">
<input name="act" type="hidden" id="act" value="Send"></td>
<td align="center"><a href="set02.php">返回</a></td>
</tr>
</form>
</table>
<script type="text/javascript">
var fm = document.fm01;
var sUserB = fm.sUser2.value;
function setUser(typ)
{
if(typ=="Clear") { fm.sUser2.value = ""; }
else { fm.sUser2.value = sUserB; }
}
function chkData()
{
var eflag = 0;
for(i=0;i<1;i++)
{ ////////// //////////////// Start For ////////////////
/*
if (fm.UsrPW.value.length==0)
{
alert(" 确认密码 不能为空!");
fm.UsrPW.focus();
eflag = 1; break;
}
if (fm.UsrPW.value!=document.fm01.UsrPR.value)
{
alert(" 确认密码 与 管理员密码 要相同!");
fm.UsrPW.focus();
eflag = 1; break;
}
*/
} ////////// //////////////// End For //////////////////
if (eflag==0){
fm.submit();
}
}
</script>
</body>
</html>