|
@@ -4,7 +4,37 @@
|
|
* @author darkredz
|
|
* @author darkredz
|
|
*/
|
|
*/
|
|
class HumanResourceController extends DooController {
|
|
class HumanResourceController extends DooController {
|
|
|
|
+
|
|
public function beforeRun($resource, $action) {
|
|
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() {
|
|
function __construct() {
|
|
if (isset ( $_COOKIE ["staff"] )) {
|
|
if (isset ( $_COOKIE ["staff"] )) {
|
|
@@ -115,13 +145,20 @@ class HumanResourceController extends DooController {
|
|
$staff->pendingApprovals = 0;
|
|
$staff->pendingApprovals = 0;
|
|
$staff->InductionDate = date ( "Y-m-d H:i:s" );
|
|
$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" );
|
|
$staff->updateDate = date ( "Y-m-d H:i:s" );
|
|
@@ -132,16 +169,16 @@ class HumanResourceController extends DooController {
|
|
// 操作日志
|
|
// 操作日志
|
|
Doo::loadModel ( 'staffOperationLog' );
|
|
Doo::loadModel ( 'staffOperationLog' );
|
|
$staffOperationLog = new 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 (
|
|
$item = array (
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
- 'operation' => $this->staff ['username'] . " 审批通过" . $staffDetail ['username'].$nature."入职",
|
|
|
|
|
|
+ 'operation' => $this->staff ['username'] . " 审批通过" . $staffDetail ['username'] . $nature . "入职",
|
|
'status' => 3,
|
|
'status' => 3,
|
|
'img' => $staffDetail ['avatar'],
|
|
'img' => $staffDetail ['avatar'],
|
|
'username' => $staffDetail ['username'],
|
|
'username' => $staffDetail ['username'],
|
|
@@ -149,8 +186,6 @@ class HumanResourceController extends DooController {
|
|
'category' => $staffDetail ['category']
|
|
'category' => $staffDetail ['category']
|
|
);
|
|
);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
$staffOperationLog->setInvoiceOperationLog ( $item );
|
|
$staffOperationLog->setInvoiceOperationLog ( $item );
|
|
|
|
|
|
return '/hr';
|
|
return '/hr';
|
|
@@ -245,11 +280,23 @@ class HumanResourceController extends DooController {
|
|
* 员工信息
|
|
* 员工信息
|
|
*/
|
|
*/
|
|
function hrEmployee() {
|
|
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";
|
|
$pendStatus = $this->get_args ( 'pendStatus' ) ? $this->get_args ( 'pendStatus' ) : "ALL";
|
|
$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : 'ALL';
|
|
$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : 'ALL';
|
|
$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : 'ALL';
|
|
$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : 'ALL';
|
|
$MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : '';
|
|
$MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : '';
|
|
-
|
|
|
|
|
|
+ //$this->send_sms();
|
|
Doo::loadClass ( 'XDeode' );
|
|
Doo::loadClass ( 'XDeode' );
|
|
$XDeode = new XDeode ( 5 );
|
|
$XDeode = new XDeode ( 5 );
|
|
|
|
|
|
@@ -362,6 +409,11 @@ class HumanResourceController extends DooController {
|
|
$staffManage = new staffManage ();
|
|
$staffManage = new staffManage ();
|
|
|
|
|
|
// 用户名检测
|
|
// 用户名检测
|
|
|
|
+ $detailStaff=$staff->getStaffByName($username);
|
|
|
|
+ //print_r($detailStaff);
|
|
|
|
+ if (!empty($detailStaff))
|
|
|
|
+ die ( 'illegal request3' );
|
|
|
|
+
|
|
$staff->username = $username;
|
|
$staff->username = $username;
|
|
$staff->hiredate = $hiredate;
|
|
$staff->hiredate = $hiredate;
|
|
$staff->nature = $nature;
|
|
$staff->nature = $nature;
|
|
@@ -371,7 +423,7 @@ class HumanResourceController extends DooController {
|
|
$cid = $XDeode->decode ( $department [0] );
|
|
$cid = $XDeode->decode ( $department [0] );
|
|
// 加入默认总部分类
|
|
// 加入默认总部分类
|
|
if (! is_numeric ( $cid ))
|
|
if (! is_numeric ( $cid ))
|
|
- die ( 'illegal request' );
|
|
|
|
|
|
+ die ( 'illegal request1' );
|
|
$cagegory = $L_category->getCategoryById ( $cid );
|
|
$cagegory = $L_category->getCategoryById ( $cid );
|
|
// 部门
|
|
// 部门
|
|
if (! empty ( $department [1] )) {
|
|
if (! empty ( $department [1] )) {
|
|
@@ -411,7 +463,7 @@ class HumanResourceController extends DooController {
|
|
$cidMode = implode ( '_', $cidMode );
|
|
$cidMode = implode ( '_', $cidMode );
|
|
$staffManageDetail = $staffManage->getStaffManageByCid ( $cidMode );
|
|
$staffManageDetail = $staffManage->getStaffManageByCid ( $cidMode );
|
|
if (empty ( $staffManageDetail ))
|
|
if (empty ( $staffManageDetail ))
|
|
- die ( 'illegal request' );
|
|
|
|
|
|
+ die ( 'illegal request2' );
|
|
|
|
|
|
$pendingApprovalsSid = current ( $staffManageDetail ['staffList'] ) [0];
|
|
$pendingApprovalsSid = current ( $staffManageDetail ['staffList'] ) [0];
|
|
$staff->pendingApprovals = $pendingApprovalsSid;
|
|
$staff->pendingApprovals = $pendingApprovalsSid;
|
|
@@ -430,12 +482,14 @@ class HumanResourceController extends DooController {
|
|
$id = $staff->insert ();
|
|
$id = $staff->insert ();
|
|
|
|
|
|
// 更新假期相关信息
|
|
// 更新假期相关信息
|
|
|
|
+ Doo::loadModel ( 'holidaystaff' );
|
|
$holidaystaff = new HStaff ();
|
|
$holidaystaff = new HStaff ();
|
|
$holidaystaff->uid = $id;
|
|
$holidaystaff->uid = $id;
|
|
$holidaystaff->insert ();
|
|
$holidaystaff->insert ();
|
|
|
|
+ $staff = new staff ();
|
|
|
|
|
|
$staffmsg = $staff->getUserById ( $id );
|
|
$staffmsg = $staff->getUserById ( $id );
|
|
- $this->updateAnnualLeave ( $staffmsg [0] );
|
|
|
|
|
|
+ $this->updateAnnualLeave ( $staffmsg[0] );
|
|
|
|
|
|
// 标签更新
|
|
// 标签更新
|
|
for($i = 1; $i <= 7; $i ++) {
|
|
for($i = 1; $i <= 7; $i ++) {
|
|
@@ -452,166 +506,24 @@ class HumanResourceController extends DooController {
|
|
$item = array (
|
|
$item = array (
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
'status' => 1,
|
|
'status' => 1,
|
|
- 'img' => $staffmsg ['avatar'],
|
|
|
|
- 'username' => $staffmsg ['username'],
|
|
|
|
- 'uid' => $staffmsg ['sid'],
|
|
|
|
|
|
+ 'img' => '/global/img/avtra',
|
|
|
|
+ 'username' => $username,
|
|
|
|
+ 'uid' => $id,
|
|
'operation' => "添加新员工",
|
|
'operation' => "添加新员工",
|
|
- 'category' => $staffmsg ['category']
|
|
|
|
|
|
+ 'category' => $cagegory [0] ['title']
|
|
);
|
|
);
|
|
$staffOperationLog->setInvoiceOperationLog ( $item );
|
|
$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' );
|
|
die ( 'illegal request' );
|
|
|
|
|
|
// 工龄记录
|
|
// 工龄记录
|
|
- $seniorityFormula = json_decode ( $detail ['seniorityFormula'],true );
|
|
|
|
|
|
+ $seniorityFormula = json_decode ( $detail ['seniorityFormula'], true );
|
|
$arr = array_keys ( $seniorityFormula );
|
|
$arr = array_keys ( $seniorityFormula );
|
|
$key = end ( $arr );
|
|
$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" );
|
|
$seniorityFormula [$key] ['dimissionDate'] = date ( "Y-m-d H:i:s" );
|
|
else
|
|
else
|
|
die ( 'illegal request' );
|
|
die ( 'illegal request' );
|
|
@@ -1301,8 +1213,6 @@ class HumanResourceController extends DooController {
|
|
$staff = new staff ();
|
|
$staff = new staff ();
|
|
Doo::loadModel ( 'L_category' );
|
|
Doo::loadModel ( 'L_category' );
|
|
$L_category = new L_category ();
|
|
$L_category = new L_category ();
|
|
- Doo::loadModel ( 'district' );
|
|
|
|
- $district = new district ();
|
|
|
|
|
|
|
|
$stafflist = $staff->getStaffByCondition ( $con );
|
|
$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' ) ) );
|
|
$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 ['districtList'] = $district->get_lv ( 1 );
|
|
|
|
|
|
$this->data ['onJobCount'] = $onJobCount;
|
|
$this->data ['onJobCount'] = $onJobCount;
|
|
@@ -1508,14 +1420,13 @@ class HumanResourceController extends DooController {
|
|
<th class="taC" width="150">婚姻状况</th><td>
|
|
<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>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<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() {
|
|
function createJobNumber() {
|
|
@@ -1955,6 +1921,8 @@ class HumanResourceController extends DooController {
|
|
return $list;
|
|
return $list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取get或者POST值
|
|
* 获取get或者POST值
|
|
*
|
|
*
|
|
@@ -1978,12 +1946,14 @@ class HumanResourceController extends DooController {
|
|
|
|
|
|
// 检查年假是否过期并更新年假
|
|
// 检查年假是否过期并更新年假
|
|
private function updateAnnualLeave($staff) {
|
|
private function updateAnnualLeave($staff) {
|
|
|
|
+
|
|
Doo::loadModel ( 'holidaystaff' );
|
|
Doo::loadModel ( 'holidaystaff' );
|
|
$hstaff = new HStaff ();
|
|
$hstaff = new HStaff ();
|
|
$hstaffmsg = $hstaff->getOne ( array (
|
|
$hstaffmsg = $hstaff->getOne ( array (
|
|
'where' => 'uid=' . $staff ['sid'],
|
|
'where' => 'uid=' . $staff ['sid'],
|
|
'asArray' => TRUE
|
|
'asArray' => TRUE
|
|
) );
|
|
) );
|
|
|
|
+
|
|
$hiredate = $staff ['hiredate'];
|
|
$hiredate = $staff ['hiredate'];
|
|
$hadyear = intval ( (time () - strtotime ( $hiredate )) / (86400 * 365) );
|
|
$hadyear = intval ( (time () - strtotime ( $hiredate )) / (86400 * 365) );
|
|
if ($hadyear != $hstaffmsg ['hadyear']) {
|
|
if ($hadyear != $hstaffmsg ['hadyear']) {
|