[Weberp-svn] SF.net SVN: weberp:[5200] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-04-18 07:38:17
|
Revision: 5200 http://weberp.svn.sourceforge.net/weberp/?rev=5200&view=rev Author: tim_schofield Date: 2011-04-18 07:38:09 +0000 (Mon, 18 Apr 2011) Log Message: ----------- XHTML and quoting changes Modified Paths: -------------- trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/CustomerTypes.php trunk/Customers.php Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/CustEDISetup.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -27,13 +27,9 @@ //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') - OR strstr($_POST['EDIReference'],"\"") - OR strstr($_POST['EDIReference'],'&') - OR strstr($_POST['EDIReference'],' ')) { + if (ContainsIllegalCharacters($_POST['EDIReference'])) { $InputError = 1; - prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); + prnMsg(_('The customers EDI reference code cannot contain any of the illegal characters') ,'warn'); } if (strlen($_POST['EDIReference'])<4 AND ($_POST['EDIInvoices']==1 OR $_POST['EDIOrders']==1)){ $InputError = 1; Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/CustLoginSetup.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -72,7 +72,7 @@ prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); } elseif (ContainsIllegalCharacters($_POST['UserID'])) { $InputError = 1; - prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); + prnMsg(_('User names cannot contain any of the illegal characters') ,'error'); } elseif (strlen($_POST['Password'])<5){ if (!$SelectedUser){ $InputError = 1; @@ -252,18 +252,18 @@ $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 @@ -280,7 +280,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> @@ -291,9 +291,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], @@ -316,10 +316,10 @@ 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)) { @@ -359,16 +359,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 $_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*/ @@ -397,28 +397,28 @@ 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); @@ -427,10 +427,10 @@ 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>'; } @@ -442,8 +442,8 @@ 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); @@ -457,78 +457,78 @@ 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 != 'CVS'){ 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>'; } } } @@ -537,8 +537,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -548,11 +548,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' 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>'; } } } @@ -566,31 +566,31 @@ $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>'; @@ -600,4 +600,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/CustWhereAlloc.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -7,7 +7,7 @@ $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,29 +15,29 @@ 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>'; @@ -84,12 +84,12 @@ 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> + $tableheader = '<tr><th>'._('Type').'</th> + <th>'._('Number').'</th> + <th>'._('Reference').'</th> + <th>'._('Ex Rate').'</th> + <th>'._('Amount').'</th> + <th>'._('Alloc').'</th> </tr>'; echo $tableheader; @@ -112,13 +112,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'],2).'</td> + <td class=number>'.number_format($myrow['amt'],2).'</td> + </tr>'; $RowCounter++; If ($RowCounter == 12){ Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/CustomerBranches.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -54,7 +54,7 @@ if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { $InputError = 1; - prnMsg(_('The Branch code cannot contain a space or any of the following characters')." + ' \ & or \"",'error'); + prnMsg(_('The Branch code cannot contain a space or any of the illegal characters'),'error'); $Errors[$i] = 'BranchCode'; $i++; } @@ -107,8 +107,8 @@ 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>'; - } else { + 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"]; @@ -117,27 +117,27 @@ $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]; + $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>'; - } + $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) { @@ -180,7 +180,7 @@ /*Selected branch is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Customer Branches form */ $SelectedBranch=$_POST['BranchCode']; - $sql = "INSERT INTO custbranch (branchcode, + $sql = "INSERT INTO custbranch (branchcode, debtorno, brname, braddress1, @@ -289,7 +289,7 @@ unset($_POST['CustBranchCode']); unset($_POST['DeliverBlind']); unset($SelectedBranch); - } + } } else if (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -330,12 +330,12 @@ 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 . "'"; $ErrMsg = _('The branch record could not be deleted') . ' - ' . _('the SQL server returned the following message'); - $result = DB_query($sql,$db,$ErrMsg); + $result = DB_query($sql,$db,$ErrMsg); if (DB_error_no($db)==0){ prnMsg(_('Branch Deleted'),'success'); } @@ -380,16 +380,16 @@ 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){ @@ -401,19 +401,19 @@ } - 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], @@ -469,7 +469,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)) { @@ -539,17 +539,17 @@ $_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 @@ -571,12 +571,12 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); $_POST['BranchCode'] = $_GET['BranchCode']; - $_POST['BrName'] = $myrow['name']; + $_POST['BrName'] = $myrow['name']; $_POST['BrAddress1'] = $myrow['addrsss1']; - $_POST['BrAddress2'] = $myrow['addrsss2']; + $_POST['BrAddress2'] = $myrow['addrsss2']; $_POST['BrAddress3'] = $myrow['addrsss3']; $_POST['BrAddress4'] = $myrow['addrsss4']; - $_POST['BrAddress5'] = $myrow['addrsss5']; + $_POST['BrAddress5'] = $myrow['addrsss5']; $_POST['BrAddress6'] = $myrow['addrsss6']; } if (!isset($_POST['BranchCode'])) { @@ -585,7 +585,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>'; + ' tabindex=1 type="Text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -644,12 +644,10 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Salesman']) and $myrow['salesmancode']==$_POST['Salesman']) { - echo '<option selected VALUE='; + echo '<option selected VALUE="'.$myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } else { - echo '<option VALUE='; + echo '<option VALUE="'.$myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } - echo $myrow['salesmancode'] . '>' . $myrow['salesmanname']; - } //end while loop echo '</select></td></tr>'; @@ -661,7 +659,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; } @@ -670,12 +668,10 @@ echo '<td><select tabindex=14 name="Area">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo '<option selected VALUE='; + echo '<option selected VALUE="'.$myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } else { - echo '<option VALUE='; + echo '<option VALUE="'.$myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } - echo $myrow['areacode'] . '>' . $myrow['areadescription']; - } //end while loop @@ -688,7 +684,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; } @@ -698,12 +694,10 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['DefaultLocation']) and $myrow['loccode']==$_POST['DefaultLocation']) { - echo '<option selected VALUE='; + echo '<option selected VALUE="'.$myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option VALUE='; + echo '<option VALUE="'.$myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - echo $myrow['loccode'] . '>' . $myrow['locationname']; - } //end while loop echo '</select></td></tr>'; @@ -741,7 +735,7 @@ if (!isset($_POST['Email'])) {$_POST['Email']='';} echo '<tr><td>'.(($_POST['Email']) ? '<a href="Mailto:'.$_POST['Email'].'">'._('Email').':</a>' : _('Email').':').'</td>'; - //only display email link if there is an email address + //only display email link if there is an email address echo '<td><input tabindex=18 type="Text" name="Email" size=56 maxlength=55 value="'. $_POST['Email'].'"></td></tr>'; echo '<tr><td>'._('Tax Group').':</td>'; @@ -754,34 +748,34 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) { - echo '<option selected VALUE='; + echo '<option selected VALUE="'. $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE='; + echo '<option VALUE="'. $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } - echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + ; } //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'>"; + 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>'; } } @@ -790,22 +784,21 @@ /* 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">'; + for ($p = 1; $p <= 2; $p++) { + if ($p == $_POST['DeliverBlind']) { + echo '<option VALUE=' . $p . ' selected>'; + } else { + echo '<option VALUE=' . $p . '>'; + } + switch ($p) { + case 1: + echo _('Show company details and logo') . '</option>'; break; + case 2: + echo _('Hide company details and logo') . '</option>'; break; + } + } + echo '</select></td></tr>'; echo '<tr><td>'._('Postal Address 1 (Street)').':</td>'; if (!isset($_POST['BrPostAddr1'])) {$_POST['BrPostAddr1']='';} @@ -829,4 +822,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/CustomerReceipt.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -232,8 +232,8 @@ echo '<table class=selection><tr><th>'._('Batch Number').'</th> <th>'._('Date Banked').'</th> - <th>'._('Customer Name').'</th - <th>'._('GL Code').'</th + <th>'._('Customer Name').'</th> + <th>'._('GL Code').'</th> <th>'._('Amount of Receipt').'</th></tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -1051,8 +1051,9 @@ $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-18 07:36:59 UTC (rev 5199) +++ trunk/CustomerTypes.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -183,10 +183,10 @@ $result = DB_query($sql,$db); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Type ID') . "</th> - <th>" . _('Type Name') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Type ID') . '</th> + <th>' . _('Type Name') . '</th> + </tr>'; $k=0; //row colour counter @@ -199,12 +199,12 @@ $k=1; } - printf(" + printf(' <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], @@ -217,11 +217,11 @@ //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 @@ -241,9 +241,9 @@ $_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> <tr><td>'; // We dont allow the user to change an existing type code @@ -253,14 +253,14 @@ // 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 @@ -272,4 +272,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-04-18 07:36:59 UTC (rev 5199) +++ trunk/Customers.php 2011-04-18 07:38:09 UTC (rev 5200) @@ -50,7 +50,7 @@ $i++; } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) { $InputError = 1; - prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); + prnMsg( _('The customer code cannot contain any of the illefal characters') ,'error'); $Errors[$i] = 'DebtorNo'; $i++; } elseif (strlen($_POST['Address1']) >40) { @@ -285,7 +285,7 @@ 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; @@ -443,10 +443,10 @@ 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; @@ -455,7 +455,7 @@ /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then provide an input box for the DebtorNo to manually assigned */ if ($_SESSION['AutoDebtorNo']==0) { - echo '<tr><td>' . _('Customer Code') . ":</td><td><input tabindex=1 type='Text' name='DebtorNo' size=11 maxlength=10></td></tr>"; + echo '<tr><td>' . _('Customer Code') . ':</td><td><input tabindex=1 type="Text" name="DebtorNo" size=11 maxlength=10></td></tr>'; } echo '<tr><td>' . _('Customer Name') . ':</td> @@ -526,8 +526,8 @@ <td><input tabindex=13 type="textbox" class ="number" name="PymtDiscount" value=0 size=5 maxlength=4></td></tr>'; echo '<tr><td>' . _('Credit Limit') . ':</td> <td><input tabindex=14 type="text" class="number" name="CreditLimit" value=' . $_SESSION['DefaultCreditLimit'] . ' size=16 maxlength=14></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ":</td> - <td><input tabindex=15 type='Text' name='TaxRef' size=22 maxlength=20></td></tr>"; + echo '<tr><td>' . _('Tax Reference') . ':</td> + <td><input tabindex=15 type="Text" name="TaxRef" size=22 maxlength=20></td></tr>'; $result=DB_query("SELECT terms, termsindicator FROM paymentterms",$db); if (DB_num_rows($result)==0){ @@ -594,7 +594,8 @@ echo'</table></td></tr></table>'; if ($DataError ==0){ - echo "<br /><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; + echo '<br /><div class="centre"><input tabindex=20 type="Submit" name="submit" value="' . _('Add New Customer') . + '"> <input tabindex=21 type=submit action=RESET VALUE="' . _('Reset') . '"></div>'; } echo '</form>'; @@ -602,7 +603,7 @@ //DebtorNo exists - either passed when calling the form or from the form itself - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; @@ -643,8 +644,8 @@ /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then display the DebtorNo */ if ($_SESSION['AutoDebtorNo']== 0 ) { - echo '<tr><td>' . _('Customer Code') . ":</td> - <td>" . $DebtorNo. "</td></tr>"; + echo '<tr><td>' . _('Customer Code') . ':</td> + <td>' . $DebtorNo. '</td></tr>'; } $_POST['CustName'] = $myrow['name']; $_POST['Address1'] = $myrow['address1']; @@ -725,13 +726,13 @@ echo '<tr><td>' . _('Sales Type') . ":</td><td>".$myrow['sales_type']."</td></tr>"; } else { $result=DB_query("SELECT typeabbrev, sales_type FROM salestypes",$db); - echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> - <td><select name='SalesType'>"; + echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ':</td> + <td><select name="SalesType">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['SalesType']==$myrow['typeabbrev']){ - echo "<option selected value='". $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option selected value="'. $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='". $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option value="'. $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } //end while loop DB_data_seek($result,0); @@ -744,13 +745,13 @@ echo '<tr><td>' . _('Customer Type') . ":</td><td>".$myrow['typename']."</td></tr>"; } else { $result=DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename",$db); - echo '<tr><td>' . _('Customer Type') . ":</td> - <td><select name='typeid'>"; + echo '<tr><td>' . _('Customer Type') . ':</td> + <td><select name="typeid">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['typeid']==$myrow['typeid']){ - echo "<option selected VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected VALUE="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } else { - echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option VALUE="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } //end while loop DB_data_seek($result,0); @@ -783,16 +784,16 @@ if (isset($_GET['Modify'])) { $result=DB_query("SELECT terms FROM paymentterms WHERE termsindicator='".$_POST['PaymentTerms']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Payment Terms') . ":</td><td>".$myrow['terms']."</td></tr>"; + echo '<tr><td>' . _('Payment Terms') . ':</td><td>'.$myrow['terms'].'</td></tr>'; } else { $result=DB_query("SELECT terms, termsindicator FROM paymentterms",$db); - echo '<tr><td>' . _('Payment Terms') . ":</td> - <td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms']==$myrow['termsindicator']){ - echo "<option selected VALUE=". $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option selected VALUE="'. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; } else { - echo '<option VALUE='. $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option VALUE='. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; } } //end while loop DB_data_seek($result,0); @@ -805,13 +806,13 @@ echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['reasondescription']."</td></tr>"; } else { $result=DB_query("SELECT reasoncode, reasondescription FROM holdreasons",$db); - echo '<tr><td>' . _('Credit Status') . ":</td> - <td><select name='HoldReason'>"; + echo '<tr><td>' . _('Credit Status') . ':</td> + <td><select name="HoldReason">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['HoldReason']==$myrow['reasoncode']){ - echo '<option selected VALUE='. $myrow['reasoncode'] . '>' . $myrow['reasondescription']; + echo '<option selected VALUE='. $myrow['reasoncode'] . '">' . $myrow['reasondescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow['reasoncode'] . '>' . $myrow['reasondescription']; + echo '<option VALUE='. $myrow['reasoncode'] . '">' . $myrow['reasondescription'] . '</option>'; } } //end while loop DB_data_seek($result,0); @@ -824,13 +825,13 @@ echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['currency']."</td></tr>"; } else { $result=DB_query("SELECT currency, currabrev FROM currencies",$db); - echo '<tr><td>' . _('Customers Currency') . ":</td> - <td><select name='CurrCode'>"; + echo '<tr><td>' . _('Customers Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ - echo '<option selected value='. $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected value='. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo '<option value='. $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option value='. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } //end while loop DB_data_seek($result,0); @@ -839,38 +840,38 @@ /*added lines 8/23/2007 by Morris Kelly to get po line parameter Y/N*/ if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Credit Status') . ":</td><td>"._('No')."</td></tr>"; + echo '<tr><td>' . _('Credit Status') . ':</td><td>'._('No').'</td></tr>'; } else { - echo '<tr><td>' . _('Credit Status') . ":</td><td>"._('Yes')."</td></tr>"; + echo '<tr><td>' . _('Credit Status') . ':</td><td>'._('Yes').'</td></tr>'; } } else { - echo '<tr><td>' . _('Require Customer PO Line on SO') . ":</td> - <td><select name='CustomerPOLine'>"; + echo '<tr><td>' . _('Require Customer PO Line on SO') . ':</td> + <td><select name="CustomerPOLine">'; if ($_POST['CustomerPOLine']==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 value=0>' . _('No'); - echo '<option selected value=1>' . _('Yes'); + echo '<option value=0>' . _('No') . '</option>'; + echo '<option selected value=1>' . _('Yes') . '</option>'; } echo '</select></td></tr>'; } if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Invoice Addressing') . ":</td><td>"._('Address to HO')."</td></tr>"; + echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to HO').'</td></tr>'; } else { - echo '<tr><td>' . _('Invoice Addressing') . ":</td><td>"._('Address to Branch')."</td></tr>"; + echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to Branch').'</td></tr>'; } } else { - echo '<tr><td>' . _('Invoice Addressing') . ":</td> - <td><select name='AddrInvBranch'>"; + echo '<tr><td>' . _('Invoice Addressing') . ':</td> + <td><select name="AddrInvBranch">'; if ($_POST['InvAddrBranch']==0){ - echo '<option selected VALUE=0>' . _('Address to HO'); - echo '<option VALUE=1>' . _('Address to Branch'); + echo '<option selected VALUE=0>' . _('Address to HO') . '</option>'; + echo '<option VALUE=1>' . _('Address to Branch') . '</option>'; } else { - echo '<option VALUE=0>' . _('Address to HO'); - echo '<option selected VALUE=1>' . _('Address to Branch'); + echo '<option VALUE=0>' . _('Address to HO') . '</option>'; + echo '<option selected VALUE=1>' . _('Address to Branch') . '</option>'; } } @@ -941,7 +942,7 @@ }//END WHILE LIST LOOP echo '</table>'; // echo "<input type='Submit' name='addcontact' VALUE='" . _('ADD Contact') . "'>"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo="'.$DebtorNo.'"&ID='.$ID.'&Edit'.$Edit.'>'; + echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?DebtorNo="'.$DebtorNo.'"&ID='.$ID.'&Edit'.$Edit.'>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Edit) and $Edit!='') { $SQLcustcontacts="SELECT * from custcontacts @@ -954,15 +955,15 @@ $_POST['phoneno']=$myrowcc['phoneno']; $_POST['notes']=$myrowcc['notes']; echo '<table class=selection>'; - echo "<tr> - <td>" . _('Name') . "</td><td><input type=text name='custname' value='".$_POST['custname']."'></td></tr><tr> - <td>" . _('Role') . "</td><td><input type=text name='role' value='".$_POST['role']."'></td></tr><tr> - <td>" . _('Phone no') . "</td><td><input type='text' name='phoneno' value='".$_POST['phoneno']."'></td></tr><tr> - <td>" . _('Notes') . "</td><td><textarea name='notes'>".$_POST['notes']."</textarea></td></tr> + echo '<tr> + <td>' . _('Name') . '</td><td><input type=text name="custname" value="'.$_POST['custname'].'"></td></tr><tr> + <td>' . _('Role') . '</td><td><input type=text name="role" value="'.$_POST['role'].'"></td></tr><tr> + <td>' . _('Phone no') . '</td><td><input type="text" name="phoneno" value="'.$_POST['phoneno'].'"></td></tr><tr> + <td>' . _('Notes') . '</td><td><textarea name="notes">'.$_POST['notes'].'</textarea></td></tr> <tr><td colspan=2><input type=submit name=update value=update></td></tr></table> - "; + '; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo="'.$DebtorNo.'"&ID"'.$ID.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'&ID'.$ID.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |