<?php
#
# Projeto :  Bruno
# Data : 13/11/2014
# 
# ROBO Detalhe
#

    //*******************************************************************	
	// INCLUDES nao alterar a ordem dos includes
    //*******************************************************************	
	include "includes/library.php";
	include "includes/session.php";
 	include("includes/top_comum.php");
	
	//recuperando variaveis da tela
	//-----------------------------------
	$mod = request("mod");
	include $mod .  "/consistencia.php";
	
	
	$last_url = request_session("LAST_URL");
	if ( empty($last_url) ){
			$last_url = "area_usuario.php?$sid_get";
	} 
	//Adicionando java script de validação
	//------------------------------------------
?>
	<div class="row">
					<div class="col-xs-12 col-sm-7 col-md-7 col-lg-7">
						<h1 class="page-title txt-color-blueDark"><i class="fa-fw fa fa-desktop"></i> <?php echo show($modules[$mod]["detail_titulo"])?> </h1>
					</div>
    </div>
	
	<form name="formfields" action="robo_editar.php" method="post" onsubmit="return consiste(this)" class="form-horizontal" role="form">
	<div id="row">
	<center>
	<? if ( is_allowed( request_session("USER_NIVEL"), request("mod"), "edit") ){?>
			<input type="submit" value="alterar registro" class="btn btn-primary btn-lg" onclick="javascript:this.disabled = 'disabled';this.form.submit();">
	<? } ?>
	
	<? if ( is_allowed( request_session("USER_NIVEL"), request("mod"), "delete") ){
				$mod = request("mod");
				$key = request("key");
				$url = "robo_excluir.php?$sid_get&mod=$mod&key=$key";
	?>
			<input type="button" value="excluir registro"  class="btn btn-primary btn-lg" onclick="javascript:this.disabled = 'disabled';document.location='<?php echo $url?>&url=<?php echo urlencode($last_url)?>';">
	<? } ?>
	
	        <input type="button" value="cancelar" class="btn btn-lg" onclick="javascript:this.disabled = 'disabled';document.location='<?php echo $last_url?>';" >
	</center>
	</div>
	<br>	
	<?php echo $sid_post?>
	
	<input type="hidden" name="mod" value="<?php echo request("mod")?>">
	<input type="hidden" name="key" value="<?php echo request("key")?>">

	
	

    <?php
			//aqui é onde irá o form de acordo com o design personalizado
			$mode = "detail";
			include $mod . "/form.php";
	?>

	<div id="row">
	<center>
	<? if ( is_allowed( request_session("USER_NIVEL"), request("mod"), "edit") ){?>
			<input type="submit" value="alterar registro" class="btn btn-primary btn-lg" onclick="javascript:this.disabled = 'disabled';this.form.submit();">
	<? } ?>
	
	<? if ( is_allowed( request_session("USER_NIVEL"), request("mod"), "delete") ){
				$mod = request("mod");
				$key = request("key");
				$url = "robo_excluir.php?$sid_get&mod=$mod&key=$key";
	?>
			<input type="button" value="excluir registro"  class="btn btn-primary btn-lg" onclick="javascript:this.disabled = 'disabled';document.location='<?php echo $url?>&url=<?php echo urlencode($last_url)?>';">
	<? } ?>
	
	        <input type="button" value="cancelar" class="btn btn-lg" onclick="javascript:this.disabled = 'disabled';document.location='<?php echo $last_url?>';" >
	</center>
	</div>		
	</form>
<? 	include("includes/bottom_comum.php"); ?>

