Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Supplier selection
06-11-2013, 08:45 PM
Post: #1
Supplier selection
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;
unset($_POST['SupplierNameSearch']);
unset($_POST['SupplierCode']);
// lines added up to XXXX
unset($_POST['Search']);
} else {
unset($_SESSION['SupplierID']);
// XXXX
}
}
Find all posts by this user
Quote this message in a reply
06-12-2013, 07:02 AM
Post: #2
RE: Supplier selection
Thanks tomglare - will apply your changes.

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)