Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/08/2015, 21:39
charlescuella
 
Fecha de Ingreso: febrero-2009
Mensajes: 489
Antigüedad: 15 años, 3 meses
Puntos: 8
Busqueda Ciclo For sumar dias y excluir dias domingos

hola espero y me puedan ayudar.
Estoy tratando de hacer un ciclo en donde según mi fecha date en Y-m-d y dependiendo de la cantidad de cuotas definidas, este me sume los dias pero si el dia es Domingo este dia se excluya y siga sumando algo asi.

1 / 2015-08-12 / Wed
2 / 2015-08-13 / Thu
3 / 2015-08-14 / Fri
4 / 2015-08-15 / Sat
--------------------------------
5 / 2015-08-17 / Mon
6 / 2015-08-18 / Tue
7 / 2015-08-19 / Wed
8 / 2015-08-20 / Thu
9 / 2015-08-21 / Fri
10 / 2015-08-22 / Sat

esto es lo que llevo
Código PHP:
$prestamo->cuotas 30;
echo 
"<b>Cuotas $prestamo->cuotas</b>"."</br></br>";


                    for ( 
$i $i <= $prestamo->cuotas $i ++) {
                        
$cuota->num_cuota $i;
                        
$registrado_fin strtotime "+$i day" strtotime (date ('Y-m-d'))) ;
                        
$registrado_fin date 'Y-m-d' $registrado_fin );

                        
$registrado_fin2 strtotime "+$i day" strtotime (date ('Y-m-d'))) ;
                        
$registrado_fin2 date 'D' $registrado_fin2 );

                        if (
$registrado_fin2 !='Sun') {
                            echo 
"$i / $registrado_fin / $registrado_fin2"."</br>";                            
                        }else{
                            echo 
"-------------------------------- </br>";
                        }

                        
                    } 
y me nuestra en pantalla esto:

1 / 2015-08-12 / Wed
2 / 2015-08-13 / Thu
3 / 2015-08-14 / Fri
4 / 2015-08-15 / Sat
--------------------------------
6 / 2015-08-17 / Mon
7 / 2015-08-18 / Tue
8 / 2015-08-19 / Wed
9 / 2015-08-20 / Thu
10 / 2015-08-21 / Fri
11 / 2015-08-22 / Sat
.. / .................../ ...
.. / .................../ ...
.. / .................../ ...
.. / .................../ ...


gracias por la colaboración
__________________
sitios
www.avisoya.com
www.yavendi.com

Última edición por charlescuella; 10/08/2015 a las 21:44