Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/08/2009, 22:24
Avatar de ricardoernes
ricardoernes
 
Fecha de Ingreso: agosto-2009
Ubicación: Miranda
Mensajes: 188
Antigüedad: 14 años, 9 meses
Puntos: 4
Respuesta: Enviar Informacion !!!

Código PHP:
<?php
session_start
();
//Comprobamos que exista la variable de sesion:
if(!$_SESSION['SidUsuario']){
    
header('Location:index.php?error=noSesion');
}
//Si existe, tomamos el valor:
$usuario $_SESSION['SidUsuario'];
$nombreCompleto $_SESSION['Snombre']." ";
$nombreCompleto .=    $_SESSION['Sapellido'];

$cargo $_SESSION['Scargo'];


$cargoConsulta = isset($_POST['selectCargo']) ? $_POST['selectCargo']:NULL;

?>
<html>
<body>
            
                    <p align="center" class="Estilo2">Registro Usuario </p>
                    <table width="65%" border="4" align="center" bgcolor="#FFFFCC">
                    <!-- <form name="registroUsuario"  action="php/registrarUsuario.php" method="post"> -->
                      <tr>
                                    <td width="48%"><div align="center" class="Estilo1">
                                      
                                        <label>
                                        <div align="left">C&eacute;dula
                                          <input type="text" name="cedula">
                                        </div>
                                        </label>
                                      
                                      </div></td>
<td width="52%"><div align="center" class="Estilo1">
                                      
                                        
                                        <label></label>
                                        
                                        <label>
                                        <div align="left">Password
                                          <input type="text" name="password">
                                        </div>
                                        </label>
                                     
                                      </div></td>
                      </tr>
                                  <tr>
                                    <td><div align="center" class="Estilo1">
                                      
                                        <label>
                                        <div align="left">Nombre
                                          <input type="text" name="nombre">
                                        </div>
                                        </label>
                                     
                                      </div>                                      </td>
                                    <td><div align="center" class="Estilo1">
                                     
                                        <label>
                                        <div align="left">Apellido
                                          <input type="text" name="apellido">
                                        </div>
                                        </label>
                                     
                                      </div></td>
                                  </tr>
                                  <tr>
                                    <td><div align="center" class="Estilo1">
                                     
                                        <label>
                                        <div align="left">Teléfono Personal
                                          
                                          <input type="text"  name="opcNumero1">
                                          </label>
                                      </div>
                                        <label></label>
                                        <label>                                        </label>
                                      
                                      </div></td>
                                    <td><div align="center" class="Estilo1">
                                      <label>
                                      <div align="left">Email
                                        <input type="text" name="email">
                                      </div>
                                      </label>
</div></td>
                                  </tr>
                                  <tr>
                                  
                                  
                                    <td>
                                      <form name="consultar"   action="cargarUsuario.php" method="post">                                 
                                      <label>
                                      <div align="left">
                                        <label></label>
                                       Cargo
                                        <?php
                                        
                                        
if ( $_SESSION['SidUnidad'] > '1')
                                        {
                                               
//Creando la conexion
                                                
$con mysql_connect('localhost','actividad','xx');
                                                if (!
$con)
                                                    die(
"No nos dieron conexion");
                                                else
                                                {    
//seleccionando la Base de Datos Personal
                                                    
$db mysql_select_db('registro',$con);
                                                    if (!
$db)
                                                        die(
"No nos dieron la Base de Datos");
                                                    else
                                                    {
                                                        
$query "select nombre from cargo;";                                        
                                                        
                                                        
$resultado mysql_query($query,$con);
                                                        
                                                                                                    
                                                        echo
'    <select name="selectCargo" onChange="this.form.submit()">';
                                                        
                                                        if (
$_POST['selectCargo'] == "")
                                                            echo 
'<option>Seleccione:</option>';
                                                        else
                                                            echo 
'<option>'.$_POST['selectCargo'].'</option>';
                                                        
                                                        
                                                        while (
$linea mysql_fetch_array($resultado)) 
                                                        {  
                                                           if (
$_POST['selectCargo'] != $linea[0]) 
                                                           echo (
'<option value="'.$linea[0].'">'.$linea[0].'</option>');    
                                                        } 
                                                        echo
'        </select>';  

                                                            
                                                    }
                                                    
mysql_close($con);
                                                }
                                                
                                        }
//fin if de control de Unidad
                                        
else
                                            {
                                                echo
'    <select name="selectCargo" title= "para disponibilidad de los demas cargos por favor registre Unidad">';
                                                echo 
'<option>Seleccione:</option>';
                                                   echo 
'<option value="1">Jefe de Direccion</option>';    
                                                 
                                                echo
'        </select>';
                                            }
                                                
                                        
?>
                                        <label></label>
                                      </div>
                                      </label>                                    
                                      </form>
                                      </td>
                                    <td><div align="left">
                                      <label></label>
                                      <label>Estado
  <input type="text" name="estado2" disabled="true" value="Activo">
  </label>
                                    </div></td>
                                  </tr>
                                  <tr>
                                    <td>                                   
                                      <label>

                                      <label> </label>
                                      <?php
                                    
if ($cargoConsulta != NULL && $cargoConsulta != "Jefe de Direccion")
                                    
                                        {
                                        
                                    
?>
                                    <div align="left">Unidad
                                    <?php
                                        
                                         
//Creando la conexion
                                                
$con mysql_connect('localhost','actividad','xx');
                                                if (!
$con)
                                                    die(
"No nos dieron conexion");
                                                else
                                                {    
//seleccionando la Base de Datos Personal
                                                    
$db mysql_select_db('registro',$con);
                                                    if (!
$db)
                                                        die(
"No nos dieron la Base de Datos");
                                                    else
                                                    {
                                                        
$query "select nombre from unidad where estado='Activa';";                                        
                                                        
                                                        
$resultado mysql_query($query,$con);
                                                        
                                                                                                    
                                                        echo
'    <select name="selectUnidad">';
                                                        echo 
'<option>Seleccione:</option>';
                                                        
                                                        while (
$linea mysql_fetch_array($resultado)) 
                                                        {  
                                                           echo (
'<option value="'.$linea[0].'">'.$linea[0].'</option>');    
                                                        } 
                                                        echo
'        </select>';  

                                                            
                                                    }
                                                    
mysql_close($con);
                                                }
                                        
                                    }
                                                  
                                    
?>
                                          <label></label>
                                      </div>
                                     </label>                                    
                                    </td>
                                    <td>                                      
                                      <label>
                                        <div align="left">
                                          <label></label>
                                          <input name="Submit3" type="submit" class="button" value="Registrar">
                                          <input name="SubmitCancelar" type="button" class="button" value="Cancelar" onClick="location.href='submenuAdministrador.php';">
</div>
                                      </label>                                  </td>
                                  </tr>
     <!--</form>--> 
    </table>
        
 
</body>

</html>