<?php include('casa/setup.casa.php');
$codigo = DataForms::GET('id');
$titulo = 'Crear nueva Categoría';
include('inc_head.php');										
?>
<style>
.input-group-text{
	color:white;
	text-align:left;
	font-weight:bold;
}	
</style>
</head>
<body>
	<div class="wrapper">
	
	<?php include('inc_menu.php');?>

		<div class="main-panel">
			<div class="content">
				
				<div class="page-inner">						
				<div class="row">
					<div class="col-md-12">
						<form>
							<div class="card">
								<div class="card-header">
									<div class="card-title"><?php echo $titulo;?></div>
								</div>
								<div class="card-body">
									<div class="row">										
										<div class="col-md-6">														
											<div class="form-group">																																																																																																										
												<div class="input-group mb-2">													
													<div class="input-group-prepend">
														<span class="input-group-text bg-dark">Título Categoría:</span></div>												
													<input id='txtNombre' type="text" class="form-control">
												</div>																																																																																																																																																																																																																																																																																																																																																																			
											</div>																																																						
										</div>		
										
										
									</div>
								</div>
								<div class="card-action"><center>
									<div id='res'></div>
									<a href='<?php echo PATH_HOME.'categorias/listado'; ?>' class="btn btn-info"><b> CANCELAR </b></a>
									<button class="btn btn-dark" type='submit'><b> GUARDAR DATOS </b></button>	</center>								
								</div>
							</div>
						</form>
						</div>
					</div>
				</div>
				
			</div>
			<?php include('inc_pie.php');?>
		</div>
		
		
	</div>
</body>
</html>
<script>
$('form').on('submit', function(event) {
  event.preventDefault();

  $.post('<?php echo PATH_HOME.'categorias-ins2/'. sha1(uniqid()); ?>',{
	 'codigo': '<?php echo $code; ?>', 
	 'txtNombre': $('#txtNombre').val(), 
	 'MxEncoder': '<?php echo sha1(uniqid()); ?>'
  },function(data){
    $('#res').html(data);
  });  
});
</script>