error_reporting(E_ALL);
require './Common/Extend/Classes/PHPExcel.php';
require './Common/Extend/Classes/PHPExcel/Reader/Excel2007.php';
require './Common/Extend/Classes/PHPExcel/Reader/Excel5.php';
$info = $upload->getUploadFileInfo();
$filepath = "./Upimg/".$info[0][savename];
$PHPExcel = new PHPExcel();
$PHPReader = new PHPExcel_Reader_Excel2007();
$PHPExcel = $PHPReader->load($filepath);
$sheet = $PHPExcel->getActiveSheet();
$allCol=PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn());
$allRow=$sheet->getHighestRow();
$M=new Model;
for($j=2;$j<=$allRow;$j++)
{
$a = $PHPExcel->getActiveSheet()->getCell("A".$j)->getValue();//获取A列的值
$b = $PHPExcel->getActiveSheet()->getCell("B".$j)->getValue();//获取B列的值
$c = $PHPExcel->getActiveSheet()->getCell("C".$j)->getValue();//获取C列的值
$d = $PHPExcel->getActiveSheet()->getCell("D".$j)->getValue();//获取D列的值
$e = $PHPExcel->getActiveSheet()->getCell("E".$j)->getValue();//获取E列的值
$f = $PHPExcel->getActiveSheet()->getCell("F".$j)->getValue();//获取F列的值
$g = $PHPExcel->getActiveSheet()->getCell("G".$j)->getValue();//获取G列的值
$h = $PHPExcel->getActiveSheet()->getCell("H".$j)->getValue();//获取X列的值
$i = $PHPExcel->getActiveSheet()->getCell("I".$j)->getValue();//获取I列的值
$jj = $PHPExcel->getActiveSheet()->getCell("J".$j)->getValue();//获取J列的值
$k = $PHPExcel->getActiveSheet()->getCell("K".$j)->getValue();//获取K列的值
$l = $PHPExcel->getActiveSheet()->getCell("L".$j)->getValue();//获取L列的值
$m = $PHPExcel->getActiveSheet()->getCell("M".$j)->getValue();//获取M列的值
$n = $PHPExcel->getActiveSheet()->getCell("N".$j)->getValue();//获取N列的值
$p = $PHPExcel->getActiveSheet()->getCell("P".$j)->getValue();//获取P列的值
$qq = $PHPExcel->getActiveSheet()->getCell("Q".$j)->getValue();//获取Q列的值
$r = $PHPExcel->getActiveSheet()->getCell("R".$j)->getValue();//获取R列的值
$sql="insert into law_constant(true_name,email,sex,birthday,certificate_num,first_date,law_firm_name,law_firm_address,lawer_xueli,professional,school,work_year,occup_language,word_experience,hobbies) values('".$c."','".$p."','".$d."','".$jj."','".$b."','".$e."','".$f."','".$h."','".$i."','".$k."','".$l."','".$m."','".$n."','".$qq."','".$r."');";
$res=$M->query($sql);
}
if($res[0]==''){$this->success("导入数据库成功!",'__APP__/Lawerinfo/index');}
else{$this->error("导入数据库失败!","__APP__/Lawerinfo/index");}
}
}
}