<!--
*
*  INSPINIA - Responsive Admin Theme
*  version 2.9.2
*
-->

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title><?=get_myconf('app_name')?></title>
	
	<!-- CSS -->

    <link href="<?=base_url()?>assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?=base_url()?>assets/font-awesome/css/font-awesome.css" rel="stylesheet">

    <!-- Toastr style -->
    <link href="<?=base_url()?>assets/css/plugins/toastr/toastr.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="<?=base_url()?>assets/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
	
	<!-- DATATABLES -->
	
    <link href="<?=base_url()?>assets/css/plugins/dataTables2/datatables.min.css" rel="stylesheet">
	<link src="https://cdn.datatables.net/buttons/1.6.1/css/buttons.dataTables.min.css"></link>
	<link src="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css"></link>
	
	<!-- SELECT2 -->
    <link href="<?=base_url()?>assets/css/plugins/select2/select2.min.css" rel="stylesheet">

    <link href="<?=base_url()?>assets/css/animate.css" rel="stylesheet">
    <link href="<?=base_url()?>assets/css/style.css" rel="stylesheet">
	
    <!-- Sweet Alert 2 -->
    <link href="<?=base_url()?>assets/css/plugins/sweetalert2/sweetalert2.css" rel="stylesheet">
    <!-- iCHeck -->
    <link href="<?=base_url()?>assets/css/plugins/iCheck/custom.css" rel="stylesheet">
	
    <!-- filepond -->
	<link rel="stylesheet" href="<?=base_url()?>assets/css/plugins/filepond/filepond.css">
	<link rel="stylesheet" href="<?=base_url()?>assets/css/plugins/filepond/filepond-plugin-image-preview.min.css">
	<link rel="stylesheet" href="<?=base_url()?>assets/css/plugins/filepond/filepond-plugin-file-poster.css">
	<link rel="stylesheet" href="<?=base_url()?>assets/css/plugins/filepond/filepond-plugin-image-edit.css">
	
	<!-- jsTree -->
	
    <link href="<?=base_url()?>assets/css/plugins/jsTree/style.min.css" rel="stylesheet">	
	
    <link href="<?=base_url()?>assets/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <!-- Date picker -->
    <link href="<?=base_url()?>assets/css/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
	<!-- Chosen -->
    <link href="<?=base_url()?>assets/css/plugins/chosen/bootstrap-chosen.css" rel="stylesheet">
	
    <!-- Ladda style -->
    <link href="<?=base_url()?>assets/css/plugins/ladda/ladda-themeless.min.css" rel="stylesheet">
	<!-- Color Picker -->
    <link href="<?=base_url()?>assets/css/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
	
	<?php $this->load->view('style')?>

	<!-- JAVASCRIPTS -->
	

    <!-- Mainly scripts -->
    <script src="<?=base_url()?>assets/js/jquery-3.1.1.min.js"></script>
    <script src="<?=base_url()?>assets/js/popper.min.js"></script>
    <script src="<?=base_url()?>assets/js/bootstrap.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

    <!-- Flot 
    <script src="<?=base_url()?>assets/js/plugins/flot/jquery.flot.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/flot/jquery.flot.spline.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/flot/jquery.flot.resize.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/flot/jquery.flot.pie.js"></script>-->

    <!-- Peity -->
    <script src="<?=base_url()?>assets/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="<?=base_url()?>assets/js/demo/peity-demo.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="<?=base_url()?>assets/js/inspinia.js"></script>
    <script src="<?=base_url()?>assets/js/helper.js"></script>
	<script>
	  window.paceOptions = { ajax: { ignoreURLs: ['EIO=3&transport=polling'], trackWebSockets: false } }
	</script>
    <script src="<?=base_url()?>assets/js/plugins/pace/pace.min.js"></script>

    <!-- jQuery UI 
    <script src="<?=base_url()?>assets/js/plugins/jquery-ui/jquery-ui.min.js"></script>
	-->

    <!-- GITTER -->
    <script src="<?=base_url()?>assets/js/plugins/gritter/jquery.gritter.min.js"></script>

    <!-- Sparkline -->
    <script src="<?=base_url()?>assets/js/plugins/sparkline/jquery.sparkline.min.js"></script>

    <!-- Sparkline demo data  -->
    <script src="<?=base_url()?>assets/js/demo/sparkline-demo.js"></script>

    <!-- ChartJS-->
    <script src="<?=base_url()?>assets/js/plugins/chartJs/Chart.min.js"></script>
	
	<!-- DATATABLES -->
	
    <script src="<?=base_url()?>assets/js/plugins/dataTables2/datatables.min.js"></script>
    <!-- Chosen -->
    <script src="<?=base_url()?>assets/js/plugins/chosen/chosen.jquery.js"></script>
	
	<!-- SELECT2 -->
	
    <script src="<?=base_url()?>assets/js/plugins/select2/select2.full.min.js"></script>

    <!-- Toastr -->
    <script src="<?=base_url()?>assets/js/plugins/toastr/toastr.min.js"></script>
	
    <script src="<?=base_url()?>assets/js/eModal.js"></script>
    <!-- Sweet alert 2 -->
    <script src="<?=base_url()?>assets/js/plugins/sweetalert2/sweetalert2.js"></script>
    <!-- iCheck -->
    <script src="<?=base_url()?>assets/js/plugins/iCheck/icheck.min.js"></script>
	
    <!-- filepond -->
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-file-encode.min.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-file-validate-type.min.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-file-validate-size.min.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-exif-orientation.min.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-preview.min.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-file-poster.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-resize.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-crop.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-transform.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-image-edit.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond-plugin-file-rename.js"></script>
	<script src="<?=base_url()?>assets/js/plugins/filepond/filepond.js"></script>
	
	<!-- jstree -->
	<script src="<?=base_url()?>assets/js/plugins/jsTree/jstree.min.js"></script>
	
   <!-- Input Mask-->
    <script src="<?=base_url()?>assets/js/plugins/jasny/jasny-bootstrap.min.js"></script>
	
   <!-- Date picker -->
   <script src="<?=base_url()?>assets/js/plugins/datapicker/bootstrap-datepicker.js"></script>
   
    <!-- Date range picker -->
    <script src="<?=base_url()?>assets/js/plugins/daterangepicker/daterangepicker.js"></script>
	
    <!-- Print AREA -->
	<script src="<?=base_url()?>assets/js/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
	
    <!-- Ladda -->
    <script src="<?=base_url()?>assets/js/plugins/ladda/spin.min.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/ladda/ladda.min.js"></script>
    <script src="<?=base_url()?>assets/js/plugins/ladda/ladda.jquery.min.js"></script>
    <!-- Color picker -->
    <script src="<?=base_url()?>assets/js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
    <!-- Ellipsis plugin -->
    <script src="<?=base_url()?>assets/js/jquery.ellipsis.min.js"></script>
    <script type="text/javascript" src="<?=base_url()?>assets/js/printThis.js"></script>
	<!-- NODEJS-SOCKETIO 
	<script type="text/javascript" src="https://nodejs.serbasembako.com/socket.io/socket.io.js"></script>
	-->
	<script>
	var site_url = "<?=base_url()?>";</script>
</head>

<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav metismenu" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element"> 
						<?php 
							$profile_pic_img = base_url().'assets/img/user.png';
							$images_list = getImageList($this->session->userdata("idOperator"),1);
							if(isset($images_list[0]['options']['metadata']['poster']))
							{
								$profile_pic_img = $images_list[0]['options']['metadata']['poster'];
							}
						?>
						<span>
						<img alt="image" class="img-thumbnail img-md" src="<?=$profile_pic_img?>">
                             </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="javascript:void;">
                            <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold"><?=$this->session->userdata("userName")?></strong>
                             </span> <span class="text-muted text-xs block"><?=$this->session->userdata('oprDescription')?><b class="caret"></b></span> </span> </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
																<li><a onclick="modalView({url:'settings/settings/profile/1/<?=$this->session->userdata('idOperator');?>',title:'Edit',subtitle:'Profile'})">Profile</a></li>
                                <li class="divider"></li>
                                <li><a href="javascript:void(0)" onclick="logoutApp()">Log Out</a></li>
                            </ul>
                        </div>
                        <div class="logo-element">
                            <?=substr($this->session->userdata("userName"), 0, 3)?>
                        </div>
                    </li>
                    <?=$this->menu->generate()?>
					<li id="logout_menu" class="">
						<a href="javascript:void(0)" onclick="logoutApp()">
							<div class="flipthis-wrapper">
								<i class="fa fa-power-off"></i><span class="">Logout</span>
							</div>
						</a>
					</li>
                </ul>

            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
        <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <a class="navbar-minimalize minimalize-styl-2 btn btn-success " href="javascript:void(0)"><i class="fa fa-bars"></i> </a>
            <form role="search" class="navbar-form-custom" action="search_results.html">
                <div class="form-group">
                    <input type="text" placeholder="" class="form-control" name="top-search" id="top-search">
                </div>
            </form>
        </div>
            <ul class="nav navbar-top-links navbar-right">
                <li style="padding: 10px">
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle count-info" data-toggle="dropdown" href="javascript:void(0)">
                        <i class="fa fa fa-bell"></i>  <span class="label label-warning" id="notify_counter">0</span>
                    </a>
					<ul class="dropdown-menu dropdown-alerts">
						<div id="notify_content">
						</div>
                    </ul>
                </li>
				<li><a>&nbsp;</a>
				</li>
                <li class="hidden">
                    <a href="<?=base_url()?>login/signout">
                        <i class="fa fa-sign-out"></i> Log out
                    </a>
                </li>
            </ul>

        </nav>
        </div>
		<!-- BREADCRUMB-->
		<div class="row wrapper border-bottom white-bg page-heading">
			<div class="col-lg-10">
				<h2 class="" id="menu_title"></h2>
				<ol class="breadcrumb" id="menu_breadcrumb">
				</ol>
			</div>
		</div>
            <?php $this->load->view($content); ?>
			<div class="footer">
                    <div class="pull-right">
                    id: <?=session_id();?>
                    </div>
                    <div class="">
                    <strong>Copyright</strong> &copy; <?=date('Y')?> <?=get_myconf('dev_team')?>
                    </div>
                </div>
        </div>
    </div>
    <div style="display: none;">
        <div id="print-html-content"></div>
    </div>
	<?php $this->load->view('js')?>
	
	<script>
		if (!$('body').hasClass('no-skin-config'))
		{
			$.ajax({
				type: "GET",
				url: "<?=base_url()?>main/getSkinConfig/",
				data: {},
				dataType: 'html',
				success: function(response)
				{
					$('body').append(response);
				},
				error: function( jqXhr, textStatus, errorThrown ){
					var error_message = 'internal error';
					if(jqXhr.responseJSON !== undefined)
					{
						error_message = jqXhr['responseJSON']['message'];
					}
					swal('error', error_message, "error");
				}
			});
		}
		var body = $('body');	
		var collapse = "<?=$this->session->userdata('collapse_menu')?>";
			if (collapse == 'on') {
				if (body.hasClass('fixed-sidebar')) {
					if (!body.hasClass('body-small')) {
						body.addClass('mini-navbar');
					}
				} else {
					if (!body.hasClass('body-small')) {
						body.addClass('mini-navbar');
					}
				}
			}
		
		var fixedsidebar = "<?=$this->session->userdata('fixedsidebar')?>";
			if (fixedsidebar == 'on') {
				body.addClass('fixed-sidebar');
				$('.sidebar-collapse').slimScroll({
					height: '100%',
					railOpacity: 0.9
				});
			}
			
		var fixednavbar = "<?=$this->session->userdata('fixednavbar')?>";
			if (fixednavbar == 'on') {
				$(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top');
				body.addClass('fixed-nav');
			}
			
		var fixednavbar2 = "<?=$this->session->userdata('fixednavbar2')?>";
			if (fixednavbar2 == 'on'){
				$('#fixednavbar2').prop('checked','checked')
			}

		var boxedlayout = "<?=$this->session->userdata('boxedlayout')?>";
			if (boxedlayout == 'on') {
				body.addClass('boxed-layout');
			}

		var fixedfooter = "<?=$this->session->userdata('fixedfooter')?>";
			if (fixedfooter == 'on') {
				$(".footer").addClass('fixed');
			}
			
		var skinColor = "<?=$this->session->userdata('skinColor')?>";

		if (skinColor != '') {
			setActiveSkin(skinColor);
		}
	</script>
</body>
</html>
