PHP code help for OOPS concepts

Codes here !

Moderators: macek, egami, gesf

poonam123
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Nov 21, 2013 4:47 am

PHP code help for OOPS concepts

Postby poonam123 » Thu Nov 21, 2013 5:06 am

Hi All,

This is my work for PHP based assignment given to me as a small task to complete.
Please can somebody guide me how and what other classes or methods do i need other than the ones I have created or if somebody could suggest the design; that would be equally helpful.

Thank you
====================================================================
Requirements
1) Create a database of 60 products, assign each a stock level and a unique Bin location from the range A1 – F10 (see warehouse floorplan).

2) Provide a method for querying a product/bin location which returns the product description, bin location and current stock level.

3) Provide a method for creating an order. An order will always consist of 5 different products chosen by the user.

4) If there is insufficient stock available to fulfil the order display a warning message, otherwise decrease the relevant stock levels and calculate/display the optimum picking route.

The optimum picking route must start from one of the pick stations (P1, P2, P3), and is the shortest number of steps needed to 'pick' all of the products before returning to the original pick station.


5) The user interface must be web based.


6) Write a short paragraph about the scalability of your solution, i.e. How would the implementation handle a much bigger warehouse?

7) An object oriented approach must be demonstrated.

8) The task must be completed using PHP 5 and mySQL 5. Please send the SQL and PHP files as well as upload the solution to a server. If you do not access to a server, we can provide you with access to one for the purposes of this task.


Scenario
Please refer to diagram 1 for an example of a simple warehouse floor plan.

The warehouse consists of 6 racks of product bins A1-F10. Each product bin holds a unique type of product – a product is only accessible by standing directly in front of the product bin.

e.g A 'picker' standing at position 'X' can pick from product bins B6 and C6, whereas a picker standing in position 'Y' cannot pick from anywhere.

The order picking procedure is as follows:
A 'pick sheet' will print at the packing station P1, P2 or P3 & be collected by a picker. The pick sheet lists all products required for an order, the bin location for each product & the route the picker should follow.
When all items have been picked, the picker returns to the packing station where they collected the original pick sheet & deposits all items.

Note: Pickers can walk directly through the packing stations, but they cannot walk directly through any racking or product bins!

Y
A10 B10 C10 D10 E10 F10
A9 B9 C9 D9 E9 F9
A8 B8 C8 D8 E8 F8
A7 B7 C7 D7 E7 F7
A6 B6 X C6 D6 E6 F6
A5 B5 C5 D5 E5 F5
A4 B4 C4 D4 E4 F4
A3 B3 C3 D3 E3 F3
A2 B2 C2 D2 E2 F2

A1 B1 C1 D1 E1 F1

P1 P2 P3


Diagram 1: Simple warehouse floor plan
Key: m is the distance in metres.
P1, P2, P3 Picking Station coded purple
A1-F10 Product bins coded yellow
=============================================================
<?php
include ("product_bin_class.php");
$pbin_class= new product_bin_class('localhost','root','root');
$pbin_class -> database('test');
$result = $pbin_class -> fetch_and_display('product_bin');
echo '<table>';
echo '<tr><th>Product ID' . '</th><th>Product Desc' . '</th><th>Product Desc' . '</tr>';
echo '<form action="product_bin_class.php" method="POST"><b>Pick Only Two Please!</b> ';
echo '<input name="placeorder" type="hidden">';
for ($x = 0; $x < count($result); $x++)
{

echo '<tr>';
echo '<td>' . $result[$x][0] . '</td><td>' . $result[$x][1] . '</td><td>'.$result[$x][3];

// :Begin - dynamic checkbox generation for deleting staff
echo '<td>';
echo '<input type="checkbox" name="checkbox[]" value="' . $result[$x][0] . '"/>';
echo '</td>';
// :End
echo '</tr>';
}
echo '<tr align="right"><td colspan="3"><input type="submit" name="Order" value="Order" onclick= "hello()"; value="Click to Release";"/></td></tr>';
echo '</form>';
echo '</table>';
//$listvals=$_POST['checkbox'];
//$n=count($listvals);
//echo "User chose $n items from the list.<br>\n" ;
if(isset($_POST['Order'])) {
echo "show Order";
if(sizeof($_POST['checkbox']) == 5) {
for($i=0;$i<$n;$i++)
echo "Item $i=".$listvals[$i]."<br>\n";
} else {
echo "error, pick exactly 5 items!";
}
}
?>
<html>
<body>
<script type="text/javascript">
function hello()
{
alert ("hello");
}
</script></body>
</html>

Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 2 guests

cron