Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/05/2015, 09:26
rudiaz
 
Fecha de Ingreso: abril-2015
Ubicación: Santiago de Chile
Mensajes: 80
Antigüedad: 9 años
Puntos: 0
Respuesta: Problemas al ingresar datos a la base de datos

Esta es la segunta parte del programa:

Código PHP:
Ver original
  1. $num_unico=mysql_result($result,0, "num_unico");
  2.     $nombre_largo=mysql_result($result,0, "Nombre_largo");
  3.     $sucursal=mysql_result($result,0, "Sucursal");
  4.     $c_usados=mysql_result($result,0,"c_usados");
  5.     $c_ford_nuevos=mysql_result($result,0,"c_ford_nuevos");
  6.     $hyundai=mysql_result($result,0,"Hyundai");
  7.     $global=mysql_result($result,0,"Global");
  8.     $u_livianos=mysql_result($result,0,"u_livianos");
  9.     $ford_livianos=mysql_result($result,0,"ford_livianos");
  10.     $fortaleza=mysql_result($result,0,"fortaleza");
  11.     $fortaleza_camiones=mysql_result($result,0,"fortaleza_camiones");
  12.     $motos=mysql_result($result,0,"Motos");
  13.     $rentacar=mysql_result($result,0,"rentacar");
  14.     $agricola=mysql_result($result,0,"agricola");
  15.     $sin_area=mysql_result($result,0,"sin_area");
  16.     $nombre_user=mysql_result($result,0, "Nombre_Usuario");
  17.     $pass=mysql_result($result,0, "Clave_ing");
  18.     $nivel=mysql_result($result,0, "Nivel");
  19.     $cargo=mysql_result($result,0, "cargo_coti");
  20.     $celular=mysql_result($result,0, "celular_coti");
  21.     $email=mysql_result($result,0, "email");
  22.     $num_unico=mysql_result($result,0, "num_unico");
  23.     $fono_fijo=mysql_result($result,0, "Fono_Fijo");
  24. }
  25. echo("<br>");
  26. echo("<input type=hidden value=".$_POST["usuario"]." name=num_actual>");
  27. echo("<table border=1 width=100%>");
  28. echo("<tr>");
  29. echo("</tr>");
  30. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Datos de Usuario</span></td>");
  31. echo("</tr>");
  32. echo $num_unico;
  33. echo("<table border=1 width=100%>");
  34. echo("<tr>");
  35. echo("</tr>");
  36. echo("  <td>Nombre Completo</td>");
  37. 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>");
  38. echo("</tr>");
  39. echo("<tr>");
  40. echo("  <td>Sucursal</td>");
  41. echo("  <td>");
  42. echo("  <select name=sucursal onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  43. $result = mysql_query("SELECT * FROM mae_ubicaciones WHERE sucursal ='S' order by Ubicacion");
  44. if (mysql_num_rows($result)>0){
  45.    $i=0;
  46.    $rows=mysql_num_rows($result);
  47.    while($i < $rows) {
  48.       if ($sucursal==mysql_result($result, $i, "Ubicacion")){
  49.         echo("<option selected value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  50.         }else{
  51.         echo("<option value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  52.         }
  53.    $i++;
  54.    }
  55. }
  56. echo("</select>");
  57. echo("  </td>");
  58. echo("</tr>");
  59. echo("<tr>");
  60. echo("  <td>Contrase&ntilde;a</td>");
  61. 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>");
  62. echo("</tr>");
  63. echo("<tr>");
  64. echo("  <td>Area de trabajo (Marcada con ''X'')</td>");
  65. 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>");
  66. echo("</tr>");
  67. echo("<tr>");
  68. echo("  <td></td>");
  69. 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>");
  70. echo("</tr>");
  71. echo("  <td></td>");
  72. 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>");
  73. echo("</tr>");
  74. echo("  <td></td>");
  75. 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>");
  76. echo("</tr>");
  77. echo("  <td></td>");
  78. 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>");
  79. echo("</tr>");
  80. echo("  <td></td>");
  81. 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>");
  82. echo("</tr>");
  83. echo("  <td></td>");
  84. 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>");
  85. echo("</tr>");
  86. echo("  <td></td>");
  87. 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>");
  88. echo("</tr>");
  89. echo("  <td></td>");
  90. 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>");
  91. echo("</tr>");
  92. echo("  <td></td>");
  93. 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>");
  94. echo("</tr>");
  95. echo("  <td></td>");
  96. 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>");
  97. echo("</tr>");
  98. echo("  <td></td>");
  99. 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>");
  100. echo("</tr>");
  101. echo("<tr>");
  102. echo("  <td>Fono</td>");
  103. 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>");
  104. echo("</tr>");
  105.  
  106. echo("<tr>");
  107. echo("  <td>Nivel</td>");
  108. echo("  <td>");
  109. echo("  <select name=nivel onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  110. if ($nivel==3){echo("<option selected value=3>Vendedor</option>");}else{echo("<option value=3>Vendedor</option>");}
  111. if ($nivel==2){echo("<option selected value=2>Asistente</option>");}else{echo("<option value=2>Asistente</option>");}
  112. if ($nivel==1){echo("<option selected value=1>Administrador</option>");}else{echo("<option value=1>Administrador</option>");}
  113. echo("</select>");
  114. echo("  </td>");
  115. echo("</tr>");
  116. echo("<tr>");