Código PHP:
Ver original
echo("<br>"); echo("<form method=POST name=datos_ingreso>"); echo("<input type=hidden value=".$_POST["usuario"]." name=num_actual>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("</tr>"); echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Datos de Usuario</span></td>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("</tr>"); echo(" <td>Nombre Completo</td>"); echo(" <td><input type=text value=".chr(34).$nombre_largo.chr(34)." name=nombre_largo size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Sucursal</td>"); echo(" <td>"); echo(" <select name=sucursal onkeypress=".chr(34)."return tabular(event,this)".chr(34).">"); $result = mysql_query("SELECT * FROM mae_ubicaciones WHERE sucursal ='S' order by Ubicacion"); if (mysql_num_rows($result)>0){ $i=0; $rows=mysql_num_rows($result); while($i < $rows) { if ($sucursal==mysql_result($result, $i, "Ubicacion")){ echo("<option selected value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>"); }else{ echo("<option value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>"); } $i++; } } echo("</select>"); echo(" </td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Contraseña</td>"); echo(" <td><input type=text value=".chr(34).$pass.chr(34)." name=clave size=10 maxlength=10 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Area de trabajo (Marcada con ''X'')</td>"); echo(" <td>Camiones Usados <input type=text value=".chr(3).$c_usados.chr(3)." name=c_usados size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td></td>"); echo(" <td>Camiones Ford Nuevos <input type=text value=".chr(3).$c_ford_nuevos.chr(3)." name=c_ford_nuevos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Hyundai <input type=text value=".chr(3).$Hyundai.chr(3)." name=Hyundai size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Global <input type=text value=".chr(3).$global.chr(3)." name=global size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Utilitarios Livianos <input type=text value=".chr(3).$u_livianos.chr(3)." name=u_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Ford Livianos <input type=text value=".chr(3).$ford_livianos.chr(3)." name=ford_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Fortaleza <input type=text value=".chr(3).$fortaleza.chr(3)." name=Fortaleza size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Fortaleza Camiones <input type=text value=".chr(3).$fortaleza_camiones.chr(3)." name=fortaleza_camiones size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Motos <input type=text value=".chr(3).$motos.chr(3)." name=motos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Rentacar <input type=text value=".chr(3).$rentacar.chr(3)." name=Rentacar size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Agricola <input type=text value=".chr(3).$agricola.chr(3)." name=agricola size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo(" <td></td>"); echo(" <td>Sin Area <input type=text value=".chr(3).$sin_area.chr(3)." name=sin_area size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Fono</td>"); echo(" <td><input type=text value=".chr(34).$fono_fijo.chr(34)." name=fono_fijo size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Nivel</td>"); echo(" <td>"); echo(" <select name=nivel onkeypress=".chr(34)."return tabular(event,this)".chr(34).">"); if ($nivel==3){echo("<option selected value=3>Vendedor</option>");}else{echo("<option value=3>Vendedor</option>");} if ($nivel==2){echo("<option selected value=2>Asistente</option>");}else{echo("<option value=2>Asistente</option>");} if ($nivel==1){echo("<option selected value=1>Administrador</option>");}else{echo("<option value=1>Administrador</option>");} echo("</select>"); echo(" </td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Cargo</td>"); echo(" <td><input type=text value=".chr(34).$cargo.chr(34)." name=cargo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Celular</td>"); echo(" <td><input type=text value=".chr(34).$celular.chr(34)." name=celular size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); $busqueda = 0; $cont=1; $busqueda = mysql_query("SELECT * FROM equipos_computacionales WHERE numero_unico=".$_POST["usuario"]); $Total=mysql_num_rows($busqueda); if (($busqueda)>0 and ($Total == 1)){ $ini=mysql_result($busqueda,0, "ini")+1; $email=mysql_result($busqueda,0, "email"); $clave_correo=mysql_result($busqueda,0, "clave_correo"); $contrasena=mysql_result($busqueda,0,"contrasena"); $tipo_equipo=mysql_result($busqueda,0,"tipo_equipo"); $propietario=mysql_result($busqueda,0,"propietario"); $ip_equipo=mysql_result($busqueda,0,"ip_equipo"); $detalle=mysql_result($busqueda,0,"detalle"); $busqueda = 0; $cont=$cont+1; } if ($Total==0){ $ini="1"; $email=""; $clave_correo=""; $contrasena=""; $tipo_equipo=""; $propietario=""; $detalle=""; $ip_equipo=""; $detalle=""; } echo("<table border=1 width=100%>"); echo("<br>"); echo("<tr>"); echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Claves del Sistema</span></td>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("</tr>"); echo(" <td>e-Mail</td>"); echo(" <td><input type=text value=".chr(34).$email.chr(34)." name=email size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo(" <td>Clave Correo</td>"); echo(" <td><input type=text value=".chr(34).$clave_correo.chr(34)." name=clave_correo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("</table>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<br>"); echo("<tr>"); echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Plataforma</span></td>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("</tr>"); echo("<tr>"); echo("<td>Nombre de Usuario</td>"); echo(" <td><input type=text value=".chr(34).$nombre_user.chr(34)." name=nombre size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Contraseña</td>"); echo(" <td><input type=text value=".chr(34).$contrasena.chr(34)." name=contrasena size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>"); echo("</tr>"); echo("<tr>"); echo(" <td>Numero Unico</td>"); echo(" <td><input type=text value=".chr(10).$num_unico.chr(10)." name=num_unico size=30 maxlength=40 onkeypress=".chr(10)."return tabular(event,this)".chr(10)."></td>"); echo("</tr>"); echo("</table>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<br>"); echo("<tr>"); echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Equipos</span></td>"); echo("</tr>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("</tr>"); echo("<tr>"); echo("<td>Seleccione el Tipo de Equipo</td>"); echo("<td>"); ?> <select name="$tipo_equipo" size="1"> <option value="PC" selected>PC</option> <option value="NOTEBOOK">Notebook</option> <option value="PANTALLA">Pantalla</option> </select> <? echo("</td>"); echo("<tr>"); echo("<tr>"); echo(" <td>IP</td>"); echo("</tr>"); echo("<tr>"); echo("<tr>"); echo(" <td>Propiedad de:</td>"); echo("<td>"); ?> <select name="$propiedad" size="1"> <option value="Curifor" selected>Curifor</option> <option value="Personal">Personal</option> </select> <? echo("</td>"); echo("<tr>"); echo(" <td valign='top'>Detalles</td>"); echo(" <td> "); ?> <textarea name="$detalle" rows="100" cols="100" enabled><? echo $detalle; ?> </textarea> <? echo "</td>"; echo "</tr>"; echo("</table>"); echo("<tr>"); echo("<br>"); echo("<table border=1 width=100%>"); echo("<tr>"); echo("<table border=1 width=100%>"); ?> <input type="button" value="Guardar" onclick="guardar()"> </form> <? } ?> </div> </body> </html>