<?php include "../index/conexion.inc" ?>
<?php include "../index/validacion.php" ?>
<!doctype html>
<html lang="es">
	<head>
		<?php include '../index/head.php'; ?>
	</head>
	<body class="nav-md" onLoad="recargar();">
		<div class="container body">
			<div class="main_container">
				<div class="right_col" role="main">
				<div class="">
					<!-- page content -->
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12">	
							<div class="x_panel">
								<div class="x_content">
									<div class="row">
										<div class="form-group">
											<label for="message">Respuesta SAP</label>
											<?php
												// conexión
												$servername = $svr_servidor;
												$conectioninfo = array("Database"=>"JoinIntegrador", "UID"=>$svr_usuario, "PWD"=>$svr_contrasena, "CharacterSet"=>"UTF-8");
												$conexion = sqlsrv_connect($servername, $conectioninfo);
												if ($conexion == false)
												{
													$mensaje = "Existe un error al intentar conectarse con el servidor...";
												}
												else
												{
													$cV01 = $_GET['id'];
													$sql = "SELECT W.* \n"
														  ."FROM ws_joinpagos AS W \n"
														  ."WHERE (W.LINEA = ".$cV01.")";
													$pa1 = array();
													$op1 = array("scrollable" => SQLSRV_CURSOR_KEYSET);
													// Lanzar la consulta
													$re1 = sqlsrv_query($conexion, $sql, $pa1, $op1);
													while($fila = sqlsrv_fetch_array($re1))
													{
														echo "
															<textarea id='message' class='form-control' name='message' rows='20' cols='100'>
															".$fila['RESPONSETEXT']."
															</textarea>
														";
													}
													sqlsrv_free_stmt($re1);
												}
												sqlsrv_close($conexion);
											?>
										</div>
									</div>
									</br>
									<div class="row">
										<div class="form-group">
											<button type="button" class="btn btn-danger" onclick="self.close();">
												<span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span> Cerrar
											</button>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php include '../index/fbody.php'; ?>
	</body>
</html>
<script>
	function valida_campos(f)
	{
		if (this.neo.cV02.value == '')
		{
			alert("Ingrese justificación.");
			this.neo.cV01.focus();
			return false;
		}
	}
</script>