Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/06/2009, 11:49
Avatar de acoevil
acoevil
 
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 9 meses
Puntos: 32
Respuesta: Problemita con >>> (proceso inverso al descuento de stock)

Segun entiendo tu duda es algo asi

Código PHP:
echo stock(1500);

function 
stock($cant_pedida){

//Valores representarian los valore de la DB 
$valores=array(100,200,500,1000,500);
for(
$n=0;$n<count($valores);$n++){
    
$total=$cant_pedida-$valores[$n];
    if(
$total<0){
        break;
    }
    
$cant_pedida=$total;
    echo 
$total."<br>";
    
}