<!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['kd_user'])){
				echo $login['kd_user'].' | ';
			}
			?> 
			<?php echo $this->baseTitle ?>
		</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/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>
		<script type="text/javascript">
		ddaccordion.init({
			headerclass: "submenuheader", //Shared CSS class name of headers group
			contentclass: "submenu", //Shared CSS class name of contents group
			revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
			mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
			collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
			defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
			onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
			animatedefault: false, //Should contents open by default be animated into view?
			persiststate: true, //persist state of opened contents within browser session?
			toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
			togglehtml: ["suffix", "<img src='<?php echo $this->baseUrl ?>assets/thema/default/images/plus.gif' class='statusicon' />", "<img src='<?php echo $this->baseUrl ?>assets/thema/default/images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
			animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
			oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
				//do nothing
			},
			onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
				//do nothing
			}
		})
		</script>
		<script src="<?php echo $this->baseUrl ?>assets/thema/default/js/jquery.jclock-1.2.0.js.txt" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/thema/default/js/jconfirmaction.jquery.js" type="text/javascript"></script><script src="<?php echo $this->baseUrl ?>assets/thema/default/js/niceforms.js" type="text/javascript"></script>
		<script src="<?php echo $this->baseUrl ?>assets/thema/default/js/apank.js" type="text/javascript"></script>
		<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>assets/thema/default/css/niceforms-default.css">
	</head>
<body>
<input type="hidden" id="_cls" value="">
<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="tempGridFocus" value="_noGrid_0">
<input type="hidden" id="tglDefault" value="<?php echo date("d/m/Y") ?>">
<div id="apankForm"></div>
<div id="divAjax"></div>
<div id="main_container">

	<table id="table_body" cellspacing=0 cellpadding=0>
		<tr>
			<td id="table_body_left">&nbsp;</td>
			<td id="table_content">
				<table id="table_head" cellspacing=0 cellpadding=0 >
					<tr id="menu_content">
						<td>
							<div class="menu">
								<ul>
									<li><a class="current" href="<?php echo $this->baseUrl.'index/home' ?>">Dashboard</a></li>
									<?php 
									$aclMenus = $this->getTrueMenus($this->session);
									$this->getPlugin('Menu')->getDisplayTreeMenu($this->baseUrl, $aclMenus); 
									?>
								</ul>
							</div>
						</td>
						<td id="head_left">
							<?php
							echo $login['nm_user'].' - '.$login['nm_cabang']
							?>
							, 
							<a href="<?php echo $this->baseUrl ?>Master-Password">Setting</a> | 
							<a href="<?php echo $this->baseUrl ?>login/logout" class="logout">Logout</a>
						</td>
					<tr>
					<tr id="favorit_menu_baris" class="">
						<td colspan="2">&nbsp;</td>
					</tr>
					<tr id="favorit_menu" class="td_hidden">
						<td colspan="2">apank</td>
					</tr>
					<tr id="tr_fv_menu">
						<td></td>
						<td id="tomb_fv_menu">
							<a href="#">
								<img class="hide_fv" id="button_fv_menu_favorite" src="<?php echo $this->baseUrl ?>assets/thema/default/css/images/fv_menu.png">
							</a>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div id="content">
								<div id="titlePage" style="padding-top: 0px; font-size: 13px; font-weight: bold; margin-bottom: 5px">
									<?php
									$menu = $this->getPlugin('Menu')->menuHome();
									$mn = array();
									foreach($menu as $r){
										$k = $r['url'];
										$mn[$k] = $r['menu'];
									}
									$act = $_SESSION['menu'];
									echo 'RASIO  <span class="menuNoneLine">'.$mn[$act].'</span> &rsaquo; ';
									?>
									<?php $this->getPlugin('Menu')->titlePage($this->getParameter, $this->baseUrl, $this->session); ?>
								</div> 
								<div style="width: 1070px"><?php include $this->basePath.'assets/view/'.$this->view; ?></div>
							</div>
						</td>
					</tr>
				</table>
			</td>
			<td id="table_body_right">&nbsp;</td>
		</tr>
	</table>
	<div id="table_body_bottom">&nbsp;</div>
	

</div>		
</body>
</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){            
	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();
		},
		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 > 1){
						_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){
				$('#apankForm').empty();
			}
		}))
		_loadPilih = false;
		_pilihManualGrid = function(_pk){
			_md = $('#_typeBrowse').val();
			$('#apankForm').empty();
			if(_md === 'browse'){
				if(_loadPilih != false){
					_loadPilih.abort();
				}
				_loadPilih = $.ajax({
				type: "GET",
					url: "<?php echo $this->baseurl ?>Basic/pilih/&modul="+$('#_cls').val()+'&id='+_pk+"&token="+$('#_token').val(),
					data: $(this).serialize(),
					success: function(data) {
						$("#errorDisplay").html(data);
					}
				})
			}
			if(_md === 'popUp'){
				_lastNo = parseInt($('#_urutPopUp').val());
				$('.urut_'+_lastNo).val(_pk);
				function showDiv() {
					makeCekNotNull(_lastNo);
					clearInterval(timer);
				}
				var timer = setInterval( showDiv, 100);
				display($('.urut_'+_lastNo).attr('display'), _lastNo);
			}
		}
		$('.barisManualGrid').live("click", (function(){
			_no = parseInt($(this).attr("_no"));
			setManualGridFocus(_no);
		}))
		$('.barisManualGrid').live("dblclick", (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();
})
</script>
