|
From: <vv...@us...> - 2012-09-15 23:52:35
|
Revision: 5665
http://web-erp.svn.sourceforge.net/web-erp/?rev=5665&view=rev
Author: vvs2012
Date: 2012-09-15 23:52:28 +0000 (Sat, 15 Sep 2012)
Log Message:
-----------
Display relevant information about supplier on SelectSupplier page
Modified Paths:
--------------
trunk/SelectSupplier.php
trunk/doc/Change.log
Modified: trunk/SelectSupplier.php
===================================================================
--- trunk/SelectSupplier.php 2012-09-13 22:22:58 UTC (rev 5664)
+++ trunk/SelectSupplier.php 2012-09-15 23:52:28 UTC (rev 5665)
@@ -120,6 +120,7 @@
}
} //one of keywords or SupplierCode was more than a zero length string
$result = DB_query($SQL, $db);
+ unset($SingleSupplierReturned);
if (DB_num_rows($result) == 1) {
$myrow = DB_fetch_row($result);
$SingleSupplierReturned = $myrow[0];
@@ -129,52 +130,120 @@
$_SESSION['SupplierID'] = $SingleSupplierReturned;
unset($_POST['Keywords']);
unset($_POST['SupplierCode']);
+ unset($_POST['Search']);
}
-if (isset($_SESSION['SupplierID'])) {
+if (isset($_SESSION['SupplierID']) AND !isset($_POST['Search'])) {
$SupplierName = '';
- $SQL = "SELECT suppliers.suppname
- FROM suppliers
- WHERE suppliers.supplierid ='" . $_SESSION['SupplierID'] . "'";
- $SupplierNameResult = DB_query($SQL, $db);
- if (DB_num_rows($SupplierNameResult) == 1) {
- $myrow = DB_fetch_row($SupplierNameResult);
- $SupplierName = $myrow[0];
- }
- echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>';
- echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>';
- echo '<br />
- <table width="90%" cellpadding="4">
- <tr>
- <th style="width:33%">' . _('Supplier Inquiries') . '</th>
- <th style="width:33%">' . _('Supplier Transactions') . '</th>
- <th style="width:33%">' . _('Supplier Maintenance') . '</th>
- </tr>';
- echo '<tr><td valign="top" class="select">'; /* Inquiry Options */
- echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a>
- <br />
- <br />';
-
- echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>';
- echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />';
- wikiLink('Supplier', $_SESSION['SupplierID']);
- echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>';
- echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>';
- echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>';
- echo '</td><td valign="top" class="select">'; /* Supplier Transactions */
- echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />';
- echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />';
- echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />';
- echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />';
- echo '<br />';
- echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>';
- echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */
- echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />';
- echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>';
- echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>';
- echo '<br />';
- echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>';
- echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>';
- echo '</td></tr></table>';
+ $sql = "SELECT suppname,
+ address1,
+ address2,
+ address3,
+ address4,
+ telephone,
+ fax,
+ email
+ FROM suppliers
+ WHERE supplierid = '" . $_SESSION['SupplierID'] . "'";
+
+ $result = DB_query($sql, $db);
+ if (DB_num_rows($result) == 1) {
+ $myrow = DB_fetch_array($result);
+ $SupplierName = $myrow['suppname'];
+ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>';
+ echo '<table style="width:80%"><tr><td style="width:50%" valign="top" class="select">';
+ echo '<table style="width:90%">';
+ echo '<tr><th>' . _('Address Line 1 (Street)') . ':</th><td>' . stripcslashes($myrow['address1']) . '</td></tr>';
+ echo '<tr><th>' . _('Address Line 2 (Suburb/City)') . ':</th><td>' . stripcslashes($myrow['address2']) . '</td></tr>';
+ echo '<tr><th>' . _('Address Line 3 (State/Province)') . ':</th><td>' . stripcslashes($myrow['address3']) . '</td></tr>';
+ echo '<tr><th>' . _('Address Line 4 (Postal Code)') . ':</th><td>' . stripcslashes($myrow['address4']) . '</td></tr>';
+ echo '<tr><th>' . _('Telephone') . ':</th><td>' . $myrow['telephone'] . '</td></tr>';
+ echo '<tr><th>' . _('Facsimile') . ':</th><td>' . $myrow['fax'] . '</td></tr>';
+ echo '<tr><th>' . _('Email Address') . ':</th><td>' . $myrow['email'] . '</td></tr>';
+ echo '</table></td><td valign="top" class="select">';
+
+ echo '<table style="width:90%"><tr>
+ <th style="white-space: nowrap" colspan="5">' . _('Contacts Defined for') . ' - ' . $SupplierName . '</th>
+ </tr>';
+
+ $sql = "SELECT suppliers.suppname,
+ contact,
+ position,
+ tel,
+ suppliercontacts.fax,
+ suppliercontacts.email
+ FROM suppliercontacts,
+ suppliers
+ WHERE suppliercontacts.supplierid=suppliers.supplierid
+ AND suppliercontacts.supplierid = '" . $_SESSION['SupplierID'] . "'";
+
+ $result = DB_query($sql, $db);
+
+ if (DB_num_rows($result)>0){
+
+ $myrow = DB_fetch_array($result);
+
+ echo '<tr>
+ <th>' . _('Name') . '</th>
+ <th>' . _('Position') . '</th>
+ <th>' . _('Phone No') . '</th>
+ <th>' . _('Fax No') . '</th>
+ <th>' . _('Email') . '</th>
+ </tr>';
+
+ do {
+ printf('<tr><td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td><a href="mailto:%s">%s</a></td></tr>',
+ $myrow['contact'],
+ $myrow['position'],
+ $myrow['tel'],
+ $myrow['fax'],
+ $myrow['email'],
+ $myrow['email']);
+ } while ($myrow = DB_fetch_array($result));
+ }
+ echo '</table>';
+ echo '</td></tr></table>';
+
+ echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>';
+ echo '<br />
+ <table width="90%" cellpadding="4">
+ <tr>
+ <th style="width:33%">' . _('Supplier Inquiries') . '</th>
+ <th style="width:33%">' . _('Supplier Transactions') . '</th>
+ <th style="width:33%">' . _('Supplier Maintenance') . '</th>
+ </tr>';
+ echo '<tr><td valign="top" class="select">'; /* Inquiry Options */
+ echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a>
+ <br />
+ <br />';
+
+ echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>';
+ echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />';
+ wikiLink('Supplier', $_SESSION['SupplierID']);
+ echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>';
+ echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>';
+ echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>';
+ echo '</td><td valign="top" class="select">'; /* Supplier Transactions */
+ echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />';
+ echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />';
+ echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />';
+ echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />';
+ echo '<br />';
+ echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>';
+ echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */
+ echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />';
+ echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>';
+ echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>';
+ echo '<br />';
+ echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>';
+ echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>';
+ echo '</td></tr></table>';
+ } else {
+ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : ' . _('is not selected') . '.</p>';
+ }
} else {
// Supplier is not selected yet
echo '<br />';
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2012-09-13 22:22:58 UTC (rev 5664)
+++ trunk/doc/Change.log 2012-09-15 23:52:28 UTC (rev 5665)
@@ -1,4 +1,5 @@
webERP Change Log
+15/9/12 Vitaly: Display relevant information about supplier on SelectSupplier page
12/9/12 Icedlava: some small corrections in the Manual, and update of bookmark links for some setup, petty cash and order functions.
8/9/12 Phil: removed all use of $_REQUEST across all scripts replace with GET/POST to cirumvent SQL injection attacks as reported by Daniel Compton
6/9/12 Thomas Timothy Lie and baliboss.com Team: updated Indonesian translation
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|