本文整理汇总了PHP中Employee::getEmployee方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::getEmployee方法的具体用法?PHP Employee::getEmployee怎么用?PHP Employee::getEmployee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::getEmployee方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAccountChanges
public static function processAccountChanges($csv, $CID, $UID)
{
include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Models/Deposit.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Models/Ledger.php";
foreach ($csv as $accountChange) {
$EID = $accountChange[0];
$payrollDate = strtotime($accountChange[1]);
$payrollDate = date('Y-m-d H:i:s', $payrollDate);
$withheldAmount = $accountChange[2];
$employee = Employee::getEmployee($EID, $CID);
if ($employee) {
$deposit = Deposit::depositAmt($employee->getAccountNum(), $UID, $withheldAmount, $payrollDate);
Ledger::addDeposit($deposit);
}
}
}
示例2: header
$v = $_SESSION['v'];
$Fname = $_POST['Fname'];
$Lname = $_POST['Lname'];
$PhoneNum = $_POST['PhoneNum'];
$EID = $_POST['EID'];
$CID = $_POST['CID'];
if (!isset($Fname) || !isset($Lname) || !isset($PhoneNum) || !isset($EID)) {
header('Location:https://' . $_SESSION['redir'] . "?result=1&u=" . $u . "&v=" . $v);
}
if ($CID == 1) {
include "DB/Models/BossFlexEmployee.php";
/** @var BossFlexEmployee $emp */
$emp = BossFlexEmployee::getEmployeeByBFID($EID);
if ($emp->getBFID() == $EID && $emp->getFname() == $Fname && $emp->getLname() == $Lname && $emp->getPhoneNum() == $PhoneNum) {
$_SESSION['NewUser'] = serialize($emp);
$_SESSION['BossFlex'] = true;
header('Location:Register.php');
} else {
header('Location:https://' . $_SESSION['redir'] . "?result=2&u=" . $u . "&v=" . $v);
}
} else {
include "DB/Models/Employee.php";
/** @var Employee $emp */
$emp = Employee::getEmployee($EID, $CID);
if ($emp->getEID() == $EID && $emp->getFname() == $Fname && $emp->getLname() == $Lname && $emp->getPhoneNum() == $PhoneNum) {
$_SESSION['NewUser'] = serialize($emp);
header('Location:Register.php');
} else {
header('Location:https://' . $_SESSION['redir'] . "?result=2&u=" . $u . "&v=" . $v);
}
}
示例3: index
public function index()
{
if (Input::has("json_data")) {
$json_data = Input::get("json_data");
$data = json_decode($json_data);
try {
$login = $data->login;
$method = $data->method;
$section = $data->section;
$where = $data->where;
$detail_data = $data->data;
if (User::getLogin($login) != "[]") {
if ($method == "login") {
$arr = array("method" => $method, "section" => "user", "data" => $login);
return json_encode($arr);
}
if ($method == "get") {
if ($section == "employee") {
if ($where == "") {
$arr = array("method" => $method, "section" => $section, "data" => Employee::all());
return json_encode($arr);
} else {
$arr = array("method" => $method, "section" => $section, "data" => Employee::getEmployee($where));
return json_encode($arr);
}
}
}
if ($method == "append") {
if ($section == "employee") {
if (Employee::checkEmployee($detail_data->eid) == "") {
Employee::appendEmployee($detail_data);
$arr = array("method" => $method, "section" => $section, "data" => "Success");
return json_encode($arr);
} else {
$arr = array("method" => $method, "section" => $section, "data" => "Fail, Duplicate EID");
return json_encode($arr);
}
}
}
if ($method == "update") {
if ($section == "employee") {
if (Employee::checkEmployee($detail_data->eid) != "") {
Employee::updateEmployee($detail_data);
$arr = array("method" => $method, "section" => $section, "data" => "Success");
return json_encode($arr);
} else {
$arr = array("method" => $method, "section" => $section, "data" => "Fail, Wrong EID");
return json_encode($arr);
}
}
}
if ($method == "remove") {
if ($section == "employee") {
try {
foreach ($where as $value) {
Employee::removeEmployee($value);
}
$arr = array("method" => $method, "section" => $section, "data" => "Success");
return json_encode($arr);
} catch (Exception $e) {
return "Error: Can't remove, Employee is using!";
}
}
}
} else {
return "Error: Login fail!";
}
} catch (Exception $e) {
return "Error: JsonData is not correct!" . $e;
}
} else {
return "Error: JsonData not found!";
}
}