Esempio n. 1
0
 public function actionAdd()
 {
     if (!empty($_POST)) {
         $model = new Employee();
         $model->name = $_POST['Employee_name'];
         $model->age = $_POST['Employee_age'];
         $model->gender = $_POST['Employee_gender'];
         $model->rate = $_POST['Employee_rate'];
         $this->_employeeManager->create($model);
         $this->navigate('?p=site/index');
     } else {
         $rates = $this->_ratesManager->getAll();
         $this->view->render('add', ['rates' => $rates], 'master');
     }
 }
Esempio n. 2
0
 * @author    :
 */
use application\model\contracts\Employee;
use application\model\implementation\EmployeeManager;
use application\model\implementation\RatesManager;
use application\view\ViewHelper;
require_once '../framework/Object.php';
require_once '../model/contracts/Employee.php';
require_once '../model/contracts/EmployeeManagerInterface.php';
require_once '../model/contracts/RatesManagerInterface.php';
require_once '../model/implementation/RatesManager.php';
require_once '../model/implementation/EmployeeManager.php';
require_once '../view/ViewHelper.php';
$settings = (include 'settings.php');
$manager = new EmployeeManager($settings);
$ratesManager = new RatesManager();
$employee = null;
if (isset($_GET["id"])) {
    $employee = $manager->getById((int) $_GET["id"]);
}
$rates = $ratesManager->getAll();
$genders = ViewHelper::getGenderList();
$employeeList = $manager->getAll();
if ($employee === null) {
    exit;
}
?>

<?php 
include 'header.master.php';
?>