deportament.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'] . "/core/db_provider.php";
  3. include $_SERVER['DOCUMENT_ROOT'] . "/core/it_deportament.php";
  4. include $_SERVER['DOCUMENT_ROOT'] . "/core/it_employee.php";
  5. $itc = new ITDeportamentComtroller();
  6. $iec = new ITEmployeeComtroller();
  7. try {
  8. // $deportament = null;
  9. if (isset($_GET['deportament'])) {
  10. $deportament = $itc->get_all_by_id($_GET['deportament']);
  11. $list_employee = $iec->get_employee_by_deportament($deportament->id);
  12. } else exit();
  13. // var_dump($deportament);
  14. } catch (PDOException $e) {
  15. exit();
  16. }
  17. ?>
  18. <div class='row' style='margin-bottom: 20px; padding: 20px;'>
  19. <div class='col-md-8 col-md-offset-2'>
  20. <h2><?= $deportament->name ?></h2>
  21. <br /><br /><br />
  22. <?php foreach ($list_employee as $employee) : ?>
  23. <b><?= $employee->position ?><br /><?= $employee->fio ?><br>
  24. <?php if ($employee->phone != NULL) : ?>
  25. Телефон: <?= $employee->phone ?><br></b>
  26. <?php endif ?>
  27. <hr style='clear: both;'>
  28. <?php endforeach ?>
  29. </div>
  30. </div>