Foros del Web » Programando para Internet » PHP »

Calendario Php

Estas en el tema de Calendario Php en el foro de PHP en Foros del Web. Quisiera tener en mi web un calendario como lo de los hoteles que uno ponga el dia y eso y siga con la reservacion si ...
  #1 (permalink)  
Antiguo 27/03/2008, 12:25
 
Fecha de Ingreso: diciembre-2007
Mensajes: 267
Antigüedad: 16 años, 4 meses
Puntos: 3
Calendario Php

Quisiera tener en mi web un calendario como lo de los hoteles que uno ponga el dia y eso y siga con la reservacion si alguien sabe algun tuto o manual para hacerlo gracias
  #2 (permalink)  
Antiguo 27/03/2008, 12:50
Avatar de ranceis  
Fecha de Ingreso: septiembre-2006
Mensajes: 42
Antigüedad: 17 años, 7 meses
Puntos: 0
Re: Calendario Php

visita:
http://www.forosdelweb.com/f18/capturar-validar-fecha-569491/#post2337428

en el post # 4 puse un codigo
  #3 (permalink)  
Antiguo 27/03/2008, 16:13
Avatar de pato12  
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Re: Calendario Php

Hola,
Encontre este codigo. Espero que te sirba:
Código PHP:
<?php
  $sel_date 
= isset($_REQUEST['sel_date']) ? $_REQUEST['sel_date'] : time();
  if( isset(
$_POST['hrs']) ){
     
$t getdate($sel_date);
     
$sel_date mktime($_POST['hrs'], $_POST['mins'], $t['seconds'], $t['mon'], $t['mday'], $t['year']);
  }
  
$t getdate($sel_date);
  
$start_date mktime($t['hours'], $t['minutes'], $t['seconds'], $t['mon'], 1$t['year']);
  
$start_date -= 86400 date('w'$start_date);
  
  
$prev_year mktime($t['hours'], $t['minutes'], $t['seconds'], $t['mon'], $t['mday'], $t['year'] - 1);
  
$prev_month mktime($t['hours'], $t['minutes'], $t['seconds'], $t['mon'] - 1$t['mday'], $t['year']);
  
$next_year mktime($t['hours'], $t['minutes'], $t['seconds'], $t['mon'], $t['mday'], $t['year'] + 1);
  
$next_month mktime($t['hours'], $t['minutes'], $t['seconds'], $t['mon'] + 1$t['mday'], $t['year']);
?>
<form method="post">
<table width="180" border="0" cellspacing="1" 
  style="border: 1px solid black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center">
  <tr> 
    <td width="14%" bgcolor="#66FF99">
       <a href="?sel_date=<?= $prev_year ?>" style="text-decoration: none" title="Prevous Year">&lt;&lt;</a></td>
    <td width="14%" bgcolor="#66FF99">
       <a href="?sel_date=<?= $prev_month ?>" style="text-decoration: none" title="Prevous Month">&lt;</a></td>
    <td colspan="3" bgcolor="#66FF99">
       <?= date('M Y'$sel_date?>
    </td>
    <td width="14%" bgcolor="#66FF99">
       <a href="?sel_date=<?= $next_month ?>" style="text-decoration: none" title="Next Month">&gt;</a></td>
    <td width="14%" bgcolor="#66FF99">
       <a href="?sel_date=<?= $next_year ?>" style="text-decoration: none" title="Next Year">&gt;&gt;</a></td>
  </tr>
  <tr> 
    <td bgcolor="#0099FF">Sun</td>
    <td bgcolor="#0099FF">Mon</td>
    <td width="14%" bgcolor="#0099FF">Tue</td>
    <td width="14%" bgcolor="#0099FF">Wed</td>
    <td width="14%" bgcolor="#0099FF">Thu</td>
    <td bgcolor="#0099FF">Fri</td>
    <td bgcolor="#0099FF">Sat</td>
  </tr>
  <?php
     $day 
1;
     for(
$i $start_date$day <= 42$i+=86400$day++){
        if( 
$day == ) echo "<tr>\n";        
        if( 
$t['mon'] == date('n'$i ) )
           if( 
$i == $sel_date )
              echo 
' <td bgcolor="gold">'date('j'$i) ."</td>\n";
           else
              echo 
' <td><a href="?sel_date='$i .'" style="text-decoration: none">'date('j'$i) ."</a></td>\n";
        else
           echo 
' <td ><a href="?sel_date='$i .'" style="text-decoration: none"><font  color="silver">'date('j'$i) ."</font></a></td>\n";                
        if( 
$day == )  echo "</tr>\n";
     }
  
?>
  <tr>
    <td colspan="7" align="left" bgcolor="silver">Time:
    <select name="hrs" onchange="document.forms[0].submit()">
    <?php
       
for($i 0$i 24$i++)
          echo 
'   <option '. (date('G'$sel_date)==$i 'selected':'') .'>'sprintf('%02d'$i) ."</option>\n";
    
?>
    </select>:
    <select name="mins" onchange="document.forms[0].submit()">
    <?php
        
for($i 0$i 60$i++)
           echo 
'   <option '. (date('i'$sel_date)==$i 'selected':'') .'>'sprintf('%02d'$i) ."</option>\n";
    
?>
    </select> hrs
    <input type="hidden" name="sel_date" value="<?= $sel_date ?>">    
    </td>
  </tr>
</table>
</form>
Gracias
Salu2
__________________
Half Music - www.halfmusic.com
  #4 (permalink)  
Antiguo 27/03/2008, 19:38
 
Fecha de Ingreso: diciembre-2007
Mensajes: 267
Antigüedad: 16 años, 4 meses
Puntos: 3
Re: Calendario Php

gracias por las respuestas si otra gente sabe por favor responder
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:42.