HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.lkaiw.com/six/dr/shuju.php
<?php
         include_once('connect.php');//链接数据库
        require "PHPExcel/IOFactory.php";
		 
		require_once 'PHPExcel.class.php';
       require_once 'PHPExcel/Reader/Excel5.php';
	
	

        $excelio=PHPExcel_IOFactory::load($_FILES['excel']['tmp_name']); //第一个参数是表单提交的name,第二个是临时名
        $sheetcount=$excelio->getSheetCount();
        $datas=$excelio->getSheet(0)->toArray(); // 获取第一个sheet数据
        unset($datas[0]);  // 删除表头名字,
        echo "<pre>";
       // print_r ($datas);     //.....接着你就可以操作数据库入库了
       $dataszs=count($datas);//ecexl 里面的总行数
 
   $daodao=0;//默认导入0条数据 
   $fugai=0;//默认覆盖0条数据
 
 
 
    for($i=1;$i<=$dataszs;$i++){
		
		
		
		$linehao =$datas[$i][0]; //第一个字段 
		$linelj =$datas[$i][1];
 
		
 $data_valuesaa= "('$linehao','$linelj','1')";	
 $sqla = "SELECT * FROM xiao where linehao='$linehao'";
$resultaa = mysqli_query($conn, $sqla);
 		
 
	if($linehao!=""){
 	//不重复就插入数据开始
	$sql="insert into xiao (linehao,linelj,zhuantai) values $data_valuesaa";//批量插入数据表中
	
  //$sql="insert into user (name,linehao,crm_womzhq,crm_kkstpo,crm_uosiyv,crm_kmfcfu,crm_rzijih,crm_yqarrc,crm_vgpixi,crm_dmugeo,crm_bzffok,crm_desacu) values $data_valuesaa";//批量插入数据表中
	
	
	if ($conn->query($sql) === TRUE) {
	    
	    $daodao=$i;
	 
        //  echo "导入成功".$i."<br>";
} else {
 echo "导入失败订单是: " . $linehao . "<br>" . $conn->error;
}
	//不重复就插入数据结束
	
}
 //查询是否存在重复的值结束
 
				
		
		
		
		
	}
 
 
 
 
 
 
 
 
  // echo  $datasz[1][0].'<br>';
  // echo  $datasz[1][1].'<br>';
  // echo  $datasz[1][2].'<br>';

$tip = "总共导入".$dataszs."条数据。新增加".$daodao."条数据"."覆盖".$fugai."条数据";
   
  echo "<script>alert('" . $tip . "');history.go(-1);</script>";  
 

 
 
	
	?>