Thread: [Weberp-svn] SF.net SVN: weberp:[4182] trunk/BankAccounts.php
Brought to you by:
sotandeka,
tim_schofield
From: <sot...@us...> - 2011-01-09 10:19:14
|
Revision: 4182 http://weberp.svn.sourceforge.net/weberp/?rev=4182&view=rev Author: sotandeka Date: 2011-01-09 10:19:07 +0000 (Sun, 09 Jan 2011) Log Message: ----------- Correct the quotes in SQL literals Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-01-09 10:06:22 UTC (rev 4181) +++ trunk/BankAccounts.php 2011-01-09 10:19:07 UTC (rev 4182) @@ -82,7 +82,7 @@ /*Check if there are already transactions against this account - cant allow change currency if there are*/ - $sql = 'SELECT * FROM banktrans WHERE bankact=' . $SelectedBankAccount; + $sql = "SELECT * FROM banktrans WHERE bankact=" . $SelectedBankAccount; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { $sql = "UPDATE bankaccounts @@ -336,7 +336,7 @@ if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; } -$result = DB_query('SELECT currabrev, currency FROM currencies',$db); +$result = DB_query("SELECT currabrev, currency FROM currencies",$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { echo '<option selected VALUE='; @@ -355,7 +355,7 @@ } if (isset($SelectedBankAccount)) { - $result = DB_query('SELECT invoice FROM bankaccounts where accountcode =' . $SelectedBankAccount ,$db); + $result = DB_query("SELECT invoice FROM bankaccounts where accountcode =" . $SelectedBankAccount ,$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { echo '<option selected VALUE=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-11 16:56:18
|
Revision: 5822 http://weberp.svn.sourceforge.net/weberp/?rev=5822&view=rev Author: tim_schofield Date: 2011-07-11 16:56:12 +0000 (Mon, 11 Jul 2011) Log Message: ----------- Remove old references to $PageSecurity Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-11 16:55:39 UTC (rev 5821) +++ trunk/BankAccounts.php 2011-07-11 16:56:12 UTC (rev 5822) @@ -2,8 +2,6 @@ /* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Bank Accounts Maintenance'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-12 13:34:10
|
Revision: 5990 http://weberp.svn.sourceforge.net/weberp/?rev=5990&view=rev Author: tim_schofield Date: 2011-07-12 13:34:04 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Remove unnecessary use of SID Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-12 13:33:53 UTC (rev 5989) +++ trunk/BankAccounts.php 2011-07-12 13:34:04 UTC (rev 5990) @@ -246,7 +246,7 @@ if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; + echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; echo '<br />'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-14 16:05:54
|
Revision: 6221 http://weberp.svn.sourceforge.net/weberp/?rev=6221&view=rev Author: tim_schofield Date: 2011-07-14 16:05:48 +0000 (Thu, 14 Jul 2011) Log Message: ----------- XHTML quoting corrections Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-14 16:05:37 UTC (rev 6220) +++ trunk/BankAccounts.php 2011-07-14 16:05:48 UTC (rev 6221) @@ -279,10 +279,10 @@ echo '<input type=hidden name=SelectedBankAccount value=' . $SelectedBankAccount . '>'; echo '<input type=hidden name=AccountCode value=' . $_POST['AccountCode'] . '>'; - echo '<table class=selection> <tr><td>' . _('Bank Account GL Code') . ':</td><td>'; + echo '<table class="selection"> <tr><td>' . _('Bank Account GL Code') . ':</td><td>'; echo $_POST['AccountCode'] . '</td></tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('Bank Account GL Code') . + echo '<table class="selection"><tr><td>' . _('Bank Account GL Code') . ':</td><td><Select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; $sql = "SELECT accountcode, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-16 09:56:44
|
Revision: 6525 http://weberp.svn.sourceforge.net/weberp/?rev=6525&view=rev Author: tim_schofield Date: 2011-07-16 09:56:38 +0000 (Sat, 16 Jul 2011) Log Message: ----------- XHTML quoting corrections Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-16 09:56:28 UTC (rev 6524) +++ trunk/BankAccounts.php 2011-07-16 09:56:38 UTC (rev 6525) @@ -277,8 +277,8 @@ $_POST['CurrCode'] = $myrow['currcode']; $_POST['DefAccount'] = $myrow['invoice']; - echo '<input type=hidden name=SelectedBankAccount value=' . $SelectedBankAccount . '>'; - echo '<input type=hidden name=AccountCode value=' . $_POST['AccountCode'] . '>'; + echo '<input type="hidden" name="SelectedBankAccount" value="' . $SelectedBankAccount . '" />'; + echo '<input type="hidden" name="AccountCode" value="' . $_POST['AccountCode'] . '" />'; echo '<table class="selection"> <tr><td>' . _('Bank Account GL Code') . ':</td><td>'; echo $_POST['AccountCode'] . '</td></tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 14:05:32
|
Revision: 6998 http://weberp.svn.sourceforge.net/weberp/?rev=6998&view=rev Author: tim_schofield Date: 2011-07-26 14:05:26 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-26 14:05:15 UTC (rev 6997) +++ trunk/BankAccounts.php 2011-07-26 14:05:26 UTC (rev 6998) @@ -296,7 +296,7 @@ $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AccountCode']) and $myrow['accountcode']==$_POST['AccountCode']) { - echo '<option selected value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; + echo '<option selected="True" value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } else { echo '<option value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } @@ -336,7 +336,7 @@ $result = DB_query("SELECT currabrev, currency FROM currencies",$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; + echo '<option selected="True" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } else { echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } @@ -354,9 +354,9 @@ $result = DB_query("SELECT invoice FROM bankaccounts where accountcode =" . $SelectedBankAccount ,$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { - echo '<option selected value=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option selected="True" value="1">'._('Yes').'</option><option value=0>'._('No').'</option>'; } else { - echo '<option selected value=0>'._('No').'</option><option value=1>'._('Yes').'</option>'; + echo '<option selected="True" value="0">'._('No').'</option><option value=1>'._('Yes').'</option>'; } }//end while loop } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 20:44:31
|
Revision: 7057 http://weberp.svn.sourceforge.net/weberp/?rev=7057&view=rev Author: tim_schofield Date: 2011-07-26 20:44:25 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-26 20:44:03 UTC (rev 7056) +++ trunk/BankAccounts.php 2011-07-26 20:44:25 UTC (rev 7057) @@ -321,13 +321,13 @@ } echo '<tr><td>' . _('Bank Account Name') . ': </td> - <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td></tr> <tr><td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td></tr> <tr><td>' . _('Bank Account Number') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td></tr> <tr><td>' . _('Bank Address') . ': </td> - <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td></tr> <tr><td>' . _('Currency Of Account') . ': </td><td><select tabindex="5" name="CurrCode">'; if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-27 20:44:33
|
Revision: 7098 http://weberp.svn.sourceforge.net/weberp/?rev=7098&view=rev Author: tim_schofield Date: 2011-07-27 20:44:27 +0000 (Wed, 27 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-27 20:44:13 UTC (rev 7097) +++ trunk/BankAccounts.php 2011-07-27 20:44:27 UTC (rev 7098) @@ -366,7 +366,7 @@ echo '</select></td>'; echo '</tr></table><br /> - <div class="centre"><input tabindex="7" type="Submit" name="submit" value="'. _('Enter Information') .'"></div>'; + <div class="centre"><input tabindex="7" type="submit" name="submit" value="'. _('Enter Information') .'" /></div>'; echo '</form>'; include('includes/footer.inc'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-31 20:03:55
|
Revision: 7405 http://weberp.svn.sourceforge.net/weberp/?rev=7405&view=rev Author: tim_schofield Date: 2011-07-31 20:03:49 +0000 (Sun, 31 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-07-29 21:48:59 UTC (rev 7404) +++ trunk/BankAccounts.php 2011-07-31 20:03:49 UTC (rev 7405) @@ -214,7 +214,7 @@ } else { $defacc=_('Yes'); } - printf('<td>%s<br /><font size=2>%s</font></td> + printf('<td>%s<br /><font size="2">%s</font></td> <td>%s</td> <td>%s</td> <td>%s</td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-12-27 13:17:41
|
Revision: 8401 http://weberp.svn.sourceforge.net/weberp/?rev=8401&view=rev Author: tim_schofield Date: 2011-12-27 13:17:35 +0000 (Tue, 27 Dec 2011) Log Message: ----------- Remove select * sql, only retrieve fields we need Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-12-27 13:17:21 UTC (rev 8400) +++ trunk/BankAccounts.php 2011-12-27 13:17:35 UTC (rev 8401) @@ -80,7 +80,7 @@ /*Check if there are already transactions against this account - cant allow change currency if there are*/ - $sql = "SELECT * FROM banktrans WHERE bankact=" . $SelectedBankAccount; + $sql = "SELECT banktransid FROM banktrans WHERE bankact=" . $SelectedBankAccount; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { $sql = "UPDATE bankaccounts @@ -91,7 +91,7 @@ invoice ='" . $_POST['DefAccount'] . "' WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br />'; + echo '<br />'; } else { $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:47:32
|
Revision: 8524 http://weberp.svn.sourceforge.net/weberp/?rev=8524&view=rev Author: tim_schofield Date: 2012-02-18 20:47:25 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-18 20:47:16 UTC (rev 8523) +++ trunk/BankAccounts.php 2012-02-18 20:47:25 UTC (rev 8524) @@ -9,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br />'; +echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "Currency Default" of "Fallback Default" to print Account details on Invoices (only one account should be set to "Fall Back Default").') . '.</div><br />'; if (isset($_GET['SelectedBankAccount'])) { $SelectedBankAccount=$_GET['SelectedBankAccount']; @@ -80,27 +80,25 @@ /*Check if there are already transactions against this account - cant allow change currency if there are*/ - $sql = "SELECT banktransid FROM banktrans WHERE bankact=" . $SelectedBankAccount; + $sql = "SELECT banktransid FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + invoice ='" . $_POST['DefAccount'] . "' + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br />'; + echo '<br />'; } else { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - currcode ='" . $_POST['CurrCode'] . "', - invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + currcode ='" . $_POST['CurrCode'] . "', + invoice ='" . $_POST['DefAccount'] . "' + WHERE accountcode = '" . $SelectedBankAccount . "'"; } $msg = _('The bank account details have been updated'); @@ -108,22 +106,20 @@ /*Selectedbank account is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new bank account form */ - $sql = "INSERT INTO bankaccounts ( - accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' - )"; + $sql = "INSERT INTO bankaccounts (accountcode, + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice + ) VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -137,6 +133,7 @@ echo '<br />'; unset($_POST['AccountCode']); unset($_POST['BankAccountName']); + unset($_POST['BankAccountCode']); unset($_POST['BankAccountNumber']); unset($_POST['BankAddress']); unset($_POST['CurrCode']); @@ -152,17 +149,17 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'BankTrans' - $sql= "SELECT COUNT(*) FROM banktrans WHERE banktrans.bankact='$SelectedBankAccount'"; + $sql= "SELECT COUNT(bankact) AS accounts FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['accounts']>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow['accounts'] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { - $sql="DELETE FROM bankaccounts WHERE accountcode='$SelectedBankAccount'"; + $sql="DELETE FROM bankaccounts WHERE accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql,$db); prnMsg(_('Bank account deleted'),'success'); } //end if Delete bank account @@ -172,70 +169,72 @@ } /* Always show the list of accounts */ -If (!isset($SelectedBankAccount)) { +if (!isset($SelectedBankAccount)) { $sql = "SELECT bankaccounts.accountcode, - bankaccounts.bankaccountcode, - chartmaster.accountname, - bankaccountname, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode = chartmaster.accountcode"; + bankaccounts.bankaccountcode, + chartmaster.accountname, + bankaccountname, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class="selection">'; + echo '<table class="selection"> + <tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; - echo '<tr><th>' . _('GL Account Code') . '</th> - <th>' . _('Bank Account Name') . '</th> - <th>' . _('Bank Account Code') . '</th> - <th>' . _('Bank Account Number') . '</th> - <th>' . _('Bank Address') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Default for Invoices') . '</th> - </tr>'; - $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - if ($myrow[7]==0) { - $defacc=_('No'); - } else { - $defacc=_('Yes'); - } - printf('<td>%s<br /><font size="2">%s</font></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedBankAccount=%s&delete=1">' . _('Delete') . '</td> - </tr>', - $myrow[0], - $myrow[2], - $myrow[3], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6], - $defacc, - htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), - $myrow[0], - htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), - $myrow[0]); + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if ($myrow['invoice']==0) { + $DefaultBankAccount=_('No'); + } elseif ($myrow['invoice']==1) { + $DefaultBankAccount=_('Fall Back Default'); + } elseif ($myrow['invoice']==2) { + $DefaultBankAccount=_('Currency Default'); + } + printf('<td>%s<br /><font size="2">%s</font></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow['accountcode'], + $myrow['accountname'], + $myrow['bankaccountname'], + $myrow['bankaccountcode'], + $myrow['bankaccountnumber'], + $myrow['bankaddress'], + $myrow['currcode'], + $DefaultBankAccount, + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $myrow['accountcode'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $myrow['accountcode']); } //END WHILE LIST LOOP @@ -257,14 +256,14 @@ //editing an existing bank account - not deleting $sql = "SELECT accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='$SelectedBankAccount'"; + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -279,24 +278,29 @@ echo '<input type="hidden" name="SelectedBankAccount" value="' . $SelectedBankAccount . '" />'; echo '<input type="hidden" name="AccountCode" value="' . $_POST['AccountCode'] . '" />'; - echo '<table class="selection"> <tr><td>' . _('Bank Account GL Code') . ':</td><td>'; - echo $_POST['AccountCode'] . '</td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td> + </tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered - echo '<table class="selection"><tr><td>' . _('Bank Account GL Code') . - ':</td><td><Select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; + echo '<table class="selection"> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> + <td><select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_ = accountgroups.groupname - AND accountgroups.pandl = 0 - ORDER BY accountcode"; + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname + WHERE accountgroups.pandl = 0 + ORDER BY accountcode"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AccountCode']) and $myrow['accountcode']==$_POST['AccountCode']) { - echo '<option selected="True" value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; + echo '<option selected="selected" value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } else { echo '<option value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } @@ -320,23 +324,36 @@ $_POST['BankAddress']=''; } -echo '<tr><td>' . _('Bank Account Name') . ': </td> - <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Number') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Address') . ': </td> - <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Currency Of Account') . ': </td><td><select tabindex="5" name="CurrCode">'; +echo '<tr> + <td>' . _('Bank Account Name') . ': </td> + <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Code') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Number') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Address') . ': </td> + <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Currency Of Account') . ': </td> + <td><select tabindex="5" name="CurrCode">'; -if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ +if (!isset($_POST['CurrCode']) or $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; } -$result = DB_query("SELECT currabrev, currency FROM currencies",$db); +$result = DB_query("SELECT currabrev, + currency + FROM currencies",$db); + while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected="True" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; + echo '<option selected="selected" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } else { echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } @@ -344,23 +361,35 @@ echo '</select></td>'; -echo '<tr><td>' . _('Default for Invoices') . ': </td><td><select tabindex="6" name="DefAccount">'; +echo '<tr> + <td>' . _('Default for Invoices') . ': </td> + <td><select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ - $_POST['DefAccount'] = $_SESSION['CompanyRecord']['currencydefault']; + $_POST['DefAccount'] = $_SESSION['CompanyRecord']['currencydefault']; } if (isset($SelectedBankAccount)) { $result = DB_query("SELECT invoice FROM bankaccounts where accountcode =" . $SelectedBankAccount ,$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { - echo '<option selected="True" value="1">'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option selected="selected" value="1">'._('Fall Back Default').'</option> + <option value="2">'._('Currency Default') . '</option> + <option value="0">'._('No').'</option>'; + } elseif ($myrow['invoice']== 2) { + echo '<option value="0">'._('No').'</option> + <option selected="selected" value="2">'._('Currency Default') . '</option> + <option value="1">'._('Fall Back Default').'</option>'; } else { - echo '<option selected="True" value="0">'._('No').'</option><option value=1>'._('Yes').'</option>'; + echo '<option selected="selected" value="0">'._('No').'</option> + <option value="2">'._('Currency Default') . '</option> + <option value="1">'._('Fall Back Default').'</option>'; } }//end while loop } else { - echo '<option value=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option value="1">'._('Fall Back Default').'</option> + <option value="2">'._('Currency Default') . '</option> + <option value="0">'._('No').'</option>'; } echo '</select></td>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-06-30 10:57:02
|
Revision: 9339 http://weberp.svn.sourceforge.net/weberp/?rev=9339&view=rev Author: tim_schofield Date: 2012-06-30 10:56:56 +0000 (Sat, 30 Jun 2012) Log Message: ----------- Provide event handler for new Ajax functionality Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-06-30 10:56:47 UTC (rev 9338) +++ trunk/BankAccounts.php 2012-06-30 10:56:56 UTC (rev 9339) @@ -250,7 +250,7 @@ echo '<br />'; } -echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; +echo '<form onsubmit="return SubmitForm(this)" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-08-17 12:46:20
|
Revision: 9518 http://weberp.svn.sourceforge.net/weberp/?rev=9518&view=rev Author: tim_schofield Date: 2012-08-17 12:46:14 +0000 (Fri, 17 Aug 2012) Log Message: ----------- Changes for new interface Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-08-17 12:46:02 UTC (rev 9517) +++ trunk/BankAccounts.php 2012-08-17 12:46:14 UTC (rev 9518) @@ -9,9 +9,6 @@ $BookMark = 'BankAccounts'; include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "Currency Default" of "Fallback Default" to print Account details on Invoices (only one account should be set to "Fall Back Default").') . '.</div><br />'; - if (isset($_GET['SelectedBankAccount'])) { $SelectedBankAccount=$_GET['SelectedBankAccount']; } elseif (isset($_POST['SelectedBankAccount'])) { @@ -187,17 +184,23 @@ $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class="selection"> - <tr> - <th>' . _('GL Account Code') . '</th> - <th>' . _('Bank Account Name') . '</th> - <th>' . _('Bank Account Code') . '</th> - <th>' . _('Bank Account Number') . '</th> - <th>' . _('Bank Address') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Default for Invoices') . '</th> - </tr>'; + echo '<table class="selection">'; + echo '<tr> + <th colspan="9" class="header"> + <img src="'.$rootpath.'/css/'.$theme.'/images/bank.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . ' + </th> + </tr>'; + echo '<tr> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('GL Account Code') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Bank Account Name') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Bank Account Code') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Bank Account Number') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Bank Address') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Currency') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Default for Invoices') . '</th> + </tr>'; + $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { if ($k==1){ @@ -214,39 +217,27 @@ } elseif ($myrow['invoice']==2) { $DefaultBankAccount=_('Currency Default'); } - printf('<td>%s<br />%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow['accountcode'], - $myrow['accountname'], - $myrow['bankaccountname'], - $myrow['bankaccountcode'], - $myrow['bankaccountnumber'], - $myrow['bankaddress'], - $myrow['currcode'], - $DefaultBankAccount, - htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), - $myrow['accountcode'], - htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), - $myrow['accountcode']); + echo '<td>' . $myrow['accountcode'] . '<br />' . $myrow['accountname'] . '</td> + <td>' . $myrow['bankaccountname'] . '</td> + <td>' . $myrow['bankaccountcode'] . '</td> + <td>' . $myrow['bankaccountnumber'] . '</td> + <td>' . $myrow['bankaddress'] . '</td> + <td>' . $myrow['currcode'] . '</td> + <td>' . $DefaultBankAccount . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'], _('Edit')) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'] . '&delete=1', _('Delete')) . '</td> + </tr>'; } //END WHILE LIST LOOP - echo '</table><br />'; + echo '</table>'; } if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; + echo '<div class="centre"><p>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), _('Show All Bank Accounts Defined')) . '</p></div>'; echo '<br />'; } @@ -331,7 +322,12 @@ </tr> <tr> <td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td> + <td> + <a class="tooltip" href="#"> + <span class="custom info"><img src="'.$rootpath.'/css/'.$theme.'/images/Info.png" height="48" width="48" /><em>' . _('Information') . '</em>' . _('Account Code is for SWIFT or BSB type Bank Codes.') . '</span> + <input tabindex="3" type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /> + </a> + </td> </tr> <tr> <td>' . _('Bank Account Number') . ': </td> @@ -343,7 +339,8 @@ </tr> <tr> <td>' . _('Currency Of Account') . ': </td> - <td><select tabindex="5" name="CurrCode">'; + <td> + <select tabindex="5" name="CurrCode">'; if (!isset($_POST['CurrCode']) or $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; @@ -354,9 +351,9 @@ while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected="selected" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; + echo '<option selected="selected" value="'.$myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; + echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } //end while loop @@ -364,7 +361,10 @@ echo '<tr> <td>' . _('Default for Invoices') . ': </td> - <td><select tabindex="6" name="DefAccount">'; + <td> + <a class="tooltip" href="#"> + <span class="custom info"><img src="'.$rootpath.'/css/'.$theme.'/images/Info.png" height="48" width="48" /><em>' . _('Information') . '</em>' . _('Set Default for Invoices to "Currency Default" or "Fallback Default" to print Account details on Invoices (only one account can be set to "Fall Back Default").') . '</span> + <select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ $_POST['DefAccount'] = $_SESSION['CompanyRecord']['currencydefault']; @@ -393,10 +393,10 @@ <option value="0">'._('No').'</option>'; } -echo '</select></td>'; +echo '</select></a></td>'; -echo '</tr></table><br /> - <div class="centre"><button tabindex="7" type="submit" name="submit">'. _('Enter Information') .'</button></div><br />'; +echo '</tr></table> + <div class="centre"><button tabindex="7" type="submit" name="submit">'. _('Enter Information') .'</button></div>'; echo '</form>'; include('includes/footer.inc'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-09-06 09:16:50
|
Revision: 9583 http://weberp.svn.sourceforge.net/weberp/?rev=9583&view=rev Author: tim_schofield Date: 2012-09-06 09:16:39 +0000 (Thu, 06 Sep 2012) Log Message: ----------- Improvements for new layout Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-09-03 15:57:12 UTC (rev 9582) +++ trunk/BankAccounts.php 2012-09-06 09:16:39 UTC (rev 9583) @@ -87,8 +87,7 @@ bankaddress='" . $_POST['BankAddress'] . "', invoice ='" . $_POST['DefAccount'] . "' WHERE accountcode = '" . $SelectedBankAccount . "'"; - prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br />'; + prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'info'); } else { $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', bankaccountcode='" . $_POST['BankAccountCode'] . "', @@ -128,7 +127,6 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg($msg,'success'); - echo '<br />'; unset($_POST['AccountCode']); unset($_POST['BankAccountName']); unset($_POST['BankAccountCode']); @@ -153,7 +151,7 @@ if ($myrow['accounts']>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br /> ' . _('There are') . ' ' . $myrow['accounts'] . ' ' . _('transactions with this bank account code'); + echo _('There are') . ' ' . $myrow['accounts'] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -167,7 +165,6 @@ } /* Always show the list of accounts */ -if (!isset($SelectedBankAccount)) { $sql = "SELECT bankaccounts.accountcode, bankaccounts.bankaccountcode, chartmaster.accountname, @@ -181,7 +178,7 @@ ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; + $DbgMsg = _('The SQL used to retrieve the bank account details was') . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class="selection">'; @@ -203,44 +200,37 @@ $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - if ($myrow['invoice']==0) { - $DefaultBankAccount=_('No'); - } elseif ($myrow['invoice']==1) { - $DefaultBankAccount=_('Fall Back Default'); - } elseif ($myrow['invoice']==2) { - $DefaultBankAccount=_('Currency Default'); - } - echo '<td>' . $myrow['accountcode'] . '<br />' . $myrow['accountname'] . '</td> - <td>' . $myrow['bankaccountname'] . '</td> - <td>' . $myrow['bankaccountcode'] . '</td> - <td>' . $myrow['bankaccountnumber'] . '</td> - <td>' . $myrow['bankaddress'] . '</td> - <td>' . $myrow['currcode'] . '</td> - <td>' . $DefaultBankAccount . '</td> - <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'], _('Edit')) . '</td> - <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'] . '&delete=1', _('Delete')) . '</td> - </tr>'; - + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; } - //END WHILE LIST LOOP + if ($myrow['invoice']==0) { + $DefaultBankAccount=_('No'); + } elseif ($myrow['invoice']==1) { + $DefaultBankAccount=_('Fall Back Default'); + } elseif ($myrow['invoice']==2) { + $DefaultBankAccount=_('Currency Default'); + } + echo '<td>' . $myrow['accountcode'] . '<br />' . $myrow['accountname'] . '</td> + <td>' . $myrow['bankaccountname'] . '</td> + <td>' . $myrow['bankaccountcode'] . '</td> + <td>' . $myrow['bankaccountnumber'] . '</td> + <td>' . $myrow['bankaddress'] . '</td> + <td>' . $myrow['currcode'] . '</td> + <td>' . $DefaultBankAccount . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'], _('Edit')) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedBankAccount=' . $myrow['accountcode'] . '&delete=1', _('Delete')) . '</td> + </tr>'; - - echo '</table>'; } +//END WHILE LIST LOOP -if (isset($SelectedBankAccount)) { - echo '<br />'; - echo '<div class="centre"><p>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), _('Show All Bank Accounts Defined')) . '</p></div>'; - echo '<br />'; -} +echo '</table>'; + echo '<form onsubmit="return SubmitForm(this, \'\')" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -324,7 +314,7 @@ <td>' . _('Bank Account Code') . ': </td> <td> <a class="tooltip"> - <span class="custom info"><img src="'.$rootpath.'/css/'.$theme.'/images/Info.png" height="48" width="48" /><em>' . _('Information') . '</em>' . _('Account Code is for SWIFT or BSB type Bank Codes.') . '</span> + <span class="custom info"><em>' . _('Information') . '</em>' . _('Account Code is for SWIFT or BSB type Bank Codes.') . '</span> <input tabindex="3" type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /> </a> </td> @@ -363,7 +353,7 @@ <td>' . _('Default for Invoices') . ': </td> <td> <a class="tooltip"> - <span class="custom info"><img src="'.$rootpath.'/css/'.$theme.'/images/Info.png" height="48" width="48" /><em>' . _('Information') . '</em>' . _('Set Default for Invoices to "Currency Default" or "Fallback Default" to print Account details on Invoices (only one account can be set to "Fall Back Default").') . '</span> + <span class="custom info"><em>' . _('Information') . '</em>' . _('Set Default for Invoices to "Currency Default" or "Fallback Default" to print Account details on Invoices (only one account can be set to "Fall Back Default").') . '</span> <select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ @@ -387,16 +377,21 @@ <option value="1">'._('Fall Back Default').'</option>'; } }//end while loop + + echo '</select></a></td>'; + + echo '</tr></table> + <div class="centre"><button tabindex="7" type="submit" name="submit">'. _('Update Information') .'</button></div>'; } else { echo '<option value="1">'._('Fall Back Default').'</option> <option value="2">'._('Currency Default') . '</option> <option value="0">'._('No').'</option>'; -} -echo '</select></a></td>'; + echo '</select></a></td>'; -echo '</tr></table> - <div class="centre"><button tabindex="7" type="submit" name="submit">'. _('Enter Information') .'</button></div>'; + echo '</tr></table> + <div class="centre"><button tabindex="7" type="submit" name="submit">'. _('Enter Information') .'</button></div>'; +} echo '</form>'; include('includes/footer.inc'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |