<?php
	/*
	Hezecom Email Solution
	Author: Hezecom Technologies (http://hezecom.com) info@hezecom.net
	COPYRIGHT 2014 ALL RIGHTS RESERVED
	
	You must have purchased a valid license from CodeCanyon.com in order to have 
	access this file.

	You may only use this file according to the respective licensing terms 
	you agreed to when purchasing this item.
	*/

	session_start();
	include('config/config.php');
	include('language/eng.php');
	include('libraries/functions.php');
	include_once('libraries/class_dbcon.php');
	include_once('libraries/upload_class.php');	
	include("libraries/xmlapi.php");
    include('libraries/class_cpanel.php');
	$new = new MyCpanel();
?>
<?php
//LEAVE THIS TO PREVENT HTML HEADERS WHEN EXPORTING
if(!get('hexport')){
//////////////////////////////////////
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo H_TITLE;?></title>
<link rel="stylesheet" type="text/css" href="<?php echo H_THEME;?>/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo H_THEME;?>/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo H_THEME;?>/css/footable.core.min.css" type="text/css"/>
<link rel="stylesheet" href="<?php echo H_THEME;?>/css/jquery.lightbox.min.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="<?php echo H_THEME;?>/css/datepicker.css">
<link href="<?php echo H_THEME;?>/css/admin.css" rel="stylesheet">
<link href="<?php echo H_THEME;?>/css/style.css" rel="stylesheet">
<link href="<?php echo H_THEME;?>/css/chosen.min.css" rel="stylesheet">
<script src="<?php echo H_THEME;?>/js/modernizr.custom.js"></script>
</head>

<body>
  		<?php
  		if(get('msg')=='add'){success_msg(LANG_SUCCESS_ADD);}
		elseif(get('msg')=='update'){success_msg(LANG_SUCCESS_UPDATE);}
		elseif(get('msg')=='delete'){success_msg(LANG_SUCCESS_DELETE);}
		elseif(get('msg')=='truncate'){success_msg(LANG_SUCCESS_TRUNCATE);}
		elseif(get('msg')=='error'){error_msg(LANG_ERROR_MSG);}
		elseif(get('msg')=='backup'){success_msg(LANG_BACKUP_CREATED);}
		elseif(get('dbrestore')!=''){success_msg(LANG_BACKUP_RESTORED);}
		elseif(get('dbfile')!=''){success_msg(LANG_BACKUP_DELETED);}
		elseif(get('msg')=='importer'){success_msg(LANG_CSV_SUCCESS);}
		?>
        
    <div id="hezewraper">
      <div class="navbar navbar-static-top navbar-fixed-top navbar-inverse">
          <button type="button" class="navbar-toggle pull-left" data-toggle="collapse" id="showLeft" style="border:0;">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          
      <a class="navbar-brand" style="color:#FFF;" href="index.php"><i class="fa fa-desktop"></i> <?php echo H_TITLE;?></a>
          <div class="collapse navbar-collapse navbar-ex1-collapse">
          <?php  if(isset($_SESSION['admin_user'])){?>
            <p class="navbar-text pull-right" style="color:#FFF;">
              <?php echo LANG_LOGIN_IN_AS.' '.$_SESSION['admin_user'];?>  <a href="libraries/logout.php?logout=admin"><i class=" fa fa-power-off"></i> <?php echo LANG_LOGOUT;?></a>
            </p>
            <?php }?>
          </div><!--/.nav-collapse -->
       
      </div>
      
     <?php  if(isset($_SESSION['admin_user'])){?> 
    <!--MOBILE NAV-->  
      <div class="phone-navigation">
      <div class="heze-mobilemenu-push">
		<nav class="heze-mobilemenu heze-mobilemenu-vertical heze-mobilemenu-left" id="heze-mobilemenu-s1">
        <div class="divscroll">
			<ul class="heze-accordion">
			<li id="one" class="files">
		<a href="#1" class="active"><i class="fa fa-dashboard aln"></i> <?php echo LANG_DASHBOARD;?><span><i class="fa fa-chevron-down"></i></span></a>
		<ul class="sub-menu" style="display: block;">
        
		<li><a href="<?php echo H_ADMIN;?>&view=mailusers&do=setup"><i class="fa fa-cog"></i><?php echo LANG_SETTINGS;?></a></li>
        <li><a href="<?php echo H_ADMIN;?>&view=mailusers&do=viewall"><i class="fa fa-envelope-o"></i> <?php echo LANG_EMAIL_USERS;?></a></li>
		<li><a href="libraries/logout.php?logout=admin"><i class="fa fa-power-off"></i><?php echo LANG_LOGOUT;?></a></li>
				</ul>
                </li>
           
           </ul>
           </div>
		</nav>
        </div>
        </div>
      <!--/MOBILE NAV-->

     <!-- SIDE MENU -->
     
    <div class="heze-navmenu">
    <div class="divscroll">
			<ul class="heze-accordion">
			<li id="one" class="files">
				<a href="#1" class="active"><i class="fa fa-dashboard aln"></i> <?php echo LANG_DASHBOARD;?><span><i class="fa fa-chevron-down"></i></span></a>
<ul class="sub-menu" style="display: block;">
<li><a href="<?php echo H_ADMIN;?>&view=mailusers&do=setup"><i class="fa fa-cog"></i><?php echo LANG_SETTINGS;?></a></li>
<li><a href="webmail/adminpanel" target="_blank"><i class="fa fa-gears"></i><?php echo LANG_MAIL_SETTINGS;?></a></li>
<li><a href="<?php echo H_ADMIN;?>&view=mailusers&do=viewall"><i class="fa fa-envelope-o"></i> <?php echo LANG_EMAIL_USERS;?></a></li>
</ul>
</li>
           </ul>
           </div>
</div>
<!-- END SIDE MENU -->
<?php }?>
<!-- BODY CONTENTS -->
<div class="heze-container">
  <!--TABLE-->
  <?php }//END HEADE DISPLAY///////
		if(!isset($_SESSION['admin_user'])){include('libraries/views/admin/login.php');}
		elseif(get('view')){
		include(APP_FOLDER.'/controllers/admin/main.php');
		}else{
		?>
     
 <div class="col-lg-12">
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><h3 class="panel-title"><i class="fa fa-reorder"></i> Welcome!</h3></div>
  <div class="panel-body" style="padding:10px;">
   <p>
   Welcome to Hezecom Email Solution.
   </p>
  </div>

</div>
 </div><!--/col-12-->
 <?php }?>
      
 </div><!--/heze-container-->       
</div><!--hezewraper-->
  
 <?php
//LEAVE THIS TO PREVENT HTML HEADERS WHEN EXPORTING
if(!get('hexport')){
//////////////////////////////////////
?>   
 <div id="footer" class="navbar-fixed-bottom">
      <div class="container">
        <p class="text-muted credit">&copy; <?php echo date('Y')?> <a href="http://hezecom.com">Hezecom Technologies</a></p>
      </div>
    </div>
    
<script src='<?php echo H_THEME;?>/js/jquery.js'></script>
<script src="<?php echo H_THEME;?>/js/bootstrap.min.js"></script>
<script src="<?php echo H_THEME;?>/js/footable.js" type="text/javascript"></script>
<script src="<?php echo H_THEME;?>/js/jquery.slimscroll.min.js"></script>
<script src="<?php echo H_THEME;?>/js/jquery.lightbox.min.js" type="text/javascript"></script>
<script src="<?php echo H_THEME;?>/js/bootstrap-datepicker.js"></script>
<script src="<?php echo H_THEME;?>/js/jquery.form.js"></script>
<script src="<?php echo H_THEME;?>/js/chosen.jquery.min.js"></script>
<script src="<?php echo H_THEME;?>/js/hezecom.custom.js"></script>
<?php }?>
  </body>
  </html>
