<!DOCTYPE html>
<?php
$this->lang->load("menu", $this->session->userdata('language'));
$admin = ($this->session->userdata('logged_in') && element('role',$this->session->userdata('logged_in')) == "ADMIN") ? TRUE : FALSE;
?>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Audit Permohonan AP</title>
	<!--<link rel="shortcut icon" href="<?php echo base_url(); ?>dist/img/favicon.png">-->
	<!--link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" type="text/css">-->
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/ionicons/css/ionicons.min.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datatables/dataTables.bootstrap.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap-datetimepicker.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/daterangepicker/daterangepicker.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/AdminLTE.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/validationengine/validationEngine.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/skins/_all-skins.min.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>dist/custom/custom.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/pnotify/css/pnotify.buttons.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/pnotify/css/jquery.pnotify.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/chartist/chartist.css">
	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
	<![endif]-->
	<script type="text/javascript">
	var custombox_cancel = "<?php echo $this->lang->line('cancel'); ?>";
	var custombox_confirm = "<?php echo $this->lang->line('confirm'); ?>";
	var custombox_defaultmsg = "<?php echo $this->lang->line('defaultmsg') ?>";
	</script>
	<script src="<?php echo base_url(); ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<script src="<?php echo base_url(); ?>plugins/jQueryUI/jquery-ui.js"></script>
	<script src="<?php echo base_url(); ?>plugins/daterangepicker/moment.js"></script>
	<script src="<?php echo base_url(); ?>bootstrap/js/bootstrap.min.js"></script>
	<script src="<?php echo base_url(); ?>plugins/daterangepicker/moment.js"></script>
	<script src="<?php echo base_url(); ?>plugins/daterangepicker/daterangepicker.js"></script>
	<script src="<?php echo base_url(); ?>bootstrap/js/bootstrap-datetimepicker.js"></script>
	<script src="<?php echo base_url(); ?>plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="<?php echo base_url(); ?>plugins/datatables/dataTables.bootstrap.min.js"></script>
	<script src="<?php echo base_url(); ?>plugins/countUp/countUp.min.js"></script>
	<script src="//cdn.jsdelivr.net/accounting.js/0.3.2/accounting.min.js"></script>
	<script src="<?php echo base_url(); ?>plugins/chartist/chartist.min.js"></script>
	<script src="//cdn.jsdelivr.net/jquery.sparkline/2.1.2/jquery.sparkline.js"></script>
	<script src="//cdn.jsdelivr.net/raphael/2.1.4/raphael.js"></script>
	<script src="<?php echo base_url(); ?>plugins/mapael/jquery.mapael.js"></script>
	<script src="<?php echo base_url(); ?>plugins/mapael/malaysia.js"></script>
	
	<?php echo $this->layouts->print_includes(); ?>
	<script type="text/javascript">
	$(function() {
	  var pgurl = window.location.href;
		$(".main-menu li").removeClass('active').removeClass('bg-red-active');
		$(".main-menu li a").each(function(){
			if($(this).attr("href") == pgurl || $(this).attr("href") == '' )
			$(this).parent('li').addClass("active").addClass('bg-red-active');
		});
	});
	</script>
	<style>
	.navbar ul li.active { bacground-color: #900 !important; }
	@media print { .no-print, .no-print *, .printHide, #scrollUp { display: none !important; } }
	#menuButton { color: #FFF; margin: 2% 1%; }
	#menuModal { z-index: 10001 !important; }
	</style>
</head>
<body class="skin-blue-light">
	<?php
	$_c = strtolower(trim($this->uri->segment(1)));		
	$path = base_url().'dist/img/profile/';
	$vpath = STR_REPLACE("\\","/",FCPATH).'dist/img/profile/';
	$pic = ($this->session->userdata('logged_in')) ? element('userProfilePic', $this->session->userdata('logged_in')) : "default.png";
	$profile = $path . (($pic) ? ((file_exists($vpath.$pic)) ? ((getimagesize($vpath.$pic)) ? $pic : 'default.png') : 'default.png') : 'default.png');
	$default = $path . 'default.png';
	?>
	<div class="wrapper">
		<header class="main-header printHide bg-navy">
			<nav class="navbar navbar-static-top bg-navy">
				<div class="container-fluid" style="width: 100%;">
					<div class="navbar-header" style="width: 100%;">
						<!-- LOGO -->
						<a href="<?php echo base_url(); ?>home" class="navbar-brand">
							<img src="<?php echo base_url(); ?>dist/img/abc.png" class="pull-left" />
						</a>
						<!-- MAIN MENU -->
						<ul class="nav navbar-nav hidden-xs hidden-sm" style="margin: 0;">
							<!-- HOME -->
							<li class="<?php echo ($_c == "home" || !$_c) ? "active" : ""; ?>">
								<a href="<?php echo base_url(); ?>home" class="odd">
									<i class="fa fa-home fa-fw"></i><br />
									<span class="ng-scope"><?php echo $this->lang->line('home'); ?></span>
								</a>
							</li>
							<!-- APPLY -->
							<li class="<?php echo ($_c == "apply") ? "active" : ""; ?>">
								<a href="<?php echo base_url(); ?>apply" class="even">
									<span class="glyphicon glyphicon-plus"></span>
									<i class="fa fa-pencil fa-fw"></i><br />
									<span class="ng-scope"><?php echo $this->lang->line('request'); ?> AP</span>
								</a>
							</li>
							<!-- REVIEW -->
							<li class="<?php echo ($_c == "review") ? "active" : ""; ?>">
								<a href="<?php echo base_url(); ?>review" class="odd">
									<span class="glyphicon glyphicon-plus"></span>
									<i class="fa fa-binoculars fa-fw"></i><br />
									<span class="ng-scope"><?php echo $this->lang->line('review'); ?> Audit</span>
								</a>
							</li>
							<!-- COMPANY -->
							<li class="<?php echo ($_c == "company") ? "active" : ""; ?>">
								<a href="<?php echo base_url(); ?>company" class="odd">
									<i class="fa fa-bank fa-fw"></i><br />
									<span class="ng-scope"><?php echo $this->lang->line('company'); ?></span>
								</a>
							</li>
							<!-- SETUP -->
							<?php if ($admin) : ?>
							<li class="<?php echo ($_c == "setup") ? "dropdown active" : "dropdown"; ?>">
								<a href="Javascript:void(0);" class="dropdown-toggle odd" data-toggle="dropdown">
									<i class="fa fa-gears fa-fw"></i><br />
									<span class="ng-scope"><?php echo $this->lang->line('admin'); ?></span>
									<span class="caret"></span>
								</a>

								<ul class="dropdown-menu" role="menu">
									<li><a href="<?php echo base_url(); ?>setup/review/1"><?php echo $this->lang->line('setup')." ".$this->lang->line('review'); ?></a></li>
									<li><a href="<?php echo base_url(); ?>setup/subreview"><?php echo $this->lang->line('setup')." ".$this->lang->line('subreview'); ?></a></li>
									<!--<li><a href="<?php echo base_url(); ?>setup/auditreport"><?php echo $this->lang->line('setup')." ".$this->lang->line('report')." ".$this->lang->line('audit'); ?></a></li>-->
									<li class="divider"></li>
									<li><a href="<?php echo base_url(); ?>users"><?php echo $this->lang->line('setup')." ".$this->lang->line('user'); ?></a></li>
								</ul>
							</li>
							<?php endif; ?>
						</ul>
						
						<!-- MENU BUTTON -->
						<a href="#" class="hidden-lg hidden-md pull-right" id="menuButton" data-toggle="modal" data-target="#menuModal"><i class="fa fa-bars fa-3x"></i></a>

						<!-- PROFILE MENU -->
						<div class="navbar-custom-menu pull-right hidden-xs hidden-sm">
							<ul class="nav navbar-nav">
								<li class="dropdown user user-menu">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">
										<img id="user_login_profile_pic" src="<?php echo $profile; ?>" class="user-image" />
										<span class="hidden-xs"><?php echo element('username', $this->session->userdata('logged_in')); ?></span>
									</a>
									<ul class="dropdown-menu">
										<li class="user-header bg-navy">
											<img src="<?php echo $profile; ?>" class="img-circle">
											<p><a href="<?php echo base_url()."users/profile" ?>"><?php echo element('username', $this->session->userdata('logged_in')); ?></a></p>
										</li>
										<li class="user-footer">
											<div>
												<a href="<?php echo base_url().'users/profile'; ?>" class="btn btn-default btn-flat pull-left">Profile</a>
												<a href="<?php echo base_url(); ?>logout" class="btn btn-default btn-flat pull-right">Sign out</a>
											</div>
										</li>
									</ul>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</nav>
			
			<?php
			// SELECTED COMPANY NAME
			if ($this->session->userdata('companyID')) {
				if ($selectedCompany = $this->general_model->get_byFilter('company_main',array('*'), array('ID'=>$this->session->userdata('companyID')))) {
					$sc = $selectedCompany[0];
					?>
					<div class="box box-widget">
						<div class='box-header with-border'>
							<div class='user-block'>							
								<?php
								if ($this->router->fetch_class() != 'home') {
									echo ($this->router->fetch_method() != 'index') ?
													"<a class=\"pull-left btn btn-danger btn-xs\" href=\"".(base_url().$this->router->fetch_class())."\"><i class=\"fa fa-backward\"></i></a>\n" :
													"<a class=\"pull-left btn btn-danger btn-xs\" href=\"".(base_url())."\"><i class=\"fa fa-backward\"></i></a>\n";
								}
								?>
								
								<span class='username'><a href="<?php echo base_url(); ?>company/details"><?php echo $sc->companyName; ?></a></span>
								
								<span class='description'>[<?php echo $sc->companyNo; ?>]</span>
							</div>

							<div class='box-tools'>
								<a class='btn btn-box-tool' data-toggle='tooltip' title='<?php echo $this->lang->line('change'); ?>' href="<?php echo base_url(); ?>company">
									<i class='fa fa-circle-o'></i>
									<span><?php echo $this->lang->line('change'); ?></span>
								</a>
							</div>
						</div>
					</div>
					<?php
				}
			}
			?>
		</header>
							
		<!-- MENU MODAL -->
		<div class="modal fade" id="menuModal" role="dialog">
			<div class="modal-dialog modal-sm">
			
				<div class="modal-content">
					<div class="modal-header" >							
						<button type="button" class="close" data-dismiss="modal"><i class="fa fa-times fa-2x"></i></button>
						<h3 class="modal-title">MENU</h3>
					</div>
					
					<div class="modal-body">
						<div class="row">
							<div class="col-sm-8 col-xs-6">
								<!-- MAIN MENU -->
								<ul class="nav navbar-nav nav-stacked" style="margin: 0; font-size: 1em;">
									<!-- HOME -->
									<li class="<?php echo ($_c == "home" || !$_c) ? "active" : ""; ?>">
										<a href="<?php echo base_url(); ?>home">
											<i class="fa fa-home fa-fw"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ng-scope"><?php echo $this->lang->line('home'); ?></span>
										</a>
									</li>
									<!-- APPLY -->
									<li class="<?php echo ($_c == "apply") ? "active" : ""; ?>">
										<a href="<?php echo base_url(); ?>apply" class="even">
											<i class="glyphicon glyphicon-plus"></i>&nbsp;<i class="fa fa-pencil fa-fw"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ng-scope"><?php echo $this->lang->line('request'); ?> AP</span>
										</a>
									</li>
									<!-- REVIEW -->
									<li class="<?php echo ($_c == "review") ? "active" : ""; ?>">
										<a href="<?php echo base_url(); ?>review" class="odd">
											<i class="glyphicon glyphicon-plus"></i>&nbsp;<i class="fa fa-binoculars fa-fw"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ng-scope"><?php echo $this->lang->line('review'); ?> Audit</span>
										</a>
									</li>
									<!-- COMPANY -->
									<li class="<?php echo ($_c == "company") ? "active" : ""; ?>">
										<a href="<?php echo base_url(); ?>company" class="odd">
											<i class="fa fa-bank fa-fw"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ng-scope"><?php echo $this->lang->line('company'); ?></span>
										</a>
									</li>
									<!-- SETUP -->
									<li class="<?php echo ($_c == "setup") ? "dropdown active" : "dropdown"; ?>">
										<a href="Javascript:void(0);" class="dropdown-toggle odd" data-toggle="dropdown">
											<i class="fa fa-gears fa-fw"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ng-scope"><?php echo $this->lang->line('admin'); ?></span>
											<span class="caret"></span>
										</a>
										<ul class="dropdown-menu" role="menu">
											<li><a href="<?php echo base_url(); ?>setup/review/1"><?php echo $this->lang->line('setup')." ".$this->lang->line('review'); ?></a></li>
											<li><a href="<?php echo base_url(); ?>setup/subreview"><?php echo $this->lang->line('setup')." ".$this->lang->line('subreview'); ?></a></li>
											<li><a href="<?php echo base_url(); ?>users"><?php echo $this->lang->line('setup')." ".$this->lang->line('user'); ?></a></li>
										</ul>
									</li>
								</ul>
							</div>
							
							<div class="col-sm-4 col-xs-6">
								<div style="margin: 5%;">
									<img class="img-circle img-fluid img-responsive" style="width:100%; height:auto;" src="<?php echo $profile; ?>" />		
									<div class="row text-center" style="padding: 2%;">
										<div class="col-sm-12 col-xs-6 text-center" style="margin: 1% auto;"><a href="<?php echo base_url().'users/profile'; ?>" 	class="btn btn-default btn-sm btn-flat">Profile</a></div>
										<div class="col-sm-12 col-xs-6 text-center" style="margin: 1% auto;"><a href="<?php echo base_url(); ?>logout" 						class="btn btn-default btn-sm btn-flat">Sign out</a></div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div class="modal-footer">
					
					</div>
				</div>
				
			</div>
		</div>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
