<!DOCTYPE html>
<html>
<head>
<title><?php echo $site_name; ?></title>
 <link rel='shortcut icon' href="<?php echo URL::base();?>favicon.ico" type='image/x-icon'/> 
<?php foreach ($styles as $style) : ?>
<link rel="stylesheet" href="<?php echo URL::base();?>media/admin/css/<?php echo $style; ?>.css" type="text/css" media="screen"/>
<?php endforeach; ?>

	<!-- The styles -->

	<style type="text/css">
	  body {
		padding-bottom: 40px;
	  }
	  .sidebar-nav {
		padding: 9px 0;
	  }
	</style>
	
	<script type="text/javascript">
 function chargerimage() {
      //do stuff
	  alert('kamel');
 }
 
 </script>
 
 	

<?php foreach ($scripts as $script) : ?>
<script type="text/javascript" src="<?php echo URL::base(); ?>media/admin/js/<?php echo $script; ?>.js" ></script>
<?php endforeach; ?>

<style type="text/css">
.error {
	color: red;
}
.message {
	padding: 10px;
	background-color: yellow;
}
</style>

<meta http-equiv="refresh" content="30">

</head>
<body>
    <?php  echo $cmdcount; ?> 
<!-- topbar starts -->
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container-fluid">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".top-nav.nav-collapse,.sidebar-nav.nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
				<a class="brand" href="#">  <span style="color:gold;">ATC</span></a>
				
				<!-- theme selector starts -->
			
				<!-- theme selector ends -->
				
				<!-- user dropdown starts -->
			
				<!-- user dropdown ends -->
				
			
			</div>
		</div>
	</div>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				<?php   // Load the user information 	
		$user = Auth::instance()->get_user();

		// if a user is not logged in, redirect to login page 		
		if ( $user)
		{
		 ?>
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<div class="well nav-collapse sidebar-nav">
					<ul class="nav nav-tabs nav-stacked main-menu">
					  
						<li class="nav-header hidden-tablet">Menu</li>
			<?php  if( Auth::instance()->logged_in("admin")){ ?>
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listeslider'); ?>"><i class="icon-film"></i><span class="hidden-tablet"> Sliders</span></a></li>
			<?php  } ?>	
            <?php   if(  Auth::instance()->logged_in("admin")){ ?>			
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listearticles'); ?>"><i class="icon-list-alt"></i><span class="hidden-tablet"> Articles</span></a></li>
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listeadmins'); ?>"><i class="icon-user"></i><span class="hidden-tablet"> Utilisateurs</span></a></li>
			<?php } ?>	
			
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listeproduits'); ?>"><i class="icon-barcode"></i><span class="hidden-tablet"> Produits</span></a></li>
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listeusers'); ?>"><i class="icon-user"></i><span class="hidden-tablet"> Clients</span></a></li>
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listecommandes'); ?>"><i class="icon-shopping-cart"></i><span class="hidden-tablet"> Commandes </span>
						        	
                                <?php   if(  Model::factory('Commande')->count_all_non_valide()>0){ ?>	
						        <span class="rouge"><?php echo  Model::factory('Commande')->count_all_non_valide(); ?></span>
						  
						     <?php  } ?>	
						  </a></li>
						
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listepartenaires'); ?>"><i class="icon-eye-open"></i><span class="hidden-tablet"> Partenaires</span></a></li>
						<li><a class="ajax-link" href="<?php echo URL::site('admin/listepromotions'); ?>"><i class="icon-eye-open"></i><span class="hidden-tablet"> Promotions</span></a></li>
												
					</ul>
					
				

	        <?php echo View::factory('admin/info'); ?>
			 
	
				
				</div><!--/.well -->
			</div><!--/span-->
			<!-- left menu ends -->
			<?php } ?>
			
			
			
			<div id="content" class="span10">
			<!-- content starts -->
			

			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">Accueil</a>
					</li>
					
				</ul>
			</div>
			
	
 
            <?php   // Load the user information 	
		$user = Auth::instance()->get_user();

		// if a user is not logged in, redirect to login page 		
		if ( $user)
		{
			 ?>				  
               <?php echo $content; ?>
			   
		 <?php	  }else {?>
			  <?php echo View::factory('admin/login'); }?>
			  
<!--<textarea id="elm1" name="area">texte here</textarea>-->
		  
       
					<!-- content ends -->
			</div><!--/#content.span10-->
				</div><!--/fluid-row-->
				
		<hr>

	

		<footer>
			<p class="pull-left">&copy; <a href="http://www.atcdz.com" target="_blank">ATC</a> 2011- <?php echo date("Y"); ?></p>
			<p class="pull-right">Powered by: <a href="http://www.atcdz.com"><img src="<?php echo URL::base();?>media/images/logoatc.png"  alt="All Technology Consulting" /> </a></p>
		</footer>
		
	</div><!--/.fluid-container-->

	<!-- external javascript
	================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->

	<!-- jQuery -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery-1.7.2.min.js"></script>
	<!-- jQuery UI -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery-ui-1.8.21.custom.min.js"></script>
	<!-- transition / effect library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-transition.js"></script>
	<!-- alert enhancer library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-alert.js"></script>
	<!-- modal / dialog library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-modal.js"></script>
	<!-- custom dropdown library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-dropdown.js"></script>
	<!-- scrolspy library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-scrollspy.js"></script>
	<!-- library for creating tabs -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-tab.js"></script>
	<!-- library for advanced tooltip -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-tooltip.js"></script>
	<!-- popover effect library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-popover.js"></script>
	<!-- button enhancer library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-button.js"></script>
	<!-- accordion library (optional, not used in demo) -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-collapse.js"></script>
	<!-- carousel slideshow library (optional, not used in demo) -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-carousel.js"></script>
	<!-- autocomplete library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-typeahead.js"></script>
	<!-- tour library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/bootstrap-tour.js"></script>
	<!-- library for cookie management 
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.cookie.js"></script>
	<!-- calander plugin -->
	<script src='<?php echo URL::base(); ?>media/admin/js/fullcalendar.min.js'></script>
	<!-- data table plugin -->
	<script src='<?php echo URL::base(); ?>media/admin/js/jquery.dataTables.min.js'></script>

	<!-- chart libraries start -->
	<script src="<?php echo URL::base(); ?>media/admin/js/excanvas.js"></script>
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.flot.min.js"></script>
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.flot.pie.min.js"></script>
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.flot.stack.js"></script>
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.flot.resize.min.js"></script>
	<!-- chart libraries end -->

	<!-- select or dropdown enhancer -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.chosen.min.js"></script>
	<!-- checkbox, radio, and file input styler -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.uniform.min.js"></script>
	<!-- plugin for gallery image view -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.colorbox.min.js"></script>
	<!-- rich text editor library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.cleditor.min.js"></script>
	<!-- notification plugin -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.noty.js"></script>
	<!-- file manager library -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.elfinder.min.js"></script>
	<!-- star rating plugin -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.raty.min.js"></script>
	<!-- for iOS style toggle switch -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.iphone.toggle.js"></script>
	<!-- autogrowing textarea plugin -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.autogrow-textarea.js"></script>
	<!-- multiple file upload plugin -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.uploadify-3.1.min.js"></script>
	<!-- history.js for cross-browser state change on ajax -->
	<script src="<?php echo URL::base(); ?>media/admin/js/jquery.history.js"></script>
	<!-- application script for Charisma demo -->
	<script src="<?php echo URL::base(); ?>media/admin/js/charisma.js"></script>

</body>
</html>





