Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/11/2009, 12:41
Bertitha
 
Fecha de Ingreso: septiembre-2009
Ubicación: Aguascalientes,Méx
Mensajes: 158
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: recargar pagina

Código HTML:
<form id="form2" name="form2" method="POST">
  
  
  <center>
    <table width="790" height="201" border="0" align="center">
    <tr>
          <td width="876"><fieldset>
            <legend>Datos de la empresa:</legend>&nbsp;
            <table width="689" height="374" border="0" align="center">
              <tr>
                <td width="199">Nombre de la empresa:</td>
                <td width="480"><label>
                  <input name="nom_empresa" type="text" id="nom_empresa" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>Dirección:</td>
                <td><label>
                  <input name="direccion" type="text" id="direccion" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>Delegación:</td>
                <td><label>
                  <input name="delegacion" type="text" id="delegacion" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>Estado:</td>
                <td>[PHP]<?php 
				if (!($link=mysql_connect("localhost","root","")))
				{
			        echo "error en la conexión";
        			exit();
    			}
			    if (!(mysql_select_db("gestioniso",$link)))
				{
			        echo "error al seleccionar la base de datos";
        			exit();
    			}
				  $str_sql="select id_estado, estado from estado order by orden";
				  $resultado1=mysql_query($str_sql,$link); 
				  echo "<select name=estado>";
					while(($registro1 = mysql_fetch_object($resultado1)))
					 {
						$id_estado=$registro1->id_estado;
						$estado=$registro1->estado;	
						echo "<option value=\"$id_estado\">$estado</option>";     
					 }
				  echo "</select>";
				?>[/PHP]</td>
              </tr>
              <tr>
                <td><label>Ciudad:</label></td>
                <td><label>
                  <input name="ciudad" type="text" id="ciudad" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>Código postal:</td>
                <td><label>
                  <input name="codigo" type="text" id="codigo" size="70" />
                </label></td>
              </tr>
              <tr>
                <td><label>Etapa del sistema ISO:</label></td>
                <td>[PHP]<?php 
				if (!($link=mysql_connect("localhost","root","")))
				{
			        echo "error en la conexión";
        			exit();
    			}
			    if (!(mysql_select_db("gestioniso",$link)))
				{
			        echo "error al seleccionar la base de datos";
        			exit();
    			}
				  $str_sql="select id_etapa, etapa from etapa order by orden";
				  $resultado1=mysql_query($str_sql,$link); 
				  echo "<select name=etapa>";
					while(($registro1 = mysql_fetch_object($resultado1)))
					 {
						$id_etapa=$registro1->id_etapa;
						$etapa=$registro1->etapa;	
						echo "<option value=\"$id_etapa\">$etapa</option>";     
					 }
				  echo "</select>";
				?>[/PHP]</td>
              </tr>
              <tr>
                <td>Giro:</td>
                <td><label>
                  <input name="giro" type="text" id="giro" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>R.F.C.:</td>
                <td><label>
                  <input name="rfc" type="text" id="rfc" size="70" />
                </label></td>
              </tr>
              <tr>
                <td>Forma de ingreso:</td>
                <td>[PHP]<?php 
				if (!($link=mysql_connect("localhost","root","")))
				{
			        echo "error en la conexión";
        			exit();
    			}
			    if (!(mysql_select_db("gestioniso",$link)))
				{
			        echo "error al seleccionar la base de datos";
        			exit();
    			}
				  $str_sql="select id_forma, forma from forma_ingreso order by orden";
				  $resultado1=mysql_query($str_sql,$link); 
				  echo "<select name=forma>";
					while(($registro1 = mysql_fetch_object($resultado1)))
					 {
						$id_forma=$registro1->id_forma;
						$forma=$registro1->forma;	
						echo "<option value=\"$id_forma\">$forma</option>";     
					 }
				  echo "</select>";
				?>[/PHP]</td>
              </tr>
              <tr>
                <td>Teléfono (s):</td>
                <td><label>
                  <input name="tel1" type="text" id="tel1" size="20" />
                  , 
                  <input name="tel2" type="text" id="tel2" size="20" />
                y 
                <input name="tel3" type="text" id="tel3" size="20" />
                </label></td>
              </tr>
              <tr>
                <td>Fax(s:)</td>
                <td><label>
                  <input name="fax1" type="text" id="fax1" size="20" />
                </label>
                  y
                  <label>
                    <input name="fax2" type="text" id="fax2" size="20" />
                  </label></td>
              </tr>
              <tr>
                <td height="22">Tipo de cliente:</td>
                <td><select name="c_tipocliente" onchange="this.form.submit()">
                     <option value="0">--Elija un tipo--</option>
                    [PHP]<?php
                        if (!($link=mysql_connect("localhost","root","")))
                        {
                            echo "error en la conexión";
                            exit();
                        }
                        if (!(mysql_select_db("gestioniso",$link)))
                        {
                            echo "error al seleccionar la base de datos";
                            exit();
                        }
                      $c_tipocliente=$_POST['c_tipocliente'];
                      $query="select id_cliente, tipo_cliente from tipo_cliente";
                      $resultado=mysql_query($query,$link);    
                        while(($registro1 = mysql_fetch_object($resultado)))
                         {
                            $id_cliente=$registro1->id_cliente;
                            $tipo_cliente=$registro1->tipo_cliente;	
                            if ($c_tipocliente==$id_cliente) 
                              $selected=" selected";
                            else 
                              $selected="";		 
                            echo "<option value=\"$id_cliente\" $selected>$tipo_cliente</option><br>";     
                         }
                    ?>[/PHP]
                    </select></td>
              </tr>
              <tr>
                <td></td>
                <td>[PHP]<?php
					  $combo_subtipo=$_POST['combo_subtipo'];						   
					  if($c_tipocliente>0 && $c_tipocliente==1)
					   {
							  $query="select id_subtipo,subtipo from sub_tipo where id_cliente=$c_tipocliente";
							  $resultado=mysql_query($query,$link);  
							  echo "<select name=combo_subtipo onchange=\"this.form.submit()\">";   
							  echo '<option value="0">--Elija un tipo--</option>';
								while(($registro1 = mysql_fetch_object($resultado)))
								 {
									$id_subtipo=$registro1->id_subtipo;
									$subtipo=$registro1->subtipo;
									if ($combo_subtipo==$id_subtipo) 
                              			$selected=" selected";
                           			else 
                              			$selected="";		 
                            			echo "<option value=\"$id_subtipo\" $selected>$subtipo</option><br>";	 
								 }
							  echo "</select>";
							  }
					   //si quiero un case
					  if($c_tipocliente==1)
					   {
						   if($combo_subtipo>0 && $combo_subtipo==1)
						   {
							   echo '<table width="500" border="0">';
							   echo '<tr><td>Referencia:</td><td><input type="text" name="texto" id="texto"/></td></tr>';
							   echo '<tr><td>Adjuntar Archivo:</td><td><input type="file" name="archivo2" id="archivo2"/></td></tr>';
							   echo '<tr><td>Escriba Justificación:</td><td><textarea name="area2" id="area2" cols="30" rows="3"></textarea></td></tr>';
							   echo '</table>';
						   }elseif($combo_subtipo==2)
						   {
							   echo '<table width="500" border="0">';
							   echo '<tr><td>Referencia:</td><td><input type="text" name="texto" id="texto"/></td></tr>';
							   echo '<tr><td>Escriba Justificación:</td><td><textarea name="area2" id="area2" 									cols="30" rows="3"></textarea></td></tr>';
							   echo '</table>';
						   }
					   }
					  if($c_tipocliente==2)
					   {
							echo '<table width="500" border="0">';
							echo '<tr><td>Adjuntar Archivo:</td><td><input type="file" name="archivo2" id="archivo2"/></td></tr>';
							echo '<tr><td>Escriba Justificación:</td><td><textarea name="area2" id="area2" cols="30" rows="3"></textarea></td></tr>';
							echo '</table>';
					   }
					  if($c_tipocliente==3)
					   {
					   }  
					?>[/PHP]
					</td>
              </tr>
            </table>
            <center></center>
            <p>
              <center>&nbsp;&nbsp;<input name="Guardar2" type="submit" class="style9" id="Guardar2" value="Guardar" />
&nbsp;&nbsp;&nbsp;
<input name="Cancelar2" type="reset" class="style9" id="Cancelar2" value="Cancelar" /> </center>           
            <p>&nbsp;</p>
          </fieldset></td>
        </tr>
      </table>
  </center>
  <input type="hidden" name="MM_insert" value="form2" />
</form> 
ustedes perdonaran pero es un formulario un poco grande....eso es lo que piden los clientes
__________________
“Primero resuelve el problema. Entonces, escribe el código.”