<?php

require_once APPPATH . 'libraries/Cf_REST_Controller.php';

class WelcomeWizard extends Cf_REST_Controller
{

    function __construct()
    {
        parent::__construct();
        $this->load->model('WelcomeWizard_model');
    }

    function seenWizard_get()
    {
        $username = $this->session->userdata('username');
        $seenWizard = $this->WelcomeWizard_model->getSeenWizardByUserName($username);
        $this->respond(200, json_encode($seenWizard));
    }

    function seenWizard_post()
    {
        $username = $this->session->userdata('username');
        $postData = json_decode($this->request->body, true);
        $this->WelcomeWizard_model->changeSeenWizardByUserName($username, $postData['seenWizard']);
        $this->respond(201, '');
    }

}