<?php

class TrainingController extends CI_Controller
{
	public function index()
	{
		$this->load->view('templates/1_head.php');

		$this->load->view('templates/2_nav.php');

		$this->load->view('templates/3_sidebar_menu_left.php');

		/* Meeting Curl API Start */

		// create & initialize a curl session
		$curl = curl_init();
		curl_setopt($curl, CURLOPT_URL, "https://myadmin.mali-mart.com/api/meeting-list");
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		$output = curl_exec($curl);
		curl_close($curl);

		$data['meetings'] = $output;
		/* Meeting Curl API End */

		$this->load->view('training/trainings.php', $data); //4_dynamic

		$this->load->view('templates/5_footer.php');

		$this->load->view('templates/6_script_end.php');
	}

	public function startMeeting()
	{

		$data['join_url'] = $_GET['url'];
		$data['password'] = $_GET['password'];
		$data['topic'] = $_GET['topic'];
		$data['description'] = $_GET['description'];
		$data['time'] = $_GET['time'];

		$this->load->view('training/start-training.php', $data); //4_dynamic

	}
}
