<table class="text">
<tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 load($file_name,$encode='utf-8'); $sheet = $objPHPExcel->getSheet(0); $highestRow = $sheet->getHighestRow(); // 取得总行数 $highestColumn = $sheet->getHighestColumn(); // 取得总列数 for($i=1;$i<=$highestRow;$i++) { $data=array(); $data['A']=$objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue(); $data['A']=$this->geshihua($data['A']); $data['B']=$objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); $data['B']=$this->geshihua($data['B']); $data['C']=$objPHPExcel->getActiveSheet()->getCell("C".$i)->getValue(); $data['C']=$this->geshihua($data['C']); $data['D']=$objPHPExcel->getActiveSheet()->getCell("D".$i)->getValue(); $data['D']=$this->geshihua($data['D']); $data['E']=$objPHPExcel->getActiveSheet()->getCell("E".$i)->getValue(); $data['E']=$this->geshihua($data['E']); $data['F']=$objPHPExcel->getActiveSheet()->getCell("F".$i)->getValue(); $data['F']=$this->geshihua($data['F']); $data['G']=$objPHPExcel->getActiveSheet()->getCell("G".$i)->getValue(); $data['G']=$this->geshihua($data['G']); $data['H']=$objPHPExcel->getActiveSheet()->getCell("H".$i)->getValue(); $data['H']=$this->geshihua($data['H']); $data['I']=$objPHPExcel->getActiveSheet()->getCell("I".$i)->getValue(); $data['I']=$this->geshihua($data['I']); $data['J']=$objPHPExcel->getActiveSheet()->getCell("J".$i)->getValue(); $data['J']=$this->geshihua($data['J']); $data['K']=$objPHPExcel->getActiveSheet()->getCell("K".$i)->getValue(); $data['K']=$this->geshihua($data['K']); if(trim($data['A'])<>''){ $_data[]=$data; } } foreach ($_data as $key => $vale) { $z['serial_number']=trim($vale['A']); $z['sn_code']=md5('LLHB'.date('YmdHis') . str_pad(mt_rand(1,9999999),7,'0',STR_PAD_LEFT)); $z['name']=str_replace(' ','',$vale['B']); $z['identity']=trim($vale['C']); $z['address']=trim($vale['D']); $z['community']=trim($vale['E']); $z['relation']=str_replace(' ',$vale['F']); $z['relation_name']=str_replace(' ',$vale['G']); $z['first_contact']=str_replace(' ',$vale['H']); $z['first_contact_phone']=trim($vale['I']); $z['second_contact']=str_replace(' ',$vale['J']); $z['second_contact_phone']=trim($vale['K']); $z['station_id']='29'; $z['region_id']='1'; $p=array('uploads/image/20170120/'.trim($vale['A']).'.png','uploads/image/20170120/'.trim($vale['A']).'.png',); $z['picture']=json_encode($p); $z['add_time']=time(); M('n_people')->add($z); // pp($z); // $_z[]=$z; } // pp($_z); pp('123456');