From: <dai...@us...> - 2013-07-28 10:17:00
|
Revision: 6153 http://sourceforge.net/p/web-erp/reponame/6153 Author: daintree Date: 2013-07-28 10:16:57 +0000 (Sun, 28 Jul 2013) Log Message: ----------- HTML5 Modified Paths: -------------- trunk/CustomerAllocations.php trunk/PDFBankingSummary.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/CustomerAllocations.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -40,10 +40,18 @@ $TotalAllocated = 0; $TotalDiffOnExch = 0; + echo '<br />Total number of potential allocations = ' . $_POST['TotalNumberOfAllocs']; + + for ($AllocCounter=0;$AllocCounter < $_POST['TotalNumberOfAllocs']; $AllocCounter++) { // loop through amounts allocated using AllocnItm->ID for each record + echo '<br />Counter = ' . $AllocCounter; if (isset($_POST['Amt' . $AllocCounter])) { - // allocatable charge amounts + + + echo ' - Amount allocated' . $_POST['Amt' . $AllocCounter] . ' for ' . $_POST['AllocID' . $AllocCounter]; + + // allocatable charge amounts if (!is_numeric(filter_number_format($_POST['Amt' . $AllocCounter]))) { $_POST['Amt' . $AllocCounter] = 0; } @@ -72,10 +80,7 @@ } if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { - prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . - $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. - _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); + prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' ' . _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; } } @@ -85,53 +90,53 @@ // //========[ START TRANSACTION ]=========== // - $error = ''; - $Result=DB_Txn_Begin($db); + $Error = ''; + $Result= DB_Txn_Begin($db); $AllAllocations = 0; foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { if ($AllocnItem->PrevAllocRecordID != 'NA') { // original allocation has changed so delete the old allocation record $SQL = "DELETE FROM custallocns WHERE id = '" . $AllocnItem->PrevAllocRecordID . "'"; if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not delete old allocation record'; + $Error = _('Could not delete old allocation record'); } } -// if ($AllocnItem->OrigAlloc != $AllocnItem->AllocAmt) // has previous allocated amount changed? -// { - if ($AllocnItem->AllocAmt > 0) { - $SQL = "INSERT INTO - custallocns ( - datealloc, - amt, - transid_allocfrom, - transid_allocto - ) VALUES ( - '" . date('Y-m-d') . "', - '" . $AllocnItem->AllocAmt . "', - '" . $_SESSION['Alloc']->AllocTrans . "', - '" . $AllocnItem->ID . "' - )"; - if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not change allocation record'; - } + if ($AllocnItem->AllocAmt > 0) { + $SQL = "INSERT INTO + custallocns ( + datealloc, + amt, + transid_allocfrom, + transid_allocto + ) VALUES ( + '" . date('Y-m-d') . "', + '" . $AllocnItem->AllocAmt . "', + '" . $_SESSION['Alloc']->AllocTrans . "', + '" . $AllocnItem->ID . "' + )"; + if( !$Result = DB_query($SQL,$db) ) { + $Error = _('Could not change allocation record'); } - $NewAllocTotal = $AllocnItem->PrevAlloc + $AllocnItem->AllocAmt; - $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt; - $Settled = (abs($NewAllocTotal-$AllocnItem->TransAmount) < 0.005) ? 1 : 0; + } + $NewAllocTotal = $AllocnItem->PrevAlloc + $AllocnItem->AllocAmt; + $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt; + $Settled = (abs($NewAllocTotal-$AllocnItem->TransAmount) < 0.005) ? 1 : 0; - $SQL = "UPDATE debtortrans - SET diffonexch='" . $AllocnItem->DiffOnExch . "', - alloc = '" . $NewAllocTotal . "', - settled = '" . $Settled . "' - WHERE id = '" . $AllocnItem->ID."'"; - if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not update difference on exchange'; - } -// } + $SQL = "UPDATE debtortrans + SET diffonexch='" . $AllocnItem->DiffOnExch . "', + alloc = '" . $NewAllocTotal . "', + settled = '" . $Settled . "' + WHERE id = '" . $AllocnItem->ID."'"; + if( !$Result = DB_query($SQL,$db) ) { + $Error = _('Could not update difference on exchange'); + } } - $Settled = (abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01) ? 1 : 0; - + if (abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01) { + $Settled = 1; + } else { + $Settled = 0; + } // Update the receipt or credit note $SQL = "UPDATE debtortrans SET alloc = '" . -$AllAllocations . "', @@ -140,7 +145,7 @@ WHERE id = '" . $_POST['AllocTrans']."'"; if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not update receipt or credit note'; + $Error = _('Could not update receipt or credit note'); } // If GLLink to debtors active post diff on exchange to GL @@ -169,7 +174,7 @@ '" . $MovtInDiffOnExch . "' )"; if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not update exchange difference in General Ledger'; + $Error = _('Could not update exchange difference in General Ledger'); } $SQL = "INSERT INTO gltrans ( @@ -190,7 +195,7 @@ '" . -$MovtInDiffOnExch . "' )"; if( !$Result = DB_query($SQL,$db) ) { - $error = 'Could not update debtors control in General Ledger'; + $Error = _('Could not update debtors control in General Ledger'); } } @@ -199,11 +204,11 @@ // //========[ COMMIT TRANSACTION ]=========== // - if ( empty($error) ) { + if (empty($Error) ) { $Result = DB_Txn_Commit($db); } else { $Result = DB_Txn_Rollback($db); - prnMsg($error,'error'); + prnMsg($Error,'error'); } unset($_SESSION['Alloc']); unset($_POST['AllocTrans']); @@ -211,25 +216,26 @@ } if (isset($_GET['AllocTrans'])) { + if (isset($_SESSION['Alloc'])) { unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); } $_SESSION['Alloc'] = new Allocation; - $_POST['AllocTrans'] = $_GET['AllocTrans']; // Set AllocTrans when page first called + $_POST['AllocTrans'] = $_GET['AllocTrans']; // Set AllocTrans when page first called $SQL= "SELECT systypes.typename, - debtortrans.type, - debtortrans.transno, - debtortrans.trandate, - debtortrans.debtorno, - debtorsmaster.name, - debtortrans.rate, - (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount) as total, - debtortrans.diffonexch, - debtortrans.alloc, - currencies.decimalplaces + debtortrans.type, + debtortrans.transno, + debtortrans.trandate, + debtortrans.debtorno, + debtorsmaster.name, + debtortrans.rate, + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount) as total, + debtortrans.diffonexch, + debtortrans.alloc, + currencies.decimalplaces FROM debtortrans INNER JOIN systypes ON debtortrans.type = systypes.typeid INNER JOIN debtorsmaster @@ -339,26 +345,22 @@ </tr>'; if (isset($_POST['AllocTrans'])) { - // Page called with trans number - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; - - // Show trans already allocated and potential new allocations - - echo '<table class="selection">'; - echo '<tr> + /* Page called with trans number + Show trans already allocated and potential new allocations + */ + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="AllocTrans" value="' . $_POST['AllocTrans'] . '" /> + <table class="selection"> + <tr> <th colspan="7"> <div class="centre"> <b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b> </div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br />' . _('Amount in customer currency') . ' <b>' . - locale_number_format(-$_SESSION['Alloc']->TransAmt,$_SESSION['Alloc']->CurrDecimalPlaces) . - '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' - . $_SESSION['Alloc']->TransExRate . ')</i>'; + echo '<br />' . _('Amount in customer currency') . ' <b>' . locale_number_format(-$_SESSION['Alloc']->TransAmt,$_SESSION['Alloc']->CurrDecimalPlaces) . '</b><i> (' . _('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } echo '</th> </tr> @@ -374,7 +376,7 @@ $Counter = 0; $TotalAllocated = 0; - $balance = 0; + $Balance = 0; $j=0; foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { $YetToAlloc = ($AllocnItem->TransAmount - $AllocnItem->PrevAlloc); @@ -397,9 +399,9 @@ $j++; if ($AllocnItem->TransAmount < 0) { - $balance+=$YetToAlloc; + $Balance+=$YetToAlloc; echo '<td>' . $curTrans .'</td> - <td class="number">' . locale_number_format($balance,$_SESSION['Alloc']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($Balance,$_SESSION['Alloc']->CurrDecimalPlaces) . '</td> </tr>'; } else { echo '<td class="number"><input type="hidden" name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,$_SESSION['Alloc']->CurrDecimalPlaces) . '" />'; @@ -410,11 +412,11 @@ } else { echo ' />'; } - $balance += $YetToAlloc-$AllocnItem->AllocAmt; + $Balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; echo '<input tabindex="' . $j . '" type="text" class="number" ' . ($j==1 ? 'autofocus="autofocus"' :'') . ' name="Amt' . $Counter .'" title="' . _('Enter the amount of this transaction to be allocated. Nothing should be entered here if the entire transaction is to be allocated, use the check box') . '" maxlength="12" size="13" value="' . locale_number_format(round($AllocnItem->AllocAmt,$_SESSION['Alloc']->CurrDecimalPlaces),$_SESSION['Alloc']->CurrDecimalPlaces) . '" /> <input type="hidden" name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '" ></td> - <td class="number">' . locale_number_format($balance,$_SESSION['Alloc']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($Balance,$_SESSION['Alloc']->CurrDecimalPlaces) . '</td> </tr>'; } $TotalAllocated += round($AllocnItem->AllocAmt,$_SESSION['Alloc']->CurrDecimalPlaces); @@ -495,8 +497,9 @@ <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td class="number">' . locale_number_format($myrow['total'],$myrow['currdecimalplaces']) . '</td> <td class="number">' . locale_number_format($myrow['total']-$myrow['alloc'],$myrow['currdecimalplaces']) . '</td> - <td>' . $myrow['currcode'] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'). '?AllocTrans=' . $myrow['id'] . '">' . _('Allocate') . '</a></td></tr>'; + <td>' . $myrow['currcode'] . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'). '?AllocTrans=' . $myrow['id'] . '">' . _('Allocate') . '</a></td> + </tr>'; } echo '</table>'; } else { @@ -559,7 +562,7 @@ $BalRow = DB_fetch_array($BalResult); $Balance = $BalRow['total']; } - $CurrentTransaction ++; + $CurrentTransaction++; $CurrCode = $myrow['currcode']; $CurrDecimalPlaces = $myrow['currdecimalplaces']; if (isset($Balance) AND abs($Balance) < -0.01 ) { @@ -574,16 +577,16 @@ $k++; } - echo '<td>' . $myrow['typename'] .'</td> - <td>' . $myrow['name'] . '</td> - <td>' . $myrow['debtorno'] . '</td> - <td>' . $myrow['transno'] . '</td> - <td>' . ConvertSQLDate($myrow['trandate']) . '</td> - <td class="number">' . locale_number_format($myrow['total'],$CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($myrow['total']-$myrow['alloc'],$CurrDecimalPlaces) . '</td> - <td>' . $CurrCode . '</td> - <td>' . $AllocateLink . '</td> - </tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">' . locale_number_format($myrow['total'],$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($myrow['total']-$myrow['alloc'],$CurrDecimalPlaces) . '</td> + <td>' . $CurrCode . '</td> + <td>' . $AllocateLink . '</td> + </tr>'; } //end loop around unallocated receipts and credit notes Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PDFBankingSummary.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -30,10 +30,11 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>'; - echo '<td><select name="BatchNo">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <td>' . _('Select the batch number of receipts to be printed') . ':</td> + <td><select required="required" autofocus="autofocus" name="BatchNo">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['transno'].'">'._('Batch') .' '. $myrow['transno'].' - '.ConvertSqlDate($myrow['transdate']).'</option>'; } Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcAssignCashToTab.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -4,8 +4,8 @@ include('includes/session.inc'); $Title = _('Assignment of Cash to Petty Cash Tab'); /* webERP manual links before header.inc */ -$ViewTopic= "PettyCash"; -$BookMark = "CashAssignment"; +$ViewTopic= 'PettyCash'; +$BookMark = 'CashAssignment'; include('includes/header.inc'); if (isset($_POST['SelectedTabs'])){ @@ -35,7 +35,7 @@ unset($_POST['Receipt']); } -if (isset($_POST['process'])) { +if (isset($_POST['Process'])) { if ($SelectedTabs=='') { prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); unset($SelectedTabs); @@ -178,7 +178,7 @@ echo '<br /> <div class="centre"> - <input type="submit" name="process" value="' . _('Accept') . '" /> + <input type="submit" name="Process" value="' . _('Accept') . '" /> <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> </div>'; echo '</div> @@ -186,7 +186,7 @@ } //end of ifs and buts! -if (isset($_POST['process']) OR isset($SelectedTabs)) { +if (isset($_POST['Process']) OR isset($SelectedTabs)) { if (!isset($_POST['submit'])) { echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . @@ -224,23 +224,24 @@ ORDER BY date, counterindex ASC"; $result = DB_query($sql,$db); - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr><th colspan="8">' . _('Detail Of PC Tab Movements For Last') .': '; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days'); - echo '<input type="submit" name="Go" value="' . _('Go') . '" />'; - echo '</th></tr>'; - echo '<tr> - <th>' . _('Date') . '</th> - <th>' . _('Expense Code') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Authorised') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> - </tr>'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <th colspan="8">' . _('Detail Of PC Tab Movements For Last') .': + <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days') . ' + <input type="submit" name="Go" value="' . _('Go') . '" /></th> + </tr> + <tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Authorised') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + </tr>'; $k=0; //row colour counter @@ -317,9 +318,9 @@ $Amount['0']=0; } - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['edit'])) { $sql = "SELECT * FROM pcashdetails @@ -334,10 +335,10 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" />'; - echo '<input type="hidden" name="CurrentAmount" value="' . $Amount[0]. '" />'; - echo '<input type="hidden" name="Days" value="' . $Days . '" />'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" /> + <input type="hidden" name="CurrentAmount" value="' . $Amount[0]. '" /> + <input type="hidden" name="Days" value="' . $Days . '" />'; } /* Ricard: needs revision of this date initialization */ @@ -345,17 +346,23 @@ $_POST['Date']=Date($_SESSION['DefaultDateFormat']); } - echo '<br /><table class="selection">'; //Main table + echo '<br /> + <table class="selection">'; //Main table if (isset($_GET['SelectedIndex'])) { - echo '<tr><th colspan="2"><h3>'._('Update Cash Assignment').'</h3></th></tr>'; + echo '<tr> + <th colspan="2"><h3>'._('Update Cash Assignment').'</h3></th> + </tr>'; } else { - echo '<tr><th colspan="2"><h3>'._('New Cash Assignment').'</h3></th></tr>'; + echo '<tr> + <th colspan="2"><h3>'._('New Cash Assignment').'</h3></th> + </tr>'; } - echo '<tr><td>' . _('Cash Assignation Date') . ':</td>'; + echo '<tr> + <td>' . _('Cash Assignation Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" required="required" autofocus="autofocus" size="10" maxlength="10" value="' . $_POST['Date'] . '" /></td> + </tr>'; - echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size="10" maxlength="10" value="' . $_POST['Date'] . '" /></td></tr>'; - if (!isset($_POST['Amount'])) { $_POST['Amount']=0; } @@ -369,8 +376,10 @@ $_POST['Notes']=''; } - echo '<tr><td>' . _('Notes') . ':</td> - <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Notes') . ':</td> + <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td> + </tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; @@ -379,21 +388,18 @@ echo '<tr> <td>' . _('Receipt') . ':</td> <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td> - </tr>'; - - echo '</table>'; // close main table - - echo '<input type="hidden" name="CurrentAmount" value="' . $Amount['0']. '" />'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="hidden" name="Days" value="' .$Days. '" />'; - - echo '<br /><div class="centre"> + </tr> + </table> + <input type="hidden" name="CurrentAmount" value="' . $Amount['0']. '" /> + <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="hidden" name="Days" value="' .$Days. '" /> + <br /> + <div class="centre"> <input type="submit" name="submit" value="' . _('Accept') . '" /> - <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div> + </div> + </form>'; - echo '</div> - </form>'; - } // end if user wish to delete } Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcAuthorizeExpenses.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -4,8 +4,8 @@ include('includes/session.inc'); $Title = _('Authorisation of Petty Cash Expenses'); /* webERP manual links before header.inc */ -$ViewTopic= "PettyCash"; -$BookMark = "AuthorizeExpense"; +$ViewTopic= 'PettyCash'; +$BookMark = 'AuthorizeExpense'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -57,11 +57,13 @@ if(!isset ($Days)){ $Days=30; } - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<br /><table class="selection">'; - echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; - echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); - echo '<input type="submit" name="Go" value="' . _('Go') . '" /></th></tr>'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <br /> + <table class="selection"> + <tr> + <th colspan="7">' . _('Detail Of Movement For Last ') .':<input type="text" class="intger" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); + echo '<input type="submit" name="Go" value="' . _('Go') . '" /></th> + </tr>'; $sql = "SELECT pcashdetails.counterindex, pcashdetails.tabcode, @@ -285,18 +287,22 @@ // Do the postings include ('includes/GLPostings.inc'); - echo '</table><br /><div class="centre"><input type="submit" name="Submit" value="' . _('Update') . '" /></div> - </div> - </form>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Submit" value="' . _('Update') . '" /></div> + </div> + </form>'; } else { /*The option to submit was not hit so display form */ -echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">'; -echo '<div>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br /><table class="selection">'; //Main table +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br /> + <table class="selection">'; //Main table $SQL = "SELECT tabcode FROM pctabs @@ -304,8 +310,9 @@ $result = DB_query($SQL,$db); -echo '<tr><td>' . _('Authorise expenses to Petty Cash Tab') . ':</td> - <td><select name="SelectedTabs">'; +echo '<tr> + <td>' . _('Authorise expenses to Petty Cash Tab') . ':</td> + <td><select name="SelectedTabs" required="required" autofocus="autofocus" >'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { @@ -317,14 +324,18 @@ } //end while loop get type of tab - echo '</select></td></tr>'; - echo '</table>'; // close main table + echo '</select></td> + </tr> + </table>'; // close main table DB_free_result($result); - echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '" /> - <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; - echo '</div>'; - echo '</form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div> + </div> + </form>'; } /*end of else not submit */ include('includes/footer.inc'); ?> Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcClaimExpensesFromTab.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -5,8 +5,8 @@ include('includes/session.inc'); $Title = _('Claim Petty Cash Expenses From Tab'); /* webERP manual links before header.inc */ -$ViewTopic= "PettyCash"; -$BookMark = "ExpenseClaim"; +$ViewTopic= 'PettyCash'; +$BookMark = 'ExpenseClaim'; include('includes/header.inc'); @@ -65,16 +65,16 @@ if ($_POST['SelectedExpense']=='') { $InputError=1; prnMsg(_('You have not selected an expense to claim on this tab'),'error'); - } elseif ($_POST['amount']==0) { + } elseif ($_POST['Amount']==0) { $InputError = 1; - prnMsg( _('The Amount must be greater than 0'),'error'); + prnMsg( _('The amount must be greater than 0'),'error'); } if (isset($SelectedIndex) AND $InputError !=1) { $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', codeexpense = '" . $_POST['SelectedExpense'] . "', - amount = '" .-filter_number_format($_POST['amount']) . "', + amount = '" .-filter_number_format($_POST['Amount']) . "', notes = '" . $_POST['Notes'] . "', receipt = '" . $_POST['Receipt'] . "' WHERE counterindex = '".$SelectedIndex."'"; @@ -99,7 +99,7 @@ '" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', '" . $_POST['SelectedExpense'] . "', - '" . -filter_number_format($_POST['amount']) . "', + '" . -filter_number_format($_POST['Amount']) . "', 0, 0, '" . $_POST['Notes'] . "', @@ -115,7 +115,7 @@ prnMsg($msg,'success'); unset($_POST['SelectedExpense']); - unset($_POST['amount']); + unset($_POST['Amount']); unset($_POST['Date']); unset($_POST['Notes']); unset($_POST['Receipt']); @@ -169,9 +169,13 @@ echo '</table>'; // close main table DB_free_result($result); - echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; - echo '</div>'; - echo '</form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div> + </div> + </form>'; } else { // isset($SelectedTabs) @@ -181,12 +185,16 @@ echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another tab') . '</a></div>'; if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><h3>' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</h3></th></tr>'; - echo '<tr><th colspan="8">' . _('Detail Of Movements For Last ') .': '; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br /> + <table class="selection"> + <tr> + <th colspan="8"><h3>' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</h3></th> + </tr> + <tr> + <th colspan="8">' . _('Detail Of Movements For Last ') .': '; if(!isset ($Days)){ @@ -202,14 +210,14 @@ $myrow=DB_fetch_array($result); $CurrDecimalPlaces = $myrow['decimalplaces']; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' ._('Days'); + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="text" class="integer" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days'); echo '<input type="submit" name="Go" value="' . _('Go') . '" />'; echo '</th></tr>'; if (isset($_POST['Cancel'])) { unset($_POST['SelectedExpense']); - unset($_POST['amount']); + unset($_POST['Amount']); unset($_POST['Date']); unset($_POST['Notes']); unset($_POST['Receipt']); @@ -296,31 +304,31 @@ } //END WHILE LIST LOOP - $sqlamount="SELECT sum(amount) + $sqlAmount="SELECT sum(amount) FROM pcashdetails WHERE tabcode='".$SelectedTabs."'"; - $ResultAmount = DB_query($sqlamount,$db); + $ResultAmount = DB_query($sqlAmount,$db); $Amount=DB_fetch_array($ResultAmount); if (!isset($Amount['0'])) { $Amount['0']=0; } - echo '<tr><td colspan="2" style="text-align:right" >' . _('Current balance') . ':</td> - <td class="number">'.locale_number_format($Amount['0'],$CurrDecimalPlaces) . '</td></tr>'; - - - echo '</table>'; - echo '</div> - </form>'; + echo '<tr> + <td colspan="2" style="text-align:right" >' . _('Current balance') . ':</td> + <td class="number">'.locale_number_format($Amount['0'],$CurrDecimalPlaces) . '</td> + </tr> + </table> + </div> + </form>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['edit'])) { $sql = "SELECT * @@ -336,9 +344,9 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" />'; - echo '<input type="hidden" name="Days" value="' .$Days. '" />'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" /> + <input type="hidden" name="Days" value="' . $Days . '" />'; }//end of Get Edit @@ -347,9 +355,13 @@ } echo '<br /><table class="selection">'; //Main table - echo '<tr><td>' . _('Date Of Expense') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size="10" maxlength="10" value="' . $_POST['Date']. '" /></td></tr>'; - echo '<tr><td>' . _('Code Of Expense') . ':</td><td><select name="SelectedExpense">'; + echo '<tr> + <td>' . _('Date Of Expense') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size="10" required="required" autofocus="autofocus" maxlength="10" value="' . $_POST['Date']. '" /></td> + </tr> + <tr> + <td>' . _('Code Of Expense') . ':</td> + <td><select required="required" name="SelectedExpense">'; DB_free_result($result); @@ -373,37 +385,46 @@ } //end while loop - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['Amount'])) { $_POST['Amount']=0; } - echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Amount') . ':</td> + <td><input type="text" class="number" required="required" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '" /></td> + </tr>'; if (!isset($_POST['Notes'])) { $_POST['Notes']=''; } - echo '<tr><td>' . _('Notes') . ':</td> - <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Notes') . ':</td> + <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td> + </tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; } - echo '<tr><td>' . _('Receipt') . ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td></tr>'; - echo '</table>'; // close main table + echo '<tr> + <td>' . _('Receipt') . ':</td> + <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td> + </tr> + </table> + <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> + <input type="hidden" name="Days" value="' .$Days. '" /> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div> + </div> + </form>'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; - echo '<input type="hidden" name="Days" value="' .$Days. '" />'; - - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; - echo '</div> - </form>'; - } // end if user wish to delete } Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcExpenses.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -284,7 +284,7 @@ echo '<table class="selection"> <tr> <td>' . _('Code Of Expense') . ':</td> - <td><input type="text"' . (in_array('CodeExpense',$Errors) ? 'class="inputerror"' : '' ) .' name="CodeExpense" /></td> + <td><input type="text"' . (in_array('CodeExpense',$Errors) ? 'class="inputerror"' : '' ) .' name="CodeExpense" required="required" autofocus="autofocus" /></td> </tr>'; } Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcReportTab.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -20,9 +20,9 @@ echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . $Title . '</p>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['FromDate'])){ $_POST['FromDate']=Date($_SESSION['DefaultDateFormat'], mktime(0,0,0,Date('m'),1,Date('Y'))); @@ -33,8 +33,10 @@ } /*Show a form to allow input of criteria for Tabs to show */ - echo '<table class="selection">'; - echo '<tr><td>' . _('Code Of Petty Cash Tab') . ':</td><td><select name="SelectedTabs">'; + echo '<table class="selection"> + <tr> + <td>' . _('Code Of Petty Cash Tab') . ':</td> + <td><select name="SelectedTabs">'; $SQL = "SELECT tabcode FROM pctabs @@ -57,17 +59,24 @@ DB_free_result($result); - echo '</select></td></tr>'; - echo'<tr><td>' . _('From Date :') . '</td><td>'; - echo '<input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" />'; - echo '</td></tr>'; - echo '<tr><td>' . _('To Date:') .'</td><td>'; - echo '<input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" />'; - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="ShowTB" value="' . _('Show HTML') .'" />'; - echo '<input type="submit" name="PrintPDF" value="' . _('PrintPDF') . '" /></div>'; - echo '</div> - </form>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('From Date :') . '</td> + <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + </tr> + <tr> + <td>' . _('To Date:') .'</td> + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="ShowTB" value="' . _('Show HTML') .'" /> + <input type="submit" name="PrintPDF" value="' . _('PrintPDF') . '" /> + </div> + </div> + </form>'; } else if (isset($_POST['PrintPDF'])) { Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcTabs.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -260,10 +260,10 @@ } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br />'; //Main table + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br />'; //Main table if ( isset($SelectedTab) AND $SelectedTab!='' ) { @@ -292,10 +292,10 @@ <td>' . $_POST['TabCode'] . '</td> </tr>'; } else { - // This is a new type so the user may volunteer a type code + // This is a new type so the user must enter a type code echo '<table class="selection"> <tr><td>' . _('Tab Code') . ':</td> - <td><input type="text"' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TabCode" /></td></tr>'; + <td><input type="text"' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TabCode" required="required" autofocus="autofocus" /></td></tr>'; } @@ -303,7 +303,8 @@ $_POST['typetabdescription']=''; } - echo '<tr><td>' . _('User Name') . ':</td> + echo '<tr> + <td>' . _('User Name') . ':</td> <td><select name="SelectUser">'; $SQL = "SELECT userid, @@ -322,10 +323,12 @@ } //end while loop get user - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_free_result($result); - echo '<tr><td>' . _('Type Of Tab') . ':</td> + echo '<tr> + <td>' . _('Type Of Tab') . ':</td> <td><select name="SelectTabs">'; $SQL = "SELECT typetabcode, @@ -348,7 +351,8 @@ echo '</select></td></tr>'; DB_free_result($result); - echo '<tr><td>' . _('Currency') . ':</td> + echo '<tr> + <td>' . _('Currency') . ':</td> <td><select name="SelectCurrency">'; $SQL = "SELECT currency, currabrev FROM currencies"; @@ -365,17 +369,20 @@ } //end while loop get type of tab - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_free_result($result); 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="integer" name="TabLimit" size="12" maxlength="11" value="' . $_POST['TabLimit'] . '" /></td></tr>'; - echo '<tr><td>' . _('Assigner') . ':</td> + echo '<tr> + <td>' . _('Assigner') . ':</td> <td><select name="SelectAssigner">'; $SQL = "SELECT userid, @@ -395,10 +402,13 @@ } //end while loop get assigner - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_free_result($result); - echo '<tr><td>' . _('Authoriser') . ":</td><td><select name='SelectAuthoriser'>"; + echo '<tr> + <td>' . _('Authoriser') . ':</td> + <td><select name="SelectAuthoriser">'; $SQL = "SELECT userid, realname @@ -417,10 +427,12 @@ } //end while loop get authoriser - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_free_result($result); - echo '<tr><td>' . _('GL Account Cash Assignment') . ':</td> + echo '<tr> + <td>' . _('GL Account Cash Assignment') . ':</td> <td><select name="GLAccountCash">'; $SQL = "SELECT chartmaster.accountcode, @@ -441,10 +453,12 @@ } //end while loop - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_free_result($result); - echo '<tr><td>' . _('GL Account Petty Cash Tab') . ':</td> + echo '<tr> + <td>' . _('GL Account Petty Cash Tab') . ':</td> <td><select name="GLAccountPcashTab">'; $SQL = "SELECT accountcode, accountname @@ -463,15 +477,19 @@ } //end while loop - echo '</select></td></tr>'; - echo '</table>'; // close main table + echo '</select></td> + </tr> + </table>'; // close main table DB_free_result($result); - echo '<br /><div class="centre"><input type="submit" name="Submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div> + </div> + </form>'; - echo '</div> - </form>'; - } // end if user wish to delete include('includes/footer.inc'); Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2013-07-27 14:35:20 UTC (rev 6152) +++ trunk/PcTypeTabs.php 2013-07-28 10:16:57 UTC (rev 6153) @@ -127,9 +127,12 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><div class="centre"><input type="submit" name="Return" value="' . _('Return to list of tab types') . '" /></div>'; - echo '</div> - </form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Return" value="' . _('Return to list of tab types') . '" /> + </div> + </div> + </form>'; include('includes/footer.inc'); exit; } else { @@ -212,10 +215,11 @@ $_POST['TypeTabCode'] = $myrow['typetabcode']; $_POST['TypeTabDescription'] = $myrow['typetabdescription']; - echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '" />'; - echo '<input type="hidden" name="TypeTabCode" value="' . $_POST['TypeTabCode']. '" />'; - echo '<table class="selection"> - <tr><td>' . _('Code Of Type Of Tab') . ':</td> + echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '" /> + <input type="hidden" name="TypeTabCode" value="' . $_POST['TypeTabCode']. '" /> + <table class="selection"> + <tr> + <td>' . _('Code Of Type Of Tab') . ':</td> <td>' . $_POST['TypeTabCode'] . '</td> </tr>'; @@ -230,7 +234,7 @@ echo '<table class="selection"> <tr> <td>' . _('Code Of Type Of Tab') . ':</td> - <td><input type="text" ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode" /></td> + <td><input type="text" ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' required="required" autofocus="autofocus" pattern="[0-9a-zA-Z_]*" name="TypeTabCode" title="' . _('Only alpha-numeric characters and the underscore character are allowed') . '" /></td> </tr>'; } @@ -243,9 +247,8 @@ <td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '" /></td> </tr>'; - echo '</table>'; // close main table - - echo '<br /> + echo '</table> + <br /> <div class="centre"> <input type="submit" name="submit" value="' . _('Accept') . '" /> <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> |