You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prnMsg( _('The user') . '' . $_POST['SelectedUser'] . '' ._('already authorised to use this bank account'),'error');
69
70
} else {
70
71
// Add new record on submit
71
-
$sql = "INSERT INTO bankaccountusers (accountcode,
72
+
$SQL = "INSERT INTO bankaccountusers (accountcode,
72
73
userid)
73
74
VALUES ('" . $_POST['SelectedBankAccount'] . "',
74
75
'" . $_POST['SelectedUser'] . "')";
75
76
76
77
$msg = _('User') . ': ' . $_POST['SelectedUser'].''._('has been authorised to use') .''. $_POST['SelectedBankAccount'] . '' . _('bank account');
77
-
$result = DB_query($sql);
78
+
$Result = DB_query($SQL);
78
79
prnMsg($msg,'success');
79
80
unset($_POST['SelectedUser']);
80
81
}
81
82
}
82
83
} elseif ( isset($_GET['delete']) ) {
83
-
$sql="DELETE FROM bankaccountusers
84
+
$SQL="DELETE FROM bankaccountusers
84
85
WHERE accountcode='".$SelectedBankAccount."'
85
86
AND userid='".$SelectedUser."'";
86
87
87
88
$ErrMsg = _('The bank account user record could not be deleted because');
88
-
$result = DB_query($sql,$ErrMsg);
89
+
$Result = DB_query($SQL,$ErrMsg);
89
90
prnMsg(_('User').''. $SelectedUser .''. _('has been un-authorised to use').''. $SelectedBankAccount .''. _('bank account') ,'success');
90
91
unset($_GET['delete']);
91
92
}
92
93
93
-
if (!isset($SelectedBankAccount)){
94
+
if (!isset($SelectedBankAccount)){
94
95
95
96
/* It could still be the second time the page has been run and a record has been selected for modification - SelectedUser will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters
96
97
then none of the above are true. These will call the same page again and allow update/input or deletion of the records*/
@@ -102,26 +103,26 @@
102
103
<td>' . _('Select Bank Account') . ':</td>
103
104
<td><select name="SelectedBankAccount">';
104
105
105
-
$SQL = "SELECT accountcode,
106
-
bankaccountname
107
-
FROM bankaccounts";
108
-
109
-
$result = DB_query($SQL);
106
+
$SQL = "SELECT
107
+
accountcode,
108
+
bankaccountname,
109
+
currcode
110
+
FROM bankaccounts
111
+
ORDER BY accountcode";
112
+
$ErrMsg = _('The bank accounts could not be retrieved because');
113
+
$DbgMsg = _('The SQL used to retrieve the bank accounts was');
0 commit comments