<?php
class Employees {
public $department;
public $profession;
public $coffee;
public $rank;
public $boss;
public $pages;
public $salary;
public $rate;
public function __construct($department, $profession, $coffee, $rank, $boss, $pages, $basicSalary)
{
$this->department = $department;
$this->profession = $profession;
$this->coffee = $coffee;
$this->rank = $rank;
$this->boss = $boss;
$this->pages = $pages;
$this->basicSalary = $basicSalary;
}
public function getRate()
{
if ($this->rank == 1) {
$this->rate = 1;
} elseif ($this->rank == 2) {
$this->rate = 1.25;
} elseif ($this->rank == 3) {
$this->rate = 1.5;
}
}
public function getSalary($basicSalary)
{
$this->salary = $basicSalary * $this->rate;
}
}
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 1, 200, 500),
new Employees('Закупки', 'Me', 20, false, 2, 200, 500),
new Employees('Закупки', 'Me', 20, false, 2, 200, 500),
new Employees('Закупки', 'Me', 20, false, 2, 200, 500),
new Employees('Закупки', 'Me', 20, false, 3, 200, 500),
new Employees('Закупки', 'Me', 20, false, 3, 200, 500),
new Employees('Закупки', 'Ma', 15, false, 2, 150, 400),
new Employees('Закупки', 'Ma', 15, false, 2, 150, 400),
new Employees('Закупки', 'Me', 20, true, 2, 200, 500)
);
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCdVVEYtOCcpOwoKY2xhc3MgRW1wbG95ZWVzIHsKICAgIHB1YmxpYyAkZGVwYXJ0bWVudDsKICAgIHB1YmxpYyAkcHJvZmVzc2lvbjsKICAgIHB1YmxpYyAkY29mZmVlOwogICAgcHVibGljICR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