本文整理汇总了PHP中Employee::GetAllEmployees方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::GetAllEmployees方法的具体用法?PHP Employee::GetAllEmployees怎么用?PHP Employee::GetAllEmployees使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::GetAllEmployees方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmployees
public function getEmployees()
{
if ($this->validateAdmin()) {
echo json_encode(Employee::GetAllEmployees());
} else {
echo 0;
}
}
示例2: EmployeeRegister
public static function EmployeeRegister()
{
$collection = Employee::GetAllEmployees();
echo '
<div class="logo">
<h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
<h4>ALL EMPLOYEES</h4>';
echo '</div>
<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
<thead class="title">
<tr>
<td>NAME</td>
<td>TELEPHONE</td>
<td>GENDER</td>
<td>DEPARTMENT</td>
<td>POSITION</td>
<td>SALARY</td>
</tr>
</thead>
<tbody>';
foreach ($collection as $model) {
echo '<tr>
<td>' . $model->name . '</td>
<td>' . $model->telephone . '</td>
<td>' . $model->gender . '</td>
<td>' . $model->department . '</td>
<td>' . $model->position . '</td>
<td><script>document.writeln((' . $model->salary->amount . ').formatMoney(2, \'.\', \',\'));</script></td>
</tr>';
}
echo '</tbody>
</table>';
}
示例3: CommitPayroll
public static function CommitPayroll($month)
{
$payroll = new Payroll($month);
$employees = Employee::GetAllEmployees();
foreach ($employees as $employee) {
$slip = new PaySlip($employee, $month);
try {
$d = explode('/', $month);
$ustamp = $d[1] . $d[0] . '31239999' + 1;
$lstamp = $d[1] . $d[0] . '00999999' + 1;
self::PostSalary($employee->id, $employee->salary->amount, $month);
self::RecoverAdvance($employee->id, $month);
//stamp >= '.$lstamp.' AND stamp <= '.$ustamp.'
$sql = 'SELECT * FROM payroll_entries WHERE party_id = ' . $employee->id . ' AND status <> 2 AND type <> "Salary Payment" ORDER BY type ASC, id DESC';
$entries = DatabaseHandler::GetAll($sql);
foreach ($entries as $entry) {
if ($entry['type'] != 'Basic Salary') {
$slip->includeEntry($entry['type'], $entry['effect'], $entry['amount']);
}
$sql = 'UPDATE payroll_entries SET status = 2, month = "' . $month . '" WHERE id = ' . $entry['id'];
DatabaseHandler::Execute($sql);
}
} catch (Exception $e) {
//Logger::Log('Payroll', 'Failed', 'Allowance for employee id: '.$employee->id.' for '.$month.'could not be posted');
return false;
}
$slip->compile();
$slip->commit();
$payroll->addPayslip($slip);
}
$payroll->setStatus('COMMITED');
return $payroll;
}