Jump to content

Need help with Storage system


Fearreaper

Recommended Posts

I'm busy with a small storage system for my site, but i encounter some problems with it.

I have successfully managed to get all products from the order, and traced on what spots those product are in the warehouse.

It looks like this atm http://img37.imageshack.us/img37/7302/tableordereng.jpg

 

this is the code i have atm (sorry i program in dutch, i hope its abit understandable)

 

<?php

$query = "select * from `orderregel` WHERE `ordernr`='".$ordernr."'";
   $row = mysql_fetch_array( $query );
            
   echo "<table border=1 width=680 bgcolor=#FFFFFF>
     <tr>
            <th width= 100>artikelnummer</th>
        <th width= 100>productnaam</th>
            <th width= 40>Plaats</th>
        <th width= 40>aantal in magazijn</th>
            <th width= 40>aantal nodig</th>          
     </tr>
         </table>";  
                      
            foreach ( self::find_by_sql($query) as $user)
            {   
                $query2 = "select * from magazijn WHERE artikelnr = ".$user->artikelnr."";
                $row = mysql_fetch_array( $query );
            
                foreach ( self::find_by_sql($query2) as $magazijn)
                {
                echo "<table class= order_overzicht border= 0 width= 680>";
                echo "<tr>    
                        <td width= 100>".$magazijn->artikelnr."</td>            
                        <td width= 100>".$magazijn->productnaam."</td>
                        <td width= 40>".$magazijn->magazijn_plaats."</td>
                        <td width= 40>".$magazijn->aantal."</td>
                        <td width= 40>".$user->aantal."</td>
                      </tr>
                      </table>";
                }
            }
?>

 

The problem i have now is, that i want it to do the following.

for example someone orders 430 packages of Haribo Kers Cola (see imageshack upload). I first want it to empty spot 16 in the wherehouse.

Only when spot 16 is empty, i want it to go to the next spot (19) wich contains the same product.

 

the end result would be something like this:

 

http://img690.imageshack.us/img690/6246/tableorderneweng.jpg

 

i hope you guys can help me out on this one, becouse i have no clue how i can resolve this problem

 

thx in advance

 

(Sorry btw for my bad english :P)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.