[Weberp-svn] SF.net SVN: weberp:[9389] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-07-08 19:38:37
|
Revision: 9389 http://weberp.svn.sourceforge.net/weberp/?rev=9389&view=rev Author: tim_schofield Date: 2012-07-08 19:38:29 +0000 (Sun, 08 Jul 2012) Log Message: ----------- New customer search facility Modified Paths: -------------- trunk/SelectCustomer.php trunk/css/silverwolf/images/cross.png trunk/css/silverwolf/sub.css trunk/includes/CustomerSearch.php trunk/javascripts/FormFunctions.js Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-07-08 19:38:12 UTC (rev 9388) +++ trunk/SelectCustomer.php 2012-07-08 19:38:29 UTC (rev 9389) @@ -5,10 +5,11 @@ $title = _('Search Customers'); include ('includes/header.inc'); include ('includes/SQL_CommonFunctions.inc'); -include ('includes/CustomerSearch.php'); -if (isset($_GET['Select'])) { - $_SESSION['CustomerID'] = $_GET['Select']; + +if (isset($_POST['ChooseCustomer'])) { + $_SESSION['CustomerID'] = $_POST['ChooseCustomer']; } + if (!isset($_SESSION['CustomerID'])) { //initialise if not already done $_SESSION['CustomerID'] = ''; } @@ -21,7 +22,6 @@ $_POST['CustAdd']=''; $_POST['CustType']=''; } -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customers') . '</p>'; if (!isset($_SESSION['CustomerType'])) { //initialise if not already done $_SESSION['CustomerType'] = ""; } @@ -80,73 +80,58 @@ } unset($result); $msg = ''; -$result=CustomerSearchSQL($db); -if (!isset($_POST['Search']) and !isset($_POST['Next']) and !isset($_POST['Previous']) and !isset($_POST['Go1']) and !isset($_POST['Go2']) and isset($_POST['JustSelectedACustomer']) and empty($_SESSION['CustomerID'])){ - /*Need to figure out the number of the form variable that the user clicked on */ - for ($i=0; $i< count($_POST); $i++){ //loop through the returned customers - if(isset($_POST['SubmitCustomerSelection'.$i])){ - break; - } - } - if ($i==count($_POST)){ - prnMsg(_('Unable to identify the selected customer'),'error'); - } else { - $_SESSION['CustomerID'] = $_POST['SelectedCustomer'.$i]; - $_SESSION['BranchID'] = $_POST['SelectedBranch'.$i]; - unset($_POST['Search']); - } -} if ($_SESSION['CustomerID'] != '' AND !isset($_POST['Search'])) { $SQL = "SELECT debtorsmaster.name, - debtorsmaster.currcode, - custbranch.phoneno - FROM debtorsmaster INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' - AND custbranch.branchcode='" . $_SESSION['BranchID'] . "'"; + debtorsmaster.currcode + FROM debtorsmaster + WHERE debtorno='" . $_SESSION['CustomerID'] . "'"; $ErrMsg = _('The customer name requested cannot be retrieved because'); $result = DB_query($SQL, $db, $ErrMsg); if ($myrow = DB_fetch_array($result)) { $CustomerName = $myrow['name']; - $PhoneNo = $myrow['phoneno']; $Currency = $myrow['currcode']; } unset($result); // Adding customer encoding. Not needed for general use. This is not a recommended upgrade submission. Gilles Deacur - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . - _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName . ' - ' . $PhoneNo . _(' has been selected') . '</p>'; - echo '<div class="page_help_text">' . _('Select a menu option to operate using this customer') . '.</div><br />'; $_POST['Select'] = NULL; - echo '<table cellpadding="4" width="90%" class="selection"><tr><th width="33%">' . _('Customer Inquiries') . '</th> - <th width="33%">' . _('Customer Transactions') . '</th> - <th width="33%">' . _('Customer Maintenance') . '</th></tr>'; + echo '<br /> + <table cellpadding="4" width="90%" class="selection"> + <tr> + <th colspan="3">' . _('Customer') . ' - ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName . '</th> + </tr> + <tr> + <th width="33%">' . _('Customer Inquiries') . '</th> + <th width="33%">' . _('Customer Transactions') . '</th> + <th width="33%">' . _('Customer Maintenance') . '</th></tr>'; echo '<tr><td valign=top class="select">'; /* Customer Inquiry Options */ - echo '<a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Customer Transaction Inquiries') . '</a><br />'; - echo '<a href="' . $rootpath . '/Customers.php?DebtorNo=' . $_SESSION['CustomerID'] . '&Modify=No">' . _('View Customer Details') . '</a><br />'; - echo '<a href="' . $rootpath . '/PrintCustStatements.php?FromCust=' . $_SESSION['CustomerID'] . '&ToCust=' . $_SESSION['CustomerID'] . '&PrintPDF=Yes">' . _('Print Customer Statement') . '</a><br />'; - echo '<a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Inquiries') . '</a><br />'; + echo InternalLink($rootpath, 'CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'], _('Customer Transaction Inquiries')) . '<br />'; + echo Internallink($rootpath, 'Customers.php?DebtorNo=' . $_SESSION['CustomerID'] . '&Modify=No', _('View Customer Details')) . '<br />'; + echo InternalLink($rootpath, 'PrintCustStatements.php?FromCust=' . $_SESSION['CustomerID'] . '&ToCust=' . $_SESSION['CustomerID'] . '&PrintPDF=Yes', _('Print Customer Statement')) . '<br />'; + echo InternalLink($rootpath, 'SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '', _('Order Inquiries')) . '<br />'; wikiLink('Customer', $_SESSION['CustomerID']); echo '</td><td valign=top class="select">'; - echo '<a href="' . $rootpath . '/SelectSalesOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Modify Outstanding Sales Orders') . '</a><br />'; - echo '<a href="' . $rootpath . '/CustomerAllocations.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Allocate Receipts or Credit Notes') . '</a><br />'; - echo '<a href="' . $rootpath . '/CounterSales.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchID'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />'; + echo InternalLink($rootpath, 'SelectSalesOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'], _('Modify Outstanding Sales Orders')) . '<br />'; + echo InternalLink($rootpath, 'CustomerAllocations.php?DebtorNo=' . $_SESSION['CustomerID'], _('Allocate Receipts or Credit Notes')) . '<br />'; echo '</td><td valign=top class="select">'; - echo '<a href="' . $rootpath . '/Customers.php?">' . _('Add a New Customer') . '</a><br />'; - echo '<a href="' . $rootpath . '/Customers.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Modify Customer Details') . '</a><br />'; - echo '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Add/Modify/Delete Customer Branches') . '</a><br />'; - echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Special Customer Prices') . '</a><br />'; - echo '<a href="' . $rootpath . '/CustEDISetup.php">' . _('Customer EDI Configuration') . '</a><br />'; - echo '<a href="' . $rootpath . '/CustLoginSetup.php">' . _('Customer Login Configuration') . '</a>'; + echo InternalLink($rootpath, 'Customers.php?"', _('Add a New Customer')) . '<br />'; + echo InternalLink($rootpath, 'Customers.php?DebtorNo=' . $_SESSION['CustomerID'], _('Modify Customer Details')) . '<br />'; + echo InternalLink($rootpath, 'CustomerBranches.php?DebtorNo=' . $_SESSION['CustomerID'], _('Add/Modify/Delete Customer Branches')) . '<br />'; + echo InternalLink($rootpath, 'SelectProduct.php', _('Special Customer Prices')) . '<br />'; + echo InternalLink($rootpath, 'CustEDISetup.php', _('Customer EDI Configuration')) . '<br />'; + echo InternalLink($rootpath, 'CustLoginSetup.php', _('Customer Login Configuration')); echo '</td>'; echo '</tr></table><br />'; } else { - echo '<table width="90%" class="selection"><tr><th width="33%">' . _('Customer Inquiries') . '</th> - <th width=33%>' . _('Customer Transactions') . '</th> - <th width=33%>' . _('Customer Maintenance') . '</th></tr>'; + echo '<br /><table width="90%" class="selection"> + <tr> + <th width="33%">' . _('Customer Inquiries') . '</th> + <th width="33%">' . _('Customer Transactions') . '</th> + <th width="33%">' . _('Customer Maintenance') . '</th> + </tr>'; echo '<tr><td class="select">'; echo '</td><td class="select">'; echo '</td><td class="select">'; @@ -156,12 +141,20 @@ echo '</td></tr></table>'; } if (strlen($msg)>1){ - prnMsg($msg, 'info'); + prnMsg($msg, 'info'); } -ShowCustomerSearchFields($rootpath, $theme, $db); -if (isset($result)) { - ShowReturnedCustomers($result); -} + +echo '<br /> + <div class="centre"> + <button type="submit" name="Search" onclick="return OpenSearchWindow(\'includes/CustomerSearch.php\', \'' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '\')"> + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Click To Search For Customers') . '" alt="" /> + ' . _('Search For Customers') . ' + </button> + </div>'; + +echo '<div id="SearchMask"></div>'; +echo '<div id="SearchWindow">'; +echo '</div>'; // Only display the geocode map if the integration is turned on, and there is a latitude/longitude to display if (isset($_SESSION['CustomerID']) and $_SESSION['CustomerID'] != '') { if ($_SESSION['geocode_integration'] == 1) { Modified: trunk/css/silverwolf/images/cross.png =================================================================== --- trunk/css/silverwolf/images/cross.png 2012-07-08 19:38:12 UTC (rev 9388) +++ trunk/css/silverwolf/images/cross.png 2012-07-08 19:38:29 UTC (rev 9389) @@ -1,419 +1,403 @@ \x89PNG |