<?php
class Manager // Я решил, что сделать классы на каждую должность лучше, чем
{ // наследовать должность от сотрудника, поэтому дальше много копипасты
private $managerRate = 500;
private $managerCoffe = 20;
private $managerPages = 200;
public $rank;
public $boss;
public function __construct($rank, $boss)
{
$this->rank = $rank;
$this->boss = $boss;
}
public function getSalary()
{
if ($this->rank == 1){
$factor = 1;
}elseif($this->rank == 2){
$factor = 1.25;
}elseif($this->rank == 3){
$factor = 1.5;
}
if ($this->boss == true)
{
$bossFactor = 1.5;
}else{
$bossFactor = 1;
}
$salary = $this->managerRate * $factor * $bossFactor;
return $salary;
}
public function getCoffe()
{
if ($this->boss == true)
{
$bossFactor = 2;
}else{
$bossFactor = 1;
}
$coffe = $this->managerCoffe * $bossFactor;
return $coffe;
}
public function getPages()
{
if ($this->boss == true)
{
$bossFactor = 0;
}else{
$bossFactor = 1;
}
$pages = $this->managerPages * $bossFactor;
return $pages;
}
}
class Marketer
{
private $marketerRate = 400;
private $marketerCoffe = 15;
private $marketerPages = 150;
public $rank;
public $boss;
public function __construct($rank, $boss)
{
$this->rank = $rank;
$this->boss = $boss;
}
public function getSalary()
{
if ($this->rank == 1){
$factor = 1;
}elseif($this->rank == 2){
$factor = 1.25;
}elseif($this->rank == 3){
$factor = 1.5;
}
if ($this->boss == true)
{
$bossFactor = 1.5;
}else{
$bossFactor = 1;
}
$salary = $this->marketerRate * $factor * $bossFactor;
return $salary;
}
public function getCoffe()
{
if ($this->boss == true)
{
$bossFactor = 2;
}else{
$bossFactor = 1;
}
$coffe = $this->marketerCoffe * $bossFactor;
return $coffe;
}
public function getPages()
{
if ($this->boss == true)
{
$bossFactor = 0;
}else{
$bossFactor = 1;
}
$pages = $this->marketerPages * $bossFactor;
return $pages;
}
}
class Engineer
{
private $engineerRate = 200;
private $engineerCoffe = 5;
private $engineerPages = 50;
public $rank;
public $boss;
public function __construct($rank, $boss)
{
$this->rank = $rank;
$this->boss = $boss;
}
public function getSalary()
{
if ($this->rank == 1){
$factor = 1;
}elseif($this->rank == 2){
$factor = 1.25;
}elseif($this->rank == 3){
$factor = 1.5;
}
if ($this->boss == true)
{
$bossFactor = 1.5;
}else{
$bossFactor = 1;
}
$salary = $this->engineerRate * $factor * $bossFactor;
return $salary;
}
public function getCoffe()
{
if ($this->boss == true)
{
$bossFactor = 2;
}else{
$bossFactor = 1;
}
$coffe = $this->engineerCoffe * $bossFactor;
return $coffe;
}
public function getPages()
{
if ($this->boss == true)
{
$bossFactor = 0;
}else{
$bossFactor = 1;
}
$pages = $this->engineerPages * $bossFactor;
return $pages;
}
}
class Analyst
{
private $analystRate = 800;
private $analystCoffe = 50;
private $analystPages = 5;
public $rank;
public $boss;
public function __construct($rank, $boss)
{
$this->rank = $rank;
$this->boss = $boss;
}
public function getSalary()
{
if ($this->rank == 1){
$factor = 1;
}elseif($this->rank == 2){
$factor = 1.25;
}elseif($this->rank == 3){
$factor = 1.5;
}
if ($this->boss == true)
{
$bossFactor = 1.5;
}else{
$bossFactor = 1;
}
$salary = $this->analystRate * $factor * $bossFactor;
return $salary;
}
public function getCoffe()
{
if ($this->boss == true)
{
$bossFactor = 2;
}else{
$bossFactor = 1;
}
$coffe = $this->analystCoffe * $bossFactor;
return $coffe;
}
public function getPages()
{
if ($this->boss == true)
{
$bossFactor = 0;
}else{
$bossFactor = 1;
}
$pages = $this->analystPages * $bossFactor;
return $pages;
}
}
class Employee // этот класс я использую для настакивания работников в массив,
{ // прежде чем отправить в департамент, потому что я хз как сделать по-другому
public $quantity;
public $position;
public $boss;
public $rank;
public function __construct($position, $rank, $boss, $quantity)
{
$this->quantity = $quantity;
$this->position = $position;
$this->boss = $boss;
$this->rank = $rank;
}
}
class Department
{
public $departmentName;
public $quantity;
public $position;
public $boss;
public $rank;
public function __construct($employees, $departmentName)
{
foreach ($employees as $employee)
{
$this->quantity[] = $employee->quantity; // тут опять любимые массивы
$this->position[] = $employee->position; // потому что я хз как сделать
$this->boss[] = $employee->boss; // по-другому и нужно считать раздельно
$this->rank[] = $employee->rank; // каждого отличного от других работника
} // или группу из однотипных
$this->departmentName = $departmentName;
}
public function getTotalCoffe()
{
$coffe = 0;
// использовал цикл для прохода по всем значениям объектов
for ($x = 0; $x < count($this->rank); $x++){ if ($this->position[$x] == 'Manager')
{
$coffe = ((new Manager($this->rank[$x], $this->boss[$x]))->getCoffe())*$this->quantity[$x] + $coffe;
}elseif ($this->position[$x] == 'Marketer')
{
$coffe = ((new Marketer($this->rank[$x], $this->boss[$x]))->getCoffe())*$this->quantity[$x] + $coffe;
}elseif ($this->position[$x] == 'Engineer')
{
$coffe = ((new Engineer($this->rank[$x], $this->boss[$x]))->getCoffe())*$this->quantity[$x] + $coffe;
}elseif ($this->position[$x] == 'Analyst')
{
$coffe = ((new Analyst($this->rank[$x], $this->boss[$x]))->getCoffe())*$this->quantity[$x] + $coffe;
}
}
return $coffe;
}
public function getTotalSalary()
{
$salary = 0;
for ($x = 0; $x < count($this->rank); $x++){ if ($this->position[$x] == 'Manager')
{
$salary = ((new Manager($this->rank[$x], $this->boss[$x]))->getSalary())*$this->quantity[$x] + $salary;
}elseif ($this->position[$x] == 'Marketer')
{
$salary = ((new Marketer($this->rank[$x], $this->boss[$x]))->getSalary())*$this->quantity[$x] + $salary;
}elseif ($this->position[$x] == 'Engineer')
{
$salary = ((new Engineer($this->rank[$x], $this->boss[$x]))->getSalary())*$this->quantity[$x] + $salary;
}elseif ($this->position[$x] == 'Analyst')
{
$salary = ((new Analyst($this->rank[$x], $this->boss[$x]))->getSalary())*$this->quantity[$x] + $salary;
}
}
return $salary;
}
public function getTotalPages()
{
$pages = 0;
for ($x = 0; $x < count($this->rank); $x++){ if ($this->position[$x] == 'Manager')
{
$pages = ((new Manager($this->rank[$x], $this->boss[$x]))->getPages())*$this->quantity[$x] + $pages;
}elseif ($this->position[$x] == 'Marketer')
{
$pages = ((new Marketer($this->rank[$x], $this->boss[$x]))->getPages())*$this->quantity[$x] + $pages;
}elseif ($this->position[$x] == 'Engineer')
{
$pages = ((new Engineer($this->rank[$x], $this->boss[$x]))->getPages())*$this->quantity[$x] + $pages;
}elseif ($this->position[$x] == 'Analyst')
{
$pages = ((new Analyst($this->rank[$x], $this->boss[$x]))->getPages())*$this->quantity[$x] + $pages;
}
}
return $pages;
}
public function getPersonelAmount()
{
{
}else{
return $this->quantity;
}
}
public function getSalaryPerPages()
{
return round($this->getTotalSalary() / $this->getTotalPages(), 2); }
}
class Company
{
public $total = 'Всего';
public $totalPersonelAmount;
public $totalSalary;
public $totalCoffe;
public $totalDocumentation;
public $totalSalaryPerPages;
public $average = 'Среднее';
public $averagePersonelAmount;
public $averageSalary;
public $averageCoffe;
public $averageDocumentation;
public $averageSalaryPerPages;
public function __construct($departments)
{
foreach ($departments as $department)
{
$this->totalPersonelAmount = $department->getPersonelAmount() + $this->totalPersonelAmount;
$this->totalSalary = $department->getTotalSalary() + $this->totalSalary;
$this->totalCoffe = $department->getTotalCoffe() + $this->totalCoffe;
$this->totalDocumentation = $department->getTotalCoffe() + $this->totalDocumentation;
$this->totalSalaryPerPages = $department->getSalaryPerPages() + $this->totalSalaryPerPages;
}
$this->averagePersonelAmount = $this->totalPersonelAmount / count($departments); $this->averageSalary = round($this->totalSalary / count($departments), 2); $this->averageCoffe = round($this->totalCoffe / count($departments), 2); $this->averageDocumentation = round($this->totalDocumentation / count($departments), 2); $this->averageSalaryPerPages = round($this->totalSalaryPerPages / count($departments), 2);
}
}
function padRight($q, $w){
}
function padLeft($q, $w){
}
new Employee ('Manager', 1, false, 9), // ты писал про тайпхинтинг, но я забыл про него
new Employee ('Manager', 2, false, 3), // ($position, $rank, $boss, $quantity)
new Employee ('Manager', 3, false, 2),
new Employee ('Marketer', 1, false, 2),
new Employee ('Manager', 2, true, 1)
);
new Employee ('Manager', 1, false, 12),
new Employee ('Marketer', 1, false, 6),
new Employee ('Analyst', 1, false, 3),
new Employee ('Analyst', 2, false, 2),
new Employee ('Marketer', 2, true, 1)
);
new Employee ('Marketer', 1, false, 15),
new Employee ('Marketer', 2, false, 10),
new Employee ('Manager', 1, false, 8),
new Employee ('Engineer', 1, false, 2),
new Employee ('Marketer', 3, true, 1)
);
new Employee ('Manager', 1, false, 13),
new Employee ('Manager', 2, false, 5),
new Employee ('Engineer', 1, false, 5),
new Employee ('Manager', 1, true, 1)
);
new Department($workers1, 'Закупок'), // ($employees, $departmentName)
new Department($workers2, 'Продаж'),
new Department($workers3, 'Рекламы'),
new Department($workers4, 'Логистики')
);
$company = new Company($departments);
function printData($departments, $company, $headline)
{
$col1 = 20;
$col2 = 8;
$col3 = 12;
$col4 = 12;
$col5 = 12;
$col6 = 12;
$col7 = 50;
if($headline == 0){
echo padRight("Департамент", $col1) .
padLeft("сотр.", $col2) .
padLeft("тугр.", $col3) .
padLeft("кофе", $col4) .
padLeft("стр.", $col5) .
padLeft("тугр./стр.", $col6) . "\n" .
}else{
echo padLeft ('Анти-кризисная мера #'."{$headline}", $col7)."\n";
}
foreach ($departments as $department) {
echo padRight($department->departmentName, $col1) .
padLeft($department->getPersonelAmount(), $col2) .
padLeft($department->getTotalSalary(), $col3) .
padLeft($department->getTotalCoffe(), $col4) .
padLeft($department->getTotalPages(), $col5) .
padLeft($department->getSalaryPerPages(), $col6) . "\n" ;
echo padRight($company->average, $col1) .
padLeft($company->averagePersonelAmount, $col2) .
padLeft($company->averageSalary, $col3) .
padLeft($company->averageCoffe, $col4) .
padLeft($company->averageDocumentation, $col5) .
padLeft($company->averageSalaryPerPages, $col6) . "\n";
echo padRight($company->total, $col1) .
padLeft($company->totalPersonelAmount, $col2) .
padLeft($company->totalSalary, $col3) .
padLeft($company->totalCoffe, $col4) .
padLeft($company->totalDocumentation, $col5) .
padLeft($company->totalSalaryPerPages, $col6)."\n\n";
}
printData($departments, $company, 0);
PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoLTEpOwptYl9pbnRlcm5hbF9lbmNvZGluZygndXRmLTgnKTsKIApjbGFzcyBNYW5hZ2VyIC8vINCvINGA0LXRiNC40LssINGH0YLQviDRgdC00LXQu9Cw0YL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