![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/12/2007, 11:13
|
| | Fecha de Ingreso: diciembre-2007
Mensajes: 19
Antigüedad: 17 años, 2 meses Puntos: 0 | |
Re: Referenciar celdas con id para usarlos en mysql La generación de tablas de seguridad son de exclusividad del administrador del sitio.
La tabla generada desde la consulta se crea dentro de otra tabla:
para que se entienda incluyo el código resumido del formulario html (es muy largo para el mensaje):
<?php
class HTML {
function View( $resultados, $total_check, $total, $limit_ini, $limit_end, $years, $selected_group ) {
global $site_path, $msg, $filas;
?>
<script language="javascript" type="text/javascript" src="<?php echo $site_path?>/include/js/javascript.js"></script>
<script language="javascript" type="text/javascript">
function submitbutton(task){
document.adminForm.task.value = task;
document.adminForm.submit();
}
</script>
<?php
if($msg){
echo '<div class="mensaje">';
echo $msg;
echo '</div>';
}
?>
<table width="100%">
.....
</select>
</div></td>
</tr>
<tr>
<td colspan="2"><form name="adminForm" method="post" action="">
<?php
echo '<div class="paginacion">';
paginacion( $limit_ini, $limit_end, $total, 'index.php?' );
echo '<div>';
?>
<table border="0" align="center" cellpadding="0"
....
</table>
<?php
}
function Edit( $data, $rut, $servicios, $matriz ) {
global $site_path;
//Registra la acción a ejecutar
if( $rut ){
$accion = "Editar ".$data->nombre;
}else{
$accion = "Agregar Nuevo Usuario";
}
?>
........
<script language="javascript" type="text/javascript">
function submitbutton(){
var form = document.adminForm;
......
}
function hideShow( ){
var grupo = document.getElementById("grupo");
var valor = grupo.options[grupo.selectedIndex].value;
var Obj = document.getElementById('hideShow');
if(valor != 1){
if(Obj.style.display == 'none'){
Obj.style.display = 'block';
}
}else{
if(Obj.style.display == 'block'){
Obj.style.display = 'none';
}
}
}
function cleanUsers(){
<?php
if ($data->grupo == 1){
echo "document.getElementById('hideShow').style.dis play = 'none';";
}else{
echo "document.getElementById('hideShow').style.dis play = 'block';";
}
?>
document.getElementById("duracion").value = "";
var calendarioHS = document.getElementById("calendarioHS").value;
if(calendarioHS == 2){
document.getElementById('hideShow').style.display = 'block';
}
}
function cleanActivacion(){
document.getElementById("duracion").value = "";
}
function genera(){
document.getElementById("id_tabla").value = Math.round(100+Math.random()*(1000-100));
for (k = 1; k <= 6; k++)
{
$filas=k;
lotto();
}
}
function lotto(){
var totalnumbers=10 //total de numeros a generar
var lowerbound=1 //limite inferior
var upperbound=99 //limite superior
var brd = document.getElementById("tabladatos");
B=' ';
LottoNumbers=new Array();
for (i = 1; i <= totalnumbers; i++)
{
RandomNumber = Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
for (j = 1; j <= totalnumbers; j)
{
if (RandomNumber == LottoNumbers[j])
{
RandomNumber=Math.round(lowerbound+Math.random()*( upperbound-lowerbound));
j=0;
}
j++;
}
LottoNumbers[i]=RandomNumber;
}
LottoNumbers=LottoNumbers.toString();
X=LottoNumbers.split(',');
for (i=0; i < X.length; i++)
{
X[i]=X[i];
if (X[i].length==1)
X[i]='0'+X[i];
}
for (i=1; i < X.length; i++)
{
brd.rows[$filas].cells[i].innerHTML = X[i];
}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="centro">
//estructura superiro de la tabla, no se incluye ya que no alcanza para el mensaje, sólo 10000 caracteres//
....
//Se inicia la generación de la tabla desde el mysql
<table class="adminlist" id="clave">
<tr>
<td colspan="3" align="right" valign="top"><div align="center"><strong>INFORMACIÓN DEL NUEVO USUARIO</strong> </div></td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td rowspan="8" valign="top"> </td>
<td colspan="4" rowspan="8" valign="top"> </td>
<td colspan="5" valign="top"><div align="center"><strong>TABLA DE VALIDACIÓN </strong></div></td>
</tr>
<tr>
<td height="21" align="right" valign="top"> </td>
<td valign="top"> </td>
<td valign="top"> </td>
<td colspan="5" rowspan="6"><div align="left">
<?php
if (mysql_num_rows($matriz) > 0){
echo "<table id='tabladatos' border = '1'> \n";
echo "<tr>
<td></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>A</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>B</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>C</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>D</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>E</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>F</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>G</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>H</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>I</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>J</strong></td>
</tr>";
$L=1;
while ($fila = mysql_fetch_row($matriz))
{
echo "<tr>";
echo "<td width='20' align='center' bgcolor='#CCCCCC'><strong>$L</strong></td>";
echo "<td width='20' align='center' id='A".$L."'>".$fila[0]."</td>";
echo "<td width='20' align='center' id='B".$L."'>".$fila[1]."</td>";
echo "<td width='20' align='center' id='C".$L."'>".$fila[2]."</td>";
echo "<td width='20' align='center' id='D".$L."'>".$fila[3]."</td>";
echo "<td width='20' align='center' id='E".$L."'>".$fila[4]."</td>";
echo "<td width='20' align='center' id='F".$L."'>".$fila[5]."</td>";
echo "<td width='20' align='center' id='G".$L."'>".$fila[6]."</td>";
echo "<td width='20' align='center' id='H".$L."'>".$fila[7]."</td>";
echo "<td width='20' align='center' id='I".$L."'>".$fila[8]."</td>";
echo "<td width='20' align='center' id='J".$L."'>".$fila[9]."</td>";
echo "</tr>";
$L++;
}
echo "</table>";
}else{
echo "<table id='tabladatos' border = '1'> \n";
echo "<tr>
<td></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>A</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>B</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>C</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>D</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>E</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>F</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>G</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>H</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>I</strong></td>
<td width='20' align='center' bgcolor='#CCCCCC'><strong>J</strong></td>
</tr>";
$H=1;
while ($H <6)
{
echo "<tr>";
echo "<td width='20' align='center' bgcolor='#CCCCCC'><strong>$H</strong></td>";
echo "<td width='20' align='center' id='A".$H."'></td>";
echo "<td width='20' align='center' id='B".$H."'></td>";
echo "<td width='20' align='center' id='C".$H."'></td>";
echo "<td width='20' align='center' id='D".$H."'></td>";
echo "<td width='20' align='center' id='E".$H."'></td>";
echo "<td width='20' align='center' id='F".$H."'></td>";
echo "<td width='20' align='center' id='G".$H."'></td>";
echo "<td width='20' align='center' id='H".$H."'></td>";
echo "<td width='20' align='center' id='I".$H."'></td>";
echo "<td width='20' align='center' id='J".$H."'></td>";
echo "</tr>";
$H++;
}
echo "</table>";
}
?>
</tr>
<tr>
<td width="200" align="right" valign="top">RUT : </td>
<td valign="top">
.........
</table>
<?php
}
}
?> |