From: <dai...@us...> - 2011-04-26 11:03:46
|
Revision: 4556 http://web-erp.svn.sourceforge.net/web-erp/?rev=4556&view=rev Author: daintree Date: 2011-04-26 11:03:36 +0000 (Tue, 26 Apr 2011) Log Message: ----------- rework scripts for xhtml and quoting Modified Paths: -------------- trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/CustomerTypes.php trunk/Customers.php trunk/InventoryValuation.php trunk/WWW_Users.php trunk/build/make_release.sh trunk/includes/GetConfig.php trunk/includes/LanguageSetup.php trunk/includes/PDFInventoryValnPageHeader.inc trunk/includes/session.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustEDISetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,14 +1,12 @@ <?php -/* $Revision: 1.11 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Customer EDI Set Up'); include('includes/header.inc'); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br />'; if (isset($Errors)) { unset($Errors); @@ -27,10 +25,7 @@ //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') - OR strstr($_POST['EDIReference'],"\"") - OR strstr($_POST['EDIReference'],'&') + if (ContainsIllegalCharacters($_POST['EDIReference']) OR strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); @@ -75,9 +70,9 @@ } } -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 '<br><table class=selection>'; +echo '<br /><table class=selection>'; $sql = "SELECT debtorno, name, @@ -105,59 +100,59 @@ if ($myrow['ediinvoices']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled'). '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } -echo "</select><a href='$rootpath/EDIMessageFormat.php?" . SID . "&MessageType=INVOIC&PartnerCode=" . $_SESSION['CustomerID'] . "'>"._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; +echo '</select><a href="' . $rootpath . '/EDIMessageFormat.php?MessageType=INVOIC&PartnerCode=' . $_SESSION['CustomerID'] . '">'._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; -echo '<tr><td>'._('Enable Receiving of EDI Orders').":</td> - <td><select tabindex=2 name='EDIOrders'>"; +echo '<tr><td>'._('Enable Receiving of EDI Orders') . ':</td> + <td><select tabindex=2 name="EDIOrders">'; if ($myrow['ediorders']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled') . '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('Customer EDI Reference').":</td> - <td><input " . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; +echo '<tr><td>'._('Customer EDI Reference') . ':</td> + <td><input ' . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=3 type="text" name="EDIReference" size=20 maxlength=20 value="' . $myrow['edireference'] . '"></td></tr>'; -echo '<tr><td>'._('EDI Communication Method').":</td> - <td><select tabindex=4 name='EDITransport'>"; +echo '<tr><td>'._('EDI Communication Method') . ':</td> + <td><select tabindex=4 name="EDITransport" >'; if ($myrow['editransport']=='email'){ - echo "<option selected value='email'>"._('Email Attachments'); - echo "<option value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option selected value="email">'._('Email Attachments') . '</option>'; + echo '<option value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } else { - echo "<option value='email'>"._('Email Attachments'); - echo "<option selected value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option value="email">'._('Email Attachments') . '</option>'; + echo '<option selected value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('FTP Server or Email Address').":</td> - <td><input " . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; +echo '<tr><td>'._('FTP Server or Email Address') . ':</td> + <td><input ' . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=5 type="text" name="EDIAddress" size=42 maxlength=40 value="' . $myrow['ediaddress'] . '"></td></tr>'; if ($myrow['editransport']=='ftp'){ - echo '<tr><td>'._('FTP Server User Name').":</td> - <td><input tabindex=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; - echo '<tr><td>'._('FTP Server Password').":</td> - <td><input tabindex=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; + echo '<tr><td>'._('FTP Server User Name') . ':</td> + <td><input tabindex=6 type="text" name="EDIServerUser" size=20 maxlength=20 value="' . $myrow['ediserveruser'] . '"></td></tr>'; + echo '<tr><td>'._('FTP Server Password') . ':</td> + <td><input tabindex=7 type="text" name="EDIServerPwd" size=20 maxlength=20 value="' . $myrow['ediserverpwd'] . '"></td></tr>'; } -echo "</table><br><div class='centre'><input tabindex=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; +echo '</table><br /><div class="centre"><input tabindex=8 type="submit" name="submit" value="' ._('Update EDI Configuration'). '"></div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustLoginSetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.2 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Login Configuration'); include('includes/header.inc'); @@ -21,7 +19,7 @@ _('Petty Cash'), _('Setup')); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br>'; $sql="SELECT name FROM debtorsmaster @@ -33,17 +31,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '</p><br />';//'</p>'; -//echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + '</p><br />'; - //Make an array of the security roles where only one role is active and is ID 1 //For the security role selection box, we will only show roles that have: //- Only one entry in securitygroups AND the tokenid of this entry == 1 //First get all available security role ID's' -$query_roles = 'SELECT secroleid FROM securityroles'; +$query_roles = "SELECT secroleid FROM securityroles"; $result_roles = DB_query($query_roles, $db); //Check for every security role if they have only one entry in securitygroups, if so check if the tokenid == 1, then store in selection box @@ -65,9 +61,7 @@ $SecurityRoles[$Sec_row[0]] = $Sec_row[1]; } DB_free_result($Sec_Result); - } - } if (isset($_GET['SelectedUser'])){ @@ -88,7 +82,7 @@ if (strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID'])) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (strlen($_POST['Password'])<5){ @@ -270,18 +264,19 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -298,7 +293,7 @@ /*The SecurityHeadings array is defined in config.php */ - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -309,9 +304,9 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedUser=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedUser=%s&delete=1\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedUser=%s">' . _('Edit') . '</a></td> + <td><a href="%s&SelectedUser=%s&delete=1">' . _('Delete') . '</a></td> + </tr>', $myrow[0], $myrow[1], $myrow[2], @@ -323,9 +318,9 @@ $myrow[8], $myrow[9], $myrow[10], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -334,10 +329,9 @@ if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br>'; } - -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'] . '" />'; if (isset($SelectedUser)) { @@ -377,17 +371,16 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; - echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; + echo '<table class="selection"> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered + echo '<table class=selection><tr><td>' . _('User Login') . ':</td><td><input type="text" name="UserID" size=22 maxlength=20 /></td></tr>'; - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; - /*set the default modules to show to all this had trapped a few people previously*/ $i=0; @@ -415,53 +408,48 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size=22 maxlength=20 value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size=36 maxlength=35></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size=32 maxlength=30></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size=32 maxlength=55></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; +echo '<tr><td>' . _('Default Location') . ':</td> + <td><select name="DefaultLocation">'; -echo '<tr><td>' . _('Default Location') . ":</td> - <td><select name='DefaultLocation'>"; - $sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } - } + //Customer is fixed by selection of customer $_POST['Cust']=$_SESSION['CustomerID']; echo '<input type="hidden" name="Cust" value="' . $_POST['Cust'] . '">'; echo '<tr><td>'._('Customer Code').':</td> <td>' . $_POST['Cust'] . '</td></tr>'; -echo '<tr><td>' . _('Branch Code') . ":</td> - <td><select name='BranchCode'>"; +echo '<tr><td>' . _('Branch Code') . ':</td> + <td><select name="BranchCode">'; $sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_POST['Cust'] . "'"; $result = DB_query($sql,$db); @@ -474,79 +462,75 @@ } if (isset($_POST['BranchCode']) and $myrow['branchcode'] == $_POST['BranchCode']){ - - echo "<option selected value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option selected value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } else { - echo "<option Value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option Value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } - } -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != 'CVS'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -555,22 +539,25 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); -while (false != ($LanguageEntry = $LangDirHandle->read())){ +foreach ($Languages as $LanguageEntry){ - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -584,32 +571,34 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td> + <td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ - echo '<option selected value=0>' . _('No'); - echo '<option value=1>' . _('Yes'); + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; } else { - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; $i++; } -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td> + <td><select name="Blocked">'; if ($_POST['Blocked']==0){ - echo '<option selected value=0>' . _('Open'); - echo '<option value=1>' . _('Blocked'); + echo '<option selected value=0>' . _('Open') . '</option>'; + echo '<option value=1>' . _('Blocked') . '</option>'; } else { - echo '<option selected value=1>' . _('Blocked'); - echo '<option value=0>' . _('Open'); + echo '<option selected value=1>' . _('Blocked') . '</option>'; + echo '<option value=0>' . _('Open') . '</option>'; } echo '</select></td></tr>'; +echo '</table><br> + <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> + </form>'; -echo "</table><br> - <div class='centre'><input type='submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; - if (isset($_GET['SelectedUser'])) { echo '<script type="text/javascript">defaultControl(document.forms[0].Password);</script>'; } else { @@ -617,5 +606,4 @@ } include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustWhereAlloc.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,13 +1,12 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . @@ -15,32 +14,33 @@ echo '<table class=selection cellpadding=2><tr>'; -echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; +echo '<td>' . _('Type') . ':</td> + <td><select tabindex=1 name="TransType"> '; $sql = "SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12"; $resultTypes = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultTypes)){ if (isset($_POST['TransType'])){ if ($myrow['typeid'] == $_POST['TransType']){ - 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>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} -echo '<td>'._('Transaction Number').":</td> - <td><input tabindex=2 type=text name='TransNo' maxlength=10 size=10 value=". $_POST['TransNo'] . '></td>'; +echo '<td>'._('Transaction Number').':</td> + <td><input tabindex=2 type="text" name="TransNo" maxlength=10 size=10 value="'. $_POST['TransNo'] . '"></td>'; -echo "</tr></table><br> - <div class='centre'><input tabindex=3 type=submit name='ShowResults' value="._('Show How Allocated').'></div>'; +echo '</tr></table><br /> + <div class="centre"><input tabindex=3 type="submit" name="ShowResults" value="' . _('Show How Allocated') . '"></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ - echo '<br>'; + echo '<br />'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -59,7 +59,6 @@ $myrow = DB_fetch_array($result); $AllocToID = $myrow['id']; - $sql = "SELECT type, transno, trandate, @@ -79,18 +78,20 @@ if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<br><table cellpadding=2 class=selection>'; + echo '<br /><table cellpadding=2 class=selection>'; - echo '<tr><th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] - . '<br>'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th></tr>'; + echo '<tr> + <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> + </tr>'; - $tableheader = "<tr><th>"._('Type')."</th> - <th>"._('Number')."</th> - <th>"._('Reference')."</th> - <th>"._('Ex Rate')."</th> - <th>"._('Amount')."</th> - <th>"._('Alloc').'</th> - </tr>'; + $tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Alloc') . '</th> + </tr>'; echo $tableheader; $RowCounter = 1; @@ -112,13 +113,13 @@ } else { $TransType = _('Receipt'); } - echo "<td>".$TransType."</td> - <td>".$myrow['transno']."</td> - <td>".$myrow['reference']."</td> - <td>".$myrow['rate']."</td> - <td class=number>".number_format($myrow['totalamt'],2)."</td> - <td class=number>".number_format($myrow['amt'],2)."</td> - </tr>"; + echo '<td>' . $TransType . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . $myrow['reference'] . '</td> + <td>' . $myrow['rate'] . '</td> + <td class=number>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $RowCounter++; If ($RowCounter == 12){ Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerBranches.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.53 $ */ /* $Id$*/ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Customer Branches'); include('includes/header.inc'); @@ -17,7 +14,7 @@ if (!isset($DebtorNo)) { prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. - <br>'._('When the pages is called from within the system this will always be the case').' <br>'. + <br />'._('When the pages is called from within the system this will always be the case').' <br />'. _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; @@ -30,9 +27,6 @@ $SelectedBranch = strtoupper($_POST['SelectedBranch']); } -// This link is already available on the menu on this page -//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; - if (isset($Errors)) { unset($Errors); } @@ -107,39 +101,35 @@ define("KEY", $api_key); if ($map_host=="") { // check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway. - echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; + echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - - $address = $_POST["BrAddress1"] . ", " . $_POST["BrAddress2"] . ", " . $_POST["BrAddress3"] . ", " . $_POST["BrAddress4"]; - - $base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY; - $request_url = $base_url . "&q=" . urlencode($address); - $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); -// $xml = simplexml_load_file($request_url) or die("url not loading"); - - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - - $status = $xml->Response->Status->code; - if (strcmp($status, "200") == 0) { - // Successful geocode - $geocode_pending = false; - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - } else { - // failure to geocode - $geocode_pending = false; - echo '<div class="page_help_text"><b>Geocode Notice:</b> Address: ' . $address . ' failed to geocode. '; - echo 'Received status ' . $status . '</div>'; - } + $address = $_POST['BrAddress1'] . ", " . $_POST['BrAddress2'] . ", " . $_POST['BrAddress3'] . ", " . $_POST['BrAddress4']; + $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml&key=' . KEY; + $request_url = $base_url . '&q=' . urlencode($address); + $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + + $status = $xml->Response->Status->code; + if (strcmp($status, '200') == 0) { + // Successful geocode + $geocode_pending = false; + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + } else { + // failure to geocode + $geocode_pending = false; + echo '<div class="page_help_text"><b>' . _('Geocode Notice') . ':</b> ' . _('Address') . ': ' . $address . ' ' . _('failed to geocode'); + echo _('Received status') . ' ' . $status . '</div>'; + } + } } - } if (isset($SelectedBranch) AND $InputError !=1) { /*SelectedBranch could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -242,8 +232,8 @@ '" . $_POST['DeliverBlind'] . "' )"; } - echo '<br>'; - $msg = _('Customer branch<b>').' ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' '._('</b>has been added, add another branch, or return to <a href=index.php>Main Menu</a>'); + echo '<br />'; + $msg = _('Customer branch').'<b> ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' </b>'._('has been added, add another branch, or return to the') . ' <a href="index.php">' . _('Main Menu') . '</a>'; //run the SQL from either of the above possibilites @@ -292,7 +282,7 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br>' . + prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br />' . _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); } else { @@ -303,7 +293,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales analysis records exist for it'),'error'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); } else { @@ -313,7 +303,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales orders exist for it') . '. ' . _('Purge old sales orders first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { // Check if there are any users that refer to this branch code $sql= "SELECT COUNT(*) FROM www_users WHERE www_users.branchcode='".$SelectedBranch."' AND www_users.customerid = '".$DebtorNo."'"; @@ -323,7 +313,7 @@ if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because users exist that refer to it') . '. ' . _('Purge old users first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); } else { $sql="DELETE FROM custbranch WHERE branchcode='" . $SelectedBranch . "' AND debtorno='" . $DebtorNo . "'"; @@ -373,16 +363,18 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; - echo "<tr><th>"._('Code')."</th> - <th>"._('Name')."</th> - <th>"._('Branch Contact')."</th> - <th>"._('Salesman')."</th> - <th>"._('Area')."</th> - <th>"._('Phone No')."</th> - <th>"._('Fax No')."</th> - <th>"._('Email')."</th> - <th>"._('Tax Group')."</th> - <th>"._('Enabled?')."</th></tr>"; + + echo '<tr><th>'._('Code').'</th> + <th>'._('Name').'</th> + <th>'._('Branch Contact').'</th> + <th>'._('Salesman').'</th> + <th>'._('Area').'</th> + <th>'._('Phone No').'</th> + <th>'._('Fax No').'</th> + <th>'._('Email').'</th> + <th>'._('Tax Group').'</th> + <th>'._('Enabled?').'</th></tr>'; + $k=0; do { if ($k==1){ @@ -393,20 +385,19 @@ $k=1; } - - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='Mailto:%s'>%s</a></td> + <td><a href="Mailto:%s">%s</a></td> <td>%s</td> <td>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s'>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s&delete=yes' onclick=\"return confirm('" . - _('Are you sure you wish to delete this branch?') . "');\">%s</td></tr>", + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s">%s</td> + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s&delete=yes" onclick=\'return confirm("' . + _('Are you sure you wish to delete this branch?') . '");\'>%s</td></tr>', $myrow[10], $myrow[2], $myrow[5], @@ -431,9 +422,9 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><br><table class=selection><tr><td><div class="centre">'; - echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br>'; - echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br>'; + echo '</table><br /><table class=selection><tr><td><div class="centre">'; + echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br />'; + echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br />'; echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, @@ -462,7 +453,7 @@ } 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'] . '" />'; if (isset($SelectedBranch)) { @@ -532,17 +523,18 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo "<input type=hidden name='SelectedBranch' VALUE='" . $SelectedBranch . "'>"; - echo "<input type=hidden name='BranchCode' VALUE='" . $_POST['BranchCode'] . "'>"; - + echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . 'DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } - echo "<br><table class=selection>"; - echo "<tr><th colspan=2><div class='centre'><b>"._('Change Branch')."</b></th></tr>"; - echo "<tr><td>"._('Branch Code').':</td><td>'; + echo '<br><table class="selection">'; + echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; + echo '<tr><td>'._('Branch Code').':</td><td>'; + echo $_POST['BranchCode'] . '</td></tr>'; } else { //end of if $SelectedBranch only do the else when a new record is being entered @@ -577,8 +569,7 @@ } echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; echo '<table class=selection><tr><td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=1 type='Text' name='BranchCode' size=12 maxlength=10 value=" . $_POST['BranchCode'] . '></td></tr>'; + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -590,7 +581,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php?"' . SID . '">'._('Define Sales People') . '</a>'; + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; include('includes/footer.inc'); exit; } @@ -654,7 +645,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no areas defined as yet') . ' - ' . _('customer branches must be allocated to an area') . '. ' . _('Please use the link below to define at least one sales area'),'error'); - echo "<br><a href='$rootpath/Areas.php?" . SID . "'>"._('Define Sales Areas').'</a>'; + echo '<br /><a href="' . $rootpath. '/Areas.php">'._('Define Sales Areas').'</a>'; include('includes/footer.inc'); exit; } @@ -681,7 +672,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); - echo "<br><a href='$rootpath/Locations.php?" . SID . "'>"._('Define Stock Locations').'</a>'; + echo '<br /><a href="' . $rootpath . '/Locations.php">'._('Define Stock Locations').'</a>'; include('includes/footer.inc'); exit; } @@ -691,11 +682,11 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['DefaultLocation']) and $myrow['loccode']==$_POST['DefaultLocation']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['loccode'] . '>' . $myrow['locationname']; + echo $myrow['loccode'] . '>' . $myrow['locationname'] . '</option>'; } //end while loop @@ -718,7 +709,7 @@ 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)) { @@ -727,30 +718,32 @@ } else { echo '<option VALUE='; } - echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>'._('Transactions on this branch').":</td><td><select tabindex=20 name='DisableTrans'>"; + echo '<tr><td>'._('Transactions on this branch') . ':</td> + <td><select tabindex=20 name="DisableTrans">'; if ($_POST['DisableTrans']==0){ - echo '<option selected VALUE=0>' . _('Enabled'); - echo '<option VALUE=1>' . _('Disabled'); + echo '<option selected value=0>' . _('Enabled') . '</option>'; + echo '<option value=1>' . _('Disabled') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Disabled'); - echo '<option VALUE=0>' . _('Enabled'); + echo '<option selected value=1>' . _('Disabled') . '</option>'; + echo '<option value=0>' . _('Enabled') . '</option>'; } echo ' </select></td></tr>'; - echo '<tr><td>'._('Default freight/shipper method').":</td><td><select tabindex=21 name='DefaultShipVia'>"; - $SQL = 'SELECT shipper_id, shippername FROM shippers'; + echo '<tr><td>'._('Default freight/shipper method') . ':</td> + <td><select tabindex=21 name="DefaultShipVia">'; + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL,$db); while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ - echo '<option selected VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } @@ -759,22 +752,16 @@ /* This field is a default value that will be used to set the value on the sales order which will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Default Packlist') . ":</td><td><select tabindex=22 name='DeliverBlind'>"; - for ($p = 1; $p <= 2; $p++) { - echo '<option VALUE=' . $p; - if ($p == $_POST['DeliverBlind']) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 1: - echo _('Show company details and logo'); break; - case 2: - echo _('Hide company details and logo'); break; - } - } - echo '</select></td></tr>'; + echo '<tr><td>' . _('Default Packlist') . ':</td><td><select tabindex=22 name="DeliverBlind">'; + if ($_POST['DeliverBlind']==2){ + echo '<option value="1">' . _('Show company details and logo') . '</option>'; + echo '<option selected value="2">' . _('Hide company details and logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show company details and logo') . '</option>'; + echo '<option value="2">' . _('Hide company details and logo') . '</option>'; + } + + echo '</select></td></tr>'; echo '<tr><td>'._('Postal Address 1 (Street)').':</td>'; if (!isset($_POST['BrPostAddr1'])) {$_POST['BrPostAddr1']='';} @@ -792,7 +779,7 @@ if (!isset($_POST['CustBranchCode'])) {$_POST['CustBranchCode']='';} echo '<td><input tabindex=27 type="Text" name="CustBranchCode" size=31 maxlength=30 value="'. $_POST['CustBranchCode'].'"></td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; + echo '<br /><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; echo '</form>'; } //end if record deleted no point displaying form to add record Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerReceipt.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -231,10 +231,10 @@ echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; echo '<table class=selection><tr><th>'._('Batch Number').'</th> - <th>'._('Date Banked').'</th> - <th>'._('Customer Name').'</th - <th>'._('GL Code').'</th - <th>'._('Amount of Receipt').'</th></tr>'; + <th>' . _('Date Banked') . '</th> + <th>' . _('Customer Name') . '</th> + <th>' . _('GL Code') . '</th> + <th>' . _('Amount of Receipt').'</th></tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -859,8 +859,8 @@ <td class=number>' . number_format($ReceiptItem->Discount,2) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td>'.$ReceiptItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> + <td>'.$ReceiptItem->Narrative . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } @@ -918,7 +918,7 @@ echo '<table class=selection>'; - $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . "%"; + $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; @@ -1050,9 +1050,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - - printf("<td><font size=1><input tabindex=".number_format(12+$j)." type=submit name='Select' value='%s'</font></td> - <td>%s</td></tr>", + printf('<td><font size=1> + <input tabindex='.number_format(12+$j).' type=submit name="Select" value="%s"></font></td> + <td>%s</td></tr>', $myrow['debtorno'], $myrow['name']); Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerTypes.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Types') . ' / ' . _('Maintenance'); include('includes/header.inc'); @@ -43,7 +41,7 @@ if (strlen($_POST['typename'])==0) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('The customer type name description must contain at least one character'),'error'); $Errors[$i] = 'CustomerType'; $i++; @@ -56,7 +54,7 @@ $checkrow=DB_fetch_row($checkresult); if ($checkrow[0]>0 and !isset($SelectedType)) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('You already have a customer type called').' '.$_POST['typename'],'error'); $Errors[$i] = 'CustomerName'; $i++; @@ -124,7 +122,7 @@ $result = DB_query($sql,$db); $_SESSION['DefaultCustomerType'] = $_POST['typeid']; } - echo '<br>'; + echo '<br />'; prnMsg($msg,'success'); unset($SelectedType); @@ -146,7 +144,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); + prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); } else { @@ -156,13 +154,13 @@ $result = DB_query($sql,$db,$ErrMsg); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg (_('Cannot delete this type because customers are currently set up to use this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this type code')); + prnMsg (_('Cannot delete this type because customers are currently set up to use this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this type code')); } else { $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; $ErrMsg = _('The Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); - echo '<br>'; + echo '<br />'; prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); unset ($SelectedType); @@ -182,11 +180,11 @@ $sql = 'SELECT typeid, typename FROM debtortype'; $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Type ID') . "</th> - <th>" . _('Type Name') . "</th> - </tr>"; + echo '<br /><table class=selection>'; + echo '<tr> + <th>' . _('Type ID') . '</th> + <th>' . _('Type Name') . '</th> + </tr>'; $k=0; //row colour counter @@ -199,16 +197,17 @@ $k=1; } - printf(" +printf('<td>%s</td> <td>%s</td> - <td>%s</td> - <td><a href='%sSelectedType=%s'>" . _('Edit') . "</td> - <td><a href='%sSelectedType=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this Customer Type?') . "');\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedType=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedType=%s&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this Customer Type?') . '");\'>' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[1], - $_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>'; @@ -217,18 +216,17 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Types Defined') . '</a></div><p>'; + echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types 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 // The user wish to EDIT an existing type - if ( isset($SelectedType) AND $SelectedType!='' ) - { + if ( isset($SelectedType) AND $SelectedType!='' ) { $sql = "SELECT typeid, typename @@ -241,26 +239,23 @@ $_POST['typeid'] = $myrow['typeid']; $_POST['typename'] = $myrow['typename']; - echo "<input type=hidden name='SelectedType' VALUE=" . $SelectedType . ">"; - echo "<input type=hidden name='typeid' VALUE=" . $_POST['typeid'] . ">"; - echo "<table class=selection> <tr><td>"; + echo '<input type=hidden name="SelectedType" value="' . $SelectedType . '">'; + echo '<input type=hidden name="typeid" value=' . $_POST['typeid'] . '">'; + echo '<table class="selection">'; // We dont allow the user to change an existing type code - echo 'Type ID: ' . $_POST['typeid'] . '</td></tr>'; + echo '<tr><td>' . _('Type ID') . ': ' . $_POST['typeid'] . '</td></tr>'; } else { - // This is a new type so the user may volunteer a type code - - echo "<table class=selection>"; - + echo '<table class="selection">'; } if (!isset($_POST['typename'])) { $_POST['typename']=''; } - echo "<tr><td>" . _('Type Name') . ":</td><td><input type='Text' name='typename' value='" . $_POST['typename'] . "'></td></tr>"; + echo '<tr><td>' . _('Type Name') . ':</td><td><input type="Text" name="typename" value="' . $_POST['typename'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/Customers.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -281,11 +281,11 @@ $BranchCode = substr($_POST['DebtorNo'],0,4); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath ."/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">'; echo '<div class="centre">' . _('You should automatically be forwarded to the entry of a new Customer Branch page') . '. ' . _('If this does not happen') .' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='" . $rootpath . "/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . '.</div>'; + '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '"></a></div>'; include('includes/footer.inc'); exit; @@ -421,8 +421,8 @@ /* First check that all the necessary items have been setup */ $SetupErrors=0; //Count errors - $sql='SELECT COUNT(typeabbrev) - FROM salestypes'; + $sql="SELECT COUNT(typeabbrev) + FROM salestypes"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -430,8 +430,8 @@ _('Click').' '.'<a target="_blank" href="' . $rootpath . '/SalesTypes.php">' . _('here').' ' . '</a>'._('to set up your price lists'),'warning').'<br />'; $SetupErrors += 1; } - $sql='SELECT COUNT(typeid) - FROM debtortype'; + $sql="SELECT COUNT(typeid) + FROM debtortype"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -445,20 +445,20 @@ include('includes/footer.inc'); exit; } - - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + 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" />'; $DataError =0; - echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; + echo '<table cl... [truncated message content] |