<?php

class Build extends Cf_Controller
{
    public function __construct()
    {
        parent::__construct();
        setCurrentApplication('build_app');
    }

    public function index()
    {
        $data = ['title' => 'Mission Portal - Build'];

        $this->load->model('ProfileModel');
        $this->ProfileModel->setAdditionalData(
            $this->session->userdata('username'),
            ProfileModel::BUILD_APP_OPENED_KEY,
            true,
        );

        if (isInternetConnectionAvailable()) {
            $this->template->load('template', 'build_app/index', $data);
        } else {
            $this->template->load('template', 'build_app/network_error', $data);
        }
    }
}
