<?php

class OrderProjectsController{
    private $model;

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

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

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

}
