<?php 
session_start();

?>

<div class="modal-header">
	
	<h4 class="modal-title" id="titlemodal">
	<strong>QUIERES CONFIRMAR EL TRASPASO, VALIDADO/VERIFICADO Y ACEPTADO ?
	</strong>
	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	</h4> 
</div>

<div class="row">

<div class="col-lg-12 col-sm-12 col-xs-12" style="height:10px;"></div>

<div class="col-lg-12 col-sm-12 col-xs-12"><strong class="text-blue" ><?php echo $msj; ?></strong></div>

<div class="col-lg-12 col-sm-12 col-xs-12" style="height:10px;"></div>


<div class="col-lg-12 col-sm-12 col-xs-12">
<strong align="center" class="text-red" >INGRESE SU CLAVE PARA VALIDAR EL TRASPASO.</strong>
<input type="text" id="txt_tra_cla" name="txt_tra_cla"  class="form-control"  value="" />
</div>

</div>

<div class="col-lg-12 col-sm-12 col-xs-12" style="height:10px;"></div>

<div class="box-footer float-right ">
		<span class="btn btn-primary" id="save_form" onclick="validar();">Guardar</span>
</div>

<script type="text/javascript">

$("#txt_tra_cla").keydown(function(e){
			if (e.which == 13){$("#save_form").focus();return false;}
});

function validar(){

	if($("#txt_tra_cla").val()==""){
		toastr["info"]('Ingrese su clave.');
	}else
	{	
	$.ajax({
		type: "POST",
		url: "../traspaso/traspaso_reg.php",
		async:false,
		dataType: "json",                  
		data: ({
			action:	'validar_traspaso',
			mod: 'traspaso',
			cla: $("#txt_tra_cla").val(),
			tra_id:'<?php echo $_POST['tra_id'];?>'
		}),
		beforeSend: function() {	

		},
		success: function(data){
			if(data.tra_est==1){
			
			toastr["success"](data.tra_msj);
			$('.modal').modal('hide');
			$('.in').removeClass('modal-backdrop');	
			
			}else if(data.tra_est==0){
					toastr["error"](data.tra_msj);	
			}
			
		},
		complete: function(){
			traspaso_tabla();
		}
	});
	}
}



</script>

