From: <dai...@us...> - 2011-05-01 09:45:27
|
Revision: 4559 http://web-erp.svn.sourceforge.net/web-erp/?rev=4559&view=rev Author: daintree Date: 2011-05-01 09:45:18 +0000 (Sun, 01 May 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/AccountSections.php trunk/AgedDebtors.php trunk/AuditTrail.php trunk/BOMIndented.php trunk/BOMListing.php trunk/BOMs.php trunk/BankAccounts.php trunk/Logout.php trunk/PageSecurity.php trunk/SecurityTokens.php trunk/StockTransferControlled.php trunk/StockUsage.php trunk/SuppTransGLAnalysis.php trunk/SupplierContacts.php trunk/SupplierInquiry.php trunk/SupplierTypes.php trunk/TaxGroups.php trunk/WorkOrderCosting.php trunk/Z_CheckDebtorsControl.php trunk/css/default/login.css trunk/css/fresh/login.css trunk/css/gel/login.css trunk/css/jelly/login.css trunk/css/professional/login.css trunk/css/professional-rtl/login.css trunk/css/silverwolf/login.css trunk/doc/Change.log.html trunk/includes/Login.php trunk/index.php Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AccountSections.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Account Sections'); @@ -136,7 +134,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; } else { //Fetch section name @@ -176,11 +174,11 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo "<table name='SectionList' class='selection'> + echo '<table name="SectionList" class="selection"> <tr> - <th>" . _('Section Number') . "</th> - <th>" . _('Section Description') . "</th> - </tr>"; + <th>' . _('Section Number') . '</th> + <th>' . _('Section Description') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -194,11 +192,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' || $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -207,12 +205,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID .'>' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' name='AccountSections' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { @@ -233,10 +231,12 @@ $_POST['SectionID'] = $myrow['sectionid']; $_POST['SectionName'] = $myrow['sectionname']; - echo "<input type=hidden name='SelectedSectionID' value='" . $_POST['SectionID'] . "'>"; - echo "<table class=selection> - <td>" . _('Section Number') . ':' . "</td> - <td>" . $_POST['SectionID'] . "</td>"; + echo '<input type=hidden name="SelectedSectionID" value="' . $_POST['SectionID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Section Number') . ':' . '</td> + <td>' . $_POST['SectionID'] . '</td> + </tr>'; } } else { @@ -250,22 +250,23 @@ if (!isset($_POST['SectionName'])) { $_POST['SectionName']=''; } - echo "<table class='selection'> + echo '<table class="selection"> <tr> - <td>" . _('Section Number') . ':' . '</td> - <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionID' class='number' size='4' maxlength='4' value='" . $_POST['SectionID'] . "' /></td></tr>"; + <td>' . _('Section Number') . ':' . '</td> + <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionID" class="number" size="4" maxlength="4" value="' . $_POST['SectionID'] . '" /></td> + </tr>'; } - echo "<tr><td>" . _('Section Description') . ':' . '</td> - <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionName' size='30' maxlength='30' value='" . $_POST['SectionName'] . "' /></td> - </tr>"; + echo '<tr><td>' . _('Section Description') . ':' . '</td> + <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionName" size="30" maxlength="30" value="' . $_POST['SectionName'] . '" /></td> + </tr>'; echo '<tr><td colspan="2"><div class="centre"><input tabindex="3" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>'; echo '</table><br />'; if (!isset($_GET['SelectedSectionID']) or $_GET['SelectedSectionID']=='') { - echo "<script>defaultControl(document.AccountSections.SectionID);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionID);</script>'; } else { - echo "<script>defaultControl(document.AccountSections.SectionName);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionName);</script>'; } echo '</form>'; Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AgedDebtors.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,9 +2,6 @@ /* $Id$ */ -/* $Revision: 1.20 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -22,7 +19,7 @@ /*Now figure out the aged analysis for the customer range under review */ if (trim($_POST['Salesman'])!=''){ - $SalesLimit = " and debtorsmaster.debtorno in (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; } else { $SalesLimit = ""; } @@ -30,6 +27,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -86,6 +84,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -100,6 +99,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -158,6 +158,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -182,6 +183,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -245,6 +247,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -267,9 +270,9 @@ $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); echo '<p>' . _('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -283,16 +286,17 @@ $TotOD1=0; $TotOD2=0; - $ListCount = DB_num_rows($CustomerResult); //UldisN - + $ListCount = DB_num_rows($CustomerResult); + $DecimalPlaces =2; //by default + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ + $DecimalPlaces = $AgedAnalysis['decimalplaces']; + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); - $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); $TotCurr += ($AgedAnalysis['balance']-$AgedAnalysis['due']); @@ -364,10 +368,10 @@ if (DB_error_no($db) !=0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - echo '<br><br>' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><br />' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo '<br>' . _('The SQL that failed was') . '<p>' . $sql; + echo '<br />' . _('The SQL that failed was') . '<p>' . $sql; } include('includes/footer.inc'); exit; @@ -380,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -414,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -426,12 +430,6 @@ $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayTotOverdue1,'right'); $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayTotOverdue2,'right'); -/* Javier: This actually would produce the output - $buf = $pdf->output(); - $len = strlen($buf); -*/ - -// if ($len < 1000) { if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); @@ -439,26 +437,14 @@ if ($debug==1){ prnMsg($SQL,'info'); } - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; + } else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); + $pdf-> __destruct(); } -/* Javier: TCPDF sends its own http header, would be an error to send it twice. - header('Content-type: application/pdf'); - header("Content-Length: $len"); - header('Content-Disposition: inline; filename=AgedDebtors.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->stream(); */ - -// This else was missed - else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); - } - } else { /*The option to print PDF was not hit */ $title=_('Aged Debtor Analysis'); @@ -471,56 +457,64 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') . ':' . "</font></td><td><input tabindex='1' Type=text maxlength=6 size=7 name=FromCriteria value='0'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ':' . "</td><td><input tabindex='2' Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':' . '</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr>'; - echo '<tr><td>' . _('All balances or overdues only') . ':' . "</td><td><select tabindex='3' name='All_Or_Overdues'>"; - echo "<option selected Value='All'>" . _('All customers with balances'); - echo "<option Value='OverduesOnly'>" . _('Overdue accounts only'); - echo "<option Value='HeldOnly'>" . _('Held accounts only'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('All balances or overdues only') . ':' . '</td> + <td><select tabindex="3" name="All_Or_Overdues"> + <option selected value="All">' . _('All customers with balances') . '</option> + <option value="OverduesOnly">' . _('Overdue accounts only') . '</option> + <option value="HeldOnly">' . _('Held accounts only') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Only Show Customers Of') . ':' . "</td><td><select tabindex='4' name='Salesman'>"; + echo '<tr><td>' . _('Only Show Customers Of') . ':' . '</td> + <td><select tabindex="4" name="Salesman">'; - $sql = 'SELECT salesmancode, salesmanname FROM salesman'; + $sql = "SELECT salesmancode, salesmanname FROM salesman"; $result=DB_query($sql,$db); - echo "<option value=''></option>"; + echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['salesmancode'] . "'>" . $myrow['salesmanname']; + echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Only show customers trading in') . ':' . "</td><td><select tabindex='5' name='Currency'>"; + echo '<tr><td>' . _('Only show customers trading in') . ':' . '</td> + <td><select tabindex="5" name="Currency">'; - $sql = 'SELECT currency, currabrev FROM currencies'; + $sql = "SELECT currency, currabrev FROM currencies"; $result=DB_query($sql,$db); - - while ($myrow=DB_fetch_array($result)){ if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ - echo "<option selected value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option selected value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo "<option value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Summary or detailed report') . ':' . "</td> - <td><select tabindex='6' name='DetailedReport'>"; - echo "<option selected value='No'>" . _('Summary Report'); - echo "<option value='Yes'>" . _('Detailed Report'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Summary or detailed report') . ':' . '</td> + <td><select tabindex="6" name="DetailedReport"> + <option selected value="No">' . _('Summary Report') . '</option> + <option value="Yes">' . _('Detailed Report') . '</option> + </select> + </td> + </tr>'; - echo '</table><br><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; + echo '</table><br /><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; } include('includes/footer.inc'); - } /*end of else not PrintPDF */ - -?> +?> \ No newline at end of file Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AuditTrail.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -40,18 +40,19 @@ // Show user selections echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; -echo '<option value=ALL>ALL'; +echo '<option value="ALL">' . _('ALL') . '</option>'; while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option selected value="' . $users[0] . '">' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option value="' . $users[0] . '">' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections -echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; +echo '<tr><td>'. _('Table '). '</td> + <td><select tabindex="4" name="SelectedTable">'; echo '<option value="ALL">' . _('ALL') . '</option>'; while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMIndented.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -15,19 +15,19 @@ $PageNumber=1; $line_height=12; - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( + $sql = "CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom ( + $sql = "CREATE TEMPORARY TABLE tempbom ( parent char(20), component char(20), sortpart text, @@ -36,7 +36,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double) DEFAULT CHARSET=utf8'; + quantity double) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -112,32 +112,32 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE passbom RENAME AS passbom2'; + $sql = "ALTER TABLE passbom RENAME AS passbom2"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( - part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom ( + part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO passbom (part, sortpart) + $sql = "INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 WHERE bom.parent = passbom2.part AND bom.effectiveto >= NOW() - AND bom.effectiveafter <= NOW()'; + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part'; + $sql = "SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -150,9 +150,9 @@ $title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -172,12 +172,12 @@ $Right_Margin,$assemblydesc); $Tot_Val=0; - $sql = 'SELECT tempbom.*, - stockmaster.description, - stockmaster.mbflag - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid - ORDER BY sortpart'; + $sql = "SELECT tempbom.*, + stockmaster.description, + stockmaster.mbflag + FROM tempbom,stockmaster + WHERE tempbom.component = stockmaster.stockid + ORDER BY sortpart"; $result = DB_query($sql,$db); // $fill is used to alternate between lines with transparent and painted background @@ -226,21 +226,16 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$assemblydesc); } - /* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - */ if ($ListCount == 0) { $title = _('Print Indented BOM Listing Error'); include('includes/header.inc'); prnMsg(_('There were no items for the selected assembly'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } @@ -251,22 +246,30 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Part') . ":</td>"; - echo "<td><input type ='text' name='Part' size='20'>"; + echo '<tr><td>' . _('Part') . ':</td> + <td><input type ="text" name="Part" size="20" /> + </tr> + <tr><td>' . _('Levels') . ':</td> + <td><select name="Levels"> + <option selected value="All">' . _('All Levels') . '</option> + <option value="One">' . _('One Level') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Levels') . ":</td><td><select name='Levels'>"; - echo "<option selected value='All'>" . _('All Levels'); - echo "<option value='One'>" . _('One Level'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Print Option') . ':</td> + <td><select name="Fill"> + <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> + <option value="no">' . _('Plain Print') . '</option> + </select> + </td> + </tr>'; + echo '</table> + <p><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); - echo '</select></td></tr>'; - echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ @@ -275,7 +278,6 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$assemblydesc) { - $line_height=12; /*PDF page header for Indented BOM Listing report */ if ($PageNumber>1){ Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMListing.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,12 +2,8 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); - If (isset($_POST['PrintPDF']) AND isset($_POST['FromCriteria']) AND strlen($_POST['FromCriteria'])>=1 @@ -48,9 +44,9 @@ $title = _('Bill of Materials Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The Bill of Material listing could not be retrieved by the SQL because'),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -105,22 +101,10 @@ $YPos -=$line_height; $pdf->line($Page_Width-$Right_Margin, $YPos,$Left_Margin, $YPos); - /* - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header('Content-Length: '.$len); - header('Content-Disposition: inline; filename=BOMListing.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Bill Of Material Listing'); @@ -131,19 +115,25 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Inventory Part Code') . ':' . "</font></td><td><input tabindex='1' type=text name=FromCriteria size=20 maxlength=20 VALUE='1'></td></tr>"; + echo '<tr><td>' . _('From Inventory Part Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" name="FromCriteria" size="20" maxlength="20" value="1"></td> + </tr>'; - echo '<tr><td>' . _('To Inventory Part Code') . ':' . "</td><td><input tabindex='2' type=text name=ToCriteria size=20 maxlength=20 VALUE='zzzzzzz'></td></tr>"; + echo '<tr><td>' . _('To Inventory Part Code') . ':' . '</td> + <td><input tabindex="2" type="text" name="ToCriteria" size="20" maxlength="20" value="zzzzzzz" /></td> + </tr>'; - echo "</table><br><div class='centre'><input tabindex='3' type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - echo "<script>defaultControl(document.forms[0].FromCriteria);</script>"; + echo '</table> + <br /><div class="centre"><input tabindex="3" type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<script>defaultControl(document.forms[0].FromCriteria);</script>'; } include('includes/footer.inc');; } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMs.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.37 $ */ + /* $Id$*/ -//$PageSecurity = 9; - include('includes/session.inc'); $title = _('Multi-Level Bill Of Materials Maintenance'); @@ -11,8 +9,6 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - -// *** POPAD&T - ... Phil modified to english variables function display_children($parent, $level, &$BOMTree) { global $db; @@ -20,15 +16,13 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, - component - FROM bom WHERE parent='" . $parent. "'" + component + FROM bom WHERE parent='" . $parent. "'" ,$db); if (DB_num_rows($c_result) > 0) { - //echo ("<UL>\n"); - - + while ($row = DB_fetch_array($c_result)) { - //echo '<br>Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br>'; + //echo '<br />Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br />'; if ($parent != $row['component']) { // indent and display the title of this child $BOMTree[$i]['Level'] = $level; // Level @@ -119,7 +113,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?' . SID; + $DrillLink = $_SERVER['PHP_SELF'] . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -161,12 +155,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $UltimateParent); @@ -246,7 +240,7 @@ } if(!Date1GreaterThanDate2($_POST['EffectiveTo'], $_POST['EffectiveAfter'])){ $InputError = 1; - prnMsg(_('The effective to date must be a date after the effective after date') . '<br>' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br>' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); + prnMsg(_('The effective to date must be a date after the effective after date') . '<br />' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br />' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); $Errors[$i] = 'EffectiveAfter'; $i++; $Errors[$i] = 'EffectiveTo'; @@ -341,7 +335,7 @@ /*The component must already be on the BOM */ - prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br>' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); + prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br />' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); $Errors[$i]='ComponentCode'; } @@ -416,8 +410,8 @@ break; } - echo '<br><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br>'; - echo '<table class=selection>'; + echo '<br /><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br />'; + echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, stockmaster.description, @@ -453,7 +447,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -473,7 +467,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Kit sets').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -493,7 +487,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Phantom').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -502,10 +496,11 @@ } //end while loop echo '</div></td></tr>'; } - echo "</table><br><table class=selection>"; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>".$SelectedParent ." - " . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; + echo '</table> + <br /> + <table class="selection">'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; - // *** POPAD&T $BOMTree = array(); //BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component //display children populates the BOM_Tree from the selected parent @@ -513,17 +508,17 @@ display_children($SelectedParent, 1, $BOMTree); $TableHeader = '<tr> - <th>' . _('Level') . '</th> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th> - <th>' . _('Auto Issue') . '</th> - <th>' . _('Qty On Hand') . '</th> - </tr>'; + <th>' . _('Level') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + <th>' . _('Auto Issue') . '</th> + <th>' . _('Qty On Hand') . '</th> + </tr>'; echo $TableHeader; if(count($BOMTree) == 0) { echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>'; @@ -546,12 +541,11 @@ DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db); } } - // *** end POPAD&T - echo "</table><br>"; + echo '</table><br />'; if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -577,24 +571,24 @@ $_POST['Quantity'] = $myrow['quantity']; $_POST['AutoIssue'] = $myrow['autoissue']; - prnMsg(_('Edit the details of the selected component in the fields below') . '. <br>' . _('Click on the Enter Information button to update the component details'),'info'); - echo "<br><input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - echo "<input type=hidden name='SelectedComponent' VALUE='$SelectedComponent'>"; + prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info'); + echo '<br /> + <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; + echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('Edit Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component') . ':</td><td><b>' . $SelectedComponent . '</b></td></tr>'; } else { //end of if $SelectedComponent - echo "<input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - /* echo "Enter the details of a new component in the fields below. <br>Click on 'Enter Information' to add the new component, once all fields are completed."; + echo '<input type=hidden name="SelectedParent" value="' . $SelectedParent . '" />'; + /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('New Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component code') . ':</td><td>'; - echo "<select " . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) ." tabindex='1' name='Component'>"; + echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; - if ($ParentMBflag=='A'){ /*Its an assembly */ $sql = "SELECT stockmaster.stockid, stockmaster.description @@ -627,64 +621,68 @@ while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE=".$myrow['stockid'].'>' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description']; + echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; } - echo "<tr><td>" . _('Location') . ": </td><td><select tabindex='2' name='LocCode'>"; + echo '<tr><td>' . _('Location') . ': </td> + <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = 'SELECT locationname, loccode FROM locations'; + $sql = "SELECT locationname, loccode FROM locations"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['LocCode']) and $myrow['loccode']==$_POST['LocCode']) { - 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 DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Work Centre Added') . ": </td><td>"; - echo "<select tabindex='3' name='WorkCentreAdded'>"; + echo '</select></td> + </tr> + <tr><td>' . _('Work Centre Added') . ': </td> + <td><select tabindex="3" name="WorkCentreAdded">'; - $sql = 'SELECT code, description FROM workcentres'; + $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo "<br><a href='$rootpath/WorkCentres.php?" . SID . "'>" . _('Work Centre Maintenance') . '</a>'; + echo '<br /><a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; include('includes/footer.inc'); exit; } while ($myrow = DB_fetch_array($result)) { if (isset($_POST['WorkCentreAdded']) and $myrow['code']==$_POST['WorkCentreAdded']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['code'] . "'>" . $myrow['description']; + echo $myrow['code'] . '">' . $myrow['description'] . '</option>'; } //end while loop DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Quantity') . ": </td><td> - <input " . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) ." - tabindex='4' type='Text' class=number name='Quantity' class=number size=10 maxlength=8 value="; + echo '</select></td> + </tr> + <tr><td>' . _('Quantity') . ': </td> + <td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="'; if (isset($_POST['Quantity'])){ echo $_POST['Quantity']; } else { echo 1; } - echo "></td></tr>"; + echo '"></td></tr>'; if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') { $_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20))); @@ -693,12 +691,10 @@ $_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } - echo "<tr><td>" . _('Effective After') . " (" . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input " . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='5' type='Text' name='EffectiveAfter' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveAfter'] ."> - </td></tr><tr><td>" . _('Effective To') . " (" . $_SESSION['DefaultDateFormat'] . "):</td><td> - <input " . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='6' type='Text' name='EffectiveTo' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveTo'] ."></td></tr>"; + echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr> + <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>'; if ($ParentMBflag=='M' OR $ParentMBflag=='G'){ echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td> @@ -709,20 +705,21 @@ $_POST['AutoIssue'] = $_SESSION['AutoIssue']; } if ($_POST['AutoIssue']==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>'; } else { - echo '<input type=hidden name="AutoIssue" VALUE=0>'; + echo '<input type=hidden name="AutoIssue" value="0">'; } - echo "</table><br><div class='centre'><input tabindex='8' type='Submit' name='Submit' value='" . _('Enter Information') . "'></form></div>"; + echo '</table> + <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>'; } //end if record deleted no point displaying form to add record @@ -791,26 +788,32 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>" . + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<div class="page_help_text">'. _('Select a manufactured part') . " (" . _('or Assembly or Kit part') . ") " . - _('to maintain the bill of material for using the options below') . "." . "<br><font size=1>" . - _('Parts must be defined in the stock item entry') . "/" . _('modification screen as manufactured') . - ", " . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. - "</font><br><table class=selection cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . - " <b>" . _('description') . "</b>:</font></td><td><input tabindex='1' type='Text' name='Keywords' size=20 maxlength=25></td> - <td><font size=3><b>" . _('OR') . "</b></font></td><td><font size=1>" . _('Enter extract of the') . - " <b>" . _('Stock Code') . "</b>:</font></td><td><input tabindex='2' type='Text' name='StockCode' size=15 maxlength=18></td> - </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div>"; + _('to maintain the bill of material for using the options below') . '<br /><font size=1>' . + _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . + ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. + '</font> + <br /> + <table class="selection" cellpadding="3" colspan="4"> + <tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> + <td><font size=3><b>' . _('OR') . '</b></font></td> + <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> + </tr> + </table> + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br><table cellpadding=2 colspan=7 class=selection>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; @@ -830,15 +833,14 @@ $StockOnHand = number_format($myrow['totalonhand'],2); } $tab = $j+3; - printf("<td><input tabindex='".$tab."' type=submit name='Select' VALUE='%s'</td> + printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> <td>%s</td> <td class=number>%s</td> - <td>%s</td></tr>", + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $StockOnHand, - $myrow['units'] - ); + $myrow['units']); $j++; //end of page full new headings if @@ -851,12 +853,12 @@ //end if results to show if (!isset($SelectedParent) or $SelectedParent=='') { - echo "<script>defaultControl(document.forms[0].StockCode);</script>"; + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } else { - echo "<script>defaultControl(document.form.JournalProcessDate);</script>"; + echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; } -echo "</form>"; +echo '</form>'; } //end StockID already selected Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BankAccounts.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.21 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Bank Accounts Maintenance'); @@ -11,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br>'; +echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br />'; if (isset($_GET['SelectedBankAccount'])) { $SelectedBankAccount=$_GET['SelectedBankAccount']; @@ -85,23 +83,21 @@ $sql = "SELECT * FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + invoice ='" . $_POST['DefAccount'] . "' + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br>'; + echo '<br />'; } else { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - currcode ='" . $_POST['CurrCode'] . "', - invoice ='" . $_POST['DefAccount'] . "' + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + currcode ='" . $_POST['CurrCode'] . "', + invoice ='" . $_POST['DefAccount'] . "' WHERE accountcode = '" . $SelectedBankAccount . "'"; } @@ -110,22 +106,20 @@ /*Selectedbank account is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new bank account form */ - $sql = "INSERT INTO bankaccounts ( - accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' - )"; + $sql = "INSERT INTO bankaccounts (accountcode, + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice) + VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -136,7 +130,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg($msg,'success'); - echo '<br>'; + echo '<br />'; unset($_POST['AccountCode']); unset($_POST['BankAccountName']); unset($_POST['BankAccountNumber']); @@ -160,7 +154,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -188,19 +182,20 @@ WHERE bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br>' . $sql; + $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class="selection">'; - echo "<tr><th>" . _('GL Account Code') . "</th> - <th>" . _('Bank Account Name') . "</th> - <th>" . _('Bank Account Code') . "</th> - <th>" . _('Bank Account Number') . "</th> - <th>" . _('Bank Address') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Default for Invoices') . "</th> - </tr>"; + echo '<tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -216,16 +211,16 @@ } else { $defacc=_('Yes'); } - printf("<td>%s<br><font size=2>%s</font></td> + printf('<td>%s<br /><font size=2>%s</font></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedBankAccount=%s\">" . _('Edit') . "</td> - <td><a href=\"%s?SelectedBankAccount=%s&delete=1\">" . _('Delete') . "</td> - </tr>", + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1">' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[2], $myrow[3], @@ -364,12 +359,13 @@ } }//end while loop } else { - echo '<option VALUE=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option value="1">'._('Yes').'</option> + <option value="0">'._('No').'</option>'; } echo '</select></td>'; -echo '</tr></table><br> +echo '</tr></table><br /> <div class="centre"><input tabindex="7" type="Submit" name="submit" value="'. _('Enter Information') .'"></div>'; echo '</form>'; Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/Logout.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -23,7 +23,7 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <label><?php echo _('Thank you for using webERP'); ?></label> + <span><?php echo _('Thank you for using webERP'); ?></span> <br /> <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </form> Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/PageSecurity.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -13,17 +13,17 @@ if (isset($_POST['Update'])) { foreach ($_POST as $ScriptName => $PageSecurityValue) { if ($ScriptName!='Update' and $ScriptName!='FormID') { - //$key=substr($key, 0, strlen($key)-4).'.php'; + $ScriptName=substr($ScriptName, 0, strlen($Sc... [truncated message content] |