webERP Forum

Full Version: Supplier selection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I find the operation of this (SelectSupplier.php) form slightly confusing. If a search returns only one result, then the list of (one) selected suppliers is unnecessarily repeated when the page reloads, and conversely, once you have selected a supplier (either the single result of a search, or selected from the list), and then run a search which returns multiple results, the previously-selected supplier details are left on screen.

I have made a small change to this script which seems to make the resulting form a bit tidier :

if (DB_num_rows($result) == 1) {
$myrow = DB_fetch_row($result);
$SingleSupplierReturned = $myrow[0];
// } - removed this bracket so that the following lines are included within the same block

if (isset($SingleSupplierReturned)) {
$_SESSION['SupplierID'] = $SingleSupplierReturned;
// lines added up to XXXX
} else {
Thanks tomglare - will apply your changes.