<?php 
/********************************************************************************* 
 *  This file is part of Sentrifugo.
 *  Copyright (C) 2014 Sapplica
 *   
 *  Sentrifugo is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sentrifugo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sentrifugo.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Sentrifugo Support <support@sentrifugo.com>
 ********************************************************************************/
?>

<?php if(empty($this->orgData) && empty($this->allEmpdata)){ ?>	
		<div class="ml-alert-1-info"><div class="style-1-icon info"></div>Organization information and employees are not added yet<!--to configure organization hierarchy-->. </div>	
<?php }else if(empty($this->allEmpdata)){ ?>
		<div class="ml-alert-1-info"><div class="style-1-icon info"></div>Employees are not added yet<!--to configure organization hierarchy-->. </div>	
<?php } else if(empty($this->orgData)){ ?>
		<div class="ml-alert-1-info"><div class="style-1-icon info"></div>Organization Information is not added yet<!--to configure organization hierarchy-->. </div>	
<?php } 
else if($this->output != '') { ?>
 <style>
	#ifrDiv{ z-index:1000;position:absolute;border:1px solid red;top:200px;left:200px;}	
  </style>  
<span id="error_message"></span>
<div id = "grayout" ></div>

	<?php echo $this->output;?>
<script type='text/javascript'>
jQuery(document).ready(function() {
	$('#grayout').slimScrollHorizontal({
	  alwaysVisible: false,
	  start: 'left',
	  position: 'bottom',
	}).css({ background: '#ccc', paddingBottom: '10px' }); 
	$("div.node").each(function(){
	   var text = $(this).text();
	   text = $.trim(text);
	   var subtext = text.substring(0,30);
	   $(this).html(subtext);
	   $(this).attr("title",$.trim(text));
	});
	    $("#org").jOrgChart();

});
</script>

<div id="addlist"></div>

<?php } else { ?> 
<div class="ml-alert-1-info"><div class="style-1-icon info"></div>
		Employees are not added yet.
</div>
<div id="addlist" style="display:none;"></div>
<?php } ?>