From: <dai...@us...> - 2011-04-01 20:14:21
|
Revision: 4532 http://web-erp.svn.sourceforge.net/web-erp/?rev=4532&view=rev Author: daintree Date: 2011-04-01 20:14:14 +0000 (Fri, 01 Apr 2011) Log Message: ----------- More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/MRPShortages.php trunk/OffersReceived.php trunk/PDFBankingSummary.php trunk/PDFCustomerList.php trunk/PageSecurity.php trunk/Payments.php trunk/PcExpenses.php trunk/PcTabs.php Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/MRPShortages.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -6,13 +6,13 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='show tables where Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; +$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. _('To run the MRP calculation click').' '.'<a href="'.$rootpath .'/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); @@ -159,7 +159,7 @@ prnMsg( _('No MRP shortages retrieved'), 'warn'); echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -225,8 +225,8 @@ $DisplayTotalVal = number_format($Total_Shortage,2); $pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Shortages Reporting'); @@ -256,7 +256,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>'; echo "<option value='no'>" . _('Plain Print').'</option>'; echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><br /><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/OffersReceived.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 4; +/*$Id: OffersReceived.php 4500 2011-02-27 09:18:42Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Offers'); @@ -40,7 +40,7 @@ } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Select Supplier') . '" alt="" />' . ' ' . _('Select Supplier') . '</p>'; - 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>'; echo '<tr><td>'._('Select Supplier').'</td>'; @@ -81,7 +81,7 @@ ORDER BY offerid"; $result=DB_query($sql, $db); - 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 '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -153,7 +153,7 @@ $_SESSION['CompanyRecord']['coyname']."\n"; $MailText.=_('The following offers you made have been accepted')."\n"; $MailText.=_('An official order will be sent to you in due course')."\n\n"; - $sql='SELECT rate FROM currencies where currabrev="'.$CurrCode.'"'; + $sql="SELECT rate FROM currencies where currabrev='" . $CurrCode ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Rate=$myrow['rate']; @@ -226,7 +226,7 @@ $result = $mail->send(array($Email), 'smtp'); prnMsg(_('The accepted offers from').' '.$SupplierName.' '._('have been converted to purchase orders and an email sent to') .' '.$Email."\n"._('Please review the order contents').' '.'<a href="'.$rootpath . - "/PO_Header.php?" . SID . "&ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); + "/PO_Header.php?ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); } if (sizeOf($rejects)>0){ $MailText=_('This email has been automatically generated by the webERP installation at').' '. Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFBankingSummary.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,35 +24,35 @@ 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>'; + echo '<td><select name="BatchNo">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['transno'].'">'._('Batch') .' '. $myrow['transno'].' - '.ConvertSqlDate($myrow['transdate']).'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type=submit name='EnterBatchNo' VALUE='" . _('Create PDF') . "'></div></form>"; + echo '<br /><div class="centre"><input type="submit" name="EnterBatchNo" value="' . _('Create PDF') . '"></div></form>'; include ('includes/footer.inc'); exit; } if (isset($_POST['BatchNo']) and $_POST['BatchNo']!='') { - $SQL= 'SELECT bankaccountname, - bankaccountnumber, - ref, - transdate, - banktranstype, - bankact, - banktrans.exrate, - banktrans.functionalexrate, - banktrans.currcode - FROM bankaccounts, - banktrans - WHERE bankaccounts.accountcode=banktrans.bankact - AND banktrans.transno="' . $_POST['BatchNo'] . '" - AND banktrans.type=12'; + $SQL= "SELECT bankaccountname, + bankaccountnumber, + ref, + transdate, + banktranstype, + bankact, + banktrans.exrate, + banktrans.functionalexrate, + banktrans.currcode + FROM bankaccounts, + banktrans + WHERE bankaccounts.accountcode=banktrans.bankact + AND banktrans.transno='" . $_POST['BatchNo'] . "' + AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; $DbgMsg = _('The SQL used to get the receipt header information that failed was'); @@ -65,111 +62,111 @@ $title = _('Create PDF Print-out For A Batch Of Receipts'); include ('includes/header.inc'); prnMsg(_('The receipt batch number') . ' ' . $_POST['BatchNo'] . ' ' . _('was not found in the database') . '. ' . _('Please try again selecting a different batch number'), 'warn'); - include('includes/footer.inc'); - exit; -} -/* OK get the row of receipt batch header info from the BankTrans table */ -$myrow = DB_fetch_array($Result); -$ExRate = $myrow['exrate']; -$FunctionalExRate = $myrow['functionalexrate']; -$Currency = $myrow['currcode']; -$BankTransType = $myrow['banktranstype']; -$BankedDate = $myrow['transdate']; -$BankActName = $myrow['bankaccountname']; -$BankActNumber = $myrow['bankaccountnumber']; -$BankingReference = $myrow['ref']; - - -$SQL = "SELECT debtorsmaster.name, - ovamount, - invtext, - reference - FROM debtorsmaster INNER JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' - AND debtortrans.type=12"; - -$CustRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br>' . $SQL,'error'); - } - include('includes/footer.inc'); - exit; -} -$SQL = "SELECT narrative, - amount - FROM gltrans - WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' - AND gltrans.type=12 and gltrans.amount <0 - AND gltrans.account !='" . $myrow['bankact'] . "' - AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; - -$GLRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br>' . $SQL,'error'); + include('includes/footer.inc'); + exit; } - include('includes/footer.inc'); - exit; + /* OK get the row of receipt batch header info from the BankTrans table */ + $myrow = DB_fetch_array($Result); + $ExRate = $myrow['exrate']; + $FunctionalExRate = $myrow['functionalexrate']; + $Currency = $myrow['currcode']; + $BankTransType = $myrow['banktranstype']; + $BankedDate = $myrow['transdate']; + $BankActName = $myrow['bankaccountname']; + $BankActNumber = $myrow['bankaccountnumber']; + $BankingReference = $myrow['ref']; + + + $SQL = "SELECT debtorsmaster.name, + ovamount, + invtext, + reference + FROM debtorsmaster INNER JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' + AND debtortrans.type=12"; + + $CustRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br />' . $SQL,'error'); + } + include('includes/footer.inc'); + exit; + } + $SQL = "SELECT narrative, + amount + FROM gltrans + WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' + AND gltrans.type=12 and gltrans.amount <0 + AND gltrans.account !='" . $myrow['bankact'] . "' + AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; + + $GLRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br />' . $SQL,'error'); + } + include('includes/footer.inc'); + exit; + } + + + include('includes/PDFStarter.php'); + + /*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ + + $pdf->addInfo('Title',_('Banking Summary')); + $pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); + $line_height=12; + $PageNumber = 0; + $TotalBanked = 0; + + include ('includes/PDFBankingSummaryPageHeader.inc'); + + while ($myrow=DB_fetch_array($CustRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); + + $YPos -= ($line_height); + $TotalBanked -= $myrow['ovamount']; + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are customer receipts in the batch to print */ + + /* Right now print out the GL receipt entries in the batch */ + while ($myrow=DB_fetch_array($GLRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); + $YPos -= ($line_height); + $TotalBanked += (-$myrow['amount']*$ExRate); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are GL receipts in the batch to print */ + + + $YPos-=$line_height; + $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->__destruct(); } - -include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - -$pdf->addInfo('Title',_('Banking Summary')); -$pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); -$line_height=12; -$PageNumber = 0; -$TotalBanked = 0; - -include ('includes/PDFBankingSummaryPageHeader.inc'); - -while ($myrow=DB_fetch_array($CustRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); - - $YPos -= ($line_height); - $TotalBanked -= $myrow['ovamount']; - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - -/* Right now print out the GL receipt entries in the batch */ -while ($myrow=DB_fetch_array($GLRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); - $YPos -= ($line_height); - $TotalBanked += (-$myrow['amount']*$ExRate); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are GL receipts in the batch to print */ - - -$YPos-=$line_height; -$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->__destruct(); //UldisN -} - ?> \ No newline at end of file Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFCustomerList.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.13 $ */ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF'])){ @@ -359,8 +357,8 @@ } /*end if $PrintThisCustomer == true */ } /*end while loop */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); exit; } else { @@ -377,10 +375,10 @@ $sql='SELECT areacode, areadescription FROM areas'; $AreasResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Areas'); + echo '<option selected value="All">' . _('All Areas') . '</option>'; While ($myrow = DB_fetch_array($AreasResult)){ - echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription']; + echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } echo '</select></td></tr>'; @@ -398,16 +396,16 @@ echo '<tr><td>' . _('Level Of Activity'). ':</td><td><select name="Activity">'; - echo '<option selected value="All">'. _('All customers'); - echo '<option value="GreaterThan">'. _('Sales Greater Than'); - echo '<option value="LessThan">'. _('Sales Less Than'); + echo '<option selected value="All">'. _('All customers') . '</option>'; + echo '<option value="GreaterThan">'. _('Sales Greater Than') . '</option>'; + echo '<option value="LessThan">'. _('Sales Less Than') . '</option>'; echo '</select></td><td>'; echo '<input type="text" class=number name="ActivityAmount" size=8 maxlength=8 value=0></td></tr>'; $DefaultActivitySince = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-6,0,Date('y'))); - echo '<tr><td>' . _('Activity Since'). ':</td><td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 - VALUE="' . $DefaultActivitySince . '"></td></tr>'; + echo '<tr><td>' . _('Activity Since'). ':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 value="' . $DefaultActivitySince . '"></td></tr>'; echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>'; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PageSecurity.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,5 +1,7 @@ <?php +/*$Id: PageSecurity.php 4500 2011-02-27 09:18:42Z daintree $ */ + include('includes/session.inc'); $title = _('Page Security Levels'); @@ -19,20 +21,20 @@ } $sql='SELECT script, - pagesecurity, - description - FROM scripts'; + pagesecurity, + description + FROM scripts'; $result=DB_query($sql, $db); -echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; -$TokenSql="SELECT tokenid, +$TokenSql='SELECT tokenid, tokenname - FROM securitytokens"; + FROM securitytokens'; $TokenResult=DB_query($TokenSql, $db); while ($myrow=DB_fetch_array($result)) { Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/Payments.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.39 $ */ -//$PageSecurity = 5; - include('includes/DefinePaymentClass.php'); include('includes/session.inc'); @@ -30,7 +27,9 @@ $_SESSION['PaymentDetail']->GLItemCounter = 1; } -if ((isset($_POST['UpdateHeader']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['UpdateHeader']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) AND $_POST['BankAccount']=='')) { prnMsg(_('A bank account must be selected to make this payment from'), 'warn'); $BankAccountEmpty=TRUE; } else { @@ -38,11 +37,11 @@ } //note this is already linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; -echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br>Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br><div class="centre">'; +echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br />Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br /><div class="centre">'; if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ @@ -113,7 +112,7 @@ $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); - $result = DB_query('SELECT currcode FROM bankaccounts WHERE accountcode =' . $_POST['BankAccount'],$db,$ErrMsg); + $result = DB_query("SELECT currcode FROM bankaccounts WHERE accountcode ='" . $_POST['BankAccount'] . "'",$db,$ErrMsg); $myrow = DB_fetch_row($result); $_SESSION['PaymentDetail']->AccountCurrency=$myrow[0]; @@ -168,7 +167,7 @@ $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("select rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ @@ -235,7 +234,7 @@ $SQL = 'SELECT bankaccounts.accountcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode'; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -254,11 +253,11 @@ AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { // it is a supplier payment by cheque and haven't printed yet so print cheque - echo '<br><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br><br>'; + echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; echo '<form method=post action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Has the cheque been printed') . '?<br><br>'; + echo _('Has the cheque been printed') . '?<br /><br />'; echo '<input type="hidden" name="CommitBatch" value="' . $_POST['CommitBatch'] . '">'; echo '<input type="hidden" name="BankAccount" value="' . $_POST['BankAccount'] . '">'; echo '<input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '"> '; @@ -593,10 +592,10 @@ $sql="SELECT suppname FROM suppliers WHERE supplierid='".$lastSupplier."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); - echo '<br><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . + echo '<br /><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . _('Enter another Payment for') . ' ' . $myrow['suppname'] . '</a>'; } else { - echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br>'; + echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br />'; } } @@ -853,13 +852,13 @@ echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>'; -echo '</table><br>'; +echo '</table><br />'; if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail']->SupplierID==''){ /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><th colspan=2><font size=3 color=blue>' . _('General Ledger Payment Analysis Entry') . '</font></th></tr>'; //Select the tag @@ -928,11 +927,11 @@ 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 '</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> + echo '<br /><table class=selection><tr> <th>' . _('Cheque No').'</th> <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> <th>' . _('GL Account') . '</th> @@ -942,25 +941,25 @@ $PaymentTotal = 0; foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { - $tagsql='SELECT tagdescription from tags where tagref='.$PaymentItem->tag; - $tagresult=DB_query($tagsql, $db); - $tagmyrow=DB_fetch_row($tagresult); + $tagsql="SELECT tagdescription from tags where tagref='" . $PaymentItem->tag . "'"; + $TagResult=DB_query($tagsql, $db); + $TagMyrow=DB_fetch_row($TagResult); if ($PaymentItem->tag==0) { - $tagname='None'; + $TagName='None'; } else { - $tagname=$tagmyrow[0]; + $TagName=$TagMyrow[0]; } echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> <td class=number>' . number_format($PaymentItem->Amount,2) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> - <td>' . $PaymentItem->tag . ' - ' . $tagname . '</td> + <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $PaymentItem->ID . '">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br>'; + echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } @@ -978,7 +977,7 @@ } else { echo '<input type="hidden" name="discount" Value=0>'; } - echo '</table><br>'; + echo '</table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } echo '</form>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcExpenses.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0$ */ -//$PageSecurity = 15; +/* $Id$*/ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Of Expenses'); @@ -95,7 +94,7 @@ $msg = _('Expense ') . ' ' . $_POST['codeexpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) - FROM pcexpenses"; + FROM pcexpenses"; $result = DB_query($checkSql, $db); $row = DB_fetch_row($result); @@ -154,12 +153,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr> - <th>" . _('Code Of Expense') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Description') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Code Of Expense') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -190,8 +189,8 @@ $myrow[1], $myrow[2], $Description[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -200,11 +199,11 @@ //end of ifs and buts! if (isset($SelectedExpense)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - 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 '<p><table class=selection>'; //Main table @@ -216,7 +215,7 @@ description, glaccount FROM pcexpenses - WHERE codeexpense='$SelectedExpense'"; + WHERE codeexpense='" . $SelectedExpense . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -225,9 +224,9 @@ $_POST['description'] = $myrow['description']; $_POST['glaccount'] = $myrow['glaccount']; - echo "<input type=hidden name='SelectedExpense' VALUE=" . $SelectedExpense . ">"; - echo "<input type=hidden name='codeexpense' VALUE=" . $_POST['codeexpense']. ">"; - echo "<table class=selection> <tr><td>" . _('Code Of Expense') . ":</td><td>"; + echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; + echo '<input type=hidden name="codeexpense" VALUE="' . $_POST['codeexpense']. '">'; + echo '<table class="selection"> <tr><td>' . _('Code Of Expense') . ':</td><td>'; // We dont allow the user to change an existing type code @@ -237,32 +236,33 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Expense') . ":</td><td><input type='Text' - " . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) ." name='codeexpense'></td></tr>"; + echo '<table class=selection> + <tr><td>' . _('Code Of Expense') . ':</td> + <td><input type="Text"' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' name="codeexpense"></td></tr>'; } if (!isset($_POST['description'])) { $_POST['description']=''; } - echo "<tr><td>" . _('Description') . ":</td><td><input type='Text' name='description' size=50 maxlength=49 value='" . $_POST['description'] . "'></td></tr>"; + echo '<tr><td>' . _('Description') . ':</td><td><input type="Text" name="description" size=50 maxlength=49 value="' . $_POST['description'] . '"></td></tr>'; - echo '<tr><td>' . _('Account Code') . ":</td><td><select name='glaccount'>"; + echo '<tr><td>' . _('Account Code') . ':</td><td><select name="glaccount">'; DB_free_result($result); - $SQL = "SELECT accountcode, + $SQL = 'SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode"; + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccount']) and $myrow['accountcode']==$_POST['glaccount']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcTabs.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Tabs'); include('includes/header.inc'); @@ -33,12 +31,12 @@ //first off validate inputs sensible $i=1; - if ($_POST['tabcode']=='' OR $_POST['tabcode']==' ' OR $_POST['tabcode']==' ') { + if ($_POST['TabCode']=='' OR $_POST['TabCode']==' ' OR $_POST['TabCode']==' ') { $InputError = 1; prnMsg('<br>' . _('The Tab code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'TabCode'; $i++; - } elseif (strlen($_POST['tabcode']) >20) { + } elseif (strlen($_POST['TabCode']) >20) { $InputError = 1; echo prnMsg(_('The Tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TabCode'; @@ -48,14 +46,14 @@ if (isset($SelectedTab) AND $InputError !=1) { $sql = "UPDATE pctabs - SET usercode = '" . $_POST['SelectUser'] . "', - typetabcode = '" . $_POST['SelectTabs'] . "', - currency = '" . $_POST['SelectCurrency'] . "', - tablimit = '" . $_POST['tablimit'] . "', - authorizer = '" . $_POST['SelectAuthorizer'] . "', - glaccountassignment = '" . $_POST['glaccountcash'] . "', - glaccountpcash = '" . $_POST['glaccountpcashtab'] . "' - WHERE tabcode = '".$SelectedTab."'"; + SET usercode = '" . $_POST['SelectUser'] . "', + typetabcode = '" . $_POST['SelectTabs'] . "', + currency = '" . $_POST['SelectCurrency'] . "', + tablimit = '" . $_POST['TabLimit'] . "', + authorizer = '" . $_POST['SelectAuthorizer'] . "', + glaccountassignment = '" . $_POST['glaccountcash'] . "', + glaccountpcash = '" . $_POST['GLAccountPcashTab'] . "' + WHERE tabcode = '".$SelectedTab."'"; $msg = _('The Tabs Of Code') . ' ' . $SelectedTab . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -64,14 +62,14 @@ $checkSql = "SELECT count(*) FROM pctabs - WHERE tabcode = '" . $_POST['tabcode'] . "'"; + WHERE tabcode = '" . $_POST['TabCode'] . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); + $CheckResult = DB_query($checkSql,$db); + $CheckRow = DB_fetch_row($CheckResult); - if ( $checkrow[0] > 0 ) { + if ( $CheckRow[0] > 0 ) { $InputError = 1; - prnMsg( _('The Tab ') . $_POST['tabcode'] . _(' already exist.'),'error'); + prnMsg( _('The Tab ') .' ' . $_POST['TabCode'] . ' ' . _(' already exists'),'error'); } else { // Add new record on submit @@ -85,16 +83,16 @@ authorizer, glaccountassignment, glaccountpcash) - VALUES ('" . $_POST['tabcode'] . "', + VALUES ('" . $_POST['TabCode'] . "', '" . $_POST['SelectUser'] . "', '" . $_POST['SelectTabs'] . "', '" . $_POST['SelectCurrency'] . "', - '" . $_POST['tablimit'] . "', + '" . $_POST['TabLimit'] . "', '" . $_POST['SelectAuthorizer'] . "', '" . $_POST['glaccountcash'] . "', - '" . $_POST['glaccountpcashtab'] . "')"; + '" . $_POST['GLAccountPcashTab'] . "')"; - $msg = _('Tab with Code ') . ' ' . $_POST["tabcode"] . ' ' . _('has been created'); + $msg = _('Tab with Code ') . ' ' . $_POST['TabCode'] . ' ' . _('has been created'); } } @@ -103,15 +101,14 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); - unset($SelectedTab); unset($_POST['SelectUser'] ); unset($_POST['SelectTabs']); unset($_POST['SelectCurrency']); - unset($_POST['tablimit']); + unset($_POST['TabLimit']); unset($_POST['SelectAuthorizer']); unset($_POST['glaccountcash']); - unset($_POST['glaccountpcashtab']); + unset($_POST['GLAccountPcashTab']); } @@ -122,7 +119,6 @@ $ErrMsg = _('The Tab record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Tab type') . ' ' . $SelectedTab . ' ' . _('has been deleted') ,'success'); - unset ($SelectedTab); unset($_GET['delete']); } @@ -140,16 +136,16 @@ $result = DB_query($sql,$db); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Tab Code') . "</th> - <th>" . _('User Name') . "</th> - <th>" . _('Type Of Tab') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Limit') . "</th> - <th>" . _('Authorizer') . "</th> - <th>" . _('GL Account For Cash Assignment') . "</th> - <th>" . _('GL Account Petty Cash Tab') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Tab Code') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('Type Of Tab') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Limit') . '</th> + <th>' . _('Authorizer') . '</th> + <th>' . _('GL Account For Cash Assignment') . '</th> + <th>' . _('GL Account Petty Cash Tab') . '</th> + </tr>'; $k=0; //row colour counter @@ -196,8 +192,8 @@ $myrow[5], $myrow[6].' - '.$Description[0], $myrow[7].' - '.$DescriptionName[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -206,11 +202,11 @@ //end of ifs and buts! if (isset($SelectedTab)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Tabs Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Tabs Defined') . '</a></div><p>'; } if (!isset($_GET['delete'])) { - 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 '<p><table class=selection>'; //Main table @@ -223,29 +219,30 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['tabcode'] = $myrow['tabcode']; + $_POST['TabCode'] = $myrow['tabcode']; $_POST['SelectUser'] = $myrow['usercode']; $_POST['SelectTabs'] = $myrow['typetabcode']; $_POST['SelectCurrency'] = $myrow['currency']; - $_POST['tablimit'] = $myrow['tablimit']; + $_POST['TabLimit'] = $myrow['tablimit']; $_POST['SelectAuthorizer'] = $myrow['authorizer']; $_POST['glaccountcash'] = $myrow['glaccountassignment']; - $_POST['glaccountpcashtab'] = $myrow['glaccountpcash']; + $_POST['GLAccountPcashTab'] = $myrow['glaccountpcash']; - echo "<input type=hidden name='SelectedTab' VALUE=" . $SelectedTab . ">"; - echo "<input type=hidden name='tabcode' VALUE=" . $_POST['tabcode']. ">"; - echo "<table class=selection> <tr><td>" . _('Tabcode') . ":</td><td>"; + echo '<input type=hidden name="SelectedTab" value="' . $SelectedTab . '">'; + echo '<input type=hidden name="TabCode" value="' . $_POST['TabCode']. '">'; + echo '<table class="selection"> <tr><td>' . _('Tab Code') . ':</td><td>'; // We dont allow the user to change an existing type code - echo $_POST['tabcode'] . '</td></tr>'; + echo $_POST['TabCode'] . '</td></tr>'; } else { // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Tabcode') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='tabcode'></td></tr>"; + echo '<table class="selection"> + <tr><td>' . _('Tab Code') . ':</td> + <td><input type="Text"' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TabCode"></td></tr>'; } @@ -253,142 +250,145 @@ $_POST['typetabdescription']=''; } - echo '<tr><td>' . _('User Name') . ":</td><td><select name='SelectUser'>"; + echo '<tr><td>' . _('User Name') . ':</td><td><select name="SelectUser">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectUser']) and $myrow['userid']==$_POST['SelectUser']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get user echo '</select></td></tr>'; - echo '<tr><td>' . _('Type Of Tab') . ":</td><td><select name='SelectTabs'>"; + echo '<tr><td>' . _('Type Of Tab') . ':</td><td><select name="SelectTabs">'; DB_free_result($result); - $SQL = "SELECT typetabcode FROM pctypetabs ORDER BY typetabcode"; + $SQL = 'SELECT typetabcode FROM pctypetabs ORDER BY typetabcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['typetabcode']==$_POST['SelectTabs']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - echo '<tr><td>' . _('Currency') . ":</td><td><select name='SelectCurrency'>"; + echo '<tr><td>' . _('Currency') . ':</td><td><select name="SelectCurrency">'; DB_free_result($result); - $SQL = "SELECT currency,currabrev - FROM currencies"; + $SQL = 'SELECT currency,currabrev + FROM currencies'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectCurrency']) and $myrow['currabrev']==$_POST['SelectCurrency']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['currabrev'] . "'>" . $myrow['currency']; + echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - if (!isset($_POST['tablimit'])) { - $_POST['tablimit']=0; + if (!isset($_POST['TabLimit'])) { + $_POST['TabLimit']=0; } - echo "<tr><td>" . _('Limit Of Tab') . ":</td><td><input type='Text' class='number' name='tablimit' size='12' maxlength='11' value='" . $_POST['tablimit'] . "'></td></tr>"; + echo '<tr><td>' . _('Limit Of Tab') . ':</td> + <td><input type="Text" class="number" name="TabLimit" size="12" maxlength="11" value="' . $_POST['TabLimit'] . '"></td></tr>'; - echo '<tr><td>' . _('Authorizer') . ":</td><td><select name='SelectAuthorizer'>"; + echo '<tr><td>' . _('Authorizer') . ':</td> + <td><select name="SelectAuthorizer">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users - ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users + ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectAuthorizer']) and $myrow['userid']==$_POST['SelectAuthorizer']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get authorizer echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Cash Assignment') . ":</td><td><select name='glaccountcash'>"; + echo '<tr><td>' . _('GL Account Cash Assignment') . ':</td><td><select name="glaccountcash">'; DB_free_result($result); - $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname - FROM chartmaster, bankaccounts - WHERE chartmaster.accountcode = bankaccounts.accountcode - ORDER BY chartmaster.accountcode"; + $SQL = 'SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster INNER JOIN bankaccounts + ON chartmaster.accountcode = bankaccounts.accountcode + ORDER BY chartmaster.accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccountcash']) and $myrow['accountcode']==$_POST['glaccountcash']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Petty Cash Tab') . ":</td><td><select name='glaccountpcashtab'>"; + echo '<tr><td>' . _('GL Account Petty Cash Tab') . ':</td> + <td><select name="GLAccountPcashTab">'; DB_free_result($result); - $SQL = "SELECT accountcode, accountname - FROM chartmaster - ORDER BY accountcode"; + $SQL = 'SELECT accountcode, accountname + FROM chartmaster + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['glaccountpcashtab']) and $myrow['accountcode']==$_POST['glaccountpcashtab']) { - echo "<option selected VALUE='"; + if (isset($_POST['GLAccountPcashTab']) and $myrow['accountcode']==$_POST['GLAccountPcashTab']) { + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name=Cancel value="' . _('Cancel') . '"></div>'; echo '</form>'; } // end if user wish to delete - include('includes/footer.inc'); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |