本文整理汇总了PHP中Employee::fetchEmployee方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::fetchEmployee方法的具体用法?PHP Employee::fetchEmployee怎么用?PHP Employee::fetchEmployee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::fetchEmployee方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertOvertime
/**
* Save new overtime into database
*
* @return bool
* @access public
*/
public function insertOvertime()
{
global $charges_account;
include_once '../hr/class/Employee.php';
$emp = new Employee();
$emp->fetchEmployee($this->employee_id);
if ($this->overtimeline_type == "H") {
$total_trip = $emp->employee_othour;
} else {
$total_trip = $emp->employee_ottrip;
}
$total_amt = $total_trip * $this->overtimeline_totalhour;
$timestamp = date("y/m/d H:i:s", time());
$this->log->showLog(3, "Inserting new overtime {$this->overtime_name}");
$sql = "INSERT INTO {$this->tableovertimeline}\r\n (employee_id,overtimeline_date,overtimeline_starttime,overtimeline_endtime,\r\n overtimeline_totalhour,line_desc,overtimeline_type,overtimeline_rate,overtimeline_basicsalary,\r\n overtimeline_totalamt,\r\n created,createdby,updated,updatedby)\r\n values(\r\n {$this->employee_id},'{$this->overtimeline_date}','{$this->overtimeline_starttime}','{$this->overtimeline_endtime}',\r\n {$this->overtimeline_totalhour},'{$this->line_desc}','{$this->overtimeline_type}',{$total_trip},{$emp->employee_salary},\r\n {$total_amt},\r\n '{$timestamp}',{$this->createdby},'{$timestamp}',{$this->updatedby})";
$this->changesql = $sql;
$this->log->showLog(4, "Before insert overtime SQL:{$sql}");
$rs = $this->xoopsDB->query($sql);
if (!$rs) {
$this->log->showLog(1, "Failed to insert overtime code {$overtime_name}:" . mysql_error() . ":{$sql}");
return false;
} else {
$this->log->showLog(3, "Inserting new overtime {$overtime_name} successfully");
return true;
}
}
示例2: updateRate
public function updateRate($overtimeline_type, $employee_id)
{
include_once '../hr/class/Employee.php';
$emp = new Employee();
$emp->fetchEmployee($employee_id);
if ($overtimeline_type == "T") {
$overtimeline_rate = $emp->employee_ottrip;
} else {
$overtimeline_rate = $emp->employee_othour;
}
return $overtimeline_rate;
}
示例3:
$o->employeegroupctrl = $ctrl->getSelectEmployeegroup($o->employeegroup_id, "Y");
$o->departmentctrl = $ctrl->getSelectDepartment($o->department_id, "Y");
$o->permanentcountryctrl = $ctrl->getSelectCountry($o->permanent_country, 'N', 'permanent_country');
$o->contactcountryctrl = $ctrl->getSelectCountry($o->contact_country, 'N', 'contact_country');
$o->uidctrl = $permission->selectAvailableSysUser($o->uid, 'Y', "uid", "", " and isstudent = 0 ", "uid", $widthuser, "Y", 0);
$o->supervisor1ctrl = $ctrl->getSelectEmployee($o->supervisor_1, 'Y', "", "supervisor_1", "", "supervisor_1", "style='width:200px'", "Y", 0);
$o->supervisor2ctrl = $ctrl->getSelectEmployee($o->supervisor_2, 'Y', "", "supervisor_2", "", "supervisor_2", "style='width:200px'", "Y", 0);
$o->jobpositionctrl = $ctrl->getSelectJobposition($o->jobposition_id, "Y", "", "jobposition_id", "", "jobposition_id", "", "Y", 0);
$o->getInputForm("new", -1, $token);
$o->showEmployeeTable("WHERE a.employee_id>0 and a.organization_id={$defaultorganization_id}", "ORDER BY a.defaultlevel,cast(a.employee_no as signed)");
}
break;
//when user request to edit particular organization
//when user request to edit particular organization
case "edit":
if ($o->fetchEmployee($o->employee_id)) {
//create a new token for editing a form
$token = $s->createToken($tokenlife, "CREATE_ACG");
$o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y');
$o->racesctrl = $ctrl->getSelectRaces($o->races_id, 'N');
$o->religionctrl = $ctrl->getSelectReligion($o->religion_id, 'N');
$o->employeegroupctrl = $ctrl->getSelectEmployeegroup($o->employeegroup_id, "Y");
$o->departmentctrl = $ctrl->getSelectDepartment($o->department_id, "Y");
$o->permanentcountryctrl = $ctrl->getSelectCountry($o->permanent_country, 'N', 'permanent_country');
$o->contactcountryctrl = $ctrl->getSelectCountry($o->contact_country, 'N', 'contact_country');
$o->uidctrl = $permission->selectAvailableSysUser($o->uid, 'Y', "uid", "", " and isstudent = 0 ", "uid", $widthuser, "Y", 0);
$o->supervisor1ctrl = $ctrl->getSelectEmployee($o->supervisor_1, 'Y', "", "supervisor_1", "", "supervisor_1", "style='width:200px'", "Y", 0);
$o->supervisor2ctrl = $ctrl->getSelectEmployee($o->supervisor_2, 'Y', "", "supervisor_2", "", "supervisor_2", "style='width:200px'", "Y", 0);
$o->jobpositionctrl = $ctrl->getSelectJobposition($o->jobposition_id, "Y", "", "jobposition_id", "", "jobposition_id", "", "Y", 0);
$o->getInputForm("edit", $o->employee, $token);
//$o->showEmployeeTable("WHERE a.employee_id>0 and a.organization_id=$defaultorganization_id","ORDER BY a.defaultlevel,cast(a.employee_no as signed)");