![](http://img101.imageshack.us/my.php?image=checkboxcy9.jpg)
http://img101.imageshack.us/my.php?image=checkboxcy9.jpg
MI CODIGO
pro-rrhh03.php
<!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>Alta Empleado</title>
<script>
// definimos los bloques
OCULTO="none";
VISIBLE="block";
function mostrar(blo) {
document.getElementById(blo).style.display=VISIBLE ;
document.getElementById('ver_off').style.display=V ISIBLE;
document.getElementById('ver_on').style.display=OC ULTO;
}
function ocultar(blo) {
document.getElementById(blo).style.display=OCULTO;
document.getElementById('ver_off').style.display=O CULTO;
document.getElementById('ver_on').style.display=VI SIBLE;
}
</script>
</head>
<body>
<div>
<form name="result" action="procesarSeleccion.php" method="get">
<p>
<?php
// creo función para conectar con DB
include('config.php');
$link=Conectarse();
extract($_GET);
// Almaceno en variables los datos del form
$idempleado=$_GET['rad'];
print("<input type=\"hidden\" name=\"idemp\" value=$idempleado />");
// Genero una variable con la consulta deseada
$result=mysql_query("SELECT *
FROM empleados
WHERE id=$idempleado",
$link);
while($row = mysql_fetch_array($result)) {
printf(" Empleado: %s %s <br> Fecha de Ingreso (AAAA-MM-DD): %s <br><br>",
$row["nombre"],
$row["apellido"],
$row["f_ingreso"]);
}
//Libero la memoria
mysql_free_result($result);
?>
<span>Herramientas</span>
</p>
<p><span>Desktop</span> </p>
<div id="ver_on"><input name="Kits" type="button" value="Ver Kits" onclick="mostrar('bloque')" />
</div>
<div id="ver_off" style="display: none"><input name="Kits" type="button" value=" Ocultar Kits" onclick="ocultar('bloque')" /></div>
<div id="bloque" style="display: none">
<table width="651">
<tr bgcolor="#666666" align="center"><td width="168"> Proveedor</td><td width="144"> Marca</td><td width="149"> Modelo</td><td width="140"> Especificaciones</td></tr>
<?php
// Cargo la tabla
$result2=mysql_query("SELECT u.id_utilitarios, p.nombre, u.marca_d,u.modelo_d,u.especificaciones_d
FROM proveedores p, utilitarios u, tipoUtilitario tu
WHERE p.id=u.id_proveedor and u.id_tipoutilitario=tu.id_tipoutilitario
and u.estado=0 and tu.tipo='desktop'
ORDER BY u.marca_d",
$link);
$i=0;
while($row2 = mysql_fetch_array($result2)) {
printf("<tr><td class='ContResult'> %s</td>
<td class='ContResult'> %s</td>
<td class='ContResult'> %s</td>
<td class='ContResult'> %s</td>",
$row2["nombre"],
$row2["marca_d"],
$row2["modelo_d"],
$row2["especificaciones_d"]);
printf("<td class='ContResult'> <input type=\"checkbox\" value=\"%d\" name=\"seleccion[%d]\" /> </td></tr>",$row2[0],$i);
$i++;
}
//Libero la memoria
mysql_free_result($result2);
// Cierro la conexión
mysql_close($link);
?>
</table>
</div>
<p> </p>
<p>
<input value="Aceptar Selección" type="submit" />
</p>
</form>
</div>
</body>
</html>
procesarSeleccion.php
<!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>
</head>
<?php
//incluir conexión a la bdd
include('config.php');
$link=Conectarse();
extract($_GET);
$cont=$_GET[$i];
printf("%d",$cont);
for($t=0;$t<=$cont;$t++)
{
$id=$_GET[$seleccion[$t]];
printf("%d",$id);
$res=mysql_query("UPDATE utilitarios SET estado=1 where id_utilitarios=$id",$link);
}
?>
<body>
</body>
</html>
Les agradezco la ayuda desde ya a todos