• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Employee类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Employee的典型用法代码示例。如果您正苦于以下问题:PHP Employee类的具体用法?PHP Employee怎么用?PHP Employee使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Employee类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testBulkAssignLeaveEntitlements

 public function testBulkAssignLeaveEntitlements()
 {
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmLeavePlugin/test/fixtures/LeaveEntitlement.yml';
     TestDataService::populate($this->fixture);
     $dao = new LeaveEntitlementDao();
     $limit = 5000;
     $empList = array();
     $employeeService = new EmployeeService();
     $employeeService->setEmployeeDao(new EmployeeDao());
     for ($i = 0; $i < $limit; $i++) {
         $employee = new Employee();
         $employee->setFirstName($i);
         $employee = $employeeService->saveEmployee($employee);
         array_push($empList, $employee->getEmpNumber());
     }
     $start_time = microtime(true);
     $leaveEntitlement = new LeaveEntitlement();
     $leaveEntitlement->setLeaveTypeId(1);
     $leaveEntitlement->setCreditedDate(date('Y-m-d'));
     $leaveEntitlement->setEntitlementType(LeaveEntitlement::ENTITLEMENT_TYPE_ADD);
     $leaveEntitlement->setDeleted(0);
     $leaveEntitlement->setNoOfDays(2);
     $leaveEntitlement->setFromDate('2012-01-01');
     $leaveEntitlement->setToDate('2012-08-01');
     $result = $dao->bulkAssignLeaveEntitlements($empList, $leaveEntitlement);
     $deference = microtime(true) - $start_time;
     $this->assertEquals(count($empList), $result, "Time Deference - " . $deference);
     echo "Add Entitlement 5000 Time " . $deference;
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:29,代码来源:LeavePerformanceTest.php


示例2: getLeavesForMeAndSubordinates

	public function getLeavesForMeAndSubordinates($req){
		
		$shareCalendar = $this->baseService->settingsManager->getSetting("Leave: Share Calendar to Whole Company");
		
		$map = json_decode('{"employee":["Employee","id","first_name+last_name"],"leave_type":["LeaveType","id","name"]}');
		
		$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
		
		
		if($shareCalendar != "1"){
			$subordinate = new Employee();
			$subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
			
			$subordinatesIds = $employee->id;
			foreach($subordinates as $sub){
				if($subordinatesIds != ""){
					$subordinatesIds.=",";
				}
				$subordinatesIds.=$sub->id;
			}
			
			$employeeLeave = new EmployeeLeave();
			$startDate = date("Y-m-d H:i:s",$req->start);
			$endDate = date("Y-m-d H:i:s",$req->end);
			
			$list = $employeeLeave->Find("employee in (".$subordinatesIds.") and status in ('Approved','Pending') and ((date_start >= ? and date_start <= ? ) or (date_end >= ? and date_end <= ?))",array($startDate,$endDate,$startDate,$endDate));
			
		}else{
			
			$employeeLeave = new EmployeeLeave();
			$startDate = date("Y-m-d H:i:s",$req->start);
			$endDate = date("Y-m-d H:i:s",$req->end);
			
			$list = $employeeLeave->Find("status in ('Approved','Pending') and ((date_start >= ? and date_start <= ? ) or (date_end >= ? and date_end <= ?))",array($startDate,$endDate,$startDate,$endDate));
			
		}

		
		if(!$list){
			LogManager::getInstance()->info($employeeLeave->ErrorMsg());
		}
		if(!empty($map)){
			$list = $this->baseService->populateMapping($list,$map);
		}
		
		$data = array();
		foreach($list as $leave){
			$data[] = $this->leaveToEvent($leave);
		}
		
		$holiday = new HoliDay();
		$holidays = $holiday->Find("1=1",array());
		
		foreach($holidays as $holiday){
			$data[] = $this->holidayToEvent($holiday);
		}
		
		echo json_encode($data);
		exit();
	}
开发者ID:IrisDande,项目名称:icehrm,代码行数:60,代码来源:LeavecalActionManager.php


示例3: compareEmployee

 private function compareEmployee(Employee $objectOne, Employee $objectTwo)
 {
     if ($objectOne->getRank() == $objectTwo->getRank()) {
         return 0;
     }
     return $objectOne->getRank() < $objectTwo->getRank() ? -1 : 1;
 }
开发者ID:shiyake,项目名称:myTestSite.dev,代码行数:7,代码来源:VecktorVersion3.php


示例4: displayEmployee

 public function displayEmployee($value, $tr)
 {
     $template = $this->context->smarty->createTemplate('controllers/logs/employee_field.tpl', $this->context->smarty);
     $employee = new Employee((int) $tr['id_employee']);
     $template->assign(array('employee_image' => $employee->getImage(), 'employee_name' => $value));
     return $template->fetch();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:7,代码来源:AdminLogsController.php


示例5: getInitData

 public function getInitData($req)
 {
     $data = array();
     $employees = new Employee();
     $data['numberOfEmployees'] = $employees->Count("1 = 1");
     $company = new CompanyStructure();
     $data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
     $user = new User();
     $data['numberOfUsers'] = $user->Count("1 = 1");
     $project = new Project();
     $data['numberOfProjects'] = $project->Count("status = 'Active'");
     $attendance = new Attendance();
     $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     if (empty($data['numberOfAttendanceLastWeek'])) {
         $data['numberOfAttendanceLastWeek'] = 0;
     }
     $empLeave = new EmployeeLeave();
     $data['numberOfLeaves'] = $empLeave->Count("date_start > '" . date("Y-m-d") . "'");
     $timeEntry = new EmployeeTimeEntry();
     $data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     $candidate = new Candidate();
     $data['numberOfCandidates'] = $candidate->Count("1 = 1");
     $job = new Job();
     $data['numberOfJobs'] = $job->Count("status = 'Active'");
     $course = new Course();
     $data['numberOfCourses'] = $course->Count("1 = 1");
     return new IceResponse(IceResponse::SUCCESS, $data);
 }
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:28,代码来源:DashboardActionManager.php


示例6: getDashboardItemData

 public function getDashboardItemData()
 {
     $data = array();
     $emp = new Employee();
     $data['numberOfEmployees'] = $emp->Count("1 = 1");
     return $data;
 }
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:7,代码来源:EmployeesAdminManager.php


示例7: getData

 public function getData($report, $req)
 {
     $leaveActionManager = new LeavesActionManager();
     $department = $req['department'];
     $employeeId = $req['employee'];
     if (($employeeId == "NULL" || empty($employeeId)) && ($department == "NULL" || empty($department))) {
         $emp = new Employee();
         $employees = $emp->Find("status = 'Active'", array());
     } else {
         if ($employeeId != "NULL" && !empty($employeeId)) {
             $emp = new Employee();
             $employees = $emp->Find("id = ?", array($employeeId));
         } else {
             $emp = new Employee();
             $employees = $emp->Find("department = ? and status = 'Active'", array($department));
         }
     }
     $reportData = array();
     $reportData[] = array("Employee ID", "Employee", "Leave Type", "Pending", "Approved", "Rejected", "Canceled", "Available", "To be Accrued", "Carried Forward from Previous Years");
     foreach ($employees as $employee) {
         $leaveEntitlements = $leaveActionManager->getEntitlementByEmployee($employee)->getObject();
         foreach ($leaveEntitlements as $leaveEntitlement) {
             $reportData[] = array($employee->employee_id, $employee->first_name . " " . $employee->last_name, $leaveEntitlement['name'], $leaveEntitlement['pendingLeaves'], $leaveEntitlement['approvedLeaves'], $leaveEntitlement['rejectedLeaves'], $leaveEntitlement['cancelRequestedLeaves'], $leaveEntitlement['availableLeaves'], $leaveEntitlement['tobeAccrued'], $leaveEntitlement['carriedForward']);
         }
     }
     return $reportData;
 }
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:27,代码来源:EmployeeLeaveEntitlementReport.php


示例8: grantAccess

 /**
  * Grant access to the WiFi network to an employee
  * @param Employee $employee
  * @return bool
  */
 public function grantAccess(Employee $employee)
 {
     //now, it's a network with "access control"
     if ($employee->getAccessLevel() === Employee::ACCESS_LEVEL_HIGH) {
         return $this->wifiNetwork->grantAccess($employee);
     }
     return false;
 }
开发者ID:Vincebml,项目名称:PHPatterns,代码行数:13,代码来源:WifiNetworkProxy.php


示例9: getEmployeeById

 private function getEmployeeById($id)
 {
     $sup = new Employee();
     $sup->Load("id = ?", array($id));
     if ($sup->id != $id) {
         error_log("Employee not found");
         return null;
     }
     return $sup;
 }
开发者ID:brajovela,项目名称:hrm,代码行数:10,代码来源:LeavesEmailSender.php


示例10: getEmployeeById

 private function getEmployeeById($id)
 {
     $sup = new Employee();
     $sup->Load("id = ?", array($id));
     if ($sup->id != $id) {
         LogManager::getInstance()->info("Employee not found");
         return null;
     }
     return $sup;
 }
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:10,代码来源:LeavesEmailSender.php


示例11: editgroup

 public function editgroup($id)
 {
     $employeeId = Session::get('userEmployeeId');
     $employee = new Employee();
     $employeeInfo = $employee->getEmployeeInfoById($employeeId);
     // Show details of a user.
     $group = Group::findOrFail($id);
     $perms = array("view" => 1, "create" => 2, "update" => 3, "delete" => 4);
     $permissions = Permission::all();
     return View::make('admin.editgroup')->with('group', $group)->with('perms', $perms)->with('permissions', $permissions)->with('employeeInfo', $employeeInfo);
 }
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:11,代码来源:GroupController.php


示例12: postProcess

 public function postProcess()
 {
     global $cookie, $currentIndex;
     if (Tools::isSubmit('submitDatePicker')) {
         if (!Validate::isDate($from = Tools::getValue('datepickerFrom')) or !Validate::isDate($to = Tools::getValue('datepickerTo'))) {
             $this->_errors[] = Tools::displayError('Date specified is invalid');
         }
     }
     if (Tools::isSubmit('submitDateDay')) {
         $from = date('Y-m-d');
         $to = date('Y-m-d');
     }
     if (Tools::isSubmit('submitDateDayPrev')) {
         $yesterday = time() - 60 * 60 * 24;
         $from = date('Y-m-d', $yesterday);
         $to = date('Y-m-d', $yesterday);
     }
     if (Tools::isSubmit('submitDateMonth')) {
         $from = date('Y-m-01');
         $to = date('Y-m-t');
     }
     if (Tools::isSubmit('submitDateMonthPrev')) {
         $m = date('m') == 1 ? 12 : date('m') - 1;
         $y = $m == 12 ? date('Y') - 1 : date('Y');
         $from = $y . '-' . $m . '-01';
         $to = $y . '-' . $m . date('-t', mktime(12, 0, 0, $m, 15, $y));
     }
     if (Tools::isSubmit('submitDateYear')) {
         $from = date('Y-01-01');
         $to = date('Y-12-31');
     }
     if (Tools::isSubmit('submitDateYearPrev')) {
         $from = date('Y') - 1 . date('-01-01');
         $to = date('Y') - 1 . date('-12-31');
     }
     if (isset($from) and isset($to) and !sizeof($this->_errors)) {
         $employee = new Employee($cookie->id_employee);
         $employee->stats_date_from = $from;
         $employee->stats_date_to = $to;
         $employee->update();
         Tools::redirectAdmin($_SERVER['REQUEST_URI']);
     }
     if (Tools::getValue('submitSettings')) {
         if ($this->tabAccess['edit'] === '1') {
             $currentIndex .= '&module=' . Tools::getValue('module');
             $this->_postConfig($this->_fieldsSettings);
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     }
     if (sizeof($this->_errors)) {
         AdminTab::displayErrors();
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:54,代码来源:AdminStatsTab.php


示例13: deleteProfileImage

 public function deleteProfileImage($req)
 {
     $profileId = $this->getCurrentProfileId();
     $subordinate = new Employee();
     $subordinatesCount = $subordinate->Count("supervisor = ? and id = ?", array($profileId, $req->id));
     if ($this->user->user_level == 'Admin' || $this->user->employee == $req->id || $subordinatesCount == 1) {
         $fs = FileService::getInstance();
         $res = $fs->deleteProfileImage($req->id);
         return new IceResponse(IceResponse::SUCCESS, $res);
     }
     return new IceResponse(IceResponse::ERROR, "Not allowed to delete profile image");
 }
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:12,代码来源:EmployeesActionManager.php


示例14: createFakerEmployee

 protected function createFakerEmployee()
 {
     $faker = Faker::create();
     for ($i = 1; $i < 50; $i++) {
         $employee = new Employee();
         $employee->first_name = $faker->firstName;
         $employee->last_name = $faker->lastName;
         $employee->email = $faker->email;
         $employee->hire_date = $faker->date($format = 'Y-m-d');
         $employee->password = $faker->password;
         $employee->save();
     }
 }
开发者ID:ThomasNYoung,项目名称:phantom-reporter,代码行数:13,代码来源:EmployeesTableSeeder.php


示例15: run

 public function run()
 {
     $employee = new Employee();
     $employee->name = 'Ganesh';
     $employee->email = '[email protected]';
     $employee->password = '00d00@ganesh';
     $employee->password_confirmation = '00d00@ganesh';
     $employee->mobile = '9999999999';
     $employee->active = 1;
     $employee->save();
     $employee::$rules = [];
     $employee->generateEmployeeId();
 }
开发者ID:testoodoo,项目名称:OoodooSiteUp,代码行数:13,代码来源:EmployeeSeeder.php


示例16: requireDefaultRecords

 public function requireDefaultRecords()
 {
     parent::requireDefaultRecords();
     $employeeSet = DataObject::get('Employee');
     foreach ($employeeSet as $employee) {
         $employee->delete();
     }
     foreach ($this->data() as $employeeName) {
         $employee = new Employee();
         $employee->Name = $employeeName;
         $employee->write();
     }
     DB::alteration_message("Added default records to Employee table", "created");
 }
开发者ID:normann,项目名称:silverstripe-frameworktest,代码行数:14,代码来源:Employee.php


示例17: renderContent

 protected function renderContent()
 {
     $model = new Employee('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Employee'])) {
         $model->attributes = $_GET['Employee'];
     }
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
         unset($_GET['pageSize']);
         // would interfere with pager and repetitive page size change
     }
     $this->render('DaftarKaryawan', array('model' => $model));
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:15,代码来源:DaftarKaryawan.php


示例18: addEmployee

 /**
  * 
  * @param array $employee
  * @return Employee
  * @throws Exception
  */
 public function addEmployee($employee)
 {
     $fileds = array_keys($employee);
     foreach ($this->getRequiredFields() as $val) {
         if (!in_array($val, $fileds)) {
             throw new Exception("required filed " . $val . " is not provided");
         }
     }
     $empObject = new Employee();
     foreach ($employee as $key => $val) {
         $empObject->set($key, $val);
     }
     $instance = $this->getServiceInstance();
     return $instance->saveEmployee($empObject);
 }
开发者ID:EFForg,项目名称:lemonhrm,代码行数:21,代码来源:EmployeeServiceWrapper.php


示例19: loadModel

 public function loadModel($id)
 {
     if (($model = Employee::model()->findByPk($id)) === null) {
         throw new CHttpException(404, Yii::t('TeamModule.team', 'Page was not found!'));
     }
     return $model;
 }
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:7,代码来源:EmployeeBackendController.php


示例20: index

 public function index()
 {
     $entities = Entity::all();
     $employees = Employee::all();
     $menu = 'data';
     return View::make('entities.index', compact('employees', 'entities', 'menu'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:7,代码来源:EntitiesController.php



注:本文中的Employee类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP EmployeePeer类代码示例发布时间:2022-05-23
下一篇:
PHP Empleado类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap