Retroceder   Foros del Web > Programación para sitios web > Bases de Datos > Mysql

Respuesta
 
Herramientas Desplegado
Antiguo 12-jul-2007, 09:16   #1 (permalink)
natashca ha deshabilitado el karma
 
Fecha de Ingreso: mayo-2007
Mensajes: 413
duda con consulta

ola a todos los del foro ... tengo lo sigiente esta consulta muestra al ir avanzando por el objecto select me muestra sus datos afuera del objeto

Código PHP:
<select name="select" size="18" id='select' onChange='MostrarNombre(this)'>
     
        
<?php
$compara
=$select;

include 
"link.php";

$dblink=mysql_connect($MySqlHostname$MySqlUsername$MySqlPassword);
mysql_select_db("$MySqlDatabase");
$sql "SELECT  DISTINCT CORRELATIVO , PATERNO , MATERNO, RUT, DV, NOMBRES FROM POSTULANTE ORDER BY PATERNO";
$query mysql_query($sql$dblink);

while (
$row mysql_fetch_array($query))
{
 
$PATERNO $row['PATERNO'];
 
$MATERNO $row['MATERNO'];
 
$NOMBRES $row['NOMBRES'];
 
$CORRELATIVO $row['CORRELATIVO'];
 
$RUT $row['RUT'];
 
$DV $row['DV'];

printf("<OPTION value=\" $PATERNO $MATERNO $NOMBRES <br> Correlativo: $CORRELATIVO <br> Rut: $RUT  - $DV\", "); 


if (
$PATERNO==$compara
{
printf(" SELECTED");
}

printf(">$PATERNO $MATERNO $NOMBRES </option>");

}
//mysql_free_result($query);
?>

</select>

tambien tengo unos datos que son puntajes y que tambien ahy que mostralos a la ves que vaya avanzando por el select ....este es el resto del codigo: la idea es esa al ir avanzando por los datos de lselect que tambien en el cuadro que esta aca abajo vaya mostrando los puntajes ....

//cuadro:
Código HTML:
 </font>
  <div id="Layer3" style="position:absolute; width:236px; height:206px; z-index:19; left: 400px; top: 80px">
    <table width="100%" border="1" bordercolor="#0000FF" bgcolor="#ffffff">
      <tr>
        <td height="32" bgcolor="#99ccff" width="37%">
          <div align="center"><font face="Tahoma"><b><font size="1" color="#000000">Item</font></b></font></div>        </td>
        <td height="32" bgcolor="#99ccff" width="28%">
          <div align="center"><font face="Tahoma"><b><font size="1" color="#000000">Valor
        Item </font></b></font></div>        </td>
        <td height="32" bgcolor="#99ccff" width="35%">
          <div align="center"><font face="Tahoma"><b><font size="1" color="#000000">Ptje.
            Asignado </font></b></font></div>        </td>
      </tr>
      
//fin cuadro
	  <?
$sqll="SELECT * FROM FACTORES_TP";
$queryy=@mysql_query($sqll, $dblink);
while ($row = mysql_fetch_array($queryy))
{
$FTP_PEDAD13 = $row['FTP_PEDAD13'];
$FTP_PEDAD14 = $row['FTP_PEDAD14'];
$FTP_PEDAD15 = $row['FTP_PEDAD15'];
$FTP_PEDAD16 = $row['FTP_PEDAD16'];
$FTP_PEDAD17 = $row['FTP_PEDAD17'];
$FTP_F1 = $row['FTP_F1'];
$FTP_MENOSVALOR = $row['FTP_MENOSVALOR'];
$FTP_DIVVALOR = $row['FTP_DIVVALOR']; //100
$FTP_F2 = $row['FTP_F2'];
$FTP_F3 = $row['FTP_F3'];
$FTP_F4 = $row['FTP_F4'];
$FTP_F5 = $row['FTP_F5'];
$FTP_F6 = $row['FTP_F6'];
$FTP_PCURREP0 = $row['FTP_PCURREP0'];
$FTP_PCURREP1 = $row['FTP_PCURREP1'];
$FTP_PCURREP2 = $row['FTP_PCURREP2'];
$FTP_FAE = $row['FTP_FAE'];
$FTP_FTP = $row['FTP_FTP'];
$FTP_N_ACEPTADOS_PROX = $row['FTP_N_ACEPTADOS_PROX'];
}
//?>
     
	  <?
$band=1;

if ($select==0) {

 if ($EDADACTUAL<=13)
         { $temp_PTJEEDAD=$FTP_PEDAD13;
           $band=1;
         }

     elseif ($EDADACTUAL==14)
        { $temp_PTJEEDAD=$FTP_PEDAD14;
 		$band=1;
         }
        elseif ($EDADACTUAL==15)
         { $temp_PTJEEDAD=$FTP_PEDAD15;
		$band=1;
         }
             elseif ($EDADACTUAL==16)
              { $temp_PTJEEDAD=$FTP_PEDAD16;
		   $band=1;
              }

             
if ($band==1) 
{
echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">Edad</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$EDADACTUAL.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$temp_PTJEEDAD.'</font></div></td><tr>';
}
}
?>
    
	  <?
if (($select==1) and ($band==0)) {
$TP_PTJEEDAD=($temp_PTJEEDAD*$FTP_F1);
}
?>
      <?
if ($select==1) {
if ($FTP_DIVVALOR !=0){
 $TP_PPC7a=(($PROMCAST7-$FTP_MENOSVALOR )/$FTP_DIVVALOR);
 $TP_PPC7=bcadd($TP_PPC7a, 0, 5);

 $TP_PPM7a=(($PROMMAT7-$FTP_MENOSVALOR )/$FTP_DIVVALOR);
 $TP_PPM7=bcadd($TP_PPM7a, 0, 5);

 $TP_PPM8a=(($PROMMAT8-$FTP_MENOSVALOR )/$FTP_DIVVALOR);
 $TP_PPM8=bcadd($TP_PPM8a, 0, 8);

 $TP_PPC8a=(($PROMCAST8-$FTP_MENOSVALOR )/$FTP_DIVVALOR);
 $TP_PPC8=bcadd($TP_PPC8a, 0, 8);

 $TP_PPC7PORa=($TP_PPC7*$FTP_F4);
 $TP_PPC7POR=bcadd($TP_PPC7PORa, 0, 10);

 $TP_PPC8PORa=($TP_PPC8*$FTP_F5);
 $TP_PPC8POR=bcadd($TP_PPC8PORa, 0, 10);

 $TP_PPM7PORa=($TP_PPM7*$FTP_F2);
 $TP_PPM7POR=bcadd($TP_PPM7PORa, 0, 3);

 $TP_PPM8PORa=($TP_PPM8*$FTP_F3);
 $TP_PPM8POR=bcadd($TP_PPM8PORa, 0, 3);

}

 else {
  echo "error div por 0!!!!";
  }
}

if ($select==0) {

echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">Ptje.Cast. 7º</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$PROMCAST7.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$TP_PPC7.'</font></div></td><tr>';

echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">Ptje.Mat. 7º</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$PROMMAT7.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$TP_PPM7.'</font></div></td><tr>';


echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">Ptje.Cast. 8º</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$PROMCAST8.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$TP_PPC8.'</font></div></td><tr>';

echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">Ptje.Mat. 8º</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$PROMMAT8.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$TP_PPM8.'</font></div></td><tr>';
}
?>
      <?
if ($select==1) {
if ($NCURREP==0)
{
$temp_PtjeCurRep=$FTP_PCURREP0;
}

elseif ($NCURREP==1)
{
$temp_PtjeCurRep=$FTP_PCURREP1;
}

else
{
$temp_PtjeCurRep=$FTP_PCURREP2;
}
}
if ($select==0) {
echo '<td width="37%"><b><font face="Tahoma" color="#0000FF" size="1">NºCurRep</font></b></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$NCURREP.'</font></div></td>';
echo '<td><div align="center"><font face="Tahoma" size="1" color="#000000">'.$temp_PtjeCurRep.'</font></div></td><tr>';
}

if ($select==0) {
$TP_PTJECURREP=($temp_PtjeCurRep*$FTP_F6);

$ABa=(($TP_PTJEEDAD)+($TP_PPM7POR)+($TP_PPM8POR)+($TP_PPC7POR)+($TP_PPC8POR)+($TP_PTJECURREP));
$AB=bcadd($ABa, 0, 3);

//echo $AB;
}
?>

      <font face="Arial, Helvetica, sans-serif" size="2" color="#293565"><b>Ingrese PTPS:</b>
      </font> <font size="2" face="Arial, Helvetica, sans-serif">
      <input type="text" name="nota" maxlength="3"  size="3" onblur = "this.value = this.value.replace(/^(\d{1,2})(\d{1})$/,'$1.$2')"/  onkeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false" />
      </font>
      <p> <font face="Arial, Helvetica, sans-serif">
        <input style="BACKGROUND-COLOR:#aaaaaa; COLOR:#000000; FONT-FAMILY:Verdana, Arial"  type="reset" name=boton_limpiar value="Limpiar">
        <input style="BACKGROUND-COLOR:#aaaaaa; COLOR:#000000; FONT-FAMILY:Verdana, Arial"  type="submit" value="Grabar PTPS" name="boton_submit" onclick="validarPTPS()">
        </font>
      <p> <font face="Arial, Helvetica, sans-serif">
ojala me puedan ayudar grasias desde ya a todos
__________________
Los que Saben....no Saben lo que Saben
natashca está desconectado   Responder Citando
Antiguo 12-jul-2007, 10:04   #2 (permalink)
wigglyUtrera ha deshabilitado el karma
 
Fecha de Ingreso: enero-2007
Mensajes: 336
Re: duda con consulta

cual es la pregunta??
wigglyUtrera está desconectado   Responder Citando
Antiguo 12-jul-2007, 10:39   #3 (permalink)
natashca ha deshabilitado el karma
 
Fecha de Ingreso: mayo-2007
Mensajes: 413
Re: duda con consulta

ahy que mostra los datos a la ves que vaya avanzando por el select ......... la idea es eso al ir avanzando por los datos del select tambien muestre los datos del cuadro que puse esta en el codigo lo viste???? esa es la pregunta como hacer para que tambien muestre los puntajes al ir avanzando aparte de los datos??

grasias
__________________
Los que Saben....no Saben lo que Saben
natashca está desconectado   Responder Citando
Antiguo 12-jul-2007, 11:33   #4 (permalink)
Yranac está en el buen camino
 
Avatar de Yranac
 
Fecha de Ingreso: junio-2007
Mensajes: 124
Enviar un mensaje por MSN a Yranac
Re: duda con consulta

Aquí no se puede escribir código php este foro es para bases de datos, quizá deberían mover este post al foro de php
__________________
mais só os ignorantes e féridos e duros, imbéciles e escuros non nos entenden, non.
Visita Mi web
Yranac está desconectado   Responder Citando
Antiguo 12-jul-2007, 12:30   #5 (permalink)
natashca ha deshabilitado el karma
 
Fecha de Ingreso: mayo-2007
Mensajes: 413
Re: duda con consulta

aps ya bueno si me podrian cambiar este tema al foro php...grasias
__________________
Los que Saben....no Saben lo que Saben
natashca está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 21:13.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93