<?php
/*********************************************
Desciption: Inicial
File: /index.php
Project: Basikus.Net
Developers: João Vieira	
Start Date: 2009/05/20
*********************************************/

//configuração principal
require_once($_SERVER['DOCUMENT_ROOT'] . "/bsk/includes/configuracao.default.php");
//funções de tratamento de textos
include($_SERVER['DOCUMENT_ROOT'] . '/bsk/includes/funcoes.default.php'); 

$ondeTou    = 'inicial';

$metaTitle  = $bngInicial;
$metaJS     = '	jQuery(document).ready(function(){ 
	    var lastsel; 
	
	    jQuery("#listaG").jqGrid({
		url:\'/bsk/artigos/registos/lista/\',
		height: 340,
		datatype: \'json\',
		mtype: \'GET\',    
		colNames:[\'' . $bngData . '\',\'' . $bngNome . '\',\'' . $bngCategoria . '\',\'' . $bngActivo . '\',\'' . $bngDestaque . '\'],
		colModel :[ 
		{name:\'eddata\', index:\'eddata\', width:110, align:\'center\', editable: false, edittype:"text", formatter: \'showlink\',  formatoptions: {baseLinkUrl: \'/bsk/artigos/\', showAction: \'\', addParam:\'\'}}, 
		{name:\'ednome\', index:\'ednome\', width:280, align:\'left\', editable: false, edittype:"text"},
		{name:\'edcategoria\', index:\'edcategoria\', width:210, align:\'center\', editable: false, edittype:"text"},
		{name:\'edactivo\', index:\'edactivo\', width:60, align:\'center\', sortable:false, editable: true, edittype:"select", editoptions:{value:"XX:' . $bngAmbos . ';NAO:' . $bngNao . ';SIM:' . $bngSim . '"}},
		{name:\'eddestaque\', index:\'eddestaque\', width:100, align:\'center\', sortable:false, editable: true, edittype:"select", editoptions:{value:"XX:' . $bngAmbos . ';NAO:' . $bngNao . ';SIM:' . $bngSim . '"}}
		],
		rowNum:100,
		rowList:[100,200,400],
		pager: jQuery(\'#listaP\'),
		sortname: \'edid\',
		sortorder: "desc",
		toolbar : [true,"top"],
		onSelectRow: function(id){ 
		    if(id && id!==lastsel){ 
			jQuery(\'#listaG\').restoreRow(lastsel); 
			jQuery(\'#listaG\').editRow(id,true); 
			lastsel=id; 
		    } 
		},
		editurl: "/bsk/artigos/registos/editar/?' . md5($pwdWord . Date('Ymd')) . '",
		viewrecords: true,
		caption: \'' . $bngListaRegistos . '\',
		loadError : function(xhr,st,err) { 
		    jQuery("#listaErr").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText); 
		}
		
	    }); 
	    jQuery("#t_listaG").height(25).hide().filterGrid("listaG",{gridModel:true,gridToolbar:true});
	    jQuery("#listaG").navGrid(\'#listaP\',{edit:false,add:false,del:true,search:false,refresh:true});
	    jQuery("#listaG").navButtonAdd("#listaP",{caption:"' . $bngPesquisar . '",title:"' . $bngPesquisa . '\'", 
	       onClickButton:function(){ 
		    if(jQuery("#t_listaG").css("display")=="none") { 
			jQuery("#t_listaG").css("display",""); 
		    }else { 
			jQuery("#t_listaG").css("display","none"); 
		    } 
		} 
	    });
	    function pickdates(id){ 
		jQuery("#" + id + "_udia","#listaG").datepicker({dateFormat:"yy-mm-dd"}); 
	    } 
	
	});';

include($_SERVER['DOCUMENT_ROOT'] . '/bsk/includes/md.topo.php');


?>

	<div id="middle">
		
		<div id="center-column">
			<div class="top-bar">
				<h1><?php print $bngInicial;?></h1>
				<div class="breadcrumbs"><a href="/bsk/"><?php print $bngInicial;?></a></div>
			</div>
			<br />
		  <div class="select-bar">
		    &nbsp;
		  </div>
		
		<table id="listaG" class="scroll"></table> 
		<div id="listaP" class="scroll" style="text-align:center;"></div> 
		<span id="listaErr" style="color:red"></span>  

		</div>
		
<?php include( $_SERVER['DOCUMENT_ROOT'] . "/bsk/includes/md.direita.php" );?>

	</div>
<?php
include($_SERVER['DOCUMENT_ROOT'] . '/bsk/includes/md.fundo.php');	
?>