<!doctype html>
<html lang="en-US">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Soaring Skills Institute - Admin</title>
		<meta name="description" content="" />
		<meta name="Author" content="PaulMG [www.stilecreations.co.ke]" />

		<!-- mobile settings -->
		<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0" />

		<!-- WEB FONTS -->
		<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700,800&amp;subset=latin,latin-ext,cyrillic,cyrillic-ext" rel="stylesheet" type="text/css" />

		<!-- CORE CSS -->
		<!-- CORE CSS -->
		<link href="<?php echo base_url(); ?>/public/admin/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		
		<!-- THEME CSS -->
		<link href="<?php echo base_url(); ?>/public/admin/css/essentials.css" rel="stylesheet" type="text/css" />
		<link href="<?php echo base_url(); ?>/public/admin/css/layout.css" rel="stylesheet" type="text/css" />
		<link href="<?php echo base_url(); ?>/public/admin/css/color_scheme/green.css" rel="stylesheet" type="text/css" id="color_scheme" />
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
          <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
          
          <link href="<?php echo base_url();?>public/admin/css/layout-datatables.css" rel="stylesheet" type="text/css" />
		<!-- THEME CSS -->
		<link href="<?php echo base_url(); ?>/public/admin/css/essentials.css" rel="stylesheet" type="text/css" />
		<link href="<?php echo base_url(); ?>/public/admin/css/layout.css" rel="stylesheet" type="text/css" />
		<link href="<?php echo base_url(); ?>/public/admin/css/color_scheme/green.css" rel="stylesheet" type="text/css" id="color_scheme" />
		
		<!-- DATATABLES -->
		 <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css">

        <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
        <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>

	</head>
	<!--
		.boxed = boxed version
	-->
	<body>
		<!-- WRAPPER -->
		<div id="wrapper">
			<aside id="aside">
				<nav id="sideNav"><!-- MAIN MENU -->
					<ul class="nav nav-list">
						<li><!-- dashboard -->
							<a class="dashboard" href="<?php echo base_url();?>/portal"><!-- warning - url used by default by ajax (if eneabled) -->
								<i class="main-icon fa fa-dashboard"></i> <span>Dashboard</span>
							</a>
						</li>
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa  fa-folder-open"></i> <span>Courses</span>
							</a>
							<ul>
    							<li><a href="<?php echo base_url('allcourses') ; ?> ">View Courses</a></li>
    							<li><a href="<?php echo base_url('addcourse') ; ?>">Add Course</a></li>
							</ul>
						</li>
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa fa-table"></i> <span>Training Schedule</span>
							</a>
							<ul><!-- submenus -->
								<li><a href="<?php echo base_url('schedules') ; ?>">View Schedule</a></li>
								<li><a href="<?php echo base_url('addschedule') ; ?>">Add Schedule</a></li>					
							</ul>
						</li>
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa fa-graduation-cap"></i> <span>Students</span>
							</a>
							<ul>
								<li><a href="<?php echo base_url('students') ; ?>">View Students</a></li>
								<li><a href="<?php echo base_url('studentsearch') ; ?>">View Student</a></li>
							</ul>
						</li>
						<li class="">
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa fa-users"></i> <span>Trainers</span>
							</a>
							<ul>
								<li><a href="<?php echo base_url('trainers') ; ?>">View Trainers</a></li>
								<li><a href="<?php echo base_url('trainersearch') ; ?>">View Trainer</a></li>
							</ul>
						</li>
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa fa-book"></i> <span>News</span>
							</a>
							<ul>
								<li><a href="<?php echo base_url('adminnews') ; ?>">View News</a></li>
								<li><a href="<?php echo base_url('addnews') ; ?>">Add Article</a></li>
							</ul>
						</li>

						<?php
							$session = \Config\Services::session();
                      		$userType = $session->get('userType');
							if($userType==1){
										 ?>
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
								<i class="main-icon fa fa-book"></i> <span>News</span>
							</a>
							<ul>
								<li><a href="<?php echo base_url('users') ; ?>">View Users</a></li>
								<li><a href="<?php echo base_url('adduser') ; ?>">Add User</a></li>
							</ul>
						</li>

						<?php
							}else{

						$userId=$session->get('userId');
										 ?>

						<!--ul class="nav nav-list"-->
						<li>
							<a href="#">
								<i class="fa fa-menu-arrow pull-right"></i>
									<i class="main-icon fa fa-gears"></i><span>User Profile</span>
								</a>
								<ul>
							<li><a href="<?php echo base_url('updateuser/'.$userId) ; ?>">
								<i class="main-icon fa fa-user"></i>Change my Details</a></li>
								<li><a href="<?php echo base_url('logout') ; ?>">
								<i class="main-icon fa fa-power-off"></i>Logout</a>
									</li>
								</ul>
						</li>
						
					<!--/ul-->

					<?php } ?>

					</ul>
				</nav>

				<span id="asidebg"></span>
			</aside>
			<!-- /ASIDE -->

			<!-- HEADER -->
			<header id="header">

				<!-- Mobile Button -->
				<button id="mobileMenuBtn"></button>

				<!-- Logo -->
				<span class="logo pull-left">
					<img src="<?php echo base_url();?>/assets/images/logo_d.png" alt="Admin Panel" height="45px" class="img-responsive" />
				</span>

				

				<span class="logo pull-left">
					<a class="btn btn-success pull-left" href="<?php echo site_url();?>" target="_blank">View Site</a>
				</span>

				<nav>


					<!-- OPTIONS LIST -->
					<ul class="nav pull-right">

						<!-- USER OPTIONS -->

						<li class="dropdown pull-left">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
								<img class="user-avatar" alt="" src="<?php echo base_url();?>/public/unify/img/noavatar.jpg" height="34" /> 
								<span class="user-name">
									<span class="hidden-xs">
										<?php echo  $user['firstName'] ; ?> <?php echo  $user['surName'] ;?>  <i class="fa fa-angle-down"></i>
									</span>
								</span>
							</a>
							<ul class="dropdown-menu hold-on-click">
								<li><!-- my inbox -->
									<li><a href="<?php echo base_url('updateuser/'.$userId) ; ?>"><i class="fa fa-cogs"></i>Change my Details</a>
									</li>
								
								<li class="divider"></li>
								<li><!-- logout -->
									<a href="<?php echo base_url('logout') ; ?>"><i class="fa fa-power-off"></i> Log Out</a>
								</li>
							</ul>
						</li>
						<!-- /USER OPTIONS -->

					</ul>
					<!-- /OPTIONS LIST -->

				</nav>

			</header>
			<!-- /HEADER -->

			<section id="middle">
				<div id="content" class="dashboard padding-20">
