Browse Source

swfupload修正

caipin 6 years ago
parent
commit
ed82668876

+ 1 - 1
global/js/hr.validator.js

@@ -14,7 +14,7 @@ $(function () {
 	    	,baseWage: 'required; '
 	    	,postWage: 'required; '
 	    	,hiredate: 'required; '
-	    			
+	    	,telephone:'mobile'
 		    ,achievementBonus: 'required; '
 	    }
 	});

+ 23 - 0
global/js/humanResource.js

@@ -327,6 +327,29 @@ $(function() {
 	$('a[employee-district]').click(function() {
 		var sidkey=$(this).attr('node-sidKey');
 		$("#sidKeyDistrict").val(sidkey);
+		var url = "/ajaxGetDistrictByLv1";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				serial : sidkey
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("#StaffDistrictHtml").html(data.html);
+					
+				} else
+					$("#StaffDistrictHtml").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+		
+		
+		
 	});
 	
 	//跳转到员工权限设置页面

+ 4 - 4
global/js/swfuplad2/fileprogress.js

@@ -77,9 +77,9 @@ FileProgress.prototype.setComplete = function () {
 	this.fileProgressElement.childNodes[3].style.width = "";
 
 	var oSelf = this;
-	setTimeout(function () {
-		oSelf.disappear();
-	}, 10000);
+//	setTimeout(function () {
+//		oSelf.disappear();
+//	}, 10000);
 };
 FileProgress.prototype.setError = function () {
 	this.fileProgressElement.className = "progressContainer red";
@@ -157,7 +157,7 @@ FileProgress.prototype.disappear1 = function () {
 			oSelf.disappear();
 		}, rate);
 	} else {
-		this.fileProgressWrapper.style.display = "none";
+		this.fileProgressWrapper.style.display = '';//"none";
 	}
 };
 

+ 42 - 11
global/js/swfuplad2/handlers.js

@@ -1,11 +1,4 @@
-/*
-		[Leo.C, Studio] (C)2004 - 2008
-		
-   		$Hanization: LeoChung $
-   		$E-Mail: who@imll.net $
-   		$HomePage: http://imll.net $
-   		$Date: 2008/11/8 18:02 $
-*/
+
 /* Demo Note:  This demo uses a FileProgress class that handles the UI for displaying the file name and percent complete.
 The FileProgress class is not part of SWFUpload.
 */
@@ -109,11 +102,11 @@ function uploadProgress(file, bytesLoaded, bytesTotal) {
 }
 
 function uploadSuccess(file, serverData) {
-	
 	try {
 		var progress = new FileProgress(file, this.customSettings.progressTarget);
 		progress.setComplete();
 		progress.setStatus("上传成功");
+		
 		progress.toggleCancel(false);
 
 	} catch (ex) {
@@ -178,8 +171,8 @@ function uploadComplete(file) {
 		
 		var progress = new FileProgress(file, this.customSettings.progressTarget);
 		progress.setComplete();
-		progress.setStatus("上传成功");
-		progress.toggleCancel(false);
+		progress.setStatus(file.name+"上传成功");
+		
 		
 		document.getElementById(this.customSettings.cancelButtonId).disabled = true;
 	}
@@ -190,3 +183,41 @@ function queueComplete(numFilesUploaded) {
 	var status = document.getElementById("divStatus");
 	status.innerHTML = numFilesUploaded + " 个文件" + (numFilesUploaded === 1 ? "" : "s") + "已上传.";
 }
+
+function uploadSuccessB(){
+	file = this.unescapeFilePostParams(file);
+	this.queueEvent("upload_success_handler", [file, serverData]);
+}
+
+function uploadSuccessDiploma (file, serverData) {
+	
+	var en=$('#diploma').val();
+	 var obj = JSON.parse(serverData);
+	if (en!='')
+		$('#diploma').val(en+'-'+obj.filename);
+	else
+		$('#diploma').val(obj.filename);
+	
+};
+
+function uploadSuccessProfessionalTitle (file,serverData) {
+	
+	var en=$('#professionalTitle').val();
+	 var obj = JSON.parse(serverData);
+	if (en!='')
+		$('#professionalTitle').val(en+'-'+obj.filename);
+	else
+		$('#professionalTitle').val(obj.filename);
+	
+};
+
+function uploadSuccessCertificate (file, serverData) {
+	
+	var en=$('#certificate').val();
+	 var obj = JSON.parse(serverData);
+	if (en!='')
+		$('#certificate').val(en+'-'+obj.filename);
+	else
+		$('#certificate').val(obj.filename);
+	
+};

+ 4 - 8
global/js/swfuplad2/swfupload.js

@@ -1,11 +1,4 @@
-/*
-		[Leo.C, Studio] (C)2004 - 2008
-		
-   		$Hanization: LeoChung $
-   		$E-Mail: who@imll.net $
-   		$HomePage: http://imll.net $
-   		$Date: 2008/11/8 18:02 $
-*/
+
 /**
  * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
  *
@@ -918,12 +911,15 @@ SWFUpload.prototype.uploadSuccess = function (file, serverData) {
 	tr.appendChild(td3); 
 	
 	var kt=document.getElementById('KT');
+	
+	if(kt!=null)
 	kt.appendChild(tr);
 	
 	
 	this.queueEvent("upload_success_handler", [file, serverData]);
 };
 
+
 SWFUpload.prototype.uploadComplete = function (file) {
 	file = this.unescapeFilePostParams(file);
 	this.queueEvent("upload_complete_handler", file);

+ 1 - 8
global/js/swfuplad2/swfupload.queue.js

@@ -1,11 +1,4 @@
-/*
-		[Leo.C, Studio] (C)2004 - 2008
-		
-   		$Hanization: LeoChung $
-   		$E-Mail: who@imll.net $
-   		$HomePage: http://imll.net $
-   		$Date: 2008/11/8 18:02 $
-*/
+
 /*
 	Queue Plug-in
 	

+ 31 - 0
protected/config/acl.conf.php

@@ -414,5 +414,36 @@ $acl ['RECEIPTS'] ['allow'] = array (
 				'receiptStatisticsStaffDetail',
 		)
 );
+//人资
+$acl ['HR'] ['allow'] = array (
+		'HumanResourceController' => array (
+				'settingEmployeeInfo',
+				'settingCredentialInfo',
+				'settingFinanceInfo',
+				'appliedDimission',
+				'employeeDismiss',
+				'employeeReentry',
+				'hrEmployee',
+				'staffAdd',
+				'staffUpdate',
+				'staffTransfer',
+				'employeeApprovals',
+				'employeeApprovalsAdd',
+				'employeeCCAdd',
+				'employeeInductionApprovals',
+				'employeeDimissionApprovals',
+				'leaveOfficeApprovals',
+				'employeeleaveCCAdd',
+				'employeeleaveApprovalsAdd',
+				'appliedEntry',
+				'hr',
+				'ajaxGetStaffInfoByType',
+				'ajaxGetStaffInfoBySid',
+				'ajaxGetDistrictByLv1',
+				'hrEmployeeApprovalsSetting',
+				'hrEmployeeAccess',
+				
+		)
+);
 
 ?>

+ 17 - 4
protected/config/routes.conf.php

@@ -520,13 +520,22 @@ $route['*']['/importInvoiceDo'] = array('InvoiceController', 'importInvoiceDo');
 $route['*']['/importInvoiceReceivables'] = array('InvoiceController', 'importInvoiceReceivables');
 $route['*']['/importInvoiceReceivablesDo'] = array('InvoiceController', 'importInvoiceReceivablesDo');
 
-$route['*']['/notificationConf'] = array('MainController', 'notificationConf');
-$route['*']['/ajaxSetNotificationConf'] = array('MainController', 'ajaxSetNotificationConf');
-
 //人资系统
 $route['*']['/settingEmployeeInfo'] = array('SettingController', 'settingEmployeeInfo');
 $route['*']['/settingCredentialInfo'] = array('SettingController', 'settingCredentialInfo');
 $route['*']['/settingFinanceInfo'] = array('SettingController', 'settingFinanceInfo');
+$route['*']['/settingPW'] = array('SettingController', 'settingPW');
+$route['*']['/settingPW/:msg'] = array('SettingController', 'settingPW');
+$route['*']['/updateMyPW'] = array('SettingController', 'updateMyPW');
+$route['*']['/notificationConf'] = array('SettingController', 'notificationConf');
+$route['*']['/ajaxSetNotificationConf'] = array('SettingController', 'ajaxSetNotificationConf');
+$route['post']['/staffUpdate'] = array('SettingController', 'staffUpdate');
+$route['post']['/settingCredentialInfoDo'] = array('SettingController', 'settingCredentialInfoDo');
+$route['post']['/settingCredentialInfoDo3'] = array('SettingController', 'settingCredentialInfoDo3');
+$route['post']['/settingCredentialInfoDo4'] = array('SettingController', 'settingCredentialInfoDo4');
+$route['post']['/settingCredentialInfoDo2'] = array('SettingController', 'settingCredentialInfoDo2');
+
+
 
 $route['*']['/appliedDimission'] = array('HumanResourceController', 'appliedDimission');
 $route['*']['/employeeDismiss'] = array('HumanResourceController', 'employeeDismiss');
@@ -534,7 +543,7 @@ $route['post']['/employeeReentry'] = array('HumanResourceController', 'employeeR
 
 $route['*']['/hrEmployee'] = array('HumanResourceController', 'hrEmployee');
 $route['post']['/staffAdd'] = array('HumanResourceController', 'staffAdd');
-$route['post']['/staffUpdate'] = array('HumanResourceController', 'staffUpdate');
+
 $route['post']['/staffTransfer'] = array('HumanResourceController', 'staffTransfer');
 
 $route['get']['/employeeApprovals'] = array('HumanResourceController', 'employeeApprovals');
@@ -550,6 +559,9 @@ $route['post']['/appliedEntry'] = array('HumanResourceController', 'appliedEntry
 $route['get']['/hr'] = array('HumanResourceController', 'hr');
 $route['post']['/ajaxGetStaffInfoByType'] = array('HumanResourceController', 'ajaxGetStaffInfoByType');
 $route['post']['/ajaxGetStaffInfoBySid'] = array('HumanResourceController', 'ajaxGetStaffInfoBySid');
+$route['post']['/ajaxGetDistrictByLv1'] = array('HumanResourceController', 'ajaxGetDistrictByLv1');
+
+
 //人资权限管理
 $route['*']['/hrEmployeeApprovalsSetting'] = array('HumanResourceController', 'hrEmployeeApprovalsSetting');
 $route['*']['/hrEmployeeAccess'] = array('HumanResourceController', 'hrEmployeeAccess');
@@ -557,6 +569,7 @@ $route['*']['/addUserDistrictAuthor'] = array('HumanResourceController', 'addUse
 
 
 
+
 //假期管理
 $route['*']['/myList'] = array('HolidayController', 'myList');
 $route['*']['/myList/:yearnum'] = array('HolidayController', 'myList');

+ 151 - 181
protected/controller/HumanResourceController.php

@@ -4,7 +4,37 @@
  * @author darkredz
  */
 class HumanResourceController extends DooController {
+	
 	public function beforeRun($resource, $action) {
+		
+		if($action=='appliedEntry'){
+			return '';
+		}
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		
+		if($detail['sid']!=superHR){
+		$accessModular = 'HR';
+		if (empty ( $detail ['cldAccessArray'] ))
+			die ( 'illegal request' );
+		else {
+			
+			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
+				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+					$flag = true;
+				} else {
+					$flag = false;
+				}
+			} else {
+				die ( 'illegal request' );
+			}
+		}
+		if (! $flag)
+			die ( 'illegal request' );
+		}
+		
 	}
 	function __construct() {
 		if (isset ( $_COOKIE ["staff"] )) {
@@ -115,13 +145,20 @@ class HumanResourceController extends DooController {
 			$staff->pendingApprovals = 0;
 			$staff->InductionDate = date ( "Y-m-d H:i:s" );
 			
- 			if($staffDetail['nature']==2)
-				$staffDetail->practiceDate= date ( "Y-m-d H:i:s" );
-			if($staffDetail['nature']==3)
-				$staffDetail->probationaryDate= date ( "Y-m-d H:i:s" );
+			if ($staffDetail ['nature'] == 2)
+				$staffDetail->practiceDate = date ( "Y-m-d H:i:s" );
+			if ($staffDetail ['nature'] == 3)
+				$staffDetail->probationaryDate = date ( "Y-m-d H:i:s" );
+			
+			$passwork=mt_rand(100000, 999999);
+			$staff->passwork = md5 ( $passwork );
 			
+			if (!empty($staffDetail['telephone'])&&is_numeric($staffDetail['telephone'])){
+				Doo::loadClass ( 'Human.func' );
+				$msg=$staffDetail['username'].','.$passwork;
+				send_sms(17280,$staffDetail['telephone'],'{"%msg%":"'.$msg.'"}');
+			}
 			
-			$staff->passwork = 'e10adc3949ba59abbe56e057f20f883e';
 		}
 		
 		$staff->updateDate = date ( "Y-m-d H:i:s" );
@@ -132,16 +169,16 @@ class HumanResourceController extends DooController {
 		// 操作日志
 		Doo::loadModel ( 'staffOperationLog' );
 		$staffOperationLog = new staffOperationLog ();
-		$nature='';
-		if($staffDetail['nature']==2){
-			$nature='实习';
-		}elseif($staffDetail['nature']==3){
-			$nature='试用';
+		$nature = '';
+		if ($staffDetail ['nature'] == 2) {
+			$nature = '实习';
+		} elseif ($staffDetail ['nature'] == 3) {
+			$nature = '试用';
 		}
 		
 		$item = array (
 				'date' => date ( "Y-m-d H:i:s" ),
-				'operation' => $this->staff ['username'] . "  审批通过" . $staffDetail ['username'].$nature."入职",
+				'operation' => $this->staff ['username'] . "  审批通过" . $staffDetail ['username'] . $nature . "入职",
 				'status' => 3,
 				'img' => $staffDetail ['avatar'],
 				'username' => $staffDetail ['username'],
@@ -149,8 +186,6 @@ class HumanResourceController extends DooController {
 				'category' => $staffDetail ['category'] 
 		);
 		
-		
-		
 		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
 		return '/hr';
@@ -245,11 +280,23 @@ class HumanResourceController extends DooController {
 	 * 员工信息
 	 */
 	function hrEmployee() {
+		
+// 		$passwork=mt_rand(100000, 999999);
+// 		//$staff->passwork = md5 ( $passwork );
+// 		$staffDetail['telephone']='13750039378';
+// 		$staffDetail['username']='欧桃珍';
+
+// 		if (!empty($staffDetail['telephone'])&&is_numeric($staffDetail['telephone'])){
+// 			Doo::loadClass ( 'Human.func' );
+// 			$msg=$staffDetail['username'].','.$passwork;
+// 			send_sms(17280,$staffDetail['telephone'],'{"%msg%":"'.$msg.'"}');
+// 		}
+		
 		$pendStatus = $this->get_args ( 'pendStatus' ) ? $this->get_args ( 'pendStatus' ) : "ALL";
 		$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : 'ALL';
 		$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : 'ALL';
 		$MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : '';
-		
+		//$this->send_sms();
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		
@@ -362,6 +409,11 @@ class HumanResourceController extends DooController {
 			$staffManage = new staffManage ();
 			
 			// 用户名检测
+			$detailStaff=$staff->getStaffByName($username);
+			//print_r($detailStaff);
+			if (!empty($detailStaff))
+				die ( 'illegal request3' );
+			
 			$staff->username = $username;
 			$staff->hiredate = $hiredate;
 			$staff->nature = $nature;
@@ -371,7 +423,7 @@ class HumanResourceController extends DooController {
 			$cid = $XDeode->decode ( $department [0] );
 			// 加入默认总部分类
 			if (! is_numeric ( $cid ))
-				die ( 'illegal request' );
+				die ( 'illegal request1' );
 			$cagegory = $L_category->getCategoryById ( $cid );
 			// 部门
 			if (! empty ( $department [1] )) {
@@ -411,7 +463,7 @@ class HumanResourceController extends DooController {
 			$cidMode = implode ( '_', $cidMode );
 			$staffManageDetail = $staffManage->getStaffManageByCid ( $cidMode );
 			if (empty ( $staffManageDetail ))
-				die ( 'illegal request' );
+				die ( 'illegal request2' );
 			
 			$pendingApprovalsSid = current ( $staffManageDetail ['staffList'] ) [0];
 			$staff->pendingApprovals = $pendingApprovalsSid;
@@ -430,12 +482,14 @@ class HumanResourceController extends DooController {
 			$id = $staff->insert ();
 			
 			// 更新假期相关信息
+			Doo::loadModel ( 'holidaystaff' );
 			$holidaystaff = new HStaff ();
 			$holidaystaff->uid = $id;
 			$holidaystaff->insert ();
+			$staff = new staff ();
 			
 			$staffmsg = $staff->getUserById ( $id );
-			$this->updateAnnualLeave ( $staffmsg [0] );
+			$this->updateAnnualLeave ( $staffmsg[0] );
 			
 			// 标签更新
 			for($i = 1; $i <= 7; $i ++) {
@@ -452,166 +506,24 @@ class HumanResourceController extends DooController {
 			$item = array (
 					'date' => date ( "Y-m-d H:i:s" ),
 					'status' => 1,
-					'img' => $staffmsg ['avatar'],
-					'username' => $staffmsg ['username'],
-					'uid' => $staffmsg ['sid'],
+					'img' => '/global/img/avtra',
+					'username' => $username,
+					'uid' => $id,
 					'operation' => "添加新员工",
-					'category' => $staffmsg ['category'] 
+					'category' => $cagegory [0] ['title'] 
 			);
 			$staffOperationLog->setInvoiceOperationLog ( $item );
-		}
-		return '/hrEmployee';
-	}
-	
-	/**
-	 * 更新员工信息
-	 */
-	function staffUpdate() {
-		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
-		
-		$username = $this->get_args ( 'username' ) ? $this->get_args ( 'username' ) : "";
-		$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : '';
-		$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : '';
-		$hiredate = $this->get_args ( 'hiredate' ) ? $this->get_args ( 'hiredate' ) : '';
-		$telephone = $this->get_args ( 'telephone' ) ? $this->get_args ( 'telephone' ) : '';
-		// $baseWage = is_numeric ( $this->get_args ( 'baseWage' ) ) ? $this->get_args ( 'baseWage' ) : 0;
-		// $postWage = is_numeric ( $this->get_args ( 'postWage' ) ) ? $this->get_args ( 'postWage' ) : 0;
-		// $achievementBonus = is_numeric ( $this->get_args ( 'achievementBonus' ) ) ? $this->get_args ( 'achievementBonus' ) : 0;
-		$gender = $this->get_args ( 'gender' ) ? $this->get_args ( 'gender' ) : '';
-		
-		$qq = is_numeric ( $this->get_args ( 'qq' ) ) ? $this->get_args ( 'qq' ) : 0;
-		$phone = is_numeric ( $this->get_args ( 'phone' ) ) ? $this->get_args ( 'phone' ) : 0;
-		$wecat = $this->get_args ( 'wecat' ) ? $this->get_args ( 'wecat' ) : '';
-		$email = $this->get_args ( 'email' ) ? $this->get_args ( 'email' ) : '';
-		
-		$birthday = $this->get_args ( 'birthday' ) ? $this->get_args ( 'birthday' ) : '';
-		$qualifications = $this->get_args ( 'qualifications' ) ? $this->get_args ( 'qualifications' ) : '';
-		$marriage = $this->get_args ( 'marriage' ) ? $this->get_args ( 'marriage' ) : '';
-		$IDcards = $this->get_args ( 'IDcards' ) ? $this->get_args ( 'IDcards' ) : '';
-		
-		$living = $this->get_args ( 'living' ) ? $this->get_args ( 'living' ) : '';
-		$nativePlace = $this->get_args ( 'nativePlace' ) ? $this->get_args ( 'nativePlace' ) : '';
-		$emergencyContacts = $this->get_args ( 'emergencyContacts' ) ? $this->get_args ( 'emergencyContacts' ) : '';
-		$remittanceName = $this->get_args ( 'remittanceName' ) ? $this->get_args ( 'remittanceName' ) : '';
-		$coupletNumber = $this->get_args ( 'coupletNumber' ) ? $this->get_args ( 'coupletNumber' ) : '';
-		$bankName = $this->get_args ( 'bankName' ) ? $this->get_args ( 'bankName' ) : '';
-		$bankNumber = $this->get_args ( 'bankNumber' ) ? $this->get_args ( 'bankNumber' ) : '';
-		
-		$salaryCard = $this->get_args ( 'salaryCard' ) ? $this->get_args ( 'salaryCard' ) : '';
-		$salaryBank = $this->get_args ( 'salaryBank' ) ? $this->get_args ( 'salaryBank' ) : '';
-		
-		$employeeInfo = $this->get_args ( 'employeeInfo' ) ? $this->get_args ( 'employeeInfo' ) : 'employeeInfo';
-		
-		if (! empty ( $sidKey )) {
-			
-			Doo::loadClass ( 'XDeode' );
-			$XDeode = new XDeode ( 5 );
-			Doo::loadModel ( 'staff' );
-			$staff = new staff ();
-			Doo::loadModel ( 'L_category' );
-			$L_category = new L_category ();
-			Doo::loadModel ( 'tag' );
-			Doo::loadModel ( 'holidaystaff' );
-			Doo::loadModel ( 'staffManage' );
-			$staffManage = new staffManage ();
-			
-			// 用户名检测
-			if (! empty ( $username )) {
-				$detail = $staff->getStaffByName ( $username );
-				if (empty ( $detail ))
-					die ( 'illegal request' );
-			}
-			$detail = $staff->getStaffBySid ( $sidKey );
-			if (empty ( $detail ))
-				die ( 'illegal request' );
-				// if (!empty($username))
-				// $staff->username = $username;
-			if (! empty ( $hiredate ))
-				$staff->hiredate = $hiredate;
-			if (! empty ( $position ))
-				$staff->position = $position;
-				
-				// 办事处-部门
-			if (! empty ( $cid_did )) {
-				$department = explode ( '_', $cid_did );
-				$cid = $XDeode->decode ( $department [0] );
-				// 加入默认总部分类
-				if (! is_numeric ( $cid ))
-					die ( 'illegal request' );
-				$cagegory = $L_category->getCategoryById ( $cid );
-				// 部门
-				if (! empty ( $department [1] )) {
-					$did = $XDeode->decode ( $department [1] );
-					if (! is_numeric ( $did ))
-						die ( 'illegal request' );
-					$staff->departmentID = $did;
-				}
-				$staff->cid = $cagegory [0] ['cid'];
-				$staff->category = $cagegory [0] ['title'];
-			}
-			
-			if (! empty ( $telephone ))
-				$staff->telephone = $telephone;
-				// if (!empty($baseWage))
-				// $staff->baseWage = $baseWage;
-				// if (!empty($postWage))
-				// $staff->postWage = $postWage;
-				// if (!empty($achievementBonus))
-				// $staff->achievementBonus = $achievementBonus;
-			if (! empty ( $gender ))
-				$staff->gender = $gender;
-			
-			if (! empty ( $qq ))
-				$staff->qq = $qq;
-			if (! empty ( $phone ))
-				$staff->phone = $phone;
-			if (! empty ( $wecat ))
-				$staff->wecat = $wecat;
-			if (! empty ( $email ))
-				$staff->email = $email;
-			if (! empty ( $birthday ))
-				$staff->birthday = $birthday;
-			if (! empty ( $$qualifications ))
-				$staff->qualifications = $qualifications;
-			if (! empty ( $marriage ))
-				$staff->marriage = $marriage;
-			if (! empty ( $IDcards ))
-				$staff->IDcards = $IDcards;
-			if (! empty ( $living ))
-				$staff->living = $living;
-			if (! empty ( $nativePlace ))
-				$staff->nativePlace = $nativePlace;
-			if (! empty ( $emergencyContacts ))
-				$staff->emergencyContacts = $emergencyContacts;
-			if (! empty ( $coupletNumber ))
-				$staff->coupletNumber = $coupletNumber;
-			if (! empty ( $bankName ))
-				$staff->bankName = $bankName;
-			if (! empty ( $bankNumber ))
-				$staff->bankNumber = $bankNumber;
-			if (! empty ( $remittanceName ))
-				$staff->remittanceName = $remittanceName;
-			
-			if (! empty ( $salaryCard ))
-				$staff->salaryCard = $salaryCard;
-			if (! empty ( $salaryBank ))
-				$staff->salaryBank = $salaryBank;
 			
-			$staff->update ( array (
-					'where' => 'sid=' . $detail ['sid'] 
-			) );
-			
-			if ($employeeInfo == 'employeeInfo') {
-				return '/hr';
-			} elseif ($employeeInfo == 'settingEmployeeInfo') {
-				return '/settingEmployeeInfo';
-			} elseif ($employeeInfo == 'settingFinanceInfo') {
-				return '/settingFinanceInfo';
+			if (!empty($telephone)&&is_numeric($telephone)){
+			Doo::loadClass ( 'Human.func' );
+			send_sms(17279,$telephone,'{"%name%":"'.$username.'"}');
 			}
 		}
-		die ( 'illegal request' );
+		return '/hrEmployee';
 	}
 	
+	
+	
 	/**
 	 * 员工转职
 	 */
@@ -820,11 +732,11 @@ class HumanResourceController extends DooController {
 				die ( 'illegal request' );
 				
 				// 工龄记录
-			$seniorityFormula = json_decode ( $detail ['seniorityFormula'],true );
+			$seniorityFormula = json_decode ( $detail ['seniorityFormula'], true );
 			$arr = array_keys ( $seniorityFormula );
 			$key = end ( $arr );
 			
-			if (isset($seniorityFormula [$key] ['dimissionDate'])||empty ( $seniorityFormula [$key] ['dimissionDate'] ))
+			if (isset ( $seniorityFormula [$key] ['dimissionDate'] ) || empty ( $seniorityFormula [$key] ['dimissionDate'] ))
 				$seniorityFormula [$key] ['dimissionDate'] = date ( "Y-m-d H:i:s" );
 			else
 				die ( 'illegal request' );
@@ -1301,8 +1213,6 @@ class HumanResourceController extends DooController {
 		$staff = new staff ();
 		Doo::loadModel ( 'L_category' );
 		$L_category = new L_category ();
-		Doo::loadModel ( 'district' );
-		$district = new district ();
 		
 		$stafflist = $staff->getStaffByCondition ( $con );
 		
@@ -1331,6 +1241,8 @@ class HumanResourceController extends DooController {
 		$monthend = date ( 'm.d', mktime ( 0, 0, 0, date ( 'm' ) + 1, 0, date ( 'Y' ) ) );
 		
 		// 员工可选的
+		Doo::loadModel ( 'district' );
+		$district = new district ();
 		$this->data ['districtList'] = $district->get_lv ( 1 );
 		
 		$this->data ['onJobCount'] = $onJobCount;
@@ -1508,14 +1420,13 @@ class HumanResourceController extends DooController {
 								<th class="taC" width="150">婚姻状况</th><td>
 										
 										';
-										
-				if ($detail ['marriage']==0) 
-				$html.='未婚';
-				elseif($detail ['marriage']==1)
-				$html.='已婚';
-					
-										
-								$html.='
+				
+				if ($detail ['marriage'] == 0)
+					$html .= '未婚';
+				elseif ($detail ['marriage'] == 1)
+					$html .= '已婚';
+				
+				$html .= '
 												</td>
 							</tr>
 							<tr>
@@ -1925,6 +1836,61 @@ class HumanResourceController extends DooController {
 	}
 	
 	/**
+	 * 获得客户地区
+	 */
+	function ajaxGetDistrictByLv1() {
+		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
+		
+		if (empty ( $serial )) {
+			echo json_encode ( array (
+					'status' => 2,
+					'msg' => 'illegal request' 
+			) );
+			die ();
+		}
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+
+		$sid = $XDeode->decode ( $serial );
+		$detail = $staff->getStaffBySid ( $sid );
+		
+		// 员工可选的
+		Doo::loadModel ( 'district' );
+		$district = new district ();
+		$districtList = $district->get_lv ( 1 );
+		
+		$did=explode(',',$detail['did']);
+		
+		$html='';
+		foreach ($districtList as $key=>$value){
+			$falg=true;
+			foreach ($did as $k=>$v){
+				if ($value['didKey']==$v){
+					$html.='<label class="checkbox inline">
+					  <input type="checkbox" name="didKey[]" checked value="'.$value['didKey'].'">'.$value['name'].'
+					</label>';
+					unset($did[$k]);
+					$falg=false;
+					break;
+				}
+			}
+			
+			if ($falg)
+				$html.='<label class="checkbox inline">
+					  <input type="checkbox" name="didKey[]"  value="'.$value['didKey'].'">'.$value['name'].'
+					</label>';
+		}
+		echo json_encode ( array (
+				'status' => 1,
+				'html' => $html
+		) );
+		
+	}
+	
+	/**
 	 * 生成工号
 	 */
 	function createJobNumber() {
@@ -1955,6 +1921,8 @@ class HumanResourceController extends DooController {
 		return $list;
 	}
 	
+	
+	
 	/**
 	 * 获取get或者POST值
 	 *
@@ -1978,12 +1946,14 @@ class HumanResourceController extends DooController {
 	
 	// 检查年假是否过期并更新年假
 	private function updateAnnualLeave($staff) {
+		
 		Doo::loadModel ( 'holidaystaff' );
 		$hstaff = new HStaff ();
 		$hstaffmsg = $hstaff->getOne ( array (
 				'where' => 'uid=' . $staff ['sid'],
 				'asArray' => TRUE 
 		) );
+		
 		$hiredate = $staff ['hiredate'];
 		$hadyear = intval ( (time () - strtotime ( $hiredate )) / (86400 * 365) );
 		if ($hadyear != $hstaffmsg ['hadyear']) {

+ 71 - 65
protected/controller/MainController.php

@@ -61,9 +61,10 @@ class MainController extends DooController {
 		$detail=array();
 		if(isset($_COOKIE ["staff"]))
 			$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		else 
+			$detail['sid']=0;
 		
 		$flag = false;
-		
 		$accessModular = 'EMAIL';
 		if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
 			$flag = true;
@@ -74,7 +75,7 @@ class MainController extends DooController {
 		if ($flag === false) {
 		$accessModular = 'INFORMATION';
 		if (empty ( $detail ['cldAccessArray'] ))
-			die ( 'illegal request' );
+			return '/settingEmployeeInfo';
 		else {
 			
 			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
@@ -84,7 +85,7 @@ class MainController extends DooController {
 					$flag = false;
 				}
 			} else {
-				die ( 'illegal request' );
+				$flag = false;
 			}
 		}
 		}
@@ -103,7 +104,7 @@ class MainController extends DooController {
 						$flag = false;
 					}
 				} else {
-					die ( 'illegal request' );
+					$flag = false;
 				}
 			}
 		}
@@ -121,18 +122,23 @@ class MainController extends DooController {
 						$flag = false;
 					}
 				} else {
-					die ( 'illegal request' );
+					$flag = false;
 				}
 			}
 		}
 		
-		if (! $flag)
+		if ($detail['sid']==superHR&&!$flag)
+			return '/settingEmployeeInfo';
+		elseif(! $flag&&$action=='logStatistics')
+			return '/settingEmployeeInfo';
+		elseif(! $flag)
 			die ( 'illegal request' );
+			
+		
 	}
 	function __construct() {
 		
 		// phpinfo();die;
-		
 		// include './protected/config/common.conf.php';
 		// include $config['BASE_PATH'].'diagnostic/debug.php';
 		if (isset ( $_COOKIE ["staff"] )) {
@@ -5609,65 +5615,65 @@ class MainController extends DooController {
 	/**
 	 * 微信通知设置
 	 */
-	function notificationConf() {
-		Doo::loadModel ( "notificationConf" );
-		$notificationConf = new notificationConf ();
-		
-		$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
-		
-		$rule = json_decode ( $detail ['conf'], true );
-		
-		$data ['rule'] = $rule;
-		$data ['memu'] = "notificationConf";
-		$data ['staff'] = $this->staff;
-		
-		$this->render ( "/admin/invoiceNotificationConf", $data );
-	}
-	function ajaxSetNotificationConf() {
-		$notificationType = $this->get_args ( 'notificationType' ) ? $this->get_args ( 'notificationType' ) : "";
-		$notificationValue = $this->get_args ( 'notificationValue' ) ? $this->get_args ( 'notificationValue' ) : '';
-		
-		if (! empty ( $notificationType ) && ! empty ( $notificationValue ) && ! empty ( $this->staff [0] ['sid'] )) {
-			Doo::loadModel ( "notificationConf" );
-			$notificationConf = new notificationConf ();
-			
-			$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
-			
-			if (empty ( $detail )) {
-				$rule = array (
-						$notificationType => $notificationValue 
-				);
-				$rule = json_encode ( $rule );
-				$item = array (
-						'sid' => $this->staff [0] ['sid'],
-						'conf' => $rule 
-				);
+// 	function notificationConf() {
+// 		Doo::loadModel ( "notificationConf" );
+// 		$notificationConf = new notificationConf ();
+		
+// 		$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
+		
+// 		$rule = json_decode ( $detail ['conf'], true );
+		
+// 		$data ['rule'] = $rule;
+// 		$data ['memu'] = "notificationConf";
+// 		$data ['staff'] = $this->staff;
+		
+// 		$this->render ( "/admin/invoiceNotificationConf", $data );
+// 	}
+// 	function ajaxSetNotificationConf() {
+// 		$notificationType = $this->get_args ( 'notificationType' ) ? $this->get_args ( 'notificationType' ) : "";
+// 		$notificationValue = $this->get_args ( 'notificationValue' ) ? $this->get_args ( 'notificationValue' ) : '';
+		
+// 		if (! empty ( $notificationType ) && ! empty ( $notificationValue ) && ! empty ( $this->staff [0] ['sid'] )) {
+// 			Doo::loadModel ( "notificationConf" );
+// 			$notificationConf = new notificationConf ();
+			
+// 			$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
+			
+// 			if (empty ( $detail )) {
+// 				$rule = array (
+// 						$notificationType => $notificationValue 
+// 				);
+// 				$rule = json_encode ( $rule );
+// 				$item = array (
+// 						'sid' => $this->staff [0] ['sid'],
+// 						'conf' => $rule 
+// 				);
 				
-				$notificationConf->addNotification ( $item );
-			} else {
-				$rule = json_decode ( $detail ['conf'], true );
-				$rule [$notificationType] = $notificationValue;
-				$rule = json_encode ( $rule );
-				$item = array (
-						'nid' => $detail ['nid'],
-						'conf' => $rule 
-				);
-				$notificationConf->setNotificationByCondition ( $item );
-			}
-			echo json_encode ( array (
-					'status' => 1,
-					'msgType' => $notificationType,
-					'msg' => '' 
-			) );
-			die ();
-		}
-		echo json_encode ( array (
-				'status' => 2,
-				'msgType' => $notificationType,
-				'msg' => 'illegal request' 
-		) );
-		die ();
-	}
+// 				$notificationConf->addNotification ( $item );
+// 			} else {
+// 				$rule = json_decode ( $detail ['conf'], true );
+// 				$rule [$notificationType] = $notificationValue;
+// 				$rule = json_encode ( $rule );
+// 				$item = array (
+// 						'nid' => $detail ['nid'],
+// 						'conf' => $rule 
+// 				);
+// 				$notificationConf->setNotificationByCondition ( $item );
+// 			}
+// 			echo json_encode ( array (
+// 					'status' => 1,
+// 					'msgType' => $notificationType,
+// 					'msg' => '' 
+// 			) );
+// 			die ();
+// 		}
+// 		echo json_encode ( array (
+// 				'status' => 2,
+// 				'msgType' => $notificationType,
+// 				'msg' => 'illegal request' 
+// 		) );
+// 		die ();
+// 	}
 	function eMailTask() {
 		Doo::loadModel ( 'tag' );
 		$tag = new tag ();

+ 21 - 21
protected/controller/ReceiptController.php

@@ -69,27 +69,27 @@ class ReceiptController extends DooController {
 				die ( 'illegal request' );
 		}
 		
-// 		Doo::loadModel ( 'staff' );
-// 		$staff = new staff ();
-// 		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
-		
-// 		$accessModular = 'RECEIPTS';
-// 		if (empty ( $detail ['cldAccessArray'] ))
-// 			die ( 'illegal request' );
-// 		else {
-			
-// 			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
-// 				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
-// 					$flag = true;
-// 				} else {
-// 					$flag = false;
-// 				}
-// 			} else {
-// 				die ( 'illegal request' );
-// 			}
-// 		}
-// 		if (! $flag)
-// 			die ( 'illegal request' );
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		
+		$accessModular = 'RECEIPTS';
+		if (empty ( $detail ['cldAccessArray'] ))
+			die ( 'illegal request' );
+		else {
+			
+			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
+				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+					$flag = true;
+				} else {
+					$flag = false;
+				}
+			} else {
+				die ( 'illegal request' );
+			}
+		}
+		if (! $flag)
+			die ( 'illegal request' );
 	}
 	function __construct() {
 		if (isset ( $_COOKIE ["staff"] )) {

+ 521 - 13
protected/controller/SettingController.php

@@ -5,25 +5,25 @@
  */
 class SettingController extends DooController {
 	
+	public $staff=array();
+	
 	public function beforeRun($resource, $action) {
-		
 	}
-	
 	function __construct() {
 		if (isset ( $_COOKIE ["staff"] )) {
 			if (! empty ( $_COOKIE ["staff"] )) {
 				Doo::loadModel ( 'staff' );
 				$staff = new staff ();
-	
-				$this->staff= $staff->getStaffBySid( $_COOKIE ["staff"] );
+				
+				$this->staff = $staff->getStaffBySid ( $_COOKIE ["staff"] );
 				return "/";
 			}
 		}
-	
+		
 		Doo::loadCore ( 'uri/DooUriRouter' );
 		$router = new DooUriRouter ();
 		$routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
-	
+		
 		if ($routeRs ['1'] != "login") {
 			header ( 'Content-Type:text/html;charset=utf-8' );
 			@header ( "Location: /login" );
@@ -33,7 +33,7 @@ class SettingController extends DooController {
 	/**
 	 * 员工信息
 	 */
-	function settingEmployeeInfo(){
+	function settingEmployeeInfo() {
 		$this->data ['staff'] = $this->staff;
 		$this->data ['memu'] = "adminmyinfo";
 		$this->data ['hrMemu'] = "settingEmployeeInfo";
@@ -43,7 +43,7 @@ class SettingController extends DooController {
 	/**
 	 * 证件信息
 	 */
-	function settingCredentialInfo(){
+	function settingCredentialInfo() {
 		$this->data ['staff'] = $this->staff;
 		$this->data ['memu'] = "adminmyinfo";
 		$this->data ['hrMemu'] = "settingEmployeeInfo";
@@ -53,13 +53,511 @@ class SettingController extends DooController {
 	/**
 	 * 财务信息
 	 */
-	function settingFinanceInfo(){
+	function settingFinanceInfo() {
 		$this->data ['staff'] = $this->staff;
 		$this->data ['memu'] = "adminmyinfo";
 		$this->data ['hrMemu'] = "settingEmployeeInfo";
 		
 		$this->render ( "/setting/settingFinanceInfo", $this->data );
 	}
+	function settingPW() {
+		$this->data ['msg'] = urldecode ( $this->params ['msg'] );
+		
+		$this->data ['staff'] = $this->staff;
+		$this->data ['memu'] = "adminmyinfo";
+		$this->data ['hrMemu'] = "settingPW";
+		
+		$this->render ( "/setting/settingPW", $this->data );
+	}
+	
+	/*
+	 * 更新密码
+	 */
+	function updateMyPW() {
+		$oldpassword = $this->get_args ( 'oldpassword' ) ? $this->get_args ( 'oldpassword' ) : "";
+		$newpassword = $this->get_args ( 'newpassword' ) ? $this->get_args ( 'newpassword' ) : "";
+		$rnewpassword = $this->get_args ( 'rnewpassword' ) ? $this->get_args ( 'rnewpassword' ) : "";
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'staffDynamic' );
+		$staffDynamic = new staffDynamic ();
+		
+		$staff->sid = $this->staff ['sid'];
+		
+		$msg = "更新成功";
+		
+		if ($this->staff ['passwork'] == md5 ( $oldpassword )) {
+			if ($newpassword == $rnewpassword && (! empty ( $newpassword )))
+				$staff->passwork = md5 ( $newpassword );
+			else
+				$msg = "密码不一致";
+		} else {
+			if ($oldpassword != "")
+				$msg = "密码错误";
+		}
+		
+		$staff->update ( array (
+				'where' => ' sid=' . $this->staff ['sid'] 
+		) );
+		
+		return "/settingPW/" . $msg;
+	}
+	
+	/**
+	 * 微信通知设置
+	 */
+	function notificationConf() {
+		Doo::loadModel ( "notificationConf" );
+		$notificationConf = new notificationConf ();
+		
+		$detail = $notificationConf->getNotificationConfBySid ( $this->staff ['sid'] );
+		
+		$rule = json_decode ( $detail ['conf'], true );
+		if (! isset ( $rule ['approval'] ))
+			$rule ['approval'] = '';
+		if (! isset ( $rule ['print'] ))
+			$rule ['print'] = '';
+		if (! isset ( $rule ['receivables'] ))
+			$rule ['receivables'] = '';
+		
+		$this->data ['rule'] = $rule;
+		$this->data ['memu'] = "adminmyinfo";
+		$this->data ['hrMemu'] = "notificationConf";
+		$this->data ['staff'] = $this->staff;
+		
+		$this->render ( "/setting/invoiceNotificationConf", $this->data );
+	}
+	
+	/**
+	 * 异步设置微信通知
+	 */
+	function ajaxSetNotificationConf() {
+		$notificationType = $this->get_args ( 'notificationType' ) ? $this->get_args ( 'notificationType' ) : "";
+		$notificationValue = $this->get_args ( 'notificationValue' ) ? $this->get_args ( 'notificationValue' ) : '';
+		
+		if (! empty ( $notificationType ) && ! empty ( $notificationValue ) && ! empty ( $this->staff ['sid'] )) {
+			Doo::loadModel ( "notificationConf" );
+			$notificationConf = new notificationConf ();
+			
+			$detail = $notificationConf->getNotificationConfBySid ( $this->staff ['sid'] );
+			
+			if (empty ( $detail )) {
+				$rule = array (
+						$notificationType => $notificationValue 
+				);
+				$rule = json_encode ( $rule );
+				$item = array (
+						'sid' => $this->staff ['sid'],
+						'conf' => $rule 
+				);
+				
+				$notificationConf->addNotification ( $item );
+			} else {
+				$rule = json_decode ( $detail ['conf'], true );
+				$rule [$notificationType] = $notificationValue;
+				$rule = json_encode ( $rule );
+				$item = array (
+						'nid' => $detail ['nid'],
+						'conf' => $rule 
+				);
+				$notificationConf->setNotificationByCondition ( $item );
+			}
+			echo json_encode ( array (
+					'status' => 1,
+					'msgType' => $notificationType,
+					'msg' => '' 
+			) );
+			die ();
+		}
+		echo json_encode ( array (
+				'status' => 2,
+				'msgType' => $notificationType,
+				'msg' => 'illegal request' 
+		) );
+		die ();
+	}
+	
+	/**
+	 * 更新员工信息
+	 */
+	function staffUpdate() {
+		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
+		
+		$username = $this->get_args ( 'username' ) ? $this->get_args ( 'username' ) : "";
+		$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : '';
+		$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : '';
+		$hiredate = $this->get_args ( 'hiredate' ) ? $this->get_args ( 'hiredate' ) : '';
+		$telephone = $this->get_args ( 'telephone' ) ? $this->get_args ( 'telephone' ) : '';
+		// $baseWage = is_numeric ( $this->get_args ( 'baseWage' ) ) ? $this->get_args ( 'baseWage' ) : 0;
+		// $postWage = is_numeric ( $this->get_args ( 'postWage' ) ) ? $this->get_args ( 'postWage' ) : 0;
+		// $achievementBonus = is_numeric ( $this->get_args ( 'achievementBonus' ) ) ? $this->get_args ( 'achievementBonus' ) : 0;
+		$gender = $this->get_args ( 'gender' ) ? $this->get_args ( 'gender' ) : '';
+		
+		$qq = is_numeric ( $this->get_args ( 'qq' ) ) ? $this->get_args ( 'qq' ) : 0;
+		$phone = is_numeric ( $this->get_args ( 'phone' ) ) ? $this->get_args ( 'phone' ) : 0;
+		$wecat = $this->get_args ( 'wecat' ) ? $this->get_args ( 'wecat' ) : '';
+		$email = $this->get_args ( 'email' ) ? $this->get_args ( 'email' ) : '';
+		
+		$birthday = $this->get_args ( 'birthday' ) ? $this->get_args ( 'birthday' ) : '';
+		$qualifications = $this->get_args ( 'qualifications' ) ? $this->get_args ( 'qualifications' ) : '';
+		$marriage = $this->get_args ( 'marriage' ) ? $this->get_args ( 'marriage' ) : '';
+		$IDcards = $this->get_args ( 'IDcards' ) ? $this->get_args ( 'IDcards' ) : '';
+		
+		$living = $this->get_args ( 'living' ) ? $this->get_args ( 'living' ) : '';
+		$nativePlace = $this->get_args ( 'nativePlace' ) ? $this->get_args ( 'nativePlace' ) : '';
+		$emergencyContacts = $this->get_args ( 'emergencyContacts' ) ? $this->get_args ( 'emergencyContacts' ) : '';
+		$remittanceName = $this->get_args ( 'remittanceName' ) ? $this->get_args ( 'remittanceName' ) : '';
+		$coupletNumber = $this->get_args ( 'coupletNumber' ) ? $this->get_args ( 'coupletNumber' ) : '';
+		$bankName = $this->get_args ( 'bankName' ) ? $this->get_args ( 'bankName' ) : '';
+		$bankNumber = $this->get_args ( 'bankNumber' ) ? $this->get_args ( 'bankNumber' ) : '';
+		
+		$salaryCard = $this->get_args ( 'salaryCard' ) ? $this->get_args ( 'salaryCard' ) : '';
+		$salaryBank = $this->get_args ( 'salaryBank' ) ? $this->get_args ( 'salaryBank' ) : '';
+		
+		$employeeInfo = $this->get_args ( 'employeeInfo' ) ? $this->get_args ( 'employeeInfo' ) : 'employeeInfo';
+		
+		if (! empty ( $sidKey )) {
+			
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			Doo::loadModel ( 'staff' );
+			$staff = new staff ();
+			Doo::loadModel ( 'L_category' );
+			$L_category = new L_category ();
+			Doo::loadModel ( 'tag' );
+			Doo::loadModel ( 'holidaystaff' );
+			Doo::loadModel ( 'staffManage' );
+			$staffManage = new staffManage ();
+			
+			// 用户名检测
+			if (! empty ( $username )) {
+				$detail = $staff->getStaffByName ( $username );
+				if (empty ( $detail ))
+					die ( 'illegal request' );
+			}
+			$detail = $staff->getStaffBySid ( $sidKey );
+			if (empty ( $detail ))
+				die ( 'illegal request' );
+				// if (!empty($username))
+				// $staff->username = $username;
+			if (! empty ( $hiredate ))
+				$staff->hiredate = $hiredate;
+			if (! empty ( $position ))
+				$staff->position = $position;
+				
+				// 办事处-部门
+			if (! empty ( $cid_did )) {
+				$department = explode ( '_', $cid_did );
+				$cid = $XDeode->decode ( $department [0] );
+				// 加入默认总部分类
+				if (! is_numeric ( $cid ))
+					die ( 'illegal request' );
+				$cagegory = $L_category->getCategoryById ( $cid );
+				// 部门
+				if (! empty ( $department [1] )) {
+					$did = $XDeode->decode ( $department [1] );
+					if (! is_numeric ( $did ))
+						die ( 'illegal request' );
+					$staff->departmentID = $did;
+				}
+				$staff->cid = $cagegory [0] ['cid'];
+				$staff->category = $cagegory [0] ['title'];
+			}
+			
+			if (! empty ( $telephone ))
+				$staff->telephone = $telephone;
+				// if (!empty($baseWage))
+				// $staff->baseWage = $baseWage;
+				// if (!empty($postWage))
+				// $staff->postWage = $postWage;
+				// if (!empty($achievementBonus))
+				// $staff->achievementBonus = $achievementBonus;
+			if (! empty ( $gender ))
+				$staff->gender = $gender;
+			
+			if (! empty ( $qq ))
+				$staff->qq = $qq;
+			if (! empty ( $phone ))
+				$staff->phone = $phone;
+			if (! empty ( $wecat ))
+				$staff->wecat = $wecat;
+			if (! empty ( $email ))
+				$staff->email = $email;
+			if (! empty ( $birthday ))
+				$staff->birthday = $birthday;
+			if (! empty ( $$qualifications ))
+				$staff->qualifications = $qualifications;
+			if (! empty ( $marriage ))
+				$staff->marriage = $marriage;
+			if (! empty ( $IDcards ))
+				$staff->IDcards = $IDcards;
+			if (! empty ( $living ))
+				$staff->living = $living;
+			if (! empty ( $nativePlace ))
+				$staff->nativePlace = $nativePlace;
+			if (! empty ( $emergencyContacts ))
+				$staff->emergencyContacts = $emergencyContacts;
+			if (! empty ( $coupletNumber ))
+				$staff->coupletNumber = $coupletNumber;
+			if (! empty ( $bankName ))
+				$staff->bankName = $bankName;
+			if (! empty ( $bankNumber ))
+				$staff->bankNumber = $bankNumber;
+			if (! empty ( $remittanceName ))
+				$staff->remittanceName = $remittanceName;
+			
+			if (! empty ( $salaryCard ))
+				$staff->salaryCard = $salaryCard;
+			if (! empty ( $salaryBank ))
+				$staff->salaryBank = $salaryBank;
+			
+			$staff->update ( array (
+					'where' => 'sid=' . $detail ['sid'] 
+			) );
+			
+			if ($employeeInfo == 'employeeInfo') {
+				return '/hr';
+			} elseif ($employeeInfo == 'settingEmployeeInfo') {
+				return '/settingEmployeeInfo';
+			} elseif ($employeeInfo == 'settingFinanceInfo') {
+				return '/settingFinanceInfo';
+			}
+		}
+		die ( 'illegal request' );
+	}
+	
+	/**
+	 * 证件文件上传
+	 */
+	function settingCredentialInfoDo() {
+		
+		$IDcards = is_numeric ( $this->get_args ( 'IDcards' ) ) ? $this->get_args ( 'IDcards' ) : 0;
+		$certificate =  $this->get_args ( 'certificate' )  ? $this->get_args ( 'certificate' ) : '';
+		$diploma =  $this->get_args ( 'diploma' )  ? $this->get_args ( 'diploma' ) : '';
+		$professionalTitle =  $this->get_args ( 'professionalTitle' )  ? $this->get_args ( 'professionalTitle' ) : '';
+		
+		
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		$save_path = DOO::conf ()->SITE_PATH . "upload/credentialInfo/";
+		$webSite=WEB_SITE.'/upload/credentialInfo/';
+		
+		if (!empty($IDcards))
+			$staff->IDcards=$IDcards;
+		
+		$msg = '';
+		$file_name = 'IDcardsImgA_'. $this->staff['sid'].'.'. $this->_GetFileEXT ( $_FILES ["IDcardsImgA"] ['name'] );
+		if (!empty($_FILES ["IDcardsImgA"] ["size"])){
+			if (! @move_uploaded_file ( $_FILES ["IDcardsImgA"] ["tmp_name"], $save_path . $file_name )) 
+				$msg .= "文件无法保存";
+			else{
+				$staff->IDcardsImgA=$webSite . $file_name;
+			}
+		}
+			
+		$file_name = 'IDcardsImgB_'. $this->staff['sid'].'.' . $this->_GetFileEXT ( $_FILES ["IDcardsImgB"] ['name'] );
+		if (!empty($_FILES ["IDcardsImgB"] ["size"]))
+		if (! @move_uploaded_file ( $_FILES ["IDcardsImgB"] ["tmp_name"], $save_path . $file_name )) {
+			$msg .= "文件无法保存";
+		}else{
+			$staff->IDcardsImgB=$webSite . $file_name;
+		}
+		
+		if (!empty($certificate)){
+			$certificateArray=explode("-", $certificate);
+			$staff->certificate=json_encode($certificateArray);
+		}
+		
+// 		$file_name = 'certificate_'. $this->staff['sid'].'.' . $this->_GetFileEXT ( $_FILES ["certificate"] ['name'] );
+// 		if (!empty($_FILES ["certificate"] ["size"]))
+// 		if (! @move_uploaded_file ( $_FILES ["certificate"] ["tmp_name"], $save_path . $file_name )) {
+// 			$msg .= "文件无法保存";
+// 		}else{
+// 			$staff->certificate=$webSite . $file_name;
+// 		}
+		
+// 		$file_name = 'diploma_'. $this->staff['sid'].'.' . $this->_GetFileEXT ( $_FILES ["diploma"] ['name'] );
+// 		if (!empty($_FILES ["diploma"] ["size"]))
+// 		if (! @move_uploaded_file ( $_FILES ["diploma"] ["tmp_name"], $save_path . $file_name )) {
+// 			$msg .= "文件无法保存";
+// 		}else{
+// 			$staff->diploma=$webSite . $file_name;
+// 		}
+		
+		$staff->update(array('where'=>'sid='.$this->staff['sid']));
+		//return '/settingCredentialInfo';
+	}
+	
+	/**
+	 * 上传学位证书
+	 * @return string
+	 */
+	function settingCredentialInfoDo3() {
+		$POST_MAX_SIZE = ini_get ( 'post_max_size' );
+		$unit = strtoupper ( substr ( $POST_MAX_SIZE, - 1 ) );
+		$multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
+	
+		if (( int ) $_SERVER ['CONTENT_LENGTH'] > $multiplier * ( int ) $POST_MAX_SIZE && $POST_MAX_SIZE) {
+			header ( "HTTP/1.1 500 Internal Server Error" );
+			echo "POST exceeded maximum allowed size.";
+			exit ( 0 );
+		}
+	
+		// Settings
+		$save_path = DOO::conf ()->SITE_PATH . "upload/credentialInfo/"; // The path were we will save the file (getcwd() may not be reliable and should be tested in your environment)
+		$upload_name = "Filedata";
+		$max_file_size_in_bytes = 2147483647; // 2GB in bytes
+		$extension_whitelist = array (
+				"doc",
+				"txt",
+				"jpg",
+				"gif",
+				"png"
+		); // Allowed file extensions
+		$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format)
+		 
+		// Other variables
+		$MAX_FILENAME_LENGTH = 260;
+		$file_name = "";
+		$file_extension = "";
+		$uploadErrors = array (
+				0 => "文件上传成功",
+				1 => "上传的文件超过了 php.ini 文件中的 upload_max_filesize directive 里的设置",
+				2 => "上传的文件超过了 HTML form 文件中的 MAX_FILE_SIZE directive 里的设置",
+				3 => "上传的文件仅为部分文件",
+				4 => "没有文件上传",
+				6 => "缺少临时文件夹"
+		);
+	
+		$nk = time ();
+		$file_name = 'diploma_'. $this->staff['sid'].'_'.$nk.'.' . $this->_GetFileEXT ( $_FILES [$upload_name] ['name'] );
+		
+		if (! @move_uploaded_file ( $_FILES [$upload_name] ["tmp_name"], $save_path . $file_name )) {
+			echo "文件无法保存.";
+			exit ( 0 );
+		}
+	
+		echo json_encode ( array (
+				'filename' => $file_name,
+				'id' => $nk
+		) );
+		exit ( 0 );
+	}
+	
+	/**
+	 * 上传职称证书
+	 * @return string
+	 */
+	function settingCredentialInfoDo4() {
+		$POST_MAX_SIZE = ini_get ( 'post_max_size' );
+		$unit = strtoupper ( substr ( $POST_MAX_SIZE, - 1 ) );
+		$multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
+	
+		if (( int ) $_SERVER ['CONTENT_LENGTH'] > $multiplier * ( int ) $POST_MAX_SIZE && $POST_MAX_SIZE) {
+			header ( "HTTP/1.1 500 Internal Server Error" );
+			echo "POST exceeded maximum allowed size.";
+			exit ( 0 );
+		}
+	
+		// Settings
+		$save_path = DOO::conf ()->SITE_PATH . "upload/credentialInfo/"; // The path were we will save the file (getcwd() may not be reliable and should be tested in your environment)
+		$upload_name = "Filedata";
+		$max_file_size_in_bytes = 2147483647; // 2GB in bytes
+		$extension_whitelist = array (
+				"doc",
+				"txt",
+				"jpg",
+				"gif",
+				"png"
+		); // Allowed file extensions
+		$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format)
+			
+		// Other variables
+		$MAX_FILENAME_LENGTH = 260;
+		$file_name = "";
+		$file_extension = "";
+		$uploadErrors = array (
+				0 => "文件上传成功",
+				1 => "上传的文件超过了 php.ini 文件中的 upload_max_filesize directive 里的设置",
+				2 => "上传的文件超过了 HTML form 文件中的 MAX_FILE_SIZE directive 里的设置",
+				3 => "上传的文件仅为部分文件",
+				4 => "没有文件上传",
+				6 => "缺少临时文件夹"
+		);
+	
+		$nk = time ();
+		$file_name = 'professionalTitle_'. $this->staff['sid'].'_'.$nk.'.' . $this->_GetFileEXT ( $_FILES [$upload_name] ['name'] );
+	
+		if (! @move_uploaded_file ( $_FILES [$upload_name] ["tmp_name"], $save_path . $file_name )) {
+			echo "文件无法保存.";
+			exit ( 0 );
+		}
+	
+		echo json_encode ( array (
+				'filename' => $file_name,
+				'id' => $nk
+		) );
+		exit ( 0 );
+	}
+	
+	/**
+	 * 上传毕业证书
+	 * @return string
+	 */
+	function settingCredentialInfoDo2() {
+		$POST_MAX_SIZE = ini_get ( 'post_max_size' );
+		$unit = strtoupper ( substr ( $POST_MAX_SIZE, - 1 ) );
+		$multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
+	
+		if (( int ) $_SERVER ['CONTENT_LENGTH'] > $multiplier * ( int ) $POST_MAX_SIZE && $POST_MAX_SIZE) {
+			header ( "HTTP/1.1 500 Internal Server Error" );
+			echo "POST exceeded maximum allowed size.";
+			exit ( 0 );
+		}
+	
+		// Settings
+		$save_path = DOO::conf ()->SITE_PATH . "upload/credentialInfo/"; // The path were we will save the file (getcwd() may not be reliable and should be tested in your environment)
+		$upload_name = "Filedata";
+		$max_file_size_in_bytes = 2147483647; // 2GB in bytes
+		$extension_whitelist = array (
+				"doc",
+				"txt",
+				"jpg",
+				"gif",
+				"png"
+		); // Allowed file extensions
+		$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format)
+			
+		// Other variables
+		$MAX_FILENAME_LENGTH = 260;
+		$file_name = "";
+		$file_extension = "";
+		$uploadErrors = array (
+				0 => "文件上传成功",
+				1 => "上传的文件超过了 php.ini 文件中的 upload_max_filesize directive 里的设置",
+				2 => "上传的文件超过了 HTML form 文件中的 MAX_FILE_SIZE directive 里的设置",
+				3 => "上传的文件仅为部分文件",
+				4 => "没有文件上传",
+				6 => "缺少临时文件夹"
+		);
+	
+		$nk = time ();
+		$file_name = 'certificate_'. $this->staff['sid'].'_'.$nk.'.' . $this->_GetFileEXT ( $_FILES [$upload_name] ['name'] );
+	
+		if (! @move_uploaded_file ( $_FILES [$upload_name] ["tmp_name"], $save_path . $file_name )) {
+			echo "文件无法保存.";
+			exit ( 0 );
+		}
+	
+		echo json_encode ( array (
+				'filename' => $file_name,
+				'id' => $nk
+		) );
+		exit ( 0 );
+	}
 	
 	/**
 	 * 获取get或者POST值
@@ -71,16 +569,26 @@ class SettingController extends DooController {
 		if (isset ( $_GET [$name] )) {
 			if (is_array ( $_GET [$name] ))
 				return $_GET [$name];
-				else
-					return addslashes ( $_GET [$name] );
+			else
+				return addslashes ( $_GET [$name] );
 		} elseif (isset ( $_POST [$name] )) {
 			if (is_array ( $_POST [$name] ))
 				return $_POST [$name];
-				else
-					return addslashes ( $_POST [$name] );
+			else
+				return addslashes ( $_POST [$name] );
 		} else
 			return false;
 	}
+	
+	/**
+	 * 旧输入导入
+	 */
+	function _GetFileEXT($filename) {
+		$pics = explode ( '.', $filename );
+		$num = count ( $pics );
+		return $pics [$num - 1];
+	}
+	
 }
 
 ?>

+ 17 - 0
protected/model/staff.php

@@ -69,9 +69,26 @@ class staff extends DooModel {
 	
 	public $cldAccess;
 	
+	
+	public $IDcards;
+	public $IDcardsImgA;
+	public $certificate;
+	public $diploma;
+	public $professionalTitle;
+	public $IDcardsImgB;
+	
+	
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
 	public $_fields = array (
+			
+			'IDcards',
+			'IDcardsImgA',
+			'IDcardsImgB',
+			'certificate',
+			'diploma',
+			'professionalTitle',
+			
 			'sid',
 			'username',
 			'staffManage',

+ 18 - 0
protected/plugin/TemplateTag.php

@@ -23,6 +23,7 @@ Doo::conf ()->TEMPLATE_GLOBAL_TAGS = array (
 		'isReceiptAuthorityShow',
 		'isInvoiceAggregateCompanyShow',
 		'forMatAccess',
+		'isShowMenu',
 		'isInvoiceCategoryShow'
 );
 
@@ -57,6 +58,23 @@ function isTimeTR($day = 3,$cTime) {
 	
 	return $flag;
 }
+
+function isShowMenu($menu=''){
+	Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$st = $staff->getStaffBySid( $_COOKIE ["staff"] );
+		
+		$cldAccess=json_decode($st['cldAccess'],true);
+		
+		if (empty($cldAccess))
+			return false;
+		if (in_array($menu,$cldAccess)||($st['sid']==superHR&&$menu=='HR')){
+			return true;
+		}
+		return false;
+}
+
+
 function isInvoiceNew($type = "GLOBAL") {
 	Doo::loadModel ( 'invoice' );
 	$invoice = new invoice ();

+ 14 - 3
protected/view/menu.html

@@ -1,33 +1,44 @@
 
+<!-- if isShowMenu('INFORMATION') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine">
 <a href="/" class="icon- <!-- if {{memu}}=="index" --> selected <!-- endif --> ">B</a>
 </li>
+<!-- endif -->
 
+<!-- if isShowMenu('DIRECTORIES') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录">
 <a href="/contacts" class="icon- <!-- if {{memu}}=="contacts" --> selected <!-- endif -->">A</a>
 </li>
+<!-- endif -->
 
+<!-- if isShowMenu('LOCK') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
 <a href="/keyonline" class="icon- <!-- if {{memu}}=="keyonline" --> selected <!-- endif -->">C</a>
 </li>
+<!-- endif -->
 
-
-
+<!-- if isShowMenu('RECEIPTS') -->
 <li  data-placement="right" data-toggle="ctooltip" class="topLine <!-- if   getGlobals('NEW') != 0 || getGlobals('NEW2') != 0  --> news <!-- endif -->" data-original-title="费用管理"  >
 <a href="/saeaBorad" class="icon- <!-- if {{memu}}=="receipt" --> selected <!-- endif -->" >U</a>
 </li>  
+<!-- endif -->
 
+<!-- if isShowMenu('INVOICE') -->
 <li data-placement="right" data-toggle="ctooltip" <!-- if isInvoiceNew() --> class="news" <!-- endif --> data-original-title="发票申请">
 <a href="/invoice" class="icon- <!-- if {{memu}}=="invoice" --> selected <!-- endif -->">D</a>
 </li>
+<!-- endif -->
 
-
+<!-- if isShowMenu('HR') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="人资管理">
 <a href="/hr" class="icon- <!-- if {{memu}}=="HumanResource" --> selected <!-- endif -->">m</a>
 </li>
+<!-- endif -->
 
+<!-- if isShowMenu('EMAIL') -->
 <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
 <a href="/eMailTask" class="icon- <!-- if {{memu}}=="eMailTask" --> selected <!-- endif -->">Z</a></li>
+<!-- endif -->
 
 <li data-placement="right" data-toggle="ctooltip" data-original-title="假期管理">
     <a href="/myList" class="icon- <!-- if {{memu}}=="holiday" --> selected <!-- endif -->">X</a>

+ 209 - 23
protected/view/setting/settingCredentialInfo.html

@@ -1,4 +1,127 @@
 <!-- include '../header' -->
+
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/swfuplad2/swfupload.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/swfuplad2/swfupload.queue.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/swfuplad2/fileprogress.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/swfuplad2/handlers.js"></script>
+
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/setting.js"></script>
+
+<script type="text/javascript">
+
+		var swfu;
+		var diplomaSwf;
+		var CertificateSwf;
+		
+		window.onload = function() {
+			var settings = {
+					flash_url : "<?= WEB_SITE_GLOBAL ?>js/swfuplad2/swfupload.swf",
+					upload_url: "/settingCredentialInfoDo4",	// Relative to the SWF file
+					
+					file_size_limit : "8 MB",
+					file_types : "*.jpg;*.gif;*.png",
+ 					file_types_description : "*.jpg;*.gif;*.png",
+					file_upload_limit : 8,
+					file_queue_limit : 3,
+					custom_settings : {
+						progressTarget : "fsUploadProgress",
+						cancelButtonId : "btnCancel"
+					},
+					debug: true,
+
+					// Button settings
+					button_image_url: "<?= WEB_SITE_GLOBAL ?>images/btn-normal1.jpg",	// Relative to the Flash file
+					button_width: "200",
+					button_height: "40",
+					button_placeholder_id: "spanButtonPlaceHolder",
+
+					// The event handler functions are defined in handlers.js
+					file_queued_handler : fileQueued,
+					file_queue_error_handler : fileQueueError,
+					file_dialog_complete_handler : fileDialogComplete,
+					upload_start_handler : uploadStart,
+					upload_progress_handler : uploadProgress,
+					upload_error_handler : uploadError,
+					upload_success_handler : uploadSuccessProfessionalTitle,
+					upload_complete_handler : uploadComplete,
+					queue_complete_handler : queueComplete	// Queue plugin event
+				};
+
+				swfu = new SWFUpload(settings);
+			
+			
+			var diplomaSettings = {
+					flash_url : "<?= WEB_SITE_GLOBAL ?>js/swfuplad2/swfupload.swf",
+					upload_url: "/settingCredentialInfoDo3",	// Relative to the SWF file
+					
+					file_size_limit : "8 MB",
+					file_types : "*.jpg;*.gif;*.png",
+					file_types_description : "*.jpg;*.gif;*.png",
+					file_upload_limit : 8,
+					file_queue_limit : 3,
+					custom_settings : {
+						progressTarget : "fsUploadProgress",
+						cancelButtonId : "btnCancel"
+					},
+					debug: false,
+
+					button_image_url: "<?= WEB_SITE_GLOBAL ?>images/btn-normal1.jpg",	// Relative to the Flash file
+					
+					button_width: "200",
+					button_height: "40",
+					button_placeholder_id: "spanButtonDiploma",
+					
+					// The event handler functions are defined in handlers.js
+					file_queued_handler : fileQueued,
+					file_queue_error_handler : fileQueueError,
+					file_dialog_complete_handler : fileDialogComplete,
+					upload_start_handler : uploadStart,
+					upload_progress_handler : uploadProgress,
+					upload_error_handler : uploadError,
+					upload_success_handler : uploadSuccessDiploma,
+					upload_complete_handler : uploadComplete,
+					queue_complete_handler : queueComplete	// 上传完成后,提示上传成功多少文件
+				};
+			diplomaSwf=new SWFUpload(diplomaSettings);
+	
+			var CertificateSettings = {
+					flash_url : "<?= WEB_SITE_GLOBAL ?>js/swfuplad2/swfupload.swf",
+					upload_url: "/settingCredentialInfoDo2",	// Relative to the SWF file
+					
+					file_size_limit : "8 MB",
+					file_types : "*.jpg;*.gif;*.png",
+					file_types_description : "*.jpg;*.gif;*.png",
+					file_upload_limit : 8,
+					file_queue_limit : 3,
+					custom_settings : {
+						progressTarget : "fsUploadProgress",
+						cancelButtonId : "btnCancel"
+					},
+					debug: false,
+
+					button_image_url: "<?= WEB_SITE_GLOBAL ?>images/btn-normal1.jpg",	// Relative to the Flash file
+
+					button_width: "200",
+					button_height: "40",
+					button_placeholder_id: "spanButtonCertificate",
+
+					file_queued_handler : fileQueued,
+					file_queue_error_handler : fileQueueError,
+					file_dialog_complete_handler : fileDialogComplete,
+					upload_start_handler : uploadStart,
+					upload_progress_handler : uploadProgress,
+					upload_error_handler : uploadError,
+					upload_success_handler : uploadSuccessCertificate,
+					upload_complete_handler : uploadComplete,
+					queue_complete_handler : queueComplete	// 上传完成后,提示上传成功多少文件
+				};
+			CertificateSwf=new SWFUpload(CertificateSettings);
+			
+			
+			
+	     };
+	</script>
+
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -27,65 +150,128 @@
 				</div>
 				
 				
-				
-				
-				
-				
 				<!--证件信息-->
 				<div class="saeaList" style="width:900px">
-				<form method="post" action="/staffUpdate"  >
+				<form method="post" action="/settingCredentialInfoDo" enctype="multipart/form-data"  >
 				<input type="hidden" name="sidKey" id='sidKey'  value="{{staff.sidKey}}">
-				<input type="hidden" name="employeeInfo"   value="settingCredentialInfo">
+				
+				
+				<input type="hidden" id="professionalTitle" name="professionalTitle" value="">
+				<input type="hidden" id="diploma" name="diploma"   value="">
+				<input type="hidden" id="certificate" name="certificate"   value="">
+				
 					<table class="table table-bordered table-condensed">
 						<tr>
-							<th class="taC" width="150">身份证号码</th><td colspan="3"><input type="text" value="{{staff.IDcards}}"></td>
+							<th class="taC" width="150">身份证号码</th>
+							<td colspan="3"><input type="text" name="IDcards" value="{{staff.IDcards}}"></td>
 						</tr>
 						<tr>
-							<th class="taC" width="150">正面(国徽)</th><td width="260"><input type="file"></td>
+							<th class="taC" width="150">正面(国徽)</th>
+							<td width="260"><input type="file" name="IDcardsImgA">
+							</td>
 							<td colspan="2">
 								<p>
-									正面(国徽) <a href="#" target="_blank">查看</a>
+									<!-- if !{{empty(staff.IDcardsImgA)}} -->
+									正面(国徽) <a href="{{staff.IDcardsImgA}}" target="_blank">查看</a>
+									<!-- endif -->
 								</p>
 							</td>
 						</tr>
 						<tr>
-							<th class="taC" width="150">反面(照片)</th><td width="260"><input type="file"></td>
+							<th class="taC" width="150">反面(照片)</th><td width="260"><input type="file" name="IDcardsImgB"></td>
 							<td colspan="2">
 								<p>
-									正面(照片) <a href="#" target="_blank">查看</a>
+								<!-- if !{{empty(staff.IDcardsImgB)}} -->
+									正面(照片) <a href="{{IDcardsImgB}}" target="_blank">查看</a>
+									<!-- endif -->
+									 
 								</p>
 							</td>
 						</tr>
 					</table>
+					
+					
+					
 					<table class="table table-bordered table-condensed">
 						<tr>
-							<th class="taC" width="150">毕业证书</th><td width="260"><input type="file"></td>
+							<th class="taC" width="150">毕业证书</th><td width="260">
+							
+							<div class="controls">
+			            	<span id="spanButtonCertificate"></span>			
+			            	</div>
+							
+							
+							</td>
 							<td colspan="2">
-								<p>
-									毕业证书1 <a href="#" target="_blank">查看</a> <a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
-								</p>
+								
+									<!-- if !{{empty(staff.certificate)}} -->
+									<p>
+									毕业证书1 <a href="IDcardsImgB" target="_blank">查看</a>
+									<a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
+									</p>
+									<!-- endif -->
+								
+								
 							</td>
 						</tr>
 						<tr>
-							<th class="taC" width="150">学位证书</th><td width="260"><input type="file"></td>
+							<th class="taC" width="150">学位证书</th><td width="260">
+							
+							
+						<div class="controls">
+			            	<span id="spanButtonDiploma"></span>	
+			            </div>
+						
+							
+							
+							</td>
 							<td colspan="2">
-								<p>
-									学位证书1 <a href="#" target="_blank">查看</a> <a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
-								</p>
+								
+									<!-- if !{{empty(staff.diploma)}} -->
+									<p>
+									学位证书1 <a href="IDcardsImgB" target="_blank">查看</a>
+									<a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
+									</p>
+									<!-- endif -->
+								
+								
 							</td>
 						</tr>
+						
+						
+						
 						<tr>
-							<th class="taC" width="150">职称证书</th><td width="260"><input type="file"></td>
+							<th class="taC" width="150">职称证书</th><td width="260">
+							
+						<!-- flash 上传 -->
+						<div class="controls">
+			            	<span id="spanButtonPlaceHolder"></span>			
+			            </div>
+						
+			            
+							
 							<td colspan="2">
+							
+							
+							<!-- if !{{empty(staff.professionalTitle)}} -->
 								<p>
 									职称证书1 <a href="#" target="_blank">查看</a> <a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
 								</p>
-								<p>
-									职称证书2 <a href="#" target="_blank">查看</a> <a href="#" data-toggle="modal" role="button" title="删除职称证书1">删除</a>
-								</p>
+							<!-- endif -->	
+								
+								
+								
 							</td>
 						</tr>
 					</table>
+					
+					<!-- flash上传提示 -->
+					<input id="btnCancel" type="button" value="取消所有上传" style="display:none" onclick="swfu.cancelQueue();" disabled="disabled">		
+					<span class="fieldset flash" id="fsUploadProgress"></span>
+					<span id="divStatus">0 个文件已上传</span>
+					
+					
+					
 					<div class="control-group">
 						<div class="controls">
 							<button type="submit" class="button">确认修改</button>

+ 2 - 2
protected/view/setting/settingMenu.html

@@ -2,6 +2,6 @@
 						<li><a href="admin-myinfo-borard.html">员工首页</a></li>
 						
 						<li><a href="/settingEmployeeInfo" <!-- if {{hrMemu}}=="settingEmployeeInfo" --> class="selected" <!-- endif --> >员工信息</a></li>
-						<li><a href="admin-myinfo-wechat.html">微信通知</a></li>
-						<li><a href="admin-myinfo-pw.html" target="">修改密码</a></li>
+						<li><a <!-- if {{hrMemu}}=="notificationConf" --> class="selected" <!-- endif --> href="/notificationConf">微信通知</a></li>
+						<li><a href="/settingPW" <!-- if {{hrMemu}}=="settingPW" --> class="selected" <!-- endif --> target="">修改密码</a></li>
 					</ul>