function import1()
 {
     $dir = $_FILES['file-name1'];
     $date = date("Y-m-d H:i:s");
     if ($_FILES['file-name1']['error'] == '0') {
         $type = substr($_FILES['file-name1']['type'], -5);
         //var_dump($type);die();
         if ($type == 'xlsx' || $type == '/kset' || $type == 'excel' || $type == 'sheet') {
             if ($_FILES['file-name1']['size'] <= 2000000) {
                 $filePath = $_FILES['file-name1']['tmp_name'];
                 //var_dump($filePath);die;
                 import("ORG.Util.MyExcel");
                 $excel = new MyExcel();
                 //var_dump($excel);die();
                 $excel->loadExcel($filePath);
                 $columnTitle = $excel->findColumnTitle();
                 //var_dump($columnTitle);die;
                 $strTitle = md5(trim(implode(',', $columnTitle)));
                 //$standard=md5("电话号码,ICCID,IP,产品型号,生产日期,WiFi-SSID,WiFi密码,备注,NULL");
                 $standard = md5("上网号");
                 //var_dump($standard);die;
                 if ($standard != $strTitle) {
                     echo "<script language='javascript'>alert('请选择正确的模板!');window.history.back(-1);</script>";
                 } else {
                     $data = $excel->findAll();
                     //echo "<pre>";
                     //var_dump($data);die();
                     //echo "</pre>";
                     //echo "<pre>";var_dump($data);echo "</pre>";die();
                     $shOb = M("flows");
                     if (count($data) <= 1) {
                         echo "<script language='javascript'>alert('无数据!');window.history.back(-1);</script>";
                     } else {
                         for ($i = 2; $i <= count($data); $i++) {
                             $reIn = $shOb->query("update r_flows set flow=0 where  CCID=" . $data[$i]['A']);
                         }
                         if ($reIn !== false) {
                             echo "<script language='javascript'>alert('导入成功!');window.history.back(-1);</script>";
                         }
                     }
                 }
             } else {
                 echo "<script language='javascript'>alert('文件过大!');window.history.back(-1);</script>";
             }
         } else {
             echo "<script language='javascript'>alert('文件类型不正确!');window.history.back(-1);</script>";
         }
     } else {
         echo "<script language='javascript'>alert('文件上传失败!');window.history.back(-1);</script>";
     }
 }
 public function import1()
 {
     $dir = $_FILES['file-name1'];
     /*
     echo "<pre>";
     var_dump($dir);
     echo "</pre>";die();
     */
     if ($_FILES['file-name1']['error'] == '0') {
         $type = substr($_FILES['file-name1']['type'], -5);
         // var_dump($type);die();
         if ($type == 'xlsx' || ($type = '/kset' || ($type = 'excel' || ($type = 'sheet')))) {
             if ($_FILES['file-name1']['size'] <= 2000000) {
                 $filePath = $_FILES['file-name1']['tmp_name'];
                 //var_dump($filePath);
                 import("ORG.Util.MyExcel");
                 $excel = new MyExcel();
                 //var_dump($excel);die();
                 $excel->loadExcel($filePath);
                 $columnTitle = $excel->findColumnTitle();
                 $strTitle = md5(trim(implode(',', $columnTitle)));
                 //$standard=md5("电话号码,ICCID,IP,产品型号,生产日期,WiFi-SSID,WiFi密码,备注");
                 $standard = md5("设备号,卡状态,配额类型,截止日期");
                 if ($standard != $strTitle) {
                     echo "<script language='javascript'>alert('请选择正确的模板!');window.history.back(-1);</script>";
                 } else {
                     $data = $excel->findAll();
                     //var_dump($data);exit();
                     //echo "<pre>";
                     //var_dump($data);die();
                     //echo "</pre>";
                     //echo "<pre>";var_dump($data);echo "</pre>";die();
                     if (count($data) <= 1) {
                         echo "<script language='javascript'>alert('无数据!');window.history.back(-1);</script>";
                     } else {
                         $dataStr = "";
                         for ($i = 2; $i <= count($data); $i++) {
                             //$dataStr.=",('".$data[$i]['A']."','".ip2long($data[$i]['B'])."','".$data[$i]['C']."','".$data[$i]['D']."','".$simBatch."',1)";
                             $shOb = M("simhard");
                             $type = stripcslashes($data[$i]['C']);
                             $deadTime = excelTime($data[$i]['D']);
                             //将时间日期字段做一下格式转换
                             //$deadTime = stripcslashes('2014-12-31');
                             $status = stripcslashes($data[$i]['B']);
                             if (stripcslashes($status) == "") {
                                 $status = 1;
                             }
                             $CCID = $data[$i]['A'];
                             $date = date("Y-m-d H:i:s");
                             $reIn = $shOb->query("update r_simhard set deadTime='{$deadTime}',type='{$type}',status='{$status}',updated_at='{$date}'  where CCID='{$CCID}'");
                         }
                         //$dataStr1=substr($dataStr,1); //var_dump($dataStr1);die();
                         if ($reIn !== false) {
                             echo "<script language='javascript'>alert('导入成功!');window.history.back(-1);</script>";
                         }
                     }
                 }
             } else {
                 echo "<script language='javascript'>alert('文件过大!');window.history.back(-1);</script>";
             }
         } else {
             echo "<script language='javascript'>alert('文件类型不正确!');window.history.back(-1);</script>";
         }
     } else {
         echo "<script language='javascript'>alert('文件上传失败!');window.history.back(-1);</script>";
     }
 }