Y estos lo php:
buscar_recambio.php
Código PHP:
<?php require_once('Connections/conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$recambio=$_GET['id'];
mysql_select_db($database_conexion, $conexion);
$query_Recordset1 = "SELECT * FROM almacen000 where recambio='$recambio'";
$Recordset1 = mysql_query($query_Recordset1, $conexion) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Documento sin título</title>
<style type="text/css">
#apDiv1 {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
</style>
<script>
function volver() {
window.opener.document.frm.recambio.value = document.myform.recambio.value;
window.opener.document.frm.denominacion.value = document.myform.denominacion.value;
window.opener.document.frm.pvp.value = document.myform.pvp.value;
window.close();
}
</script>
</head>
<body>
<div id="apDiv1">
<table width="100%" border="1">
<form id="myform" name="myform" action="" method="post">
<tr>
<td>Almacén</td>
<td>Referencia</td>
<td>Descripción</td>
<td>PVP</td>
<td>Stock</td>
</tr>
<tr>
<td><?php echo $row_Recordset1['almacen']; ?></td>
<td><input type="text" size= "9" name="recambio" value="<?php echo $row_Recordset1['recambio']; ?>"/></td>
<td><input type="text" size= "9" name="denominacion" value="<?php echo $row_Recordset1['denominacion']; ?>"/></td>
<td><input type="text" size= "9" name="pvp" value="<?php echo $row_Recordset1['pvp']; ?>"/></td>
<td><?php echo $row_Recordset1['existencias']; ?></td>
</tr>
</table>
<a href="javascript:volver();" title="pasar valor">Regresar a la Ventana Principal</a>
</form>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
buscar_recambio1.php
Código PHP:
<?php require_once('Connections/conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$recambio=$_GET['id'];
mysql_select_db($database_conexion, $conexion);
$query_Recordset1 = "SELECT * FROM almacen000 where recambio='$recambio'";
$Recordset1 = mysql_query($query_Recordset1, $conexion) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Documento sin título</title>
<style type="text/css">
#apDiv1 {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
</style>
<script>
function volver1(recambio,denominacion,pvp) {
window.opener.document.myform1.idrecambio1.value = recambio;
window.opener.document.myform1.iddenominacion1.value = denominacion;
window.opener.document.myform1.idpvp1.value = pvp;
window.close();
}
</script>
</head>
<body>
<div id="apDiv1">
<table width="100%" border="1">
<form id="myform1" name="myform1" action="" method="post">
<tr>
<td>Almacén</td>
<td>Referencia</td>
<td>Descripción</td>
<td>PVP</td>
<td>Stock</td>
</tr>
<tr>
<td><?php echo $row_Recordset1['almacen']; ?></td>
<td><input type="text" size= "9" name="recambio" id="recambio" value="<?php echo $row_Recordset1['recambio']; ?>"/></td>
<td><input type="text" size= "9" name="denominacion" id="denominacion" value="<?php echo $row_Recordset1['denominacion']; ?>"/></td>
<td><input type="text" size= "9" name="pvp" id="pvp" value="<?php echo $row_Recordset1['pvp']; ?>"/></td>
<td><?php echo $row_Recordset1['existencias']; ?></td>
</tr>
</table>
<a href="javascript:volver1();" title="pasar valor">Regresar a la Ventana Principal</a>
</form>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Gracias