<?php

class OrderProjectsController{
    private $model;

    function __construct(){
        $this->model = new OrderProjectsModel();
    }

    public function getOrderProjectsHeaders(){
        echo json_encode($this->model->getOrderProjectsHeaders(), JSON_NUMERIC_CHECK);
    }

    public function getOrderProjects(){
        $available = isset($_REQUEST['available']) ? $_REQUEST['available'] : '';
        echo json_encode($this->model->getOrderProjects($available), JSON_NUMERIC_CHECK);
    }

    public function editOrderProject(){
        $projectData = isset($_REQUEST['projectData']) ? $_REQUEST['projectData'] : '[]';
        echo json_encode($this->model->editOrderProject($projectData), JSON_NUMERIC_CHECK);
    }

    public function orderProjectsEditTemplate() {
        require_once('templates/OrderProjectsEditTemplate.php');
    }

    public function orderProjectsTemplate() {
        require_once('templates/OrderProjectsTemplate.php');
    }
}
