<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="img/favicon.png">
	<title><?=$title; ?></title>
	<?
	//Prepare tools array
	$my_tools = array(
					"wyswig" => array(
						"assets" => array("bootstrap-wysihtml5/wysihtml5-0.3.0.js", "bootstrap-wysihtml5/bootstrap-wysihtml5.js"), 
						"css" => array("bootstrap-wysihtml5/bootstrap-wysihtml5.css")
					),
					"datepicker" => array(
						"assets" => array("bootstrap-datepicker/js/bootstrap-datepicker.js"), 
						"css" => array("bootstrap-datepicker/css/datepicker.css")
					),
					"datetimepicker" => array(
						"assets" => array("bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"), 
						"css" => array("bootstrap-datetimepicker/css/datetimepicker.css")
					),
					"multi_select" => array(
						"assets" => array("jquery-multi-select/js/jquery.multi-select.js", "jquery-multi-select/js/jquery.quicksearch.js"), 
						"css" => array("jquery-multi-select/css/multi-select.css")
					),
					"switch" => array(
						"js" => array("bootstrap-switch.js","ga.js","jquery.tagsinput.js"), 
						"css" => array()
					),
					"dropzone" => array(
						"assets" => array("dropzone/dropzone.js"), 
						"assets_css" => array("dropzone/css/dropzone.css")
					),
					"fileupload" => array(
						"assets" => array("bootstrap-fileupload/bootstrap-fileupload.js"), 
						"assets_css" => array("bootstrap-fileupload/bootstrap-fileupload.css")
					),
					"datatables" => array(
						"assets" => array("data-tables/jquery.dataTables.js"), 
						"assets_css" => array("advanced-datatable/media/css/demo_page.css","advanced-datatable/media/css/demo_table.css")
					),
					"tinymce" => array(
						"assets" => array("tinymce/tinymce.min.js")
					),
					);

	//Put Meta Data
	foreach ($meta_data AS $meta_name => $meta_val)
		echo '<meta name="' . $meta_name . '" content="' . $meta_val . '">';
	?>
	
	<meta charset="<?=(isset($meta_charset)) ? $meta_charset : "UTF-8" ?>">
	
	<?foreach($css_files AS $file){
	  ?><link rel="stylesheet" href="<?=$config['admin_css_root'] . $file; ?>" type="text/css" /><?
	}
?>
	
    <link rel="stylesheet" href="<?=$config['admin_fonts_css_root'] . "font-awesome.css"; ?>" type="text/css" />
      <script type="text/javascript">
		  //For all JS Global Variable Initializtion
		  var $js_config = <?=json_encode($config)?>;
	  </script>

    <script src="<?=$config['admin_js_root'];?>jquery.js"></script>
	<?
	//Additional files
	if(is_array($additional_tools) && count($additional_tools))
	{
		foreach($additional_tools AS $tool){
			if(is_array($my_tools[$tool]['css']))
			foreach($my_tools[$tool]['css'] AS $script)
			{
				if($script){
					?><link rel="stylesheet" href="<?=$config['admin_tools_root'] . $script; ?>"/><?
				}
				
			}
			if(is_array($my_tools[$tool]['assets_css']))
			foreach($my_tools[$tool]['assets_css'] AS $script)
			{
				if($script){
					?><link rel="stylesheet" href="<?=$config['admin_tools_root'] . $script; ?>"/><?
				}
				
			}
		}
	}
	?>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

 <div id="form-loader">
	<img src="<?=$config['admin_images_root'];?>loader-1.gif" id="loader_image" />
 </div>

 <section id="container" class="">
      <!--header start-->
      <?if(!$hide_top_nav){?>
      <header class="header white-bg">
          <?$this->load->view("_layout/admin/header")?>
      </header>
      <?} ?>
      <!--header end-->
      <!--sidebar start-->
      <?
		if (!$hide_left_nav) {
			$this->load->view("_layout/admin/footer",$menu);
		}
	?>
      <!--sidebar end-->
      <!--main content start-->
      <section id="main-content">
      	<?=$content_block; ?>
      </section>
      <!--main content end-->
      <!--footer start-->
      <footer class="site-footer">
          <div class="text-center">
              <?=date("Y") ?> &copy; Powered by 
              <a href="http://www.digitall.co" style="color:#F3A600;" >
	              <img src="<?=$config['base_url']?>assets/front_assets/img/digitall-logo.png" style="height:30px;" />
	          </a>
              <a href="#" class="go-top">
                  <i class="icon-angle-up"></i>
              </a>
          </div>
      </footer>
      <!--footer end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <?
    foreach($js_files AS $file){
	  ?><script src="<?=$config['admin_js_root'] . $file; ?>"></script><?
	}
	if(is_array($additional_tools) && is_array($additional_tools) && count($additional_tools))
	{
		foreach($additional_tools AS $tool){
			if(is_array($my_tools[$tool]['assets']))
			foreach($my_tools[$tool]['assets'] AS $script)
			{
				$tool_activators .= "var tool_$tool = true;";
				?>
				<script src="<?=$config['admin_tools_root'] . $script; ?>"></script>
				<?
				
			}
			if(is_array($my_tools[$tool]['js']))
			foreach($my_tools[$tool]['js'] AS $script)
			{
				$tool_activators .= "var tool_$tool = true;";
				?>
				<script src="<?=$config['admin_js_root'] . $script; ?>"></script>
				<?
				
			}
		}
	}
	?>
	<script><?=$tool_activators?></script>
	<?
		if(is_array($form_js_files))
		foreach($form_js_files AS $file){
		  ?><script src="<?=$config['admin_js_root'] . $file; ?>"></script><?
		}
	
	?>
    
 

  </body>
</html>