From: <tim...@us...> - 2011-08-16 16:00:28
|
Revision: 4660 http://web-erp.svn.sourceforge.net/web-erp/?rev=4660&view=rev Author: tim_schofield Date: 2011-08-16 16:00:22 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Apply counting bug fix when selecting a customer Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-14 09:22:19 UTC (rev 4659) +++ trunk/SelectCustomer.php 2011-08-16 16:00:22 UTC (rev 4660) @@ -243,8 +243,8 @@ } $SQL.= " ORDER BY debtorsmaster.name"; $ErrMsg = _('The searched customer records requested cannot be retrieved because'); - - + + $result = DB_query($SQL, $db, $ErrMsg); if (DB_num_rows($result) == 1) { $myrow = DB_fetch_array($result); @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*Need to figure out the number of the form variable that the user clicked on */ - for ($i=1; $i< count($_POST); $i++){ //loop through the returned customers + for ($i=0; $i< count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } @@ -273,13 +273,13 @@ } //AND !isset($_POST['Keywords']) AND !isset($_POST['CustCode']) AND !isset($_POST['CustType']) AND !isset($_POST['CustPhone']) if ($_SESSION['CustomerID'] != '' AND !isset($_POST['Search']) AND !isset($_POST['CSV'])) { - $SQL = "SELECT debtorsmaster.name, - custbranch.phoneno - FROM debtorsmaster INNER JOIN custbranch + $SQL = "SELECT debtorsmaster.name, + custbranch.phoneno + FROM debtorsmaster INNER JOIN custbranch ON debtorsmaster.debtorno=custbranch.debtorno - WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' + WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' AND custbranch.branchcode='" . $_SESSION['BranchCode'] . "'"; - + $ErrMsg = _('The customer name requested cannot be retrieved because'); $result = DB_query($SQL, $db, $ErrMsg); if ($myrow = DB_fetch_array($result)) { @@ -287,7 +287,7 @@ $PhoneNo = $myrow['phoneno']; } unset($result); - + 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 />'; @@ -599,9 +599,9 @@ $DataResult = DB_query($SQL, $db); $myrow = DB_fetch_array($DataResult); // Select some more data about the customer - $SQL = "SELECT sum(ovamount+ovgst) as total - FROM debtortrans - WHERE debtorno = '" . $_SESSION['CustomerID'] . "' + $SQL = "SELECT sum(ovamount+ovgst) as total + FROM debtortrans + WHERE debtorno = '" . $_SESSION['CustomerID'] . "' AND type !=12"; $Total1Result = DB_query($SQL, $db); $row = DB_fetch_array($Total1Result); @@ -652,8 +652,8 @@ } // Customer Contacts echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM custcontacts - WHERE debtorno='" . $_SESSION['CustomerID'] . "' + $sql = "SELECT * FROM custcontacts + WHERE debtorno='" . $_SESSION['CustomerID'] . "' ORDER BY contid"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { @@ -695,8 +695,8 @@ } // Customer Notes echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM custnotes - WHERE debtorno='" . $_SESSION['CustomerID'] . "' + $sql = "SELECT * FROM custnotes + WHERE debtorno='" . $_SESSION['CustomerID'] . "' ORDER BY date DESC"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { @@ -736,8 +736,8 @@ } // Custome Type Notes echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM debtortypenotes - WHERE typeid='" . $CustomerType . "' + $sql = "SELECT * FROM debtortypenotes + WHERE typeid='" . $CustomerType . "' ORDER BY date DESC"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-08-16 16:00:28
|
Revision: 4660 http://web-erp.svn.sourceforge.net/web-erp/?rev=4660&view=rev Author: tim_schofield Date: 2011-08-16 16:00:22 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Apply counting bug fix when selecting a customer Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-14 09:22:19 UTC (rev 4659) +++ trunk/SelectCustomer.php 2011-08-16 16:00:22 UTC (rev 4660) @@ -243,8 +243,8 @@ } $SQL.= " ORDER BY debtorsmaster.name"; $ErrMsg = _('The searched customer records requested cannot be retrieved because'); - - + + $result = DB_query($SQL, $db, $ErrMsg); if (DB_num_rows($result) == 1) { $myrow = DB_fetch_array($result); @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*Need to figure out the number of the form variable that the user clicked on */ - for ($i=1; $i< count($_POST); $i++){ //loop through the returned customers + for ($i=0; $i< count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } @@ -273,13 +273,13 @@ } //AND !isset($_POST['Keywords']) AND !isset($_POST['CustCode']) AND !isset($_POST['CustType']) AND !isset($_POST['CustPhone']) if ($_SESSION['CustomerID'] != '' AND !isset($_POST['Search']) AND !isset($_POST['CSV'])) { - $SQL = "SELECT debtorsmaster.name, - custbranch.phoneno - FROM debtorsmaster INNER JOIN custbranch + $SQL = "SELECT debtorsmaster.name, + custbranch.phoneno + FROM debtorsmaster INNER JOIN custbranch ON debtorsmaster.debtorno=custbranch.debtorno - WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' + WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' AND custbranch.branchcode='" . $_SESSION['BranchCode'] . "'"; - + $ErrMsg = _('The customer name requested cannot be retrieved because'); $result = DB_query($SQL, $db, $ErrMsg); if ($myrow = DB_fetch_array($result)) { @@ -287,7 +287,7 @@ $PhoneNo = $myrow['phoneno']; } unset($result); - + 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 />'; @@ -599,9 +599,9 @@ $DataResult = DB_query($SQL, $db); $myrow = DB_fetch_array($DataResult); // Select some more data about the customer - $SQL = "SELECT sum(ovamount+ovgst) as total - FROM debtortrans - WHERE debtorno = '" . $_SESSION['CustomerID'] . "' + $SQL = "SELECT sum(ovamount+ovgst) as total + FROM debtortrans + WHERE debtorno = '" . $_SESSION['CustomerID'] . "' AND type !=12"; $Total1Result = DB_query($SQL, $db); $row = DB_fetch_array($Total1Result); @@ -652,8 +652,8 @@ } // Customer Contacts echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM custcontacts - WHERE debtorno='" . $_SESSION['CustomerID'] . "' + $sql = "SELECT * FROM custcontacts + WHERE debtorno='" . $_SESSION['CustomerID'] . "' ORDER BY contid"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { @@ -695,8 +695,8 @@ } // Customer Notes echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM custnotes - WHERE debtorno='" . $_SESSION['CustomerID'] . "' + $sql = "SELECT * FROM custnotes + WHERE debtorno='" . $_SESSION['CustomerID'] . "' ORDER BY date DESC"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { @@ -736,8 +736,8 @@ } // Custome Type Notes echo '<tr><td colspan="2">'; - $sql = "SELECT * FROM debtortypenotes - WHERE typeid='" . $CustomerType . "' + $sql = "SELECT * FROM debtortypenotes + WHERE typeid='" . $CustomerType . "' ORDER BY date DESC"; $result = DB_query($sql, $db); if (DB_num_rows($result) <> 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-28 09:25:37
|
Revision: 4670 http://web-erp.svn.sourceforge.net/web-erp/?rev=4670&view=rev Author: daintree Date: 2011-08-28 09:25:31 +0000 (Sun, 28 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-28 01:08:59 UTC (rev 4669) +++ trunk/SelectCustomer.php 2011-08-28 09:25:31 UTC (rev 4670) @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*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 + for ($i=0; $i<count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-28 09:25:37
|
Revision: 4670 http://web-erp.svn.sourceforge.net/web-erp/?rev=4670&view=rev Author: daintree Date: 2011-08-28 09:25:31 +0000 (Sun, 28 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-28 01:08:59 UTC (rev 4669) +++ trunk/SelectCustomer.php 2011-08-28 09:25:31 UTC (rev 4670) @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*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 + for ($i=0; $i<count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-18 21:02:23
|
Revision: 4801 http://web-erp.svn.sourceforge.net/web-erp/?rev=4801&view=rev Author: tim_schofield Date: 2012-01-18 21:02:16 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Add the email field to the csv output Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-01-16 09:24:14 UTC (rev 4800) +++ trunk/SelectCustomer.php 2012-01-18 21:02:16 UTC (rev 4801) @@ -85,24 +85,24 @@ $_POST['PageOffset'] = 1; } } -if (isset($_POST['Search']) - OR isset($_POST['CSV']) - OR isset($_POST['Go']) - OR isset($_POST['Next']) +if (isset($_POST['Search']) + OR isset($_POST['CSV']) + OR isset($_POST['Go']) + OR isset($_POST['Next']) OR isset($_POST['Previous'])) { - + unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; } - - if (($_POST['Keywords'] == '') - AND ($_POST['CustCode'] == '') - AND ($_POST['CustPhone'] == '') - AND ($_POST['CustType'] == 'ALL') - AND ($_POST['Area'] == 'ALL') + + if (($_POST['Keywords'] == '') + AND ($_POST['CustCode'] == '') + AND ($_POST['CustPhone'] == '') + AND ($_POST['CustType'] == 'ALL') + AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { - + //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -115,7 +115,8 @@ custbranch.contactname, debtortype.typename, custbranch.phoneno, - custbranch.faxno + custbranch.faxno, + custbranch.email FROM debtorsmaster LEFT JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno INNER JOIN debtortype @@ -136,22 +137,23 @@ custbranch.contactname, debtortype.typename, custbranch.phoneno, - custbranch.faxno + custbranch.faxno, + custbranch.email FROM debtorsmaster INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid - LEFT JOIN custbranch + LEFT JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno - WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' - AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' + AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' AND (debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address2 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; - + if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; - } + } if (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { $SQL .= " AND custbranch.area = '" . $_POST['Area'] . "'"; } @@ -428,7 +430,7 @@ echo '<br /><p class="page_title_text"><a href="' . $FileName . '">' . _('Click to view the csv Search Result') . '</p>'; $fp = fopen($FileName, 'w'); while ($myrow2 = DB_fetch_array($result)) { - fwrite($fp, $myrow2['debtorno'] . ',' . str_replace(',', '', $myrow2['name']) . ',' . str_replace(',', '', $myrow2['address1']) . ',' . str_replace(',', '', $myrow2['address2']) . ',' . str_replace(',', '', $myrow2['address3']) . ',' . str_replace(',', '', $myrow2['address4']) . ',' . str_replace(',', '', $myrow2['contactname']) . ',' . str_replace(',', '', $myrow2['typename']) . ',' . $myrow2['phoneno'] . ',' . $myrow2['faxno'] . "\n"); + fwrite($fp, $myrow2['debtorno'] . ',' . str_replace(',', '', $myrow2['name']) . ',' . str_replace(',', '', $myrow2['address1']) . ',' . str_replace(',', '', $myrow2['address2']) . ',' . str_replace(',', '', $myrow2['address3']) . ',' . str_replace(',', '', $myrow2['address4']) . ',' . str_replace(',', '', $myrow2['contactname']) . ',' . str_replace(',', '', $myrow2['typename']) . ',' . $myrow2['phoneno'] . ',' . $myrow2['faxno'] . ',' . $myrow2['email'] . "\n"); } echo '</div>'; } @@ -517,7 +519,7 @@ // Extended Customer Info only if selected in Configuration if ($_SESSION['Extended_CustomerInfo'] == 1) { if ($_SESSION['CustomerID'] != '') { - $sql = "SELECT debtortype.typeid, + $sql = "SELECT debtortype.typeid, debtortype.typename FROM debtorsmaster INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid @@ -533,11 +535,11 @@ $SQL = "SELECT debtorsmaster.clientsince, (TO_DAYS(date(now())) - TO_DAYS(date(debtorsmaster.clientsince))) as customersincedays, (TO_DAYS(date(now())) - TO_DAYS(date(debtorsmaster.lastpaiddate))) as lastpaiddays, - debtorsmaster.paymentterms, - debtorsmaster.lastpaid, + debtorsmaster.paymentterms, + debtorsmaster.lastpaid, debtorsmaster.lastpaiddate, currencies.decimalplaces AS currdecimalplaces - FROM debtorsmaster INNER JOIN currencies + FROM debtorsmaster INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtorsmaster.debtorno ='" . $_SESSION['CustomerID'] . "'"; $DataResult = DB_query($SQL, $db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-18 21:02:23
|
Revision: 4801 http://web-erp.svn.sourceforge.net/web-erp/?rev=4801&view=rev Author: tim_schofield Date: 2012-01-18 21:02:16 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Add the email field to the csv output Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-01-16 09:24:14 UTC (rev 4800) +++ trunk/SelectCustomer.php 2012-01-18 21:02:16 UTC (rev 4801) @@ -85,24 +85,24 @@ $_POST['PageOffset'] = 1; } } -if (isset($_POST['Search']) - OR isset($_POST['CSV']) - OR isset($_POST['Go']) - OR isset($_POST['Next']) +if (isset($_POST['Search']) + OR isset($_POST['CSV']) + OR isset($_POST['Go']) + OR isset($_POST['Next']) OR isset($_POST['Previous'])) { - + unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; } - - if (($_POST['Keywords'] == '') - AND ($_POST['CustCode'] == '') - AND ($_POST['CustPhone'] == '') - AND ($_POST['CustType'] == 'ALL') - AND ($_POST['Area'] == 'ALL') + + if (($_POST['Keywords'] == '') + AND ($_POST['CustCode'] == '') + AND ($_POST['CustPhone'] == '') + AND ($_POST['CustType'] == 'ALL') + AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { - + //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -115,7 +115,8 @@ custbranch.contactname, debtortype.typename, custbranch.phoneno, - custbranch.faxno + custbranch.faxno, + custbranch.email FROM debtorsmaster LEFT JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno INNER JOIN debtortype @@ -136,22 +137,23 @@ custbranch.contactname, debtortype.typename, custbranch.phoneno, - custbranch.faxno + custbranch.faxno, + custbranch.email FROM debtorsmaster INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid - LEFT JOIN custbranch + LEFT JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno - WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' - AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' + AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' AND (debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address2 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; - + if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; - } + } if (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { $SQL .= " AND custbranch.area = '" . $_POST['Area'] . "'"; } @@ -428,7 +430,7 @@ echo '<br /><p class="page_title_text"><a href="' . $FileName . '">' . _('Click to view the csv Search Result') . '</p>'; $fp = fopen($FileName, 'w'); while ($myrow2 = DB_fetch_array($result)) { - fwrite($fp, $myrow2['debtorno'] . ',' . str_replace(',', '', $myrow2['name']) . ',' . str_replace(',', '', $myrow2['address1']) . ',' . str_replace(',', '', $myrow2['address2']) . ',' . str_replace(',', '', $myrow2['address3']) . ',' . str_replace(',', '', $myrow2['address4']) . ',' . str_replace(',', '', $myrow2['contactname']) . ',' . str_replace(',', '', $myrow2['typename']) . ',' . $myrow2['phoneno'] . ',' . $myrow2['faxno'] . "\n"); + fwrite($fp, $myrow2['debtorno'] . ',' . str_replace(',', '', $myrow2['name']) . ',' . str_replace(',', '', $myrow2['address1']) . ',' . str_replace(',', '', $myrow2['address2']) . ',' . str_replace(',', '', $myrow2['address3']) . ',' . str_replace(',', '', $myrow2['address4']) . ',' . str_replace(',', '', $myrow2['contactname']) . ',' . str_replace(',', '', $myrow2['typename']) . ',' . $myrow2['phoneno'] . ',' . $myrow2['faxno'] . ',' . $myrow2['email'] . "\n"); } echo '</div>'; } @@ -517,7 +519,7 @@ // Extended Customer Info only if selected in Configuration if ($_SESSION['Extended_CustomerInfo'] == 1) { if ($_SESSION['CustomerID'] != '') { - $sql = "SELECT debtortype.typeid, + $sql = "SELECT debtortype.typeid, debtortype.typename FROM debtorsmaster INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid @@ -533,11 +535,11 @@ $SQL = "SELECT debtorsmaster.clientsince, (TO_DAYS(date(now())) - TO_DAYS(date(debtorsmaster.clientsince))) as customersincedays, (TO_DAYS(date(now())) - TO_DAYS(date(debtorsmaster.lastpaiddate))) as lastpaiddays, - debtorsmaster.paymentterms, - debtorsmaster.lastpaid, + debtorsmaster.paymentterms, + debtorsmaster.lastpaid, debtorsmaster.lastpaiddate, currencies.decimalplaces AS currdecimalplaces - FROM debtorsmaster INNER JOIN currencies + FROM debtorsmaster INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtorsmaster.debtorno ='" . $_SESSION['CustomerID'] . "'"; $DataResult = DB_query($SQL, $db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-18 21:20:25
|
Revision: 4802 http://web-erp.svn.sourceforge.net/web-erp/?rev=4802&view=rev Author: tim_schofield Date: 2012-01-18 21:20:19 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Add the email field to the screen output of the search Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-01-18 21:02:16 UTC (rev 4801) +++ trunk/SelectCustomer.php 2012-01-18 21:20:19 UTC (rev 4802) @@ -418,6 +418,7 @@ <th>' . _('Type') . '</th> <th>' . _('Phone') . '</th> <th>' . _('Fax') . '</th> + <th>' . _('Email') . '</th> </tr>'; echo $TableHeader; $j = 1; @@ -454,7 +455,9 @@ <td><font size=1>' . $myrow['contactname'] . '</font></td> <td><font size=1>' . $myrow['typename'] . '</font></td> <td><font size=1>' . $myrow['phoneno'] . '</font></td> - <td><font size=1>' . $myrow['faxno'] . '</font></td></tr>'; + <td><font size=1>' . $myrow['faxno'] . '</font></td> + <td><font size=1>' . $myrow['email'] . '</font></td> + </tr>'; $i++; $j++;//row counter if ($j == 11 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-18 21:20:25
|
Revision: 4802 http://web-erp.svn.sourceforge.net/web-erp/?rev=4802&view=rev Author: tim_schofield Date: 2012-01-18 21:20:19 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Add the email field to the screen output of the search Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-01-18 21:02:16 UTC (rev 4801) +++ trunk/SelectCustomer.php 2012-01-18 21:20:19 UTC (rev 4802) @@ -418,6 +418,7 @@ <th>' . _('Type') . '</th> <th>' . _('Phone') . '</th> <th>' . _('Fax') . '</th> + <th>' . _('Email') . '</th> </tr>'; echo $TableHeader; $j = 1; @@ -454,7 +455,9 @@ <td><font size=1>' . $myrow['contactname'] . '</font></td> <td><font size=1>' . $myrow['typename'] . '</font></td> <td><font size=1>' . $myrow['phoneno'] . '</font></td> - <td><font size=1>' . $myrow['faxno'] . '</font></td></tr>'; + <td><font size=1>' . $myrow['faxno'] . '</font></td> + <td><font size=1>' . $myrow['email'] . '</font></td> + </tr>'; $i++; $j++;//row counter if ($j == 11 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-12-18 08:26:51
|
Revision: 5763 http://sourceforge.net/p/web-erp/reponame/5763 Author: daintree Date: 2012-12-18 08:26:48 +0000 (Tue, 18 Dec 2012) Log Message: ----------- remove superflous repeated code in comments Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-12-17 11:53:34 UTC (rev 5762) +++ trunk/SelectCustomer.php 2012-12-18 08:26:48 UTC (rev 5763) @@ -8,10 +8,10 @@ include('includes/SQL_CommonFunctions.inc'); if (isset($_GET['Select'])) { $_SESSION['CustomerID'] = $_GET['Select']; -} //isset($_GET['Select']) +} if (!isset($_SESSION['CustomerID'])) { //initialise if not already done $_SESSION['CustomerID'] = ''; -} //!isset($_SESSION['CustomerID']) +} if (isset($_GET['Area'])) { $_POST['Area'] = $_GET['Area']; $_POST['Search'] = 'Search'; @@ -20,13 +20,13 @@ $_POST['CustPhone'] = ''; $_POST['CustAdd'] = ''; $_POST['CustType'] = ''; -} //isset($_GET['Area']) +} 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'] = ''; -} //!isset($_SESSION['CustomerType']) -// only run geocode if integration is turned on and customer has been selected -if ($_SESSION['geocode_integration'] == 1 and $_SESSION['CustomerID'] != "") { +} +// only run geocode if integration is turned on AND customer has been selected +if ($_SESSION['geocode_integration'] == 1 AND $_SESSION['CustomerID'] != "") { $sql = "SELECT * FROM geocode_param WHERE 1"; $ErrMsg = _('An error occurred in retrieving the information'); $result = DB_query($sql, $db, $ErrMsg); @@ -71,28 +71,28 @@ } </script>'; echo '<body onload="load()" onunload="GUnload()">'; -} //$_SESSION['geocode_integration'] == 1 and $_SESSION['CustomerID'] != "" +} //end if geocode integration is turned on AND a customer is selected + unset($result); $msg = ''; -if (isset($_POST['Go1']) or isset($_POST['Go2'])) { +if (isset($_POST['Go1']) OR isset($_POST['Go2'])) { $_POST['PageOffset'] = (isset($_POST['Go1']) ? $_POST['PageOffset1'] : $_POST['PageOffset2']); $_POST['Go'] = ''; -} //isset($_POST['Go1']) or isset($_POST['Go2']) +} if (!isset($_POST['PageOffset'])) { $_POST['PageOffset'] = 1; -} //!isset($_POST['PageOffset']) -else { +} else { if ($_POST['PageOffset'] == 0) { $_POST['PageOffset'] = 1; - } //$_POST['PageOffset'] == 0 + } } -if (isset($_POST['Search']) or isset($_POST['CSV']) or isset($_POST['Go']) or isset($_POST['Next']) or isset($_POST['Previous'])) { +if (isset($_POST['Search']) OR isset($_POST['CSV']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; - } //isset($_POST['Search']) + } - if (($_POST['Keywords'] == '') and ($_POST['CustCode'] == '') and ($_POST['CustPhone'] == '') and ($_POST['CustType'] == 'ALL') and ($_POST['Area'] == 'ALL') and ($_POST['CustAdd'] == '')) { + if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ($_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -111,8 +111,7 @@ ON debtorsmaster.debtorno = custbranch.debtorno INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid"; - } //($_POST['Keywords'] == '') and ($_POST['CustCode'] == '') and ($_POST['CustPhone'] == '') and ($_POST['CustType'] == 'ALL') and ($_POST['Area'] == 'ALL') and ($_POST['CustAdd'] == '') - else { + } else { $SearchKeywords = mb_strtoupper(trim(str_replace(' ', '%', $_POST['Keywords']))); $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $_POST['CustPhone'] = trim($_POST['CustPhone']); @@ -142,16 +141,16 @@ OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; - if (mb_strlen($_POST['CustType']) > 0 and $_POST['CustType'] != 'ALL') { + if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType'] != 'ALL') { $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; - } //mb_strlen($_POST['CustType']) > 0 and $_POST['CustType'] != 'ALL' - if (mb_strlen($_POST['Area']) > 0 and $_POST['Area'] != 'ALL') { + } + if (mb_strlen($_POST['Area']) > 0 AND $_POST['Area'] != 'ALL') { $SQL .= " AND custbranch.area = '" . $_POST['Area'] . "'"; - } //mb_strlen($_POST['Area']) > 0 and $_POST['Area'] != 'ALL' - } //one of keywords or custcode or custphone was more than a zero length string + } + } //one of keywords OR custcode OR custphone was more than a zero length string if ($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } //$_SESSION['SalesmanLogin'] != '' + } $SQL .= " ORDER BY debtorsmaster.name"; $ErrMsg = _('The searched customer records requested cannot be retrieved because'); @@ -162,11 +161,10 @@ $_SESSION['BranchCode'] = $myrow['branchcode']; unset($result); unset($_POST['Search']); - } //DB_num_rows($result) == 1 - elseif (DB_num_rows($result) == 0) { - prnMsg(_('No customer records contain the selected text') . ' - ' . _('please alter your search criteria and try again'), 'info'); + } elseif (DB_num_rows($result) == 0) { + prnMsg(_('No customer records contain the selected text') . ' - ' . _('please alter your search criteria AND try again'), 'info'); echo '<br />'; - } //DB_num_rows($result) == 0 + } } //end of if search if (isset($_POST['JustSelectedACustomer'])) { @@ -174,18 +172,17 @@ for ($i = 0; $i < count($_POST); $i++) { //loop through the returned customers if (isset($_POST['SubmitCustomerSelection' . $i])) { break; - } //isset($_POST['SubmitCustomerSelection' . $i]) - } //$i = 0; $i < count($_POST); $i++ + } + } //end loop through $_POST array if ($i == count($_POST)) { prnMsg(_('Unable to identify the selected customer'), 'error'); - } //$i == count($_POST) - else { + } else { $_SESSION['CustomerID'] = $_POST['SelectedCustomer' . $i]; $_SESSION['BranchCode'] = $_POST['SelectedBranch' . $i]; } -} //isset($_POST['JustSelectedACustomer']) +} // end if Just Selected A Customer -if ($_SESSION['CustomerID'] != '' and !isset($_POST['Search']) and !isset($_POST['CSV'])) { +if ($_SESSION['CustomerID'] != '' AND !isset($_POST['Search']) AND !isset($_POST['CSV'])) { if (!isset($_SESSION['BranchCode'])) { $SQL = "SELECT debtorsmaster.name, custbranch.phoneno @@ -229,11 +226,11 @@ 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 . '/CustomerAllocations.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Allocate Receipts OR Credit Notes') . '</a><br />'; echo '<a href="' . $rootpath . '/JobCards.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Job Cards') . '</a><br />'; - if (isset($_SESSION['CustomerID']) and isset($_SESSION['BranchCode'])) { + if (isset($_SESSION['CustomerID']) AND isset($_SESSION['BranchCode'])) { echo '<a href="' . $rootpath . '/CounterSales.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />'; - } //isset($_SESSION['CustomerID']) and isset($_SESSION['BranchCode']) + } 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 />'; @@ -243,7 +240,7 @@ echo '<a href="' . $rootpath . '/CustLoginSetup.php">' . _('Customer Login Configuration') . '</a>'; echo '</td>'; echo '</tr></table><br />'; -} //$_SESSION['CustomerID'] != '' and !isset($_POST['Search']) and !isset($_POST['CSV']) +} //$_SESSION['CustomerID'] != '' AND !isset($_POST['Search']) AND !isset($_POST['CSV']) else { echo '<table width="90%"> <tr> @@ -255,9 +252,9 @@ <td class="select"></td> <td class="select"></td> <td class="select">'; - if (!isset($_SESSION['SalesmanLogin']) or $_SESSION['SalesmanLogin'] == '') { + if (!isset($_SESSION['SalesmanLogin']) OR $_SESSION['SalesmanLogin'] == '') { echo '<a href="' . $rootpath . '/Customers.php?">' . _('Add a New Customer') . '</a><br />'; - } //!isset($_SESSION['SalesmanLogin']) or $_SESSION['SalesmanLogin'] == '' + } echo '</td></tr></table>'; } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; @@ -265,14 +262,13 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (mb_strlen($msg) > 1) { prnMsg($msg, 'info'); -} //mb_strlen($msg) > 1 +} echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers') . '</p>'; echo '<table cellpadding="3" class="selection">'; echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; -} //isset($_POST['Keywords']) -else { +} else { echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } echo '</td> @@ -280,8 +276,7 @@ <td>'; if (isset($_POST['CustCode'])) { echo '<input type="text" name="CustCode" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />'; -} //isset($_POST['CustCode']) -else { +} else { echo '<input type="text" name="CustCode" size="15" maxlength="18" />'; } echo '</td> @@ -292,8 +287,7 @@ <td>'; if (isset($_POST['CustPhone'])) { echo '<input type="text" name="CustPhone" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; -} //isset($_POST['CustPhone']) -else { +} else { echo '<input type="text" name="CustPhone" size="15" maxlength="18" />'; } echo '</td>'; @@ -302,8 +296,7 @@ <td>'; if (isset($_POST['CustAdd'])) { echo '<input type="text" name="CustAdd" value="' . $_POST['CustAdd'] . '" size="20" maxlength="25" />'; -} //isset($_POST['CustAdd']) -else { +} else { echo '<input type="text" name="CustAdd" size="20" maxlength="25" />'; } echo '</td></tr>'; @@ -319,8 +312,7 @@ $DataError = 1; echo '<a href="CustomerTypes.php" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan="2">' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; - } //DB_num_rows($result2) == 0 - else { + } else { // If OK show select box with option selected echo '<select name="CustType"> <option value="ALL">' . _('Any') . '</option>'; @@ -335,8 +327,7 @@ DB_data_seek($result2, 0); echo '</select></td>'; } -} //isset($_POST['CustType']) -else { +} else { //CustType is not set // No option selected="selected" yet, so show Customer Type drop down list $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); // Error if no customer types setup @@ -344,8 +335,7 @@ $DataError = 1; echo '<a href="CustomerTypes.php" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan="2">' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; - } //DB_num_rows($result2) == 0 - else { + } else { // if OK show select box with available options to choose echo '<select name="CustType"> <option value="ALL">' . _('Any') . '</option>'; @@ -366,16 +356,14 @@ $DataError = 1; echo '<a href="Areas.php" target="_parent">' . _('Setup Areas') . '</a>'; echo '<tr><td colspan="2">' . prnMsg(_('No Sales Areas defined'), 'error') . '</td></tr>'; -} //DB_num_rows($result2) == 0 -else { +} else { // if OK show select box with available options to choose echo '<select name="Area">'; echo '<option value="ALL">' . _('Any') . '</option>'; while ($myrow = DB_fetch_array($result2)) { - if (isset($_POST['Area']) and $_POST['Area'] == $myrow['areacode']) { + if (isset($_POST['Area']) AND $_POST['Area'] == $myrow['areacode']) { echo '<option selected="selected" value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; - } //isset($_POST['Area']) and $_POST['Area'] == $myrow['areacode'] - else { + } else { echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } } //end while loop @@ -388,9 +376,10 @@ <input type="submit" name="Search" value="' . _('Search Now') . '" /> <input type="submit" name="CSV" value="' . _('CSV Format') . '" /> </div>'; -if (isset($_SESSION['SalesmanLogin']) and $_SESSION['SalesmanLogin'] != '') { +if (isset($_SESSION['SalesmanLogin']) AND $_SESSION['SalesmanLogin'] != '') { prnMsg(_('Your account enables you to see only customers allocated to you'), 'warn', _('Note: Sales-person Login')); -} //isset($_SESSION['SalesmanLogin']) and $_SESSION['SalesmanLogin'] != '' +} + if (isset($result)) { unset($_SESSION['CustomerID']); $ListCount = DB_num_rows($result); @@ -399,13 +388,13 @@ if (isset($_POST['Next'])) { if ($_POST['PageOffset'] < $ListPageMax) { $_POST['PageOffset'] = $_POST['PageOffset'] + 1; - } //$_POST['PageOffset'] < $ListPageMax - } //isset($_POST['Next']) + } + } if (isset($_POST['Previous'])) { if ($_POST['PageOffset'] > 1) { $_POST['PageOffset'] = $_POST['PageOffset'] - 1; - } //$_POST['PageOffset'] > 1 - } //isset($_POST['Previous']) + } + } echo '<input type="hidden" name="PageOffset" value="' . $_POST['PageOffset'] . '" />'; if ($ListPageMax > 1) { echo '<br /><div class="centre"> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; @@ -414,20 +403,20 @@ while ($ListPage <= $ListPageMax) { if ($ListPage == $_POST['PageOffset']) { echo '<option value="' . $ListPage . '" selected="selected">' . $ListPage . '</option>'; - } //$ListPage == $_POST['PageOffset'] - else { + } else { echo '<option value="' . $ListPage . '">' . $ListPage . '</option>'; } $ListPage++; - } //$ListPage <= $ListPageMax + } echo '</select> <input type="submit" name="Go1" value="' . _('Go') . '" /> <input type="submit" name="Previous" value="' . _('Previous') . '" /> <input type="submit" name="Next" value="' . _('Next') . '" />'; echo '</div>'; - } //$ListPageMax > 1 + } echo '<br /> <table cellpadding="2" class="selection">'; + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th> @@ -442,26 +431,25 @@ $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; - } //!isset($_POST['CSV']) + } //end if NOT producing a CSV file if (DB_num_rows($result) <> 0) { - if (isset($_POST['CSV'])) { + if (isset($_POST['CSV'])) { //producing a CSV file of customers $FileName = $_SESSION['reports_dir'] . '/Customer_Listing_' . Date('Y-m-d') . '.csv'; echo '<br /><p class="page_title_text"><a href="' . $FileName . '">' . _('Click to view the csv Search Result') . '</p>'; $fp = fopen($FileName, 'w'); while ($myrow2 = DB_fetch_array($result)) { fwrite($fp, $myrow2['debtorno'] . ',' . str_replace(',', '', $myrow2['name']) . ',' . str_replace(',', '', $myrow2['address1']) . ',' . str_replace(',', '', $myrow2['address2']) . ',' . str_replace(',', '', $myrow2['address3']) . ',' . str_replace(',', '', $myrow2['address4']) . ',' . str_replace(',', '', $myrow2['contactname']) . ',' . str_replace(',', '', $myrow2['typename']) . ',' . $myrow2['phoneno'] . ',' . $myrow2['faxno'] . ',' . $myrow2['email'] . "\n"); - } //$myrow2 = DB_fetch_array($result) - } //isset($_POST['CSV']) + } //end loop through customers returned + } //end if producing a CSV if (!isset($_POST['CSV'])) { DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); - } //!isset($_POST['CSV']) + } \ $i = 0; //counter for input controls - while (($myrow = DB_fetch_array($result)) and ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { if ($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; - } //$k == 1 - else { + } else { echo '<tr class="OddTableRows">'; $k = 1; } @@ -478,21 +466,20 @@ </tr>'; $i++; $j++; //row counter - if ($j == 11 and ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { + if ($j == 11 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { $j = 1; echo $TableHeader; - } //$j == 11 and ($RowIndex + 1 != $_SESSION['DisplayRecordsMax']) + } //$j == 11 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax']) $RowIndex++; //end of page full new headings if - } //($myrow = DB_fetch_array($result)) and ($RowIndex <> $_SESSION['DisplayRecordsMax']) - //end of while loop + } //end loop through customers echo '</table>'; echo '<input type="hidden" name="JustSelectedACustomer" value="Yes" />'; - } //DB_num_rows($result) <> 0 -} //isset($result) -//end if results to show + } //end if there are customers to show +} //end if results to show + if (!isset($_POST['CSV'])) { - if (isset($ListPageMax) and $ListPageMax > 1) { + if (isset($ListPageMax) AND $ListPageMax > 1) { echo '<br /><div class="centre"> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset2">'; $ListPage = 1; @@ -510,19 +497,18 @@ <input type="submit" name="Previous" value="' . _('Previous') . '" /> <input type="submit" name="Next" value="' . _('Next') . '" />'; echo '</div>'; - } //isset($ListPageMax) and $ListPageMax > 1 - //end if results to show -} //!isset($_POST['CSV']) + }//end if results to show +} + echo '</div> </form>'; -// 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'] != '') { +// 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) { echo '<br />'; if ($Lattitude == 0) { echo '<div class="centre">' . _('Mapping is enabled, but no Mapping data to display for this Customer.') . '</div>'; - } //$Lattitude == 0 - else { + } else { echo '<tr> <td colspan="2"> <table width="45%" cellpadding="4"> @@ -540,7 +526,7 @@ </tr> </table>'; } - } //$_SESSION['geocode_integration'] == 1 + } //end if Geocode integration is turned on // Extended Customer Info only if selected in Configuration if ($_SESSION['Extended_CustomerInfo'] == 1) { if ($_SESSION['CustomerID'] != '') { @@ -585,8 +571,7 @@ <td class="select"></td> <td class="select"></td> </tr>'; - } //$myrow['lastpaiddate'] == 0 - else { + } else { echo _('Last Paid Date:') . '</td> <td class="select"> <b>' . ConvertSQLDate($myrow['lastpaiddate']) . '</b> </td> <td class="select">' . $myrow['lastpaiddays'] . ' ' . _('days') . '</td> @@ -606,8 +591,7 @@ <td class="select"></td> <td class="select"></td> </tr>'; - } //$row['total'] == 0 - else { + } else { echo '<tr> <td class="select">' . _('Total Spend from this Customer (inc tax):') . ' </td> <td class="select"><b>' . locale_number_format($row['total'], $myrow['currdecimalplaces']) . '</b></td> @@ -620,7 +604,7 @@ <td class="select"></td> </tr>'; echo '</table>'; - } //$_SESSION['CustomerID'] != '' + } //end if $_SESSION['CustomerID'] != '' // Customer Contacts $sql = "SELECT * FROM custcontacts WHERE debtorno='" . $_SESSION['CustomerID'] . "' @@ -659,11 +643,11 @@ </tr>'; } //END WHILE LIST LOOP echo '</table>'; - } //DB_num_rows($result) <> 0 + } //end if there are contact rows returned else { - if ($_SESSION['CustomerID'] != "") { + if ($_SESSION['CustomerID'] != '') { echo '<br /><div class="centre"><img src="' . $rootpath . '/css/' . $theme . '/images/group_add.png" title="' . _('Customer Contacts') . '" alt="" /><a href="AddCustomerContacts.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . ' ' . _('Add New Contact') . '</a></div>'; - } //$_SESSION['CustomerID'] != "" + } } // Customer Notes $sql = "SELECT noteid, @@ -680,10 +664,10 @@ echo '<br /><div class="centre"><img src="' . $rootpath . '/css/' . $theme . '/images/note_add.png" title="' . _('Customer Notes') . '" alt="" />' . ' ' . _('Customer Notes') . '</div><br />'; echo '<table width="45%">'; echo '<tr> - <th>' . _('date') . '</th> - <th>' . _('note') . '</th> - <th>' . _('hyperlink') . '</th> - <th>' . _('priority') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Note') . '</th> + <th>' . _('Hyperlink') . '</th> + <th>' . _('Priority') . '</th> <th>' . _('Edit') . '</th> <th>' . _('Delete') . '</th> <th> <a href="AddCustomerNotes.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . ' ' . _('Add New Note') . '</a> </th> @@ -707,11 +691,11 @@ </tr>'; } //END WHILE LIST LOOP echo '</table>'; - } //DB_num_rows($result) <> 0 + } //end if there are customer notes to display else { if ($_SESSION['CustomerID'] != '') { echo '<br /><div class="centre"><img src="' . $rootpath . '/css/' . $theme . '/images/note_add.png" title="' . _('Customer Notes') . '" alt="" /><a href="AddCustomerNotes.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . ' ' . _('Add New Note for this Customer') . '</a></div>'; - } //$_SESSION['CustomerID'] != '' + } } // Custome Type Notes $sql = "SELECT * FROM debtortypenotes @@ -722,10 +706,10 @@ echo '<br /><div class="centre"><img src="' . $rootpath . '/css/' . $theme . '/images/folder_add.png" title="' . _('Customer Type (Group) Notes') . '" alt="" />' . ' ' . _('Customer Type (Group) Notes for:' . '<b> ' . $CustomerTypeName . '</b>') . '</div><br />'; echo '<table width="45%">'; echo '<tr> - <th>' . _('date') . '</th> - <th>' . _('note') . '</th> - <th>' . _('file link / reference / URL') . '</th> - <th>' . _('priority') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Note') . '</th> + <th>' . _('File Link / Reference / URL') . '</th> + <th>' . _('Priority') . '</th> <th>' . _('Edit') . '</th> <th>' . _('Delete') . '</th> <th><a href="AddCustomerTypeNotes.php?DebtorType=' . $CustomerType . '">' . _('Add New Group Note') . '</a></th> @@ -735,8 +719,7 @@ if ($k == 1) { echo '<tr class="OddTableRows">'; $k = 0; - } //$k == 1 - else { + } else { echo '<tr class="EvenTableRows">'; $k = 1; } @@ -749,14 +732,14 @@ </tr>'; } //END WHILE LIST LOOP echo '</table>'; - } //DB_num_rows($result) <> 0 + } // end if there are customer group notes to display else { if ($_SESSION['CustomerID'] != '') { echo '<br /><div class="centre"><img src="' . $rootpath . '/css/' . $theme . '/images/folder_add.png" title="' . _('Customer Group Notes') . '" alt="" /><a href="AddCustomerTypeNotes.php?DebtorType=' . $CustomerType . '">' . ' ' . _('Add New Group Note') . '</a></div><br />'; - } //$_SESSION['CustomerID'] != '' + } } - } //$_SESSION['Extended_CustomerInfo'] == 1 -} //isset($_SESSION['CustomerID']) and $_SESSION['CustomerID'] != '' + } //end if Extended_CustomerInfo is turned on +} //end if isset($_SESSION['CustomerID']) AND $_SESSION['CustomerID'] != '' echo '<script type="text/javascript">defaultControl(document.forms[0].CustCode);</script>'; include('includes/footer.inc'); ?> \ No newline at end of file |
From: <dai...@us...> - 2012-12-18 08:41:26
|
Revision: 5764 http://sourceforge.net/p/web-erp/reponame/5764 Author: daintree Date: 2012-12-18 08:41:23 +0000 (Tue, 18 Dec 2012) Log Message: ----------- remove superflous repeated code in comments Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-12-18 08:26:48 UTC (rev 5763) +++ trunk/SelectCustomer.php 2012-12-18 08:41:23 UTC (rev 5764) @@ -227,7 +227,6 @@ 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 . '/JobCards.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Job Cards') . '</a><br />'; if (isset($_SESSION['CustomerID']) AND isset($_SESSION['BranchCode'])) { echo '<a href="' . $rootpath . '/CounterSales.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />'; } @@ -443,7 +442,7 @@ } //end if producing a CSV if (!isset($_POST['CSV'])) { DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); - } \ + } $i = 0; //counter for input controls while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { if ($k == 1) { |
From: <te...@us...> - 2013-07-03 08:03:30
|
Revision: 6045 http://sourceforge.net/p/web-erp/reponame/6045 Author: tehonu Date: 2013-07-03 08:03:25 +0000 (Wed, 03 Jul 2013) Log Message: ----------- Added ORDER BY clause Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2013-07-03 07:52:48 UTC (rev 6044) +++ trunk/SelectCustomer.php 2013-07-03 08:03:25 UTC (rev 6045) @@ -305,7 +305,7 @@ <td>'; if (isset($_POST['CustType'])) { // Show Customer Type drop down list - $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); + $result2 = DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename", $db); // Error if no customer types setup if (DB_num_rows($result2) == 0) { $DataError = 1; |
From: <te...@us...> - 2013-08-21 08:46:15
|
Revision: 6281 http://sourceforge.net/p/web-erp/reponame/6281 Author: tehonu Date: 2013-08-21 08:46:12 +0000 (Wed, 21 Aug 2013) Log Message: ----------- Customer type shown ordered by typename Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2013-08-21 08:35:07 UTC (rev 6280) +++ trunk/SelectCustomer.php 2013-08-21 08:46:12 UTC (rev 6281) @@ -328,7 +328,7 @@ } } else { //CustType is not set // No option selected="selected" yet, so show Customer Type drop down list - $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); + $result2 = DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename", $db); // Error if no customer types setup if (DB_num_rows($result2) == 0) { $DataError = 1; |
From: <ice...@us...> - 2013-09-13 00:58:55
|
Revision: 6337 http://sourceforge.net/p/web-erp/reponame/6337 Author: icedlava Date: 2013-09-13 00:58:50 +0000 (Fri, 13 Sep 2013) Log Message: ----------- Fix pattern to allow entry in customer code search. Thanks Tim for highlighting issue. Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2013-09-11 03:25:08 UTC (rev 6336) +++ trunk/SelectCustomer.php 2013-09-13 00:58:50 UTC (rev 6337) @@ -274,9 +274,9 @@ <td><b>' . _('OR') . '</b></td><td>' . _('Enter a partial Code') . ':</td> <td>'; if (isset($_POST['CustCode'])) { - echo '<input type="text" name="CustCode" pattern="[0-9+()\s]*" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />'; + echo '<input type="text" name="CustCode" pattern="[\w-]*" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="text" name="CustCode" pattern="[0-9+()\s]*" size="15" maxlength="18" />'; + echo '<input type="text" name="CustCode" pattern="[\w-]*" size="15" maxlength="18" />'; } echo '</td> </tr> @@ -285,9 +285,9 @@ <td>' . _('Enter a partial Phone Number') . ':</td> <td>'; if (isset($_POST['CustPhone'])) { - echo '<input type="tel" name="CustPhone" pattern="[0-9a-zA-Z_]*" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; + echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]*" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]*"size="15" maxlength="18" />'; + echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]* "size="15" maxlength="18" />'; } echo '</td>'; echo '<td><b>' . _('OR') . '</b></td> |
From: <ex...@us...> - 2014-06-26 03:33:09
|
Revision: 6779 http://sourceforge.net/p/web-erp/reponame/6779 Author: exsonqu Date: 2014-06-26 03:33:05 +0000 (Thu, 26 Jun 2014) Log Message: ----------- 26/06/14 Exson: Fixed the bug that Select Customers search result inconsistence with Customer receipt search result in SelectCustomer.php. Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2014-06-24 20:33:25 UTC (rev 6778) +++ trunk/SelectCustomer.php 2014-06-26 03:33:05 UTC (rev 6779) @@ -135,11 +135,11 @@ ON debtorsmaster.debtorno = custbranch.debtorno WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + AND (custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' OR custbranch.phoneno IS NULL) AND (debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address2 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' - OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; + OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')";//If there is no custbranch set, the phoneno in custbranch will be null, so we add IS NULL condition otherwise those debtors without custbranches setting will be no searchable and it will make a inconsistence with customer receipt interface. if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType'] != 'ALL') { $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; |
From: <ex...@us...> - 2015-12-09 07:53:33
|
Revision: 7407 http://sourceforge.net/p/web-erp/reponame/7407 Author: exsonqu Date: 2015-12-09 07:53:30 +0000 (Wed, 09 Dec 2015) Log Message: ----------- 09/12/05 Exson: Fixed the telephone regular expression bug in SelectCustomer.php. Reported by Terry. Modified Paths: -------------- trunk/SelectCustomer.php Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2015-12-01 15:08:45 UTC (rev 7406) +++ trunk/SelectCustomer.php 2015-12-09 07:53:30 UTC (rev 7407) @@ -289,7 +289,7 @@ if (isset($_POST['CustPhone'])) { echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]*" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]* "size="15" maxlength="18" />'; + echo '<input type="tel" name="CustPhone" pattern="[0-9\-\s()+]*" size="15" maxlength="18" />'; } echo '</td>'; echo '<td><b>' . _('OR') . '</b></td> |