Ejemplo n.º 1
0
 public function exportStudentList($studentList)
 {
     $dao = M('dict_sex');
     $sexmapping = $dao->select();
     $dao = M('dict_companytype');
     $companytypemapping = $dao->select();
     $dao = M('dict_yesno');
     $yesnomapping = $dao->select();
     $dao = M('dict_level');
     $levelmapping = $dao->select();
     $dao = M('dict_state');
     $statemapping = $dao->select();
     $dao = M('dict_socialstatus');
     $socialstatusmapping = $dao->select();
     $data = array();
     foreach ($studentList as $k => $studentInfo) {
         $data[$k]['id'] = $studentInfo['id'];
         $data[$k]['ticketno'] = " " . $studentInfo['ticketno'];
         $data[$k]['createdate'] = $studentInfo['createdate'];
         $data[$k]['createpeople'] = $studentInfo['createpeople'];
         $data[$k]['seqno'] = $studentInfo['seqno'];
         $data[$k]['name'] = $studentInfo['name'];
         $data[$k]['namepinyin'] = $studentInfo['namepinyin'];
         $data[$k]['sex'] = arr2value($sexmapping, "id", "name", $studentInfo['sex']);
         $data[$k]['company'] = $studentInfo['company'];
         $data[$k]['companytype'] = arr2value($companytypemapping, "id", "name", $studentInfo['companytype']);
         $data[$k]['cross'] = arr2value($yesnomapping, "id", "name", $studentInfo['cross']);
         $data[$k]['level'] = arr2value($levelmapping, "id", "name", $studentInfo['level']);
         $data[$k]['superior'] = $studentInfo['superior'];
         $data[$k]['title'] = $studentInfo['title'];
         $data[$k]['birthplace'] = arr2value($statemapping, "id", "name", $studentInfo['birthplace']);
         $data[$k]['birthday'] = $studentInfo['birthday'];
         $data[$k]['photoid'] = $studentInfo['photoid'];
         $data[$k]['socialstatus'] = arr2value($socialstatusmapping, "id", "name", $studentInfo['socialstatus']);
         $data[$k]['graduateschool'] = $studentInfo['graduateschool'];
         $data[$k]['graduatedate'] = $studentInfo['graduatedate'];
         $data[$k]['systemseq'] = $studentInfo['systemseq'];
         $data[$k]['companyphone'] = $studentInfo['companyphone'];
         $data[$k]['companyfax'] = $studentInfo['companyfax'];
         $data[$k]['cellphone'] = $studentInfo['cellphone'];
         $data[$k]['email'] = $studentInfo['email'];
         $data[$k]['companyaddress'] = $studentInfo['companyaddress'];
         $data[$k]['homeaddress'] = $studentInfo['homeaddress'];
         $data[$k]['homephone'] = $studentInfo['homephone'];
         $data[$k]['passportnumber'] = $studentInfo['passportnumber'];
         $data[$k]['issuedate'] = $studentInfo['issuedate'];
         $data[$k]['expiredate'] = $studentInfo['expiredate'];
         $data[$k]['issuecountry'] = $studentInfo['issuecountry'];
         $data[$k]['fathername'] = $studentInfo['fathername'];
         $data[$k]['fatherbirthday'] = $studentInfo['fatherbirthday'];
         $data[$k]['mothername'] = $studentInfo['mothername'];
         $data[$k]['motherbirthday'] = $studentInfo['motherbirthday'];
         $data[$k]['spousename'] = $studentInfo['spousename'];
         $data[$k]['spousebirthday'] = $studentInfo['spousebirthday'];
         $data[$k]['spousebirthplace'] = arr2value($statemapping, "id", "name", $studentInfo['spousebirthplace']);
         $data[$k]['spousecellphone'] = $studentInfo['spousecellphone'];
         $data[$k]['childrenname'] = $studentInfo['childrenname'];
         $data[$k]['childrencomment'] = $studentInfo['childrencomment'];
         $data[$k]['name_en'] = $studentInfo['name_en'];
         $data[$k]['sex_en'] = $studentInfo['sex_en'];
         $data[$k]['birthday_en'] = $studentInfo['birthday_en'];
         $data[$k]['title_en'] = $studentInfo['title_en'];
         $data[$k]['company_en'] = $studentInfo['company_en'];
         $data[$k]['companyaddress_en'] = $studentInfo['companyaddress_en'];
         $data[$k]['homeaddress_en'] = $studentInfo['homeaddress_en'];
         $data[$k]['operator'] = $studentInfo['operator'];
         $data[$k]['operatorphone'] = $studentInfo['operatorphone'];
         $data[$k]['operatorfax'] = $studentInfo['operatorfax'];
         $data[$k]['operatorcellphone'] = $studentInfo['operatorcellphone'];
         $data[$k]['operatorcompany'] = $studentInfo['operatorcompany'];
         $data[$k]['operatoraddress'] = $studentInfo['operatoraddress'];
         $data[$k]['operatoremail'] = $studentInfo['operatoremail'];
         $data[$k]['comment'] = $studentInfo['comment'];
     }
     $headArr = array();
     foreach ($data as $field => $v) {
         if ($field == 'id') {
             $headArr[] = '用户id';
         }
         if ($field == 'ticketno') {
             $headArr[] = '单据编号';
         }
         if ($field == 'createdate') {
             $headArr[] = '制单日期';
         }
         if ($field == 'createpeople') {
             $headArr[] = '制单人员';
         }
         if ($field == 'seqno') {
             $headArr[] = '学员编号';
         }
         if ($field == 'name') {
             $headArr[] = '学员姓名';
         }
         if ($field == 'namepinyin') {
             $headArr[] = '姓名拼音';
         }
         if ($field == 'sex') {
             $headArr[] = '性别';
         }
         if ($field == 'company') {
             $headArr[] = '工作单位';
         }
         if ($field == 'companytype') {
             $headArr[] = '单位类别';
         }
         if ($field == 'cross') {
             $headArr[] = '双跨';
         }
         if ($field == 'level') {
             $headArr[] = '学员级别';
         }
         if ($field == 'superior') {
             $headArr[] = '上级单位';
         }
         if ($field == 'title') {
             $headArr[] = '职称职务';
         }
         if ($field == 'birthplace') {
             $headArr[] = '出生地';
         }
         if ($field == 'birthday') {
             $headArr[] = '出生日期';
         }
         if ($field == 'photoid') {
             $headArr[] = '身份证';
         }
         if ($field == 'socialstatus') {
             $headArr[] = '政治面貌';
         }
         if ($field == 'graduateschool') {
             $headArr[] = '毕业院校';
         }
         if ($field == 'graduatedate') {
             $headArr[] = '毕业日期';
         }
         if ($field == 'systemseq') {
             $headArr[] = '系统序号';
         }
         if ($field == 'companyphone') {
             $headArr[] = '单位电话';
         }
         if ($field == 'companyfax') {
             $headArr[] = '单位传真';
         }
         if ($field == 'cellphone') {
             $headArr[] = '手机';
         }
         if ($field == 'email') {
             $headArr[] = '邮箱';
         }
         if ($field == 'companyaddress') {
             $headArr[] = '单位地址';
         }
         if ($field == 'homeaddress') {
             $headArr[] = '家庭地址';
         }
         if ($field == 'homephone') {
             $headArr[] = '家庭电话';
         }
         if ($field == 'passportnumber') {
             $headArr[] = '护照号码';
         }
         if ($field == 'issuedate') {
             $headArr[] = '签发日期';
         }
         if ($field == 'expiredate') {
             $headArr[] = '失效日期';
         }
         if ($field == 'issuecountry') {
             $headArr[] = '签发机构';
         }
         if ($field == 'farthername') {
             $headArr[] = '父亲姓名';
         }
         if ($field == 'fartherbirthay') {
             $headArr[] = '父亲出生日期';
         }
         if ($field == 'mothername') {
             $headArr[] = '母亲姓名';
         }
         if ($field == 'motherbirthday') {
             $headArr[] = '母亲出生日期';
         }
         if ($field == 'spousename') {
             $headArr[] = '配偶姓名';
         }
         if ($field == 'spousebirthday') {
             $headArr[] = '配偶出生日期';
         }
         if ($field == 'spousebirthplace') {
             $headArr[] = '配偶出生地';
         }
         if ($field == 'spousecellphone') {
             $headArr[] = '配偶手机';
         }
         if ($field == 'childrenname') {
             $headArr[] = '子女姓名';
         }
         if ($field == 'childrencomment') {
             $headArr[] = '子女备注';
         }
         if ($field == 'name_en') {
             $headArr[] = '英文名字';
         }
         if ($field == 'sex_en') {
             $headArr[] = '英文性别';
         }
         if ($field == 'birthday_en') {
             $headArr[] = '英文生日';
         }
         if ($field == 'title_en') {
             $headArr[] = '英文职称';
         }
         if ($field == 'company_en') {
             $headArr[] = '英文单位名称';
         }
         if ($field == 'companyaddress_en') {
             $headArr[] = '英文单位地址';
         }
         if ($field == 'homeaddress_en') {
             $headArr[] = '英文家庭地址';
         }
         if ($field == 'operator') {
             $headArr[] = '经办人';
         }
         if ($field == 'operatorphone') {
             $headArr[] = '经办人电话';
         }
         if ($field == 'operatorfax') {
             $headArr[] = '经办人传真';
         }
         if ($field == 'operatorcellphone') {
             $headArr[] = '经办人手机';
         }
         if ($field == 'operatorcompany') {
             $headArr[] = '经办人单位';
         }
         if ($field == 'operatoraddress') {
             $headArr[] = '经办人地址';
         }
         if ($field == 'operatoremail') {
             $headArr[] = '经办人邮箱';
         }
         if ($field == 'comment') {
             $headArr[] = '备注';
         }
     }
     $filename = '用户列表';
     $this->getExcel($filename, $headArr, $data);
 }
Ejemplo n.º 2
0
 public function exportProjectList($projectList)
 {
     $dao = M('dict_bureau');
     $bureaumapping = $dao->select();
     $dao = M('dict_projecttype');
     $projecttypemapping = $dao->select();
     $dao = M('dict_country');
     $countrymapping = $dao->select();
     $dao = M('dict_trainingcenter');
     $trainingcentermapping = $dao->select();
     $dao = M('dict_year');
     $yearmapping = $dao->select();
     $dao = M('user');
     $usermapping = $dao->select();
     $data = array();
     foreach ($projectList as $k => $projectInfo) {
         $data[$k]['id'] = $projectInfo['id'];
         $data[$k]['seqno'] = $projectInfo['seqno'];
         $data[$k]['name'] = $projectInfo['name'];
         $data[$k]['ticketno'] = $projectInfo['ticketno'];
         $data[$k]['createdate'] = $projectInfo['createdate'];
         $data[$k]['createperson'] = $projectInfo['createperson'];
         $data[$k]['batchno'] = $projectInfo['batchno'];
         $data[$k]['bureau'] = arr2value($bureaumapping, "id", "name", $projectInfo['bureau']);
         $data[$k]['projecttype'] = arr2value($projecttypemapping, "id", "name", $projectInfo['projecttype']);
         $data[$k]['country'] = arr2value($countrymapping, "id", "name", $projectInfo['']);
         $data[$k]['planheadcount'] = $projectInfo['planheadcount'];
         $data[$k]['actualheadcount'] = $projectInfo['actualheadcount'];
         $data[$k]['trainingcentername'] = arr2value($trainingcentermapping, "id", "name", $projectInfo['trainingcentername']);
         $data[$k]['trainingday'] = $projectInfo['trainingday'];
         $data[$k]['leadername'] = $projectInfo['leadername'];
         $data[$k]['interpreter'] = $projectInfo['interpreter'];
         $data[$k]['bureauperson'] = $projectInfo['bureauperson'];
         $data[$k]['trainingtarget'] = $projectInfo['trainingtarget'];
         $data[$k]['specialnumber'] = $projectInfo['specialnumber'];
         $data[$k]['specialbatchnumber'] = $projectInfo['specialbatchnumber'];
         $data[$k]['projectyear'] = arr2value($yearmapping, "id", "name", $projectInfo['projectyear']);
         $data[$k]['trainingcontent'] = $projectInfo['trainingcontent'];
         $data[$k]['host'] = arr2value($usermapping, "id", "name", $projectInfo['host']);
         $data[$k]['reviewer'] = arr2value($usermapping, "id", "name", $projectInfo['reviewer']);
         $data[$k]['auditor'] = arr2value($usermapping, "id", "name", $projectInfo['auditor']);
         $data[$k]['comment'] = $projectInfo['comment'];
         $data[$k]['isactive'] = $projectInfo['isactive'];
         $data[$k]['status'] = $projectInfo['status'];
     }
     $headArr = array();
     foreach ($data as $field => $v) {
         if ($field == "id") {
             $headArr[] = "用户id";
         }
         if ($field == 'seqno') {
             $headArr[] = "项目编号";
         }
         if ($field == 'name') {
             $headArr[] = "项目名称";
         }
         if ($field == 'ticketno') {
             $headArr[] = "单据编号";
         }
         if ($field == 'createdate') {
             $headArr[] = "制单日期";
         }
         if ($field == 'createperson') {
             $headArr[] = "制单人员";
         }
         if ($field == 'batchno') {
             $headArr[] = "总局批号";
         }
         if ($field == 'bureau') {
             $headArr[] = "业务司局";
         }
         if ($field == 'projecttype') {
             $headArr[] = "项目类别";
         }
         if ($field == 'country') {
             $headArr[] = "前往国家";
         }
         if ($field == 'planheadcount') {
             $headArr[] = "计划人数";
         }
         if ($field == 'actualheadcount') {
             $headArr[] = "实际人数";
         }
         if ($field == 'trainingcentername') {
             $headArr[] = "培训机构";
         }
         if ($field == 'trainingday') {
             $headArr[] = "培训天数";
         }
         if ($field == 'leadername') {
             $headArr[] = "团长姓名";
         }
         if ($field == 'interpreter') {
             $headArr[] = "随团翻译";
         }
         if ($field == 'bureauperson') {
             $headArr[] = "司局人员";
         }
         if ($field == 'trainingtarget') {
             $headArr[] = "培训目的";
         }
         if ($field == 'specialnumber') {
             $headArr[] = "外专编号";
         }
         if ($field == 'specialbatchno') {
             $headArr[] = "外专批号";
         }
         if ($field == 'projectyear') {
             $headArr[] = "项目年度";
         }
         if ($field == 'trainingcontent') {
             $headArr[] = "培训内容";
         }
         if ($field == 'host') {
             $headArr[] = '主经办人';
         }
         if ($field == 'reviewer') {
             $headArr[] = '复核人';
         }
         if ($field == 'auditor') {
             $headArr[] = "审核人";
         }
         if ($field == 'comment') {
             $headArr[] = "备注公告";
         }
         if ($field == 'isactive') {
             $headArr[] = "是否启用";
         }
         if ($field == 'status') {
             $headArr[] = "项目状态";
         }
     }
     $filename = '项目列表';
     $this->getExcel($filename, $headArr, $data);
 }