115 lines
4.0 KiB
PHP
Executable File
115 lines
4.0 KiB
PHP
Executable File
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class onboarding extends MX_Controller {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
|
|
$this->load->model("Onboarding_model");
|
|
$this->load->model("onboarding_video_content/Video_content_model");
|
|
$this->load->model('website_settings/Website_model');
|
|
}
|
|
|
|
public function index($id="") {
|
|
|
|
}
|
|
public function test()
|
|
{
|
|
echo "test";
|
|
}
|
|
public function process($token="") {
|
|
/*get token details*/
|
|
$datas = $this->Onboarding_model->token_details($token);
|
|
//pre($datas);die;
|
|
if(isset($datas->user_id) && $datas->user_id !='' && $datas->eligibility_status =="1" )
|
|
{
|
|
$data = array();
|
|
$data['token'] = $token;
|
|
$data['user'] = $this->Onboarding_model->getNurseById($datas->user_id);
|
|
$data['Landing_content'] = $this->Onboarding_model->onBoardContent('Landing_content')->description;
|
|
$data['onboard_videos'] = $this->Onboarding_model->onBoardVideos($data['user']->qualification_type);
|
|
// _die($data['Landing_content']);
|
|
// die();
|
|
$newdata = array(
|
|
'token' => $token,
|
|
'user_id' => $datas->user_id,
|
|
);
|
|
|
|
$this->session->set_userdata($newdata);
|
|
$data['content']=$this->Website_model->getContentList();
|
|
$data['basic']=$this->Website_model->getbasicInfo();
|
|
$this->load->view('onboard-head.php',$data);
|
|
$this->load->view('onboarding-process',$data);
|
|
$this->load->view('frontend/footer',$data);
|
|
}
|
|
else
|
|
{
|
|
redirect(base_url()."auth/login");
|
|
}
|
|
// just the header file
|
|
}
|
|
|
|
public function onboardingVideo($vid)
|
|
{
|
|
$data['content']=$this->Website_model->getContentList();
|
|
$data['basic']=$this->Website_model->getbasicInfo();
|
|
if(isset($_SESSION['token']))
|
|
{
|
|
$vdid = $vid;
|
|
$token = $_SESSION['token'];
|
|
$id = $_SESSION['user_id'];
|
|
$data['vid']=$vid;
|
|
$data['onboard_videos'] = $this->Onboarding_model->onBoardVideosById($vdid);
|
|
$datas = $this->Onboarding_model->token_details($token);
|
|
$data['user'] = $this->Onboarding_model->getNurseById($datas->user_id);
|
|
|
|
$questions=$this->Video_content_model->getMainQuestionsById($vid);
|
|
|
|
$chat['bot']['name']='Wecuro';
|
|
$chat['bot']['time']=date('H:i');
|
|
$chat['bot']['msg']="Hi,{$data['user']->fname} welcome to Chat! Go ahead. 😄 <br> Select your question.";
|
|
$chat['bot']['question']=$questions;
|
|
|
|
$data['chat']=$chat;
|
|
$this->load->view('onboard-head.php',$data);
|
|
$this->load->view('onboarding-video',$data);
|
|
$this->load->view('frontend/footer',$data);
|
|
// $this->load->view('onboard-foot',$data);
|
|
}
|
|
else
|
|
{
|
|
redirect(base_url()."auth/login");
|
|
}
|
|
|
|
}
|
|
|
|
public function getAnswer()
|
|
{
|
|
if(isset($_SESSION['token']))
|
|
{
|
|
$data['user_id']=$_SESSION['user_id'];
|
|
$questionId=$this->input->post('questionId');
|
|
$data['timePlay']=$this->input->post('timePlay');
|
|
$data['video_id'] = $this->input->post('videoId');
|
|
$question=$this->Video_content_model->getQuestionsAnswerById($questionId);
|
|
$data['question']=$question->question;
|
|
$data['answer']=$question->answer;
|
|
$this->Video_content_model->storeUserQuery($data);
|
|
|
|
$output['answer']=$question->answer;
|
|
$output['child_questions']=$this->Video_content_model->getChildQuestionsById($questionId);
|
|
// $this->storeVideoQuery($data);
|
|
echo json_encode($output);
|
|
//print_r($output);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* End of file accountant.php */
|
|
/* Location: ./application/modules/accountant/controllers/accountant.php */
|