<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
			<?php
			$login = $this->login;
			if(!empty($login['user'])){
				echo $login['user'].' | ';
			}
			$menu = new Menu;
			echo $menu->setTitileMenu($this->getParameter['modul'], $this->getParameter['asliGetCotroller']);
			?> 
		</title>
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/thema/default/css/style.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/thema/2016/css/style.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/jquery.apank.autocomplete.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/jquery.apank.popUp.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/jquery.apank.postForm.css">
		<link type="text/css" rel="stylesheet" href="<?php echo $this->baseUrl ?>assets/css/jquery.apank.displayNone.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/apank.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/newTab.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/skin_clean.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/flexigrid/flexigrid.css">
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/css/menuDisplay.css">
		<link type="text/css" rel="stylesheet" href="<?php echo $this->baseUrl ?>assets/css/fileuploader.css">
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery-1.7.2.min.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.shortcuts.min.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/apank.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/fungsi.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/md5.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.apank.autocomplete.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.apank.popUp.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.apank.PostForm.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.apank.displayNone.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/ddaccordion.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/jquery.meio.mask.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/flexigrid.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/accounting.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/apank.grid.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/js/fileuploader.js" type="text/javascript"></script>
	</head>
<body>

  	<div id="apankTema2016Left">
		<div id="apankTema2016LeftContent">
			<div id="apankTema2016LeftContentWhite">
				<div id="apankTema2016Logo">
					<!--<img src="<?php echo $this->baseUrl ?>assets/thema/2016/css/images/rasio.gif" style="width: 160px; height: 60px">-->
					<img src="<?php echo $this->baseUrl ?>assets/upload/sindoLogo.png" style="width: 160px; height: 60px">
					<input type="text" id="_menuTema2016">
				</div>
				<div id="apankTema2016Menu">
					<div id="apankMenu2016Display"></div>
					<div id="displayMenu2016Tree"><?php include "tree.phtml" ?></div>
				</div>
			</div>
		</div>
	</div>
	<div id="apankTema2016Line">&nbsp;</div>
	<div id="apankTema2016Right">
		<div id="apankTema2016RightContent">
			<div id="apankTema2016NameId" style="height: 35px;">
				<?php if(CLLOGO == true){ ?>
				<div id="apankTema2016LogoPt">
					<a href="" class="_hideMenu" title="Hide Menu">
						<img src="<?php echo $this->baseUrl ?>assets/thema/2016/css/images/rasio.gif" style="width: 50px; margin: 10px;">
					</a>
				</div>
				<?php } ?>
				<?php if(CLNAME == true){ ?>
				<div id="apankTema2016NamePt">
					<a href="" class="_hideMenu" title="Hide Menu">
						<b>&laquo;</b>
					</a>
					<?php echo $this->login['pt'] ?>
				</div>
				<?php } ?>
				<div id="apankTema2016NameUser">
					<span id="LoadWarning"></span>
					<a href="<?php echo $this->baseUrl ?>">DASHBOARD</a> 
					| 
					<input type="text" readonly id="tglDefault" style="background-color: #F4e3e4; color: #074573" class="_nonDesign" value="<?php echo date("d/m/Y", strtotime($this->login['date'])) ?>"> | 
					<?php
					$reg = array("USA", "IND");
					?>
					<select id="regDefault" style="background-color: #F4e3e4; color: #074573; height: 15px; width: 50px; border: none" class="_nonDesign">
						<?php 
						foreach($reg as $r){ 
							$sel = "";
							if($r == $this->login['reg']){
								$sel = "selected";
							}
						?>
							<option value="<?php echo $r ?>" <?php echo $sel ?>><?php echo $r ?>
						<?php } ?>
					</select>
				</div>
			</div>
			<input type="hidden" id="_cls" value="">
			<input type="hidden" id="defaultbaseUrl" value="<?php echo $this->baseUrl ?>">
			<input type="hidden" id="defaultBaseUrl" value="<?php echo $this->baseUrl ?>">
			<input type="hidden" id="defaultController" value="<?php echo $this->getParameter['controller'] ?>">
			<input type="hidden" id="modulMenu" value="<?php echo $this->getParameter['modul'] ?>">
			<input type="hidden" id="tempGridFocus" value="_noGrid_0">
			<div id="apankForm"></div>
			<div id="divAjax"></div>
			<div id="apankTema2016Content">
				<div id="apankTema2016Title">
					<?php 
					$menu = new Menu;			
					echo $menu->setTitile($this->getParameter['modul'], $this->getParameter['asliGetCotroller'], $this->baseUrl); 
					?>
				</div>
				<div id="mainContentTema2016">
					<?php include $this->basePath.'assets/view/'.$this->view; ?>
				</div>
			</div>
		</div>
	</div>




</html>
<script type="text/javascript">
var makeDatePicker = function() {
	// $(".tanggal").datepicker({
		// changeMonth: true,
		// changeYear: true,
		// dateFormat: 'dd/mm/yy', 
		// yearRange: '1900:<?php echo ( date("Y") + 5)  ?>',
	// });
	$('.ui-widget-content').css('display', 'none');
	$('.meioMask').setMask();
};

$(document).ajaxComplete(function() {
	makeDatePicker();
});
	
<?php if($this->disCK == true){ ?>
	function clickIE4(){
		if (event.button==2){
			return false;
		}
	}

	function clickNS4(e){
		if (document.layers||document.getElementById&&!document.all){
			if (e.which==2||e.which==3){
				return false;
			}
		}
	}

	if (document.layers){
		document.captureEvents(Event.MOUSEDOWN);
		document.onmousedown=clickNS4;
	}

	else if (document.all&&!document.getElementById){
		document.onmousedown=clickIE4;
	}

	document.oncontextmenu=new Function("return false")
<?php } ?>

function createUploader(_file, _loc, _funcSucces){            
	var uploader = new qq.FileUploader({
		element: document.getElementById(_file),
		listElement: document.getElementById('separate-list'),
		multiple: false,
		onComplete: function(id, fileName, responseJSON){
			$('.qq-upload-success').remove();
			$('#'+_loc).val(responseJSON['fileName']).focus();
			if(_funcSucces != false){
				makeFunctionModul(_funcSucces, '');
			}
		},
		action: '<?php echo $this->baseUrl ?>upload/file/'
	});           
}        

$(document).ready(function(){
	makeManualGridSetting = function(){
		cekTextPlus = function(_no){
			_cek = parseInt($('#_nom_'+_no).val());
			if(_cek > 0){
				return _no;
			}else{
				_max = parseInt($("#_maxNo").val());
				if(_max > _no){
					_no = _no + 1;
					return cekTextPlus(_no);
				}
			}
			return false;
		}

		setManualGridFocus = function(_no){
			$('.barisManualGrid').removeAttr("style");
			if(_no === 'null'){
				$('#_filterManualGrid_0').focus();
			}else{
				$('#_nom_'+_no).focus();
				$('#barisManualGrid_'+_no).css("background-color", "yellow");
			}
		}
		
		$('._filterManualGrid').live("keyup",(function(e){
			_kode = parseInt(e.which);
			if(_kode === 40){
				_no = parseInt($(this).attr("_no"));
				if(_kode === 40){
					_no = _no + 1; 
				}
				_cek = cekTextPlus(_no);
				if(_cek != false){
					setManualGridFocus(_cek);
				}
			}
		}))
		$('._recManualGrid').live("keyup", (function(e){
			_kode = parseInt(e.which);
			if(_kode === 38 || _kode === 40){
				_no = parseInt($(this).attr("_no"));
				_noA = _no;
				if(_kode === 38){
					_no = _no - 1; 
					_cek = _no;

					_nom = $('#_nom_'+_no).val();
					if(_nom === undefined & _no > 0){
						_cek = false;
						$('#_loadManualGridTop').html("Loading.....");
						loadManualGrid(_noA, 'back');
					}
					
				}
				if(_kode === 40){
					_no = _no + 1; 
					_cek = _no;
					_nom = $('#_nom_'+_no).val();
					if(_nom === undefined){
						_cek = false;
						$('#_loadManualGridBottom').html("Loading.....");
						loadManualGrid(_noA, 'next');
					}
				}
				if(_cek != false){
					setManualGridFocus(_cek);
				}
			}
			if(_kode === 13){
				_pk = $(this).attr("_pk");
				_pilihManualGrid(_pk);
			}
			if(_kode === 27){
				makeTimeFocus();
				$('#apankForm').empty();
			}
		}))
		_loadPilih = false;
		_pilihManualGrid = function(_pk){
			_md = $('#_typeBrowse').val();
			$('#apankForm').empty();
			if(_md === 'browse'){
				if(_loadPilih != false){
					_loadPilih.abort();
				}
				$('#apankFormLoadingProgres').removeAttr("style");
				_pkN = str_ireplace("/", "__--__", _pk);
				_loadPilih = $.ajax({
				type: "GET",
					url: "<?php echo $this->baseUrl ?>Basic/pilih/&modul="+$('#_cls').val()+'&id='+_pkN+"&token="+$('#_token').val(),
					data: $(this).serialize(),
					success: function(data) {
						$("#errorDisplay").html(data);
						$('#apankFormLoadingProgres').css("display", "none");
					}
				})
			}
			if(_md === 'popUp'){
				_lastNo = parseInt($('#_urutPopUp').val());
				$('.urut_'+_lastNo).val(_pk);
				function showDiv() {
					makeCekNotNull(_lastNo);
					clearInterval(timer);
				}
				var timer = setInterval( showDiv, 100);
				
				_disPopUp = $('.urut_'+_lastNo).attr('display');
				_idDisPopUp = $('.urut_'+_lastNo).attr('id');
				
				_disPopUp2 = $('.urut_'+_lastNo).attr('displayClick');
				if(_disPopUp2 != undefined){
					_disPopUp = _disPopUp2;
				}
				
				if(_disPopUp === undefined){
					_lastNo = $('#_urutPopUp').val();
					_disPopUp = $('#'+_lastNo).attr('display');
					_idDisPopUp = _lastNo;
					$('#'+_lastNo).val(_pk).focus().select();
				}
				
				
				display(_disPopUp, _idDisPopUp);
			}
		}
		$('.barisManualGrid').live("click", (function(){
			_no = parseInt($(this).attr("_no"));
			setManualGridFocus(_no);
		}))
		$('.barisManualGrid').live("dblclick", (function(){
			_pk = $(this).attr("_pk");
			_pilihManualGrid(_pk);
		}))
		$('._buttonManualGrid').live("click", (function(){
			_pk = $(this).attr("_pk");
			_pilihManualGrid(_pk);
		}))
		
		_loadManualGrid = false;
		loadManualGrid = function(_no, _type){
			_pk  = $('#barisManualGrid_'+_no).attr("_pk");
			_fil = makeFilterManualGrid();
			
			if(_loadManualGrid != false){
				_loadManualGrid.abort();
			}
			
			_loadManualGrid = $.ajax({
			type: "GET",
				url: "<?php echo $this->baseUrl ?>Basic/loadDataManualGrid/&_ctrl="+$('#_cls').val()+'&Lno='+_no+'&type='+_type+'&pk='+_pk+_fil,
				data: $(this).serialize(),
				success: function(data) {
					$("#_loadManualGridTop").html('');
					$("#_loadManualGridBottom").html('');
					$("#_loadManualGrid").html(data);
				}
			})
		}
	}
	makeManualGridSetting();
	
	_loadMenuTema2016 = false;
	makeLoadMenu = function(_menu){
		if(_loadMenuTema2016 != false){
			_loadMenuTema2016.abort();
		}
		_loadMenuTema2016 = $.ajax({
		type: "GET",
			url: "<?php echo $this->baseUrl ?>application/loadMenu/&app=<?php echo $this->getParameter['param'][0] ?>&menu="+_menu,
			data: $(this).serialize(),
			success: function(data) {
				$("#apankMenu2016Display").html(data);
				$("#displayMenu2016Tree").css("display", "none");
			}
		})
	}
	$('#_menuTema2016').keyup(function(){
		_menu = $(this).val();
		if(_menu.length > 0){
			makeLoadMenu($(this).val());
		}else{
			_loadMenuTema2016.abort();
			$("#apankMenu2016Display").removeAttr("class").html('');
			$("#displayMenu2016Tree").removeAttr("style");
		}
	})
	
	$('._hideMenu').click(function(e){
		e.preventDefault();
		
		_hide = $('#apankTema2016Left').attr('hide');
		if(_hide === 'true'){
			$('#apankTema2016Left').removeAttr("hide");
			$('#apankTema2016Left').removeAttr("class");
			$('#apankTema2016Right').removeAttr("style");
			// $('._hideMenu').html("<b>&laquo;</b>");
		}else{
			$('#apankTema2016Left').attr('hide', "true");
			$('#apankTema2016Left').addClass("displayNone");
			$('#apankTema2016Right').css("margin-left", "0px");
			// $('._hideMenu').html("<b>&raquo;</b>");
		}
		
	})
	
	var _warningLoader = false;
	warningLoader = function(){
		if(_warningLoader != false){
			_warningLoader.abort();
		}
		$('#LoadWarning').html('...');
		_warningLoader = $.ajax({
		type: "GET",
			url: "<?php echo $this->baseUrl ?>Warning/baca",
			data: $(this).serialize(),
			success: function(data) {
				$("#LoadWarning").html(data);
			}
		})	
	}
	warningLoader();
	
	
	_setRegDefault = false;
	$('#regDefault').change(function(){
		if(_setRegDefault != false){
			_setRegDefault.abort();
		}

		_setRegDefault = $.ajax({
		type: "GET",
			url: "<?php echo $this->baseUrl ?>Basic/defReg/&reg="+$('#regDefault').val(),
			data: $(this).serialize(),
			success: function(data) {
				$("#errorDisplay").html(data);
			}
		})
	})
})
</script>
