|
From: <dai...@us...> - 2011-04-28 10:39:34
|
Revision: 4557
http://web-erp.svn.sourceforge.net/web-erp/?rev=4557&view=rev
Author: daintree
Date: 2011-04-28 10:39:25 +0000 (Thu, 28 Apr 2011)
Log Message:
-----------
quoting
Modified Paths:
--------------
trunk/AccountGroups.php
trunk/Credit_Invoice.php
trunk/FixedAssetItems.php
trunk/GLTags.php
trunk/PDFBankingSummary.php
trunk/PDFChequeListing.php
trunk/PDFOrderStatus.php
trunk/Payments.php
trunk/Suppliers.php
trunk/UpgradeDatabase.php
trunk/WWW_Access.php
trunk/WorkOrderEntry.php
trunk/doc/Change.log.html
trunk/includes/ConnectDB.inc
trunk/includes/ConnectDB_mysql.inc
trunk/includes/ConnectDB_mysqli.inc
trunk/includes/Login.php
trunk/includes/MiscFunctions.php
Added Paths:
-----------
trunk/SecurityTokens.php
trunk/sql/mysql/upgrade4.03-4.04.sql
Modified: trunk/AccountGroups.php
===================================================================
--- trunk/AccountGroups.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/AccountGroups.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -1,9 +1,7 @@
<?php
-/* $Revision: 1.23 $ */
+
/* $Id$*/
-//$PageSecurity = 10;
-
include('includes/session.inc');
$title = _('Account Groups');
@@ -227,12 +225,12 @@
echo '<table class="selection">
<tr>
- <th>' . _('Group Name') . "</th>
- <th>" . _('Section') . "</th>
- <th>" . _('Sequence In TB') . "</th>
- <th>" . _('Profit and Loss') . "</th>
- <th>" . _('Parent Group') . "</th>
- </tr>";
+ <th>' . _('Group Name') . '</th>
+ <th>' . _('Section') . '</th>
+ <th>' . _('Sequence In TB') . '</th>
+ <th>' . _('Profit and Loss') . '</th>
+ <th>' . _('Parent Group') . '</th>
+ </tr>';
$k=0; //row colour counter
while ($myrow = DB_fetch_row($result)) {
@@ -262,8 +260,8 @@
<td>' . $myrow[2] . '</td>
<td>' . $PandLText . '</td>
<td>' . $myrow[4] . '</td>';
- echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>';
- echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>';
+ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>';
+ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>';
} //END WHILE LIST LOOP
echo '</table>';
@@ -271,12 +269,12 @@
if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) {
- echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'">' . _('Review Account Groups') . '</a></div>';
+ echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Account Groups') . '</a></div>';
}
if (! isset($_GET['delete'])) {
- echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">';
+ echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
@@ -339,13 +337,12 @@
<input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>';
}
echo '<tr><td>' . _('Parent Group') . ':' . '</td>
- <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) .
- ' name="ParentGroupName">';
+ <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">';
- $sql = 'SELECT groupname FROM accountgroups';
+ $sql = "SELECT groupname FROM accountgroups";
$groupresult = DB_query($sql, $db,$ErrMsg,$DbgMsg);
if (!isset($_POST['ParentGroupName'])){
- echo '<option selected="selected" value="">' ._('Top Level Group').'</option>';
+ echo '<option selected value="">' ._('Top Level Group').'</option>';
} else {
echo '<option value="">' ._('Top Level Group').'</option>';
}
Modified: trunk/Credit_Invoice.php
===================================================================
--- trunk/Credit_Invoice.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/Credit_Invoice.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -1,8 +1,6 @@
<?php
/* $Id$*/
-//$PageSecurity =3;
-
/*Functions to get the GL codes to post the transaction to */
include('includes/GetSalesTransGLCodes.inc');
/*defines the structure of the data required to hold the transaction as a session variable */
@@ -398,8 +396,8 @@
<td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td>
<td class=number>' . number_format($_SESSION['Old_FreightCost'],2) . '</td>
<td></td>
- <td colspan=2 class=number>' . _('Credit Freight Cost') . "</td>
- <td><input tabindex=".$j." type=text class=number size=6 maxlength=6 name='ChargeFreightCost' value=" . $_SESSION['CreditItems']->FreightCost . "></td>";
+ <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td>
+ <td><input tabindex='.$j.' type=text class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>';
echo '<td>';
echo '</td><td>';
@@ -422,7 +420,7 @@
}
if (!isset($_POST['ProcessCredit'])) {
- echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>';
+ echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>';
}
if ($FreightTaxLine->TaxOnTax ==1){
$TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal));
@@ -437,8 +435,8 @@
if (!isset($_POST['ProcessCredit'])) {
echo '</td>';
- echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td>
- <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td>
+ echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td>
+ <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td>
</tr>';
}
@@ -447,12 +445,12 @@
if (!isset($_POST['ProcessCredit'])) {
echo '<tr>
- <td colspan=7 class=number>' . _('Credit Totals') . "</td>
- <td class=number><hr><b>$DisplayTotal</b><hr></td>
+ <td colspan=7 class=number>' . _('Credit Totals') . '</td>
+ <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td>
<td colspan=2></td>
- <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td>
- <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td>
- </tr></table>";
+ <td class=number><hr><b>' . number_format($TaxTotal,2) . '<hr></td>
+ <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td>
+ </tr></table>';
}
$DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']);
@@ -493,12 +491,11 @@
/*Start an SQL transaction */
- $SQL = 'BEGIN';
- $Result = DB_query($SQL,$db);
+
+ $Result = DB_Txn_Begin($db);
$DefaultDispatchDate= FormatDateForSQL($DefaultDispatchDate);
-
/*Calculate the allocation and see if it is possible to allocate to the invoice being credited */
$SQL = "SELECT (ovamount+ovgst+ovfreight-ovdiscount-alloc) as baltoallocate
@@ -822,7 +819,7 @@
/* Insert stock movements for the stock coming back in - with unit cost */
- if ($MBFlag=="M" OR $MBFlag=="B"){
+ if ($MBFlag=='M' OR $MBFlag=='B'){
$SQL = "INSERT INTO stockmoves (
stockid,
type,
@@ -1437,8 +1434,7 @@
}
} /*end of if Sales and GL integrated */
- $SQL='COMMIT';
- $Result = DB_query($SQL,$db);
+ $Result = DB_Txn_Commit($db);
unset($_SESSION['CreditItems']->LineItems);
unset($_SESSION['CreditItems']);
Modified: trunk/FixedAssetItems.php
===================================================================
--- trunk/FixedAssetItems.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/FixedAssetItems.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -50,7 +50,7 @@
if ($UploadTheFile=='Yes'){
$result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename);
- $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file');
+ $message = ($result)?_('File url') .'<a href="' . $filename .'">' . $filename . '</a>' : _('Something is wrong with uploading a file');
}
/* EOR Add Image upload for New Item - by Ori */
}
@@ -262,10 +262,6 @@
prnMsg( _('The new asset has been added to the database with an asset code of:') . ' ' . $NewAssetID,'success');
unset($_POST['LongDescription']);
unset($_POST['Description']);
-// unset($_POST['AssetCategoryID']);
-// unset($_POST['AssetLocation']);
-// unset($_POST['DepnType']);
-// unset($_POST['DepnRate']);
unset($_POST['BarCode']);
unset($_POST['SerialNo']);
}//ALL WORKED SO RESET THE FORM VARIABLES
@@ -374,8 +370,8 @@
} /* end if delete asset */
$result = DB_Txn_Commit($db);
-echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID .
- '"><table class=selection>';
+echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '">
+ <table class=selection>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
@@ -452,7 +448,7 @@
echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>';
if (function_exists('imagecreatefromjpg')){
- $StockImgLink = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'.
+ $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'.
'&AssetID='.urlencode($AssetID).
'&text='.
'&width=64'.
Modified: trunk/GLTags.php
===================================================================
--- trunk/GLTags.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/GLTags.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -1,7 +1,7 @@
<?php
/* $Id$*/
-//$PageSecurity = 10;
+
include('includes/session.inc');
$title = _('Maintain General Ledger Tags');
@@ -19,13 +19,13 @@
}
if (isset($_POST['submit'])) {
- $sql = "insert into tags values(NULL, '".$_POST['description']."')";
+ $sql = "INSERT INTO tags values(NULL, '".$_POST['description']."')";
$result= DB_query($sql,$db);
}
if (isset($_POST['update'])) {
- $sql = "update tags set tagdescription='".$_POST['description'].
- "' where tagref='".$_POST['reference']."'";
+ $sql = "UPDATE tags SET tagdescription='".$_POST['description'].
+ "' WHERE tagref='".$_POST['reference']."'";
$result= DB_query($sql,$db);
}
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' .
@@ -41,9 +41,9 @@
<input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">';
if (isset($_GET['Action']) and $_GET['Action']=='edit') {
- echo '<input type=Submit name=update value=' . _('Update') . '>';
+ echo '<input type="submit" name=update value=' . _('Update') . '>';
} else {
- echo '<input type=Submit name=submit value=' . _('Insert') . '>';
+ echo '<input type="submit" name=submit value=' . _('Insert') . '>';
}
echo '</td></tr></table><p></p>';
@@ -58,13 +58,13 @@
$result= DB_query($sql,$db);
while ($myrow = DB_fetch_array($result,$db)){
- echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' .
- $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>';
+ echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td>
+ <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>';
}
echo '</table><p></p>';
-echo "<script>defaultControl(document.form.description);</script>";
+echo '<script>defaultControl(document.form.description);</script>';
include('includes/footer.inc');
Modified: trunk/PDFBankingSummary.php
===================================================================
--- trunk/PDFBankingSummary.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/PDFBankingSummary.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -16,15 +16,16 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' .
$title . '" alt="" />' . ' ' . $title . '</p>';
- $sql='SELECT DISTINCT
+ $sql="SELECT DISTINCT
transno,
transdate
FROM banktrans
WHERE type=12
- ORDER BY transno DESC';
+ ORDER BY transno DESC";
$result=DB_query($sql, $db);
- echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class=selection>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
+ <table class=selection>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>';
echo '<td><select name="BatchNo">';
@@ -165,7 +166,7 @@
$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left');
- $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN
+ $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');
$pdf->__destruct();
}
Modified: trunk/PDFChequeListing.php
===================================================================
--- trunk/PDFChequeListing.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/PDFChequeListing.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -31,6 +31,7 @@
}
echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
+
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class=selection>
<tr>
Modified: trunk/PDFOrderStatus.php
===================================================================
--- trunk/PDFOrderStatus.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/PDFOrderStatus.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -27,12 +27,11 @@
prnMsg($msg,'error');
}
- echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' '
- . _('Order Status Report') . '</p>';
+ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Order Status Report') . '</p>';
echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class=selection>
+ echo '<table class="selection">
<tr>
<td>' . _('Enter the date from which orders are to be listed') . ':</td>
<td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td>
@@ -54,7 +53,7 @@
echo '</select></td></tr>';
echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">';
- echo '<option selected value="All">' . _('All Locations');
+ echo '<option selected value="All">' . _('All Locations') . '</option>';
$result= DB_query("SELECT loccode, locationname FROM locations",$db);
while ($myrow=DB_fetch_array($result)){
@@ -242,9 +241,9 @@
if (DB_error_no($db)!=0){
include('includes/header.inc');
- echo '<br>' . _('An error occurred getting the orders details');
+ echo '<br />' . _('An error occurred getting the orders details');
if ($debug==1){
- echo '<br>' . _('The SQL used to get the orders that failed was') . '<br>' . $sql;
+ echo '<br />' . _('The SQL used to get the orders that failed was') . '<br />' . $sql;
}
include ('includes/footer.inc');
exit;
@@ -341,6 +340,6 @@
$OrderNo=0;
} /*end of new page header */
} /* end of while there are delivery differences to print */
-$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN
-$pdf->__destruct(); //UldisN
+$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');
+$pdf->__destruct();
?>
\ No newline at end of file
Modified: trunk/Payments.php
===================================================================
--- trunk/Payments.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/Payments.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -723,18 +723,19 @@
echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail']->DatePaid . '</font></th></tr>';
-$SQL = 'SELECT bankaccountname,
+$SQL = "SELECT bankaccountname,
bankaccounts.accountcode,
bankaccounts.currcode
FROM bankaccounts,
chartmaster
- WHERE bankaccounts.accountcode=chartmaster.accountcode';
+ WHERE bankaccounts.accountcode=chartmaster.accountcode";
$ErrMsg = _('The bank accounts could not be retrieved because');
$DbgMsg = _('The SQL used to retrieve the bank accounts was');
$AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg);
-echo '<tr><td>' . _('Bank Account') . ':</td><td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">';
+echo '<tr><td>' . _('Bank Account') . ':</td>
+ <td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">';
if (DB_num_rows($AccountsResults)==0){
echo '</select></td></tr></table><p>';
@@ -746,9 +747,9 @@
while ($myrow=DB_fetch_array($AccountsResults)){
/*list the bank account names */
if (isset($_POST['BankAccount']) and $_POST['BankAccount']==$myrow['accountcode']){
- echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'];
+ echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>';
} else {
- echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'];
+ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>';
}
}
echo '</select></td></tr>';
@@ -762,7 +763,7 @@
if ($_SESSION['PaymentDetail']->SupplierID==''){
echo '<tr><td>' . _('Currency of Payment') . ':</td><td><select name="Currency" onChange="ReloadForm(UpdateHeader)">';
- $SQL = 'SELECT currency, currabrev, rate FROM currencies';
+ $SQL = "SELECT currency, currabrev, rate FROM currencies";
$result=DB_query($SQL,$db);
if (DB_num_rows($result)==0){
@@ -771,9 +772,9 @@
} else {
while ($myrow=DB_fetch_array($result)){
if ($_SESSION['PaymentDetail']->Currency==$myrow['currabrev']){
- echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'];
+ echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
} else {
- echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'];
+ echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
}
}
echo '</select></td><td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td></tr>';
@@ -822,10 +823,12 @@
if ($_POST['FunctionalExRate']==1 AND isset($SuggestedFunctionalExRate)){
$_POST['FunctionalExRate'] = $SuggestedFunctionalExRate;
}
- echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td>
+ echo '<tr><td>' . _('Functional Exchange Rate') . ':</td>
+ <td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td>
<td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>';
}
-echo '<tr><td>' . _('Payment type') . ':</td><td><select name="Paymenttype">';
+echo '<tr><td>' . _('Payment type') . ':</td>
+ <td><select name="Paymenttype">';
include('includes/GetPaymentMethods.php');
/* The array Payttypes is set up in includes/GetPaymentMethods.php
@@ -834,9 +837,9 @@
foreach ($PaytTypes as $PaytType) {
if (isset($_POST['Paymenttype']) and $_POST['Paymenttype']==$PaytType){
- echo '<option selected value="' . $PaytType . '">' . $PaytType;
+ echo '<option selected value="' . $PaytType . '">' . $PaytType . '</option>';
} else {
- echo '<option Value="' . $PaytType . '">' . $PaytType;
+ echo '<option Value="' . $PaytType . '">' . $PaytType . '</option>';
}
} //end foreach
echo '</select></td></tr>';
@@ -853,7 +856,7 @@
}
echo '<tr><td>' . _('Reference / Narrative') . ':</td>
- <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>';
+ <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>';
echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>';
@@ -894,13 +897,46 @@
echo '<tr><td>' . _('Enter GL Account Manually') . ':</td>
<td><input type=Text class="number" Name="GLManualCode" Maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>';
}
- echo '<tr><td>' . _('Select GL Account') . ':</td>
- <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">';
+
+ echo '<tr><td>' . _('Select GL Group') . ':</td>
+ <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">';
- $SQL = 'SELECT accountcode,
+ $SQL = "SELECT groupname
+ FROM accountgroups
+ ORDER BY sequenceintb";
+
+ $result=DB_query($SQL,$db);
+ if (DB_num_rows($result)==0){
+ echo '</select></td></tr>';
+ prnMsg(_('No General ledger account groups have been set up yet') . ' - ' . _('payments cannot be analysed against GL accounts until the GL accounts are set up'),'error');
+ } else {
+ echo '<option value=""></option>';
+ while ($myrow=DB_fetch_array($result)){
+ if (isset($_POST['GLGroup']) and ($_POST['GLGroup']==$myrow['groupname'])){
+ echo '<option selected value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>';
+ } else {
+ echo '<option value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>';
+ }
+ }
+ echo '</select><input type="submit" name="UpdateCodes" value="Select" /></td></tr>';
+ }
+
+ if (isset($_POST['GLGroup']) and $_POST['GLGroup']!='') {
+ $SQL = "SELECT accountcode,
accountname
FROM chartmaster
- ORDER BY accountcode';
+ WHERE group_='".$_POST['GLGroup']."'
+ ORDER BY accountcode";
+ } else {
+ $SQL = "SELECT accountcode,
+ accountname
+ FROM chartmaster
+ ORDER BY accountcode";
+ }
+
+
+ echo '<tr><td>' . _('Select GL Account') . ':</td>
+ <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">';
$result=DB_query($SQL,$db);
if (DB_num_rows($result)==0){
@@ -909,40 +945,47 @@
} else {
echo '<option value=""></option>';
while ($myrow=DB_fetch_array($result)){
- if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow["accountcode"]){
- echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'];
+ if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow['accountcode']){
+ echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>';
} else {
- echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'];
+ echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>';
}
}
echo '</select></td></tr>';
}
- echo '<tr><td>'. _('Cheque/Voucher Number') .'</td><td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>';
+ echo '<tr><td>'. _('Cheque/Voucher Number') .'</td>
+ <td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>';
if (isset($_POST['GLNarrative'])) {
- echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>';
+ echo '<tr><td>' . _('GL Narrative') . ':</td>
+ <td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>';
} else {
- echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>';
+ echo '<tr><td>' . _('GL Narrative') . ':</td>
+ <td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>';
}
if (isset($_POST['GLAmount'])) {
- echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>';
+ echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td>
+ <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>';
} else {
- echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>';
+ echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td>
+ <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>';
}
echo '</table><br />';
echo '<div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>';
if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) {
- echo '<br /><table class=selection><tr>
- <th>' . _('Cheque No').'</th>
- <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th>
- <th>' . _('GL Account') . '</th>
- <th>' . _('Narrative') . '</th>
- <th>' . _('Tag') . '</th>
- </tr>';
+ echo '<br />
+ <table class=selection>
+ <tr>
+ <th>' . _('Cheque No').'</th>
+ <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th>
+ <th>' . _('GL Account') . '</th>
+ <th>' . _('Narrative') . '</th>
+ <th>' . _('Tag') . '</th>
+ </tr>';
$PaymentTotal = 0;
foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) {
Added: trunk/SecurityTokens.php
===================================================================
--- trunk/SecurityTokens.php (rev 0)
+++ trunk/SecurityTokens.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -0,0 +1,86 @@
+<?php
+
+/* $Id$*/
+//$PageSecurity = 10;
+include('includes/session.inc');
+$title = _('Maintain Security Tokens');
+
+include('includes/header.inc');
+
+if (isset($_GET['SelectedToken'])) {
+ $sql="SELECT tokenid, tokenname FROM securitytokens where tokenid='".$_GET['SelectedToken']."'";
+ $result= DB_query($sql,$db);
+ $myrow = DB_fetch_array($result,$db);
+ $ref=$myrow[0];
+ $description=$myrow[1];
+} else if (!isset($_POST['TokenID'])){
+ $description='';
+ $_POST['TokenID']='';
+ $_GET['SelectedToken']='';
+} else {
+ $description=$_POST['Description'];
+}
+
+if (isset($_POST['submit'])) {
+ $TestSQL="SELECT tokenid FROM securitytokens WHERE tokenid='".$_POST['TokenID']."'";
+ $TestResult=DB_query($TestSQL, $db);
+ if (DB_num_rows($TestResult)==0) {
+ $sql = "INSERT INTO securitytokens values('".$_POST['TokenID']."', '".$_POST['Description']."')";
+ $result= DB_query($sql,$db);
+ unset($description);
+ unset($_POST['TokenID']);
+ } else {
+ prnMsg( _('This token ID has already been used. Please use a new one') , 'warn');
+ }
+}
+
+if (isset($_POST['update'])) {
+ $sql = "UPDATE securitytokens SET tokenname='".$_POST['Description'].
+ "' WHERE tokenid='".$_POST['TokenID']."'";
+ $result= DB_query($sql,$db);
+ unset($description);
+ unset($_POST['TokenID']);
+}
+echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' .
+ _('Print') . '" alt="" />' . ' ' . $title . '</p>';
+
+echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">';
+echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+echo '<br><table><tr>';
+
+
+
+if (isset($_GET['Action']) and $_GET['Action']=='edit') {
+ echo '<td>'. _('Description') . '</td>
+ <td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td>
+ <input type="hidden" name="TokenID" value="'.$_GET['SelectedToken'].'">';
+ echo '<input type=Submit name=update value=' . _('Update') . '>';
+} else {
+ echo '<td>'._('Token ID') . '<td><input type="text" name="TokenID" value="'.$_POST['TokenID'].'"></td></tr>
+ <tr><td>'. _('Description') . '</td><td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td>';
+ echo '<input type=Submit name=submit value=' . _('Insert') . '>';
+}
+
+echo '</td></tr></table><p></p>';
+
+echo '</form>';
+
+echo '<table class=selection>';
+echo '<tr><th>'. _('Token ID') .'</th>';
+echo '<th>'. _('Description'). '</th>';
+
+$sql="SELECT tokenid, tokenname FROM securitytokens ORDER BY tokenid";
+$result= DB_query($sql,$db);
+
+while ($myrow = DB_fetch_array($result,$db)){
+ echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' .
+ $_SERVER['PHP_SELF'] . '?SelectedToken=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>';
+}
+
+echo '</table><p></p>';
+
+echo "<script>defaultControl(document.form.description);</script>";
+
+include('includes/footer.inc');
+
+?>
\ No newline at end of file
Modified: trunk/Suppliers.php
===================================================================
--- trunk/Suppliers.php 2011-04-26 11:03:36 UTC (rev 4556)
+++ trunk/Suppliers.php 2011-04-28 10:39:25 UTC (rev 4557)
@@ -2,8 +2,6 @@
/* $Id$ */
-//$PageSecurity = 5;
-
include('includes/session.inc');
$title = _('Supplier Maintenance');
@@ -137,7 +135,7 @@
break;
default:
- echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br>' .
+ echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br />' .
_('If you are using webERP outside New Zealand error trapping relevant to your country should be used');
return False;
exit;
@@ -301,8 +299,6 @@
unset($SupplierID);
}
-// This is aleady linked from this page
-//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>';
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Suppliers') . '</p>';
$InputError = 0;
@@ -426,7 +422,7 @@
$longitude = $coordinatesSplit[0];
$status = $xml->Response->Status->code;
- if (strcmp($status, "200") == 0) {
+ if (strcmp($status, '200') == 0) {
// Successful geocode
$geocode_pending = false;
$coordinates = $xml->Response->Placemark->Point->coordinates;
@@ -437,22 +433,22 @@
} else {
// failure to geocode
$geocode_pending = false;
- echo '<p>Address: ' . $address . ' failed to geocode'."\n";
- echo 'Received status ' . $status . "\n" . '</p>';
+ echo '<p>' . _('Address') . ': ' . $address . ' ' . _('failed to geocode') ."\n";
+ echo _('Received status') . ' ' . $status . "\n" . '</p>';
}
}
}
if (!isset($_POST['New'])) {
$supptranssql = "SELECT supplierno
- FROM supptrans
- WHERE supplierno='".$SupplierID ."'";
+ FROM supptrans
+ WHERE supplierno='".$SupplierID ."'";
$suppresult = DB_query($supptranssql, $db);
$supptrans = DB_num_rows($suppresult);
$suppcurrssql = "SELECT currcode
- FROM suppliers
- WHERE supplierid='".$SupplierID ."'";
+ FROM suppliers
+ WHERE supplierid='".$SupplierID ."'";
$currresult = DB_query($suppcurrssql, $db);
$suppcurr = DB_fetch_row($currresult);
@@ -516,49 +512,49 @@
} else { //its a new supplier
$sql = "INSERT INTO suppliers (supplierid,
- suppname,
- address1,
- address2,
- address3,
- address4,
- telephone,
- fax,
- email,
- supptype,
- currcode,
- suppliersince,
- paymentterms,
- bankpartics,
- bankref,
- bankact,
- remittance,
- taxgroupid,
- factorcompanyid,
- lat,
- lng,
- taxref)
- VALUES ('$SupplierID',
- '" . $_POST['SuppName'] . "',
- '" . $_POST['Address1'] . "',
- '" . $_POST['Address2'] . "',
- '" . $_POST['Address3'] . "',
- '" . $_POST['Address4'] . "',
- '".$_POST['Phone']."',
- '".$_POST['Fax']."',
- '".$_POST['Email']."',
- '".$_POST['SupplierType']."',
- '" . $_POST['CurrCode'] . "',
- '" . $SQL_SupplierSince . "',
- '" . $_POST['PaymentTerms'] . "',
- '" . $_POST['BankPartics'] . "',
- '" . $_POST['BankRef'] . "',
- '" . $_POST['BankAct'] . "',
- '" . $_POST['Remittance'] . "',
- '" . $_POST['TaxGroup'] . "',
- '" . $_POST['FactorID'] . "',
- '" . $latitude ."',
- '" . $longitude ."',
- '" . $_POST['TaxRef'] . "')";
+ suppname,
+ address1,
+ address2,
+ address3,
+ address4,
+ telephone,
+ fax,
+ email,
+ supptype,
+ currcode,
+ suppliersince,
+ paymentterms,
+ bankpartics,
+ bankref,
+ bankact,
+ remittance,
+ taxgroupid,
+ factorcompanyid,
+ lat,
+ lng,
+ taxref)
+ VALUES ('$SupplierID',
+ '" . $_POST['SuppName'] . "',
+ '" . $_POST['Address1'] . "',
+ '" . $_POST['Address2'] . "',
+ '" . $_POST['Address3'] . "',
+ '" . $_POST['Address4'] . "',
+ '".$_POST['Phone']."',
+ '".$_POST['Fax']."',
+ '".$_POST['Email']."',
+ '".$_POST['SupplierType']."',
+ '" . $_POST['CurrCode'] . "',
+ '" . $SQL_SupplierSince . "',
+ '" . $_POST['PaymentTerms'] . "',
+ '" . $_POST['BankPartics'] . "',
+ '" . $_POST['BankRef'] . "',
+ '" . $_POST['BankAct'] . "',
+ '" . $_POST['Remittance'] . "',
+ '" . $_POST['TaxGroup'] . "',
+ '" . $_POST['FactorID'] . "',
+ '" . $latitude ."',
+ '" . $longitude ."',
+ '" . $_POST['TaxRef'] . "')";
$ErrMsg = _('The supplier') . ' ' . $_POST['SuppName'] . ' ' . _('could not be added because');
$DbgMsg = _('The SQL that was used to insert the supplier but failed was');
@@ -610,7 +606,7 @@
if ($myrow[0] > 0) {
$CancelDelete = 1;
prnMsg(_('Cannot delete this supplier because there are transactions that refer to this supplier'),'warn');
- echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier');
+ echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier');
} else {
$sql= "SELECT COUNT(*) FROM purchorders WHERE supplierno='" . $SupplierID . "'";
@@ -619,7 +615,7 @@
if ($myrow[0] > 0) {
$CancelDelete = 1;
prnMsg(_('Cannot delete the supplier record because purchase orders have been created against this supplier'),'warn');
- echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier');
+ echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier');
} else {
$sql= "SELECT COUNT(*) FROM suppliercontacts WHERE supplierid='" . $SupplierID . "'";
$result = DB_query($sql, $db);
@@ -627,7 +623,7 @@
if ($myrow[0] > 0) {
$CancelDelete = 1;
prnMsg(_('Cannot delete this supplier because there are supplier contacts set up against it') . ' - ' . _('delete these first'),'warn');
- echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier');
+ echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier');
}
}
@@ -647,105 +643,140 @@
/*If the page was called without $SupplierID passed to page then assume a new supplier is to be entered show a form with a Supplier Code field other wise the form showing the fields with the existing entries against the supplier will show for editing with only a hidden SupplierID field*/
- echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>";
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo "<input type='hidden' name='New' VALUE='Yes'>";
+ echo '<input type="hidden" name="New" value="Yes">';
echo '<table class=selection>';
- echo '<tr><td>' . _('Supplier Code') . ":</td><td><input type='text' name='SupplierID' size=11 maxlength=10></td></tr>";
- echo '<tr><td>' . _('Supplier Name') . ":</td><td><input type='text' name='SuppName' size=42 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Address Line 1 (Street)') . ":</td><td><input type='text' name='Address1' size=42 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ":</td><td><input type='text' name='Address2' size=42 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Address Line 3 (State/Province)') . ":</td><td><input type='text' name='Address3' size=42 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ":</td><td><input type='text' name='Address4' size=42 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Telephone') . ":</td><td><input type='text' name='Phone' size=30 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Facsimile') . ":</td><td><input type='text' name='Fax' size=30 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Email Address') . ":</td><td><input type='text' name='Email' size=30 maxlength=40></td></tr>";
- echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>";
- $result=DB_query('SELECT typeid, typename FROM suppliertype', $db);
+ echo '<tr><td>' . _('Supplier Code') . ':</td>
+ <td><input type="text" name="SupplierID" size=11 maxlength=10></td>
+ </tr>';
+ echo '<tr><td>' . _('Supplier Name') . ':</td>
+ <td><input type="text" name="SuppName" size=42 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td>
+ <td><input type="text" name="Address1" size=42 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td>
+ <td><input type="text" name="Address2" size=42 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td>
+ <td><input type="text" name="Address3" size=42 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td>
+ <td><input type="text" name="Address4" size=42 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Telephone') . ':</td>
+ <td><input type="text" name="Phone" size=30 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Facsimile') . ':</td>
+ <td><input type="text" name="Fax" size=30 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Email Address') . ':</td>
+ <td><input type="text" name="Email" size=30 maxlength=40></td>
+ </tr>';
+ echo '<tr><td>' . _('Supplier Type') . ':</td>
+ <td><select name="SupplierType">';
+ $result=DB_query("SELECT typeid, typename FROM suppliertype", $db);
while ($myrow = DB_fetch_array($result)) {
- echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename'];
+ echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>';
} //end while loop
- echo "</select></td></tr>";
+ echo '</select></td></tr>';
$DateString = Date($_SESSION['DefaultDateFormat']);
- echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . "):</td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='SupplierSince' VALUE=$DateString size=12 maxlength=10></td></tr>";
- echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12></td></tr>";
- echo '<tr><td>' . _('Bank reference') . ":</td><td><input type='text' name='BankRef' VALUE=0 size=13 maxlength=12></td></tr>";
- echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30></td></tr>";
+ echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
+ <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="SupplierSince" value="' . $DateString . '" size=12 maxlength=10></td>
+ </tr>';
+ echo '<tr><td>' . _('Bank Particulars') . ':</td>
+ <td><input type="text" name="BankPartics" size=13 maxlength=12></td>
+ </tr>';
+ echo '<tr><td>' . _('Bank reference') . ':</td>
+ <td><input type="text" name="BankRef" value=0 size=13 maxlength=12></td>
+ </tr>';
+ echo '<tr><td>' . _('Bank Account No') . ':</td>
+ <td><input type="text" name="BankAct" size=31 maxlength=30></td></tr>';
- $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db);
+ $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db);
- echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>";
+ echo '<tr><td>' . _('Payment Terms') . ':</td>
+ <td><select name="PaymentTerms">';
while ($myrow = DB_fetch_array($result)) {
- echo "<option VALUE='". $myrow['termsindicator'] . "'>" . $myrow['terms'];
+ echo '<option value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] .'</option>';
} //end while loop
DB_data_seek($result, 0);
echo '</select></td></tr>';
- $result=DB_query('SELECT id, coyname FROM factorcompanies', $db);
+ $result=DB_query("SELECT id, coyname FROM factorcompanies", $db);
- echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>";
- echo '<option VALUE=0>' . _('None');
+ echo '<tr><td>' . _('Factor Company') . ':</td>
+ <td><select name="FactorID">';
+ echo '<option value=0>' . _('None');
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['FactorID']) and $_POST['FactorID'] == $myrow['id']){
- echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname'];
+ echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>';
} else {
- echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname'];
+ echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>';
}
} //end while loop
DB_data_seek($result, 0);
echo '</select></td></tr>';
- echo '<tr><td>' . _('Tax Reference') . ':</td><td><input type="text" name=2TaxRef" size=21 maxlength=20></td></tr>';
+ echo '<tr><td>' . _('Tax Reference') . ':</td>
+ <td><input type="text" name="TaxRef" size=21 maxlength=20></td></tr>';
- $result=DB_query('SELECT currency, currabrev FROM currencies', $db);
+ $result=DB_query("SELECT currency, currabrev FROM currencies", $db);
if (!isset($_POST['CurrCode'])){
- $CurrResult = DB_query('SELECT currencydefault FROM companies WHERE coycode=1', $db);
+ $CurrResult = DB_query("SELECT currencydefault FROM companies WHERE coycode=1", $db);
$myrow = DB_fetch_row($CurrResult);
$_POST['CurrCode'] = $myrow[0];
}
- echo '<tr><td>' . _('Supplier Currency') . ':</td><td><select name="CurrCode">';
+ echo '<tr><td>' . _('Supplier Currency') . ':</td>
+ <td><select name="CurrCode">';
while ($myrow = DB_fetch_array($result)) {
if ($_POST['CurrCode'] == $myrow['currabrev']){
- echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
+ echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
} else {
- echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
+ echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>';
}
} //end while loop
DB_data_seek($result, 0);
- echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ':</td><td><select name="Remittance">';
- echo '<option VALUE=0>' . _('Not Required') . '</option>';
- echo '<option VALUE=1>' . _('Required') . '</option>';
+ echo '</select></td></tr>
+ <tr><td>' . _('Remittance Advice') . ':</td>
+ <td><select name="Remittance">';
+ echo '<option value=0>' . _('Not Required') . '</option>';
+ echo '<option value=1>' . _('Required') . '</option>';
echo '</select></td></tr>';
- echo '<tr><td>' . _('Tax Group') . ':</td><td><select name="TaxGroup">';
+ echo '<tr><td>' . _('Tax Group') . ':</td>
+ <td><select name="TaxGroup">';
DB_data_seek($result, 0);
- $sql = 'SELECT taxgroupid, taxgroupdescription FROM taxgroups';
+ $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups";
$result = DB_query($sql, $db);
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['TaxGroup']) and $_POST['TaxGroup'] == $myrow['taxgroupid']){
- echo '<option selected VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>';
+ echo '<option selected value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>';
} else {
- echo '<option VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>';
+ echo '<option value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>';
}
} //end while loop
- echo '</select></td></tr></table><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Insert New Supplier') . '">';
+ echo '</select></td></tr>
+ </table>
+ <p><div class="centre"><input type="Submit" name="submit" value="' . _('Insert New Supplier') . '">';
echo '</div></form>';
} else {
//SupplierID exists - either passed when calling the form or from the form itself
- echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>";
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class=selection>';
@@ -796,91 +827,112 @@
$_POST['FactorID'] = $myrow['factorcompanyid'];
$_POST['TaxRef'] = $myrow['taxref'];
- echo '<input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">';
+ echo '<input type=hidden name="SupplierID" value="' . $SupplierID . '">';
} else {
// its a new supplier being added
- echo '<input type=hidden name="New" VALUE="Yes">';
- echo '<tr><td>' . _('Supplier Code') . ':</td><td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" VALUE="' . $SupplierID . '" size=12 maxlength=10></td></tr>';
+ echo '<input type=hidden name="New" value="Yes">';
+ echo '<tr><td>' . _('Supplier Code') . ':</td>
+ <td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" value="' . $SupplierID . '" size=12 maxlength=10></td></tr>';
}
- echo '<tr><td>' . _('Supplier Name') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" VALUE="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td><input type="text" name="Address1" VALUE="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td><input type="text" name="Address2" VALUE="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td><input type="text" name="Address3" VALUE="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td><input type="text" name="Address4" VALUE="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Telephone') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" VALUE="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Facsimile') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" VALUE="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Email Address') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" VALUE="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>';
- echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>";
- $result=DB_query('SELECT typeid, typename FROM suppliertype', $db);
+ echo '<tr><td>' . _('Supplier Name') . ':</td>
+ <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" value="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td>
+ <td><input type="text" name="Address1" value="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td>
+ <td><input type="text" name="Address2" value="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td>
+ <td><input type="text" name="Address3" value="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td>
+ <td><input type="text" name="Address4" value="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Telephone') . ':</td>
+ <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" value="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Facsimile') . ':</td>
+ <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" value="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Email Address') . ':</td>
+ <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" value="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>';
+ echo '<tr><td>' . _('Supplier Type') . ':</td>
+ <td><select name="SupplierType">';
+ $result=DB_query("SELECT typeid, typename FROM suppliertype", $db);
while ($myrow = DB_fetch_array($result)) {
if ($_POST['SupplierType']==$myrow['typeid']) {
- echo "<option selected value='". $myrow['typeid'] . "'>" . $myrow['typename'];
+ echo '<option selected value="'. $myrow['typeid'] . '">' . $myrow['typename'] .'</option>';
} else {
- echo "<option value='". $myrow['typeid'] . "'>" . $myrow['typename'];
+ echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>';
}
} //end while loop
- echo "</select></td></tr>";
+ echo '</select></td></tr>';
- echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td><td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" VALUE=' . $_POST['SupplierSince'] . '></td></tr>';
- echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12 VALUE='" . $_POST['BankPartics'] . "'></td></tr>";
- echo '<tr><td>' . _('Bank Reference') . ':</td><td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 VALUE="' . $_POST['BankRef'] . '"></td></tr>';
- echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30 VALUE='" . $_POST['BankAct'] . "'></td></tr>";
+ echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td>
+ <td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" value=' . $_POST['SupplierSince'] . '></td></tr>';
+ echo '<tr><td>' . _('Bank Particulars') . ':</td>
+ <td><input type="text" name="BankPartics" size=13 maxlength=12 value="' . $_POST['BankPartics'] . '"></td></tr>';
+ echo '<tr><td>' . _('Bank Reference') . ':</td>
+ <td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 value="' . $_POST['BankRef'] . '"></td></tr>';
+ echo '<tr><td>' . _('Bank Account No') . ':</td>
+ <td><input type="text" name="BankAct" size=31 maxlength=30 value="' . $_POST['BankAct'] . '"></td></tr>';
- $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db);
+ $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db);
- echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>";
+ echo '<tr><td>' . _('Payment Terms') . ':</td>
+ <td><select name="PaymentTerms">';
while ($myrow = DB_fetch_array($result)) {
if ($_POST['PaymentTerms'] == $myrow['termsindicator']){
- echo '<option selected VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms'];
+ echo '<option selected value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>';
} else {
- echo '<option VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms'];
+ echo '<option value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>';
}
} //end while loop
DB_data_seek($result, 0);
- $result=DB_query('SELECT id, coyname FROM factorcompanies', $db);
+ $result=DB_query("SELECT id, coyname FROM factorcompanies", $db);
- echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>";
- echo '<option VALUE=0>' . _('None');
+ echo '<tr><td>' . _('Factor Company') . ':</td>
+ <td><select name="FactorID">';
+ echo '<option value=0>' . _('None');
while ($myrow = DB_fetch_array($result)) {
if ($_POST['FactorID'] == $myrow['id']){
- echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname'];
+ echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>';
} else {
- echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname'];
+ echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>';
}
} //end while loop
DB_data_seek($result, 0);
- echo '<tr><td>' . _('Tax Reference') . ":</td><td><input type='text' name='TaxRef' size=21 maxlength=20 VALUE='".$_POST['TaxRef']."'></td></tr>";
+ echo '<tr><td>' . _('Tax Reference') . ':</td>
+ <td><input type="text" name="TaxRef" size=21 maxlength=20 value="' . $_POST['TaxRef'] .'"></td></tr>';
- $result=DB_query('SELECT currency, currabrev FROM currencies', $db);
+ $result=DB_query("SELECT currency, currabrev FROM currencies", $db);
- echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ":</td><td><select name='CurrCode'>";
+ echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ':</td>
+ <td><select name="CurrCode">';
while ($myrow = DB_fetch_array($result)) {
if ($_POST['CurrCode'] == $myrow['currabrev']){
- echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'];
+ echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>';
} else {
- echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'];
+ echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>';
}
} //end while loop
DB_data_seek($result, 0);
- echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ":</td><td><select name='Remittance'>";
+ echo '</select></td></tr>
+ <tr><td>' . _('Remittance Advice') . ':</td>
+ <td><select name="Remittance">';
if ($_POST['Remittance'] == 0){
- echo '<option selected VALUE=0>' . _('Not Required');
- echo '<option VALUE=1>' . _('Required');
+ echo '<option selected value=0>' . _('Not Required') .'</option>';
+ echo '<option value=1>' . _('Required') .'</option>';
} else {
- echo '<option VALUE=0>' . _('Not Required');
- echo '<option selected VALUE=1>' . _('Required');
+ echo '<option value=0>' . _('Not Required') .'</option>';
+ echo '<option selected value=1>' . _('Required') .'</option>';
}
echo '</select></td></tr>';
- echo '<tr><td>' . _('Tax Group') . ":</td><td><select name='TaxGroup'>";
+ echo '<tr><td>' . _('Tax Group') . ':</td>
+ <td><select name="TaxGroup">';
DB_data_seek($result, 0);
@@ -889,9 +941,9 @@
while ($myrow = DB_fetch_array($result)) {
if ($myrow['taxgroupid'] == $_POST['TaxGroup']) {
- echo '<option selected VALUE="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
+ echo '<option selected value="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
} else {
- echo '<option VALUE="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
+ echo '<option value="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
}
} //end while loop
@@ -899,13 +951,13 @@
echo '</select></td></tr></table>';
if (isset($_POST['New'])) {
- echo '<p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add These New Supplier Details') . '"></form>';
+ echo '<p><div class="centre"><input type="Submit" name="submit" value="' . _('Add These New Supplier Details') . '"></form>';
} else {
- echo '<br><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Supplier') . '"></div><br>';
-// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br></font></b>';
+ echo '<br /><p><div class="centre"><input type="Submit" name="submit" value="' . _('Update Supplier') . '"></div><br />';
+// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br /></font></b>';
prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn');
- echo '<br><div class=centre><input type="submit" name="delete" VALUE="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>';
- echo '<br><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>';
+ echo '<br /><div class=centre><input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>';
+ echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>';
}
echo '</div>';
} // end of main ifs
Modified: trunk/UpgradeDatabase.php
===================================================================
--- trunk/UpgradeDatabase.php 2011-04-26 11:03:36 UTC (r...
[truncated message content] |