changos es mucha letra pero bueno aqui esta mi script index.php
contiene el script la tabla mis consultas
Código PHP:
<?PHP
$dblink = mssql_connect("cyaserversan","sa","sqlcyasa")
or die("no se puede conectar a SQL Server");
$success = mssql_select_db("archivo",$dblink);
?>
<!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>
<SCRIPT type="text/javascript">
function datosg(documento){
var opc=documento;
document.getElementById("tipoar" + opc).checked = true;
}
</script> //ese es el script q kiero hacer :(
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[email protected] Sistema de digitalización de Documentos Notariales</title>
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFFFF;
}
.style2 {
font-family: "Times New Roman", Times, serif;
color: #FFFFFF;
}
.style4 {
color: #FFFFFF;
font-weight: bold;
font-family: "Arial Black";
}
body {
background-color: #CCCCFF;
}
.style5 {font-family: Arial, Helvetica, sans-serif}
.style6 {font-weight: bold; color: #FFFFFF;}
.Estilo1 {color: #000000}
.Estilo3 {color: #FFFFFF; font-weight: bold; font-family: "Trebuchet MS"; }
-->
</style>
</head>
<body>
<form id="digita" name="index" method="post" action=""enctype="multipart/form-data">
<div align="center">
<table width="960" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="cabecera_generica.jpg" width="960" height="82" /></td>
</tr>
</table>
<hr align="center" size="20" color="#685c53" />
<table width="167" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="167" height="15" bgcolor="8b2346"><div align="left" class="style1">Búsqueda Rápida</div></td>
</tr>
</table>
<br />
<table width="186" border="0" align="left" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#002C5F">
<tr>
<td width="186" height="38"><label><span class="style2"><span class="Estilo3">Número de Escritura</span></span><br />
<input name="numescri" type="text" id="numescritura" style="background-color:#EBEBEB" />
<br />
<input name="busca" type="image" id="busca" src="lupa.jpg" align="bottom" />
</label></td>
</tr>
</table>
<table width="778" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="245" bgcolor="#FFCFFF"><div align="left" class="style1 Estilo1">Escritura</div></td>
<td width="156" bgcolor="#FFCCFF"><div align="left" class="style1 Estilo1">Notaria</div></td>
<td width="120" bgcolor="#FFCCFF"><div align="left" class="style1 Estilo1">Tipo</div></td>
<td width="247" bgcolor="#FFCCFF"><div align="left" class="style1 Estilo1">Protocolo</div></td>
</tr>
<?php
$db->debug=1;
$boton=$_REQUEST["busca"];
$cadena=$_REQUEST["numescri"];
if (isset($cadena))
{
$resultreg = mssql_query("select * from expedientes where numero= '" . $cadena. "' ")or die("ha ocurrido un error en la base de datos fallo la consulta");
while ($rowreg = mssql_fetch_array($resultreg, MSSQL_ASSOC)) {
$clave=$rowreg["clave"];
$numescri= $rowreg["numero"];
$ano=$rowreg["ano"];
$doc=$rowreg["documento"];
print("<tr>");
print "<td bgcolor=#FFCCFF><font color=#000000 face=Trebuchet MS><a href=\"javascript:datosg(documento='".$doc."')\" >".$rowreg["numero"]."</font></a></td>";// aqui es donde hago el link y mando la variable
print "<td bgcolor=#FFCCFF ><font color=#000000 face=Trebuchet MS>".$rowreg["notaria"]."</font></td>";
print "<td bgcolor=#FFCCFF><font color=#000000 face=Trebuchet MS>".$rowreg["tipo"]."</font></td>";
print "<td bgcolor=#FFCCFF ><font color=#000000 face=Trebuchet MS>".$rowreg["protocolo"]."</font></td>";
print("</tr>");
}
}
mssql_close($dblink);
?>
</tr>
</table>
<p> </p>
<table width="982" border="0" align="left" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#002C5F">
<tr>
<td> </td>
<td> </td>
<td bgcolor="8b2346"><div align="center" class="style1">Documentos</div></td>
</tr>
<tr>
<td width="199" height="27"><label><span class="style2"><span class="style4">Escritura</span></span>
<input name="escritura" type="text" id="escri" style="background-color:#EBEBEB" readonly="true" value="<?php echo $numescri; ?>" />
</label></td>
<td width="163" height="27"><label><span class="style2"><span class="style4">Año</span></span><br />
<input name="anioescri" type="text" id="anioescri" style="background-color:#EBEBEB" readonly="true" value="<?php echo $ano; ?>" />
</label></td>
<td colspan="2"><label>
<input type="checkbox" name="tipoar" id="tipoar" />
<span class="style4">BIS</span></label></td>
<td width="210"> </td>
<td width="205"> </td>
</tr>
<tr>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar" />
<span class="style1">Testimonio</span>
<input type="image" name="verpdftesti" id="verpdftesti" src="iconitoPDF.gif" />
</label></td>
<td><label>
<input name="tipoar2" type="checkbox" disabled="disabled" id="tipoar2" value="" />
<span class="style1">Apéndice</span>
<input type="image" name="verpdfapen" id="verpdfapen" src="iconitoPDF.gif" />
</label></td>
<td colspan="2"><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar2" value="" />
<span class="style1">Indexado1</span>
<input type="image" name="verpdfindex1" id="verpdfindex1" src="iconitoPDF.gif" />
</label></td>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar3" value="" />
<span class="style1">Indexado2</span>
<input type="image" name="verpdfindex2" id="verpdfindex2" src="iconitoPDF.gif" />
</label></td>
<td><span class="style5">
<label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar4" value="" />
<span class="style6">Indexado3</span>
<input type="image" name="verpdfindex3" id="verpdfindex3" src="iconitoPDF.gif" />
</label>
</span></td>
</tr>
<tr>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar5" value="" />
<span class="style1">Boleta de Registro</span>
<input type="image" name="verpdfbolereg" id="verpdfbolereg" src="iconitoPDF.gif" />
</label></td>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar6" value="" />
<span class="style1">Varios</span>
<input type="image" name="verpdfvarios" id="verpdfvarios" src="iconitoPDF.gif" />
</label></td>
<td colspan="2"><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar7" value="" />
<span class="style1">Boleta de Entrada</span>
<input type="image" name="verpdfboleent" id="verpdfboleent" src="iconitoPDF.gif" />
</label></td>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar8" value="" />
<span class="style1">Boleta de Rechazo</span>
<input type="image" name="verpdfbolerech" id="verpdfbolerech" src="iconitoPDF.gif" />
</label></td>
<td><label>
<input name="tipoar" type="checkbox" disabled="disabled" id="tipoar9" value="" />
<span class="style1">Cancelacion de </span>
<input type="image" name="verpdfcancel" id="verpdfcancel" src="iconitoPDF.gif" />
<span class="style1">Escritura</span></label></td>
</tr>
<tr>
<td colspan="2" ><label><span class="style1">Observaciones </span>
<textarea name="observ" id="observ" cols="45" rows="5"></textarea>
</label></td>
<td width="99"><label><span class="style1">Guardar</span><br />
<input name="guardar" type="image" id="guardar" src="BtnGuardar.gif" align="center" />
</label></td>
<td width="106"><label><span class="style1">Salir</span><br />
<input type="image" name="salir" id="salir" src="BtnSalir.gif" />
</label></td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
muchas gracias por tu interes cuidate y espero me puedas ayudar gracias gracias!!!