<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title><?php echo $this->gPageTitle; ?></title>
    <link rel="Shortcut Icon" href="../favicon.ico"/>
    <script type="text/javascript">
        var clientexec = {};
        clientexec.runTicketSummaries = false;
        clientexec.cache_eventcount_session = '<?php echo $this->cache_eventcount_session;?>';
        clientexec.cache_eventcount_day = '<?php echo $this->cache_eventcount_day;?>';
        clientexec.admin_email = '<?php echo $this->gUser->getEmail();?>';
        clientexec.records_per_view = '<?php echo $this->recordsPerView;?>';
        var gVer = "<?php echo $this->gVersion; ?>";
        var gFuse = "<?php echo $this->gFuse; ?>";
        var gView = "<?php echo $this->gView; ?>";
        var gShowAlsoViewing = true;
        var gStaffUserId = <?php echo $this->gUser->getId(); ?>;
        var gHash = "<?php echo $this->gHash; ?>";
        var gDateFormat = "<?php echo $this->gDateFormat;?>";
        var showLastSeen=<?php echo ($this->gShowLastSeen) ? "true": "false"; ?>;
        var relativePath = "<?php echo $this->gRelativePath; ?>";		
        var companyfied = <?php echo $this->company->getId() > 0? 'true' : 'false' ?>;
        var features = {
            accounts: <?php echo $this->company->supports('accounts')? 'true' : 'false'; ?>,
            support: <?php echo $this->company->supports('support')? 'true' : 'false'; ?>,
            products: <?php echo $this->company->supports('products')? 'true' : 'false'; ?>,
            billing: <?php echo $this->company->supports('billing')? 'true' : 'false'; ?>,
            files: <?php echo $this->company->supports('files')? 'true' : 'false'; ?>
        };
    </script>
    <?php if ($this->gCSSFiles != "") { ?>
        <link rel="stylesheet" type="text/css" href="../newedge/utilities/min/index.php?f=<?php echo $this->gCSSFiles;?>&amp;g=admincss&amp;ver=<?php echo $this->gInstalledVersion;?>" />   
    <?php } else { ?>
        <link type="text/css" rel="stylesheet" href="../newedge/utilities/min/index.php?g=admincss&amp;ver=<?php echo $this->gInstalledVersion;?>" />    
    <?php } ?>
    <script type="text/javascript" src="../newedge/utilities/min/index.php?g=admintopjs&amp;f=javascript/language/<?php echo $this->gLanguage; ?>.js&amp;ver=<?php echo $this->gInstalledVersion;?><?php echo $this->debugMinifier? '&amp;debug=true' : '';?>"></script>
</head>

<body class="darkgray">

<div style="font-weight: bold; color:red; position:absolute;left:110px;top:7px;" id="mainsitenotice"><?php echo $this->gUserLoginDisabledNotice;?></div>
<div id="msg-div" class="msg-div-wrapper" style="display:none;"><div id="msg-div-inner" class="msg-div-inner"></div></div>

<div class="main">

<div id="header">
	<!--
	<div id="activecustomer-box" style="position:absolute;top:51px;right:7px;"><img src="../templates/admin/images/sitewide/activecustomer-box.png"/></div>
	-->
	<div id="searchhelp"><a href="#"><img src="../templates/admin/images/gear.png"/></a></div>
	<div id="logoff"><a href="index.php?fuse=newedge&amp;action=Logout&amp;sessionHash=<?php echo $this->gHash; ?>">
		<div class="hideshowrightpanel"></div></a>
	</div>	
    <div id="nav"> <!-- Starts Main Menu -->
        <ul class='sf-menu'>
        <?php foreach ($this->menus as $menu) {?>
            <li class="<?php echo $menu['class'];?>">
                <span><a href="<?php echo $menu['hreftarget']; ?>"><?php echo $menu['modulename'];?></a></span>
                    <ul class="sub-menu" style="display:none;">
                     <?php foreach($menu['submenu'] as $submenu) {
                         $class = "";
                         if (in_array($this->gView, $submenu->getViews())) {
                            if($secondarytagname = $submenu->getSecondaryTagName()){
                                //we have a secondary name (like plugin=) that we need to check
                                if((isset($_GET[$secondarytagname])) && ($_GET[$secondarytagname] == $submenu->getSecondaryTagValue()) ){
                                    $class = "subactive";
                                }
                            }else{
                                $class = "subactive";
                            }
                         }
                         ?>
                            <li class="<?php echo $class;?> menu-item menu-item-type-custom menu-item-object-custom"><?php echo $submenu->getURL();?></li>
                     <?php } ?>
                    </ul>
            </li>
        <?php } ?>
        </ul>
    </div> <!-- Ends Main Menu -->
   
    <div class="searchquery">
        <input id="searchquerytextfield" type="text" name="searchquerytextfield" />
    </div>
</div> <!-- end header -->

<div class="maincontainer <?php if (!$this->showSidePanel){ echo 'withrightpanel';} ?>">
	<!-- <div style="height:100%;"> -->
	<div id="maincenter">
		<div class="container">
	    	<div id="breadcrumb" style="display:none;"><span id="alsoviewing"></span></div>
			<div class="inside">
			<?php echo $this->gContents;?>			                       	
			<?php echo ($this->gExecutionTime === "") ? "" : "<div class='ce-executiontime'>".$this->gExecutionTime."</div>"; ?>
			</div>    
		</div>
	</div>
	<!--</div> -->
  
    <div id="left"></div>
    <div id="leftcontainer">
		<div id="user-box-name">		
            <img id="profilepicture" src="" title="" width="32" height="32" />
        	<div class="staff_text">
	        	<span class="staff_text_inside">
	            <a style="color:wheat" href="index.php?fuse=admin&amp;view=EditAddAdminAccount"><?php echo $this->gUserFirstName." ".$this->gUserLastName; ?></a> <br/>
	            <a id="cemyticketslink" onclick="processFilterClick('mytickets');"><?php echo $this->lang("My Tickets:");?> <span id="cemyticketscount"><?php echo $this->cache_myticketcount;?>	</span></a>         
	            <span style='color:#777;'>|</span> <a id="cehelplink" onclick="ceHelpPopup()"><?php echo $this->lang("Help");?></a></span>
            </div>
		</div>    
        <div class="heading" style="height:17px;border-bottom: 2px solid #A4000C;margin-right: -1px;"></div>
        <div id="supportticketsummary"><?php if ($this->gShowTicketSummary) {echo $this->cache_supportticket; } ?></div>		            
    </div>	
    <div id="right" class="<?php if (!$this->showSidePanel){ echo 'withrightpanel';} ?>">
	  <div class="right-tabs-container">
		<ul class="tabs">
			<?php if ($this->company->supports('accounts')) { ?>
			<li class="<?php echo ($this->sidebar_activetab===0) ? "active": "";?> rightbartab activecustomertab"><?php echo $this->lang("Active User");?></li>
			<?php } ?>
			<li class="<?php echo ($this->sidebar_activetab===2) ? "active": "";?> rightbartab kbsearchtab"><?php echo $this->lang("Articles");?></li>
			<?php if ($this->company->supports('accounts')) { ?>
			<li class="<?php echo ($this->sidebar_activetab===1) ? "active": "";?> rightbartab onlineuserstab"><?php echo $this->lang("Online");?></li>
			<?php } ?>
    	</ul>		            	
	  </div>
		           	
      <div id="kbsearchdiv" class="inside rightbardiv" style="display:<?php echo ($this->sidebar_activetab===2) ? "block": "none";?>;">
		  <div id="kbsearchcontainer">
			  <input type="text" class="x-form-text x-form-field required" id="kbquery" name="kbquery" placeholder="Search KB" value="<?php echo $this->cache_KBSearchquery; ?>" />
			  <div id="kbsearchresults" <?php if($this->cache_KBSearchResults=="") echo "style='display:none;'" ?>><?php echo $this->cache_KBSearchResults; ?></div>								
		  </div>
      </div> <!-- ends kbsearchdiv -->		    
      <div id="whoisonline" class="inside rightbardiv" style="display:<?php echo ($this->sidebar_activetab===1) ? "block": "none";?>;">
            <?php echo $this->lang("Who's Online");?>
            <ul class="dots" id="onlineusers">
              <?php echo $this->rawOnlineUsers; ?>
            </ul>
            <span id='lastxseen' style="<?php echo $this->lastXSeenStyle;?>">Last <?php echo $this->gLastXLimit;?> Seen</span>
            <ul class="dots" id="offlineusers" style="margin-bottom:4px;">
              <?php if ($this->gShowLastSeen) { echo $this->rawOfflineUsers;}?>
            </ul>
      </div> <!-- ends whoisonline -->    
   	  <!--
    	<div id="rightbar_tickets" class="inside rightbardiv" style="display:<?php echo ($this->sidebar_activetab===0) ? "block": "none";?>;">	
    	</div>
       -->    
      <div id="selectedcustomernav" class="inside rightbardiv" style="display:<?php echo ($this->sidebar_activetab===0) ? "block": "none";?>;">
			<img style='margin:20px;padding-left:50px;' src='../images/loader.gif' />		
      </div>
	</div> <!-- right col container-->
	
  </div> <!-- main container -->
</div> <!-- end main -->

<!-- right side toggle -->
<a class="toggleLink <?php if (!$this->showSidePanel){ echo 'withrightpanel';} ?>" href="#">«</a>    
<!-- ce version info - branding -->
<div class='branding <?php echo ($this->gLatestVersion==="") ? "" : "withtime"; if (!$this->showSidePanel){ echo 'withrightpanel';} ?>'>
	<a href="http://www.clientexec.com?source=feedback" target="_new">Powered by <img src="../templates/admin/images/sitewide/small_logo.gif" alt="ClientExec"> <?php echo $this->gInstalledVersion;?></a>
    <br/><span style="color:red;"><?php echo $this->gLatestVersion;?></span><?php if ( $this->gLatestVersion ) { ?><br/><?php } ?>
    <a href="https://twitter.com/clientexec" class="twitter-follow-button" data-show-count="false">Follow @clientexec</a>
	<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>    

    
    <script type="text/javascript">
    <!--
		// Main Navigation
        $(document).ready(function() {
	    <?php if ($this->gShowTicketSummary) { echo "clientexec.runTicketSummaries = true;"; } 
            	//show any messages provided from actions performed
            	$alertMsg =""; 
            	if (count($this->gMessages)>0) { 
	            	foreach ($this->gMessages as $message) {
	                    $alertMsg .= addslashes($message)." ";
	                } 
                }             
            	if (count($this->gErrorMessages)>0) { 
					foreach ($this->gErrorMessages as $message) {
	                    $alertMsg .= addslashes($message)." ";
	                }                  
                }             
                if ( ($alertMsg!="") && (count($this->gErrorMessages)>0) ) {
                    echo "ce.errormsg('".$alertMsg."');";
                } else if ($alertMsg!="") {
                    echo "ce.msg('".$alertMsg."');"; 
                }           
            	//show splashscreen                    
                if ($this->showSplashScreen) { echo "loadSplahScreen();"; }                
            ?>

	       	clientexec.searchKB_start = <?php echo $this->cache_KBSearchstart; ?>;
	       	clientexec.searchKB_query = "<?php echo $this->cache_KBSearchquery; ?>";       	
            
        });
    //-->
    if(navigator.userAgent.indexOf('Mac') > 0)
	$('body').addClass('mac-os');
    </script>
    
    <script type="text/javascript" src="../newedge/utilities/min/index.php?g=adminbottomjs&ver=<?php echo $this->gInstalledVersion;?><?php echo $this->debugMinifier? '&debug=true' : '';?>"></script>    
    <?php if ( $this->gJSFiles != '' ) { ?>
        <script type="text/javascript" src="../newedge/utilities/min/index.php?f=<?php echo $this->gJSFiles;?>&ver=<?php echo $this->gInstalledVersion;?><?php echo $this->debugMinifier? '&debug=true' : '';?>"></script>
    <?php } ?>
    <?php if (isset($this->afterJsLoads) && $this->afterJsLoads != '') { echo '<script type="text/javascript">'.$this->afterJsLoads.'</script>'; } ?>
  </body>
</html>