class Configure extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->helper(array('form', 'url', 'file', 'array','download','directory'));
$this->load->library('grocery_CRUD');
$this->load->library('email');
$this->load->library('image_lib');
$this->load->library('image_CRUD');
$this->load->library('ftp');
$this->load->library('form_validation');
$this->load->helper('cookie', 'download');
$this->load->model('MyModel');
$this->load->js("/js/javascript_funcs.js");
$this->_init();
}
private function _init()
{
$this->output->enable_profiler(FALSE); //turn on profiler
//this sets all the credentials into session
$this->session->set_userdata('LOCAL', getenv('LOCAL'));
$this->session->set_userdata('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
$this->session->set_userdata('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));
$this->session->set_userdata('hostname', getenv('hostname'));
$this->session->set_userdata('username', getenv('username'));
$this->session->set_userdata('password', getenv('password'));
$this->session->set_userdata('connectionString', getenv('connectionString'));
$this->session->set_userdata('key', getenv('key'));
$this->session->set_userdata('secret', getenv('secret'));
$this->session->set_userdata('onetime', 0);
$_SESSION['apiKey'] = getenv('apiKey');
$_SESSION['applicationID_survey'] = getenv('applicationID_survey');
$_SESSION['applicationID_login'] = getenv('applicationID_login');
$_SESSION['applicationID_admin_login'] = getenv('applicationID_admin_login');
$_SESSION['applicationID_admin_register_login'] = getenv('applicationID_admin_register_login'); //this is for both register and login
$_SESSION['emailTemplate'] = getenv('emailTemplate');
$_SESSION['tenantID_survey'] = getenv('tenantID_survey');
$_SESSION['client'] = new FusionAuth\FusionAuthClient($_SESSION['apiKey'], "http://fusionauth:9011");
//sendpulse section
$_SESSION['sendpulse_API_USER_ID'] = getenv('sendpulseID');
$_SESSION['sendpulse_SECRET'] = getenv('sendpulseSecret');
$_SESSION['stripe_SECRET'] = getenv('stripe_secret_key');
$_SESSION['sendpulse_SECRET'], new FileStorage());
$this->session->set_userdata('iTransfered',0);
$this->db->where('email', $this->session->userdata('userid'));
$this->db->where('company_division', $this->session->userdata('campaign'));
$query = $this->db->get('campaigns2');
$row = $query->result();
if (!isset($row[0])) { //not found so get the first one
$this->db->where('email', $this->session->userdata('userid'));
$query = $this->db->get('campaigns2');
$row = $query->result();
}
if (!isset($row[0]->type))
$row[0]->type = 0; //if not set make is into generic
//set the premium support flag
if ($row[0]->premium_support==1)
$_SESSION['premium_support']=1;
$this->MyModel->counts_for_three_way();
//set this to software or pharma or generic or defense
$this->output->set_template('default2');
$this->load->js('assets/themes/default/js/jquery-1.9.1.min.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-transition.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-collapse.js');
$this->load->js('js/jquery.orgchart.js'); // for charts
$testhost = getenv('TESTHOST');
$this->MyModel->update_risk(); //do this everytime a user logs in
$this->create_cubby(); //attempt to create cubbys for this person
}
public function _configure_output($output = null)
{
$GLOBALS['title'] = "Research Credit Online";
$this->load->view('configure.php', (array)$output);
}
public function index()
{
$this->_configure_output((object)array('output' => '', 'js_files' => array(), 'css_files' => array()));
$this->_example_output((object)array('output' => '', 'js_files' => array(), 'css_files' => array()));
if ($this->session->userdata('onetime')!=1)
{
$this->session->set_userdata('onetime', 1);
//load the dashboard
$this->report_generator_amazing(); <<this displays the dashboard
//load the images
$this->get_from_locker(); //bring down this guy's images from s3
}
}