chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
//-------------------------------数据
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
if(THIS_IN!="edt_admin")
|
||||
exit("错误的访问!");
|
||||
//-----------------------------------------> function
|
||||
function splitsql($sql){
|
||||
$sql = str_replace("\r", "\n", $sql);
|
||||
$ret = array();
|
||||
$num = 0;
|
||||
$queriesarray = explode(";\n", trim($sql));
|
||||
unset($sql);
|
||||
foreach($queriesarray as $query) {
|
||||
$queries = explode("\n", trim($query));
|
||||
foreach($queries as $query) {
|
||||
$ret[$num] .= $query[0] == "#" ? NULL : $query;
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
return($ret);
|
||||
}
|
||||
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
|
||||
|
||||
//---------priv
|
||||
$json_data="{";
|
||||
$priv=return_priv($_m,$msg_login_user["priv"]);
|
||||
if($priv[0]=="n"){
|
||||
//没有操作权限
|
||||
$json_data.="\"error\":\"没有操作权限\",\"code\":0,\"msg\":\"\",\"count\":0,\"data\":[],";
|
||||
}else{
|
||||
//$json_data.="\"uid\":".$uid.",";
|
||||
//有权限
|
||||
switch($_a){
|
||||
case "import":
|
||||
$sql_file=$_FILES["up_file"];
|
||||
if(!$sql_file || get_file_ext($sql_file["name"])!="sql"){
|
||||
$json_data.="\"code\":0,";
|
||||
die();
|
||||
}
|
||||
$data_file=$sql_file["tmp_name"];
|
||||
upload_file($data_file,THIS_FILE_ROOT."/cache/","tmp.sql");
|
||||
$data_file=THIS_FILE_ROOT."/cache/tmp.sql";
|
||||
$sqldump=read_file($data_file);
|
||||
unlink($data_file);
|
||||
$sqlquery = splitsql($sqldump);
|
||||
unset($sqldump);
|
||||
foreach($sqlquery as $sql) {
|
||||
if(trim($sql) != '') {
|
||||
$db->query($sql);
|
||||
if(($sqlerror = $db->error()) && $db->errno() != 1062) {
|
||||
$json_data1="\"code\":2,";
|
||||
//$db->halt('MySQL Query Error', $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
$uid=$login_uid;
|
||||
if($json_data1)
|
||||
$json_data.=$json_data1;
|
||||
else
|
||||
$json_data.="\"code\":1,";
|
||||
set_log("数据导入");
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
$json_data=substr($json_data,0,-1)."}";
|
||||
echo $json_data;
|
||||
?>
|
||||
Reference in New Issue
Block a user