Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/03/2015, 07:05
dcuartas
 
Fecha de Ingreso: febrero-2015
Mensajes: 8
Antigüedad: 10 años
Puntos: 0
Respuesta: Array de php a php

Te mandare todo el codigo de primera pagina php hay esta incompleto el session_estar ya esta
Código PHP:
<?php
  session_start
();

if(!isset(
$_SESSION['rol'])){

  
header('location: ventana.php');
}

?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"> 
   <script src="js/superfish.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/tms-0.4.1.js"></script>
    <script src="js/slider.js"></script>
</head>
<body>

     <center><h1>TU LISTADO</h1> </center>       
           

<?php 
require_once('conexion.php');

include (
'funciones.php');


$listado=  mysql_query("SELECT tbldependencia.nombre,tblsubdependencia.nombre,tbldependencia.consecutivo,tblsubdependencia.consecutivo from tblsubdependencia inner join tbldependencia on tbldependencia.consecutivo= tblsubdependencia.cons_dependencia  where tbldependencia.consecutivo=$_SESSION[cons_dependencia] ");
?>

 <!--<script type="text/javascript" language="javascript" src="js/jslistadisponibilidad.js"></script>-->
            
            
<form action="registra.php" name="habilita" method="post">
            <center><table cellpadding="0" cellspacing="0" border="2" class="display" id="habilitados">
                <thead>
                    <tr>
                    <th>N°</th>
                      <th>DEPENDENCIA</th><!--Estado-->
                        <th>SUBDEPENDENCIA</th>
                        <th>NOMBRE</th><!--Estado-->  
                        <th>TELEFONO</th>
                        <th>FECHA_INICIO</th>
                        <th>FECHA_FIN</th>
                        <th hidden >CONSECUTIVO</th>
                        <th hidden >CONSECUTIVO2</th>
                        <th hidden > DISPONIBLE</th>
                    </tr>
                </thead>
                
                 <?php
                   $num_fila 
1;
                   while(
$regmysql_fetch_array($listado))  {
                      
                              
$usu=$reg['3'] ;       
                                      
?>

                              <tr>
                              <td><input type="text" name="n" id="n" size="1" readonly value="<?php echo $num_fila;?>" ></td>
                              <td><?php echo $reg['0']; ?></td>
                              <td><?php echo $reg['1']; ?></td>
                              <?php 
                              $sql
=mysql_query("SELECT tblusuario.nombre,tblusuario.telefono,tbldisponibles.cons_usuario,tbldisponibles.consecutivo,tbldisponibles.fecha_inicio,tbldisponibles.fecha_fin from tblusuario inner join tbldisponibles on tbldisponibles.cons_usuario=tblusuario.consecutivo where 
                              tbldisponibles.cons_subdependencia=$usu"
);
                               
                              while(
$lismysql_fetch_array($sql) ) {
                              
$dis=$lis['2'];
                             
$conse=$lis['3'];
                             
$fecha_inicio=$lis['4'];
                             
$fecha_fin=$lis['5'];
                              
?>
                              <td> <input type="text" name="nombre" size="35" id="nombre_<?php echo $num_fila?>" onClick="ventana_habilitar(<?php echo $num_fila?>)" readonly value="<?php echo $lis['0']; ?>"></td>
                              
                              <td> <input type="text" name="telefono" id="telefono_<?php echo $num_fila?>" size="35" readonly value="<?php echo $lis['1']; ?>"> </td>
                              <input type="hidden" name="cons_disp" id="cons_disp_<?php echo $num_fila?>" value="<?php echo $dis?>">
                             <?php 
                           
                            
?>
                              <td> <input type="date"  name="fecha_inicio"  value="<?php echo $fecha_inicio?>"></td>
                              <td> <input type="date" name="fecha_fin" id="fecha_fin" value="<?php echo $fecha_fin?>"></td>
                              <td hidden> </td> 
                              <td> <input  type="hidden" name="consecutivo2" value="<?php echo $usu?>"></td>
                              <td> <input type="hidden" name="consecutivo" value="<?php echo $conse ?>"> </td>
                              <td > <input type="hidden" name= "num_fila" value="<?php echo $num_fila?>"></td>
             </tr>
               <?php    

               $arraycons_dis
[$num_fila] = $dis;
                 echo 
$arraycons_dis[$num_fila]."<br>";
           
               
$arrayfecha_inicio[$num_fila] = $fecha_inicio;
                
// echo $arrayfecha_inicio[$num_fila]."<br>";

                
$arrayfecha_fin[$num_fila] = $fecha_fin;
                
// echo $arrayfecha_fin[$num_fila]."<br>";
                
                
$arrayconsecutivo[$num_fila] = $conse;
                
// echo $arrayconsecutivo[$num_fila]."<br>";

                
$arraysubdependencia[$num_fila]=$usu;
                
// echo $arraysubdependencia[$num_fila]."<br>";
                // $arraycons_dis[$num_fila] = $dis;
                // echo $arraycons_dis[$num_fila];
                // $arraycons_dis[$num_fila] = $dis;
                // echo $arraycons_dis[$num_fila];
 
?>
 <input type="hidden" name="arraycons_dis" value="<?php echo $arraycons_dis[$num_fila]; ?>
 <?php
 
                $num_fila 
$num_fila 1


               }
?>


              
              </tbody>
          
              
            </table>  </center> 
            <br>

                 <center><input type="submit" name="registrar" value="Registrar" style='width:160px; height:50px' > </center>  
              <label></label>
             </form>      

</body>
</html>