|
From: <dai...@us...> - 2014-10-26 23:18:16
|
Revision: 6941
http://sourceforge.net/p/web-erp/reponame/6941
Author: daintree
Date: 2014-10-26 23:18:08 +0000 (Sun, 26 Oct 2014)
Log Message:
-----------
remove $db from DB_query calls
Modified Paths:
--------------
trunk/AccountGroups.php
trunk/AccountSections.php
trunk/AddCustomerContacts.php
trunk/AddCustomerNotes.php
trunk/AddCustomerTypeNotes.php
trunk/AgedControlledInventory.php
trunk/AgedDebtors.php
trunk/AgedSuppliers.php
trunk/Areas.php
trunk/AuditTrail.php
trunk/BOMExtendedQty.php
trunk/BOMIndented.php
trunk/BOMIndentedReverse.php
trunk/BOMInquiry.php
trunk/BOMListing.php
trunk/BOMs.php
trunk/BankAccountUsers.php
trunk/BankAccounts.php
trunk/BankMatching.php
trunk/BankReconciliation.php
trunk/COGSGLPostings.php
trunk/CompanyPreferences.php
trunk/ConfirmDispatch_Invoice.php
trunk/ContractBOM.php
trunk/ContractCosting.php
trunk/Contracts.php
trunk/CopyBOM.php
trunk/CounterReturns.php
trunk/CounterSales.php
trunk/CreditStatus.php
trunk/Credit_Invoice.php
trunk/Currencies.php
trunk/CustEDISetup.php
trunk/CustItem.php
trunk/CustLoginSetup.php
trunk/CustWhereAlloc.php
trunk/CustomerAllocations.php
trunk/CustomerBranches.php
trunk/CustomerInquiry.php
trunk/CustomerPurchases.php
trunk/CustomerReceipt.php
trunk/CustomerTransInquiry.php
trunk/CustomerTypes.php
trunk/Customers.php
trunk/DailyBankTransactions.php
trunk/DailySalesInquiry.php
trunk/Dashboard.php
trunk/DebtorsAtPeriodEnd.php
trunk/DeliveryDetails.php
trunk/Departments.php
trunk/DiscountCategories.php
trunk/DiscountMatrix.php
trunk/EDIMessageFormat.php
trunk/EDIProcessOrders.php
trunk/EDISendInvoices.php
trunk/EDISendInvoices_Reece.php
trunk/EmailConfirmation.php
trunk/EmailCustTrans.php
trunk/ExchangeRateTrend.php
trunk/FTP_RadioBeacon.php
trunk/Factors.php
trunk/FixedAssetCategories.php
trunk/FixedAssetDepreciation.php
trunk/FixedAssetItems.php
trunk/FixedAssetLocations.php
trunk/FixedAssetRegister.php
trunk/FixedAssetTransfer.php
trunk/FreightCosts.php
trunk/GLAccountCSV.php
trunk/GLAccountInquiry.php
trunk/GLAccountReport.php
trunk/GLAccounts.php
trunk/GLBalanceSheet.php
trunk/GLBudgets.php
trunk/GLCodesInquiry.php
trunk/GLJournal.php
trunk/GLJournalInquiry.php
trunk/GLProfit_Loss.php
trunk/GLTagProfit_Loss.php
trunk/GLTags.php
trunk/GLTransInquiry.php
trunk/GLTrialBalance.php
trunk/GLTrialBalance_csv.php
trunk/GeocodeSetup.php
trunk/GoodsReceived.php
trunk/ImportBankTrans.php
trunk/ImportBankTransAnalysis.php
trunk/InternalStockCategoriesByRole.php
trunk/InternalStockRequest.php
trunk/InternalStockRequestAuthorisation.php
trunk/InternalStockRequestFulfill.php
trunk/InventoryPlanning.php
trunk/InventoryPlanningPrefSupplier.php
trunk/InventoryQuantities.php
trunk/InventoryValuation.php
trunk/Labels.php
trunk/Locations.php
trunk/MRP.php
trunk/MRPCalendar.php
trunk/MRPCreateDemands.php
trunk/MRPDemandTypes.php
trunk/MRPDemands.php
trunk/MRPPlannedPurchaseOrders.php
trunk/MRPPlannedWorkOrders.php
trunk/MRPReport.php
trunk/MRPReschedules.php
trunk/MRPShortages.php
trunk/MailInventoryValuation.php
trunk/MailingGroupMaintenance.php
trunk/MaintenanceReminders.php
trunk/MaintenanceTasks.php
trunk/MaintenanceUserSchedule.php
trunk/Manufacturers.php
trunk/MaterialsNotUsed.php
trunk/NoSalesItems.php
trunk/OffersReceived.php
trunk/OrderDetails.php
trunk/OutstandingGRNs.php
trunk/PDFBankingSummary.php
trunk/PDFChequeListing.php
trunk/PDFCustTransListing.php
trunk/PDFCustomerList.php
trunk/PDFDIFOT.php
trunk/PDFDeliveryDifferences.php
trunk/PDFFGLabel.php
trunk/PDFGLJournal.php
trunk/PDFGrn.php
trunk/PDFLowGP.php
trunk/PDFOrderStatus.php
trunk/PDFOrdersInvoiced.php
trunk/PDFPeriodStockTransListing.php
trunk/PDFPickingList.php
trunk/PDFPriceList.php
trunk/PDFPrintLabel.php
trunk/PDFQALabel.php
trunk/PDFQuotation.php
trunk/PDFQuotationPortrait.php
trunk/PDFReceipt.php
trunk/PDFRemittanceAdvice.php
trunk/PDFSellThroughSupportClaim.php
trunk/PDFStockCheckComparison.php
trunk/PDFStockLocTransfer.php
trunk/PDFStockNegatives.php
trunk/PDFStockTransfer.php
trunk/PDFSuppTransListing.php
trunk/PDFTopItems.php
trunk/PDFWOPrint.php
trunk/POReport.php
trunk/PO_AuthorisationLevels.php
trunk/PO_AuthoriseMyOrders.php
trunk/PO_Chk_ShiptRef_JobRef.php
trunk/PO_Header.php
trunk/PO_Items.php
trunk/PO_OrderDetails.php
trunk/PO_PDFPurchOrder.php
trunk/PO_SelectOSPurchOrder.php
trunk/PO_SelectPurchOrder.php
trunk/PageSecurity.php
trunk/PaymentAllocations.php
trunk/PaymentMethods.php
trunk/PaymentTerms.php
trunk/Payments.php
trunk/PcAssignCashToTab.php
trunk/PcAuthorizeExpenses.php
trunk/PcClaimExpensesFromTab.php
trunk/PcExpenses.php
trunk/PcExpensesTypeTab.php
trunk/PcReportTab.php
trunk/PcTabs.php
trunk/PcTypeTabs.php
trunk/PeriodsInquiry.php
trunk/PriceMatrix.php
trunk/Prices.php
trunk/PricesBasedOnMarkUp.php
trunk/PricesByCost.php
trunk/Prices_Customer.php
trunk/PrintCustOrder.php
trunk/PrintCustOrder_generic.php
trunk/PrintCustStatements.php
trunk/PrintCustTrans.php
trunk/PrintCustTransPortrait.php
trunk/PrintWOItemSlip.php
trunk/PurchData.php
trunk/PurchaseByPrefSupplier.php
trunk/RecurringSalesOrders.php
trunk/RecurringSalesOrdersProcess.php
trunk/RelatedItemsUpdate.php
trunk/ReorderLevel.php
trunk/ReorderLevelLocation.php
trunk/ReprintGRN.php
trunk/ReverseGRN.php
trunk/SMTPServer.php
trunk/SalesAnalReptCols.php
trunk/SalesAnalRepts.php
trunk/SalesByTypePeriodInquiry.php
trunk/SalesCategories.php
trunk/SalesCategoryPeriodInquiry.php
trunk/SalesGLPostings.php
trunk/SalesGraph.php
trunk/SalesInquiry.php
trunk/SalesPeople.php
trunk/SalesTopCustomersInquiry.php
trunk/SalesTopItemsInquiry.php
trunk/SalesTypes.php
trunk/SecurityTokens.php
trunk/SelectAsset.php
trunk/SelectCompletedOrder.php
trunk/SelectContract.php
trunk/SelectCreditItems.php
trunk/SelectCustomer.php
trunk/SelectGLAccount.php
trunk/SelectOrderItems.php
trunk/SelectProduct.php
trunk/SelectRecurringSalesOrder.php
trunk/SelectSalesOrder.php
trunk/SelectSupplier.php
trunk/SelectWorkOrder.php
trunk/SellThroughSupport.php
trunk/ShipmentCosting.php
trunk/Shipments.php
trunk/Shippers.php
trunk/Shipt_Select.php
trunk/ShiptsList.php
trunk/ShopParameters.php
trunk/SpecialOrder.php
trunk/StockAdjustments.php
trunk/StockCategories.php
trunk/StockCheck.php
trunk/StockClone.php
trunk/StockCostUpdate.php
trunk/StockCounts.php
trunk/StockDispatch.php
trunk/StockLocMovements.php
trunk/StockLocStatus.php
trunk/StockLocTransfer.php
trunk/StockLocTransferReceive.php
trunk/StockMovements.php
trunk/StockQties_csv.php
trunk/StockQuantityByDate.php
trunk/StockReorderLevel.php
trunk/StockSerialItemResearch.php
trunk/StockSerialItems.php
trunk/StockStatus.php
trunk/StockTransfers.php
trunk/StockUsage.php
trunk/StockUsageGraph.php
trunk/Stocks.php
trunk/SuppContractChgs.php
trunk/SuppCreditGRNs.php
trunk/SuppFixedAssetChgs.php
trunk/SuppInvGRNs.php
trunk/SuppLoginSetup.php
trunk/SuppPaymentRun.php
trunk/SuppPriceList.php
trunk/SuppShiptChgs.php
trunk/SuppTransGLAnalysis.php
trunk/SupplierAllocations.php
trunk/SupplierBalsAtPeriodEnd.php
trunk/SupplierContacts.php
trunk/SupplierCredit.php
trunk/SupplierInquiry.php
trunk/SupplierInvoice.php
trunk/SupplierPriceList.php
trunk/SupplierTenderCreate.php
trunk/SupplierTenders.php
trunk/SupplierTransInquiry.php
trunk/SupplierTypes.php
trunk/Suppliers.php
trunk/SystemParameters.php
trunk/Tax.php
trunk/TaxAuthorities.php
trunk/TaxAuthorityRates.php
trunk/TaxCategories.php
trunk/TaxGroups.php
trunk/TaxProvinces.php
trunk/TopItems.php
trunk/UnitsOfMeasure.php
trunk/UpgradeDatabase.php
trunk/UserSettings.php
trunk/WOCanBeProducedNow.php
trunk/WOSerialNos.php
trunk/WWW_Access.php
trunk/WWW_Users.php
trunk/WhereUsedInquiry.php
trunk/WorkCentres.php
trunk/WorkOrderCosting.php
trunk/WorkOrderEntry.php
trunk/WorkOrderIssue.php
trunk/WorkOrderReceive.php
trunk/WorkOrderStatus.php
trunk/Z_BottomUpCosts.php
trunk/Z_ChangeBranchCode.php
trunk/Z_ChangeCustomerCode.php
trunk/Z_ChangeGLAccountCode.php
trunk/Z_ChangeLocationCode.php
trunk/Z_ChangeStockCategory.php
trunk/Z_ChangeStockCode.php
trunk/Z_ChangeSupplierCode.php
trunk/Z_CheckAllocationsFrom.php
trunk/Z_CheckAllocs.php
trunk/Z_CheckDebtorsControl.php
trunk/Z_CheckGLTransBalance.php
trunk/Z_ClearPOBackOrders.php
trunk/Z_CreateChartDetails.php
trunk/Z_CreateCompany.php
trunk/Z_CreateCompanyTemplateFile.php
trunk/Z_CurrencyDebtorsBalances.php
trunk/Z_CurrencySuppliersBalances.php
trunk/Z_DataExport.php
trunk/Z_DeleteCreditNote.php
trunk/Z_DeleteInvoice.php
trunk/Z_DeleteOldPrices.php
trunk/Z_DeleteSalesTransActions.php
trunk/Z_DescribeTable.php
trunk/Z_ImportChartOfAccounts.php
trunk/Z_ImportDebtors.php
trunk/Z_ImportFixedAssets.php
trunk/Z_ImportGLAccountGroups.php
trunk/Z_ImportGLAccountSections.php
trunk/Z_ImportGLTransactions.php
trunk/Z_ImportPartCodes.php
trunk/Z_ImportPriceList.php
trunk/Z_ImportStocks.php
trunk/Z_ImportSuppliers.php
trunk/Z_ItemsWithoutPicture.php
trunk/Z_MakeLocUsers.php
trunk/Z_MakeNewCompany.php
trunk/Z_MakeStockLocns.php
trunk/Z_ReApplyCostToSA.php
trunk/Z_RePostGLFromPeriod.php
trunk/Z_ReverseSuppPaymentRun.php
trunk/Z_SalesIntegrityCheck.php
trunk/Z_UpdateChartDetailsBFwd.php
trunk/Z_UpdateSalesAnalysisWithLatestCustomerData.php
trunk/Z_Upgrade3.10.php
trunk/Z_Upgrade_3.01-3.02.php
trunk/Z_Upgrade_3.04-3.05.php
trunk/Z_Upgrade_3.05-3.06.php
trunk/Z_Upgrade_3.07-3.08.php
trunk/Z_Upgrade_3.08-3.09.php
trunk/Z_Upgrade_3.09-3.10.php
trunk/Z_Upgrade_3.10-3.11.php
trunk/Z_Upgrade_3.11-4.00.php
trunk/api/api_branches.php
trunk/api/api_currencies.php
trunk/api/api_customers.php
trunk/api/api_customertypes.php
trunk/api/api_debtortransactions.php
trunk/api/api_glaccounts.php
trunk/api/api_glgroups.php
trunk/api/api_glsections.php
trunk/api/api_holdreasons.php
trunk/api/api_locations.php
trunk/api/api_login.php
trunk/api/api_paymentterms.php
trunk/api/api_salesareas.php
trunk/api/api_salesman.php
trunk/api/api_salesorders.php
trunk/api/api_salestypes.php
trunk/api/api_session.inc
trunk/api/api_shippers.php
trunk/api/api_stock.php
trunk/api/api_stockcategories.php
trunk/api/api_suppliers.php
trunk/api/api_taxgroups.php
trunk/api/api_webERPsettings.php
trunk/api/api_workorders.php
trunk/doc/Change.log
trunk/geo_displaymap_customers.php
trunk/geo_displaymap_suppliers.php
trunk/geocode.php
trunk/geocode_genxml_customers.php
trunk/geocode_genxml_suppliers.php
trunk/includes/AccountSectionsDef.inc
trunk/includes/Add_SerialItems.php
trunk/includes/ConnectDB_mysql.inc
trunk/includes/ConnectDB_mysqli.inc
trunk/includes/ConnectDB_postgres.inc
trunk/includes/ConstructSQLForUserDefinedSalesReport.inc
trunk/includes/Contract_Readin.php
trunk/includes/DateFunctions.inc
trunk/includes/DefineCartClass.php
trunk/includes/DefineContractClass.php
trunk/includes/DefineOfferClass.php
trunk/includes/DefineReceiptClass.php
trunk/includes/DefineSerialItems.php
trunk/includes/DefineShiptClass.php
trunk/includes/DefineSuppTransClass.php
trunk/includes/DefineTenderClass.php
trunk/includes/EDIconfig.inc
trunk/includes/FreightCalculation.inc
trunk/includes/GLPostings.inc
trunk/includes/GetConfig.php
trunk/includes/GetPaymentMethods.php
trunk/includes/GetPrice.inc
trunk/includes/GetSalesTransGLCodes.inc
trunk/includes/InputSerialItems.php
trunk/includes/InputSerialItemsExisting.php
trunk/includes/MiscFunctions.php
trunk/includes/OutputSerialItems.php
trunk/includes/PDFAgedDebtorsPageHeader.inc
trunk/includes/PDFPaymentRun_PymtFooter.php
trunk/includes/PDFTopItemsHeader.inc
trunk/includes/PO_PDFOrderPageHeader.inc
trunk/includes/PO_ReadInOrder.inc
trunk/includes/SQL_CommonFunctions.inc
trunk/includes/SelectOrderItems_IntoCart.inc
trunk/includes/UserLogin.php
trunk/includes/Z_POSDataCreation.php
trunk/index.php
trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php
trunk/locale/zh_HK.utf8/Manual/ManualAPIFunctions.php
trunk/reportwriter/FormMaker.php
trunk/reportwriter/ReportMaker.php
trunk/reportwriter/WriteForm.inc
trunk/reportwriter/WriteReport.inc
trunk/reportwriter/admin/RCFunctions.inc
trunk/reportwriter/admin/ReportCreator.php
trunk/reportwriter/install/ReportListForm.php
trunk/reportwriter/install/ReportListLinks.php
Modified: trunk/AccountGroups.php
===================================================================
--- trunk/AccountGroups.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AccountGroups.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -24,7 +24,7 @@
FROM accountgroups
WHERE groupname='" . $GroupName ."'";
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$myrow = DB_fetch_row($result);
if ($ParentGroupName == $myrow[0]){
return true;
@@ -48,7 +48,7 @@
$sql="UPDATE chartmaster SET group_='" . $_POST['DestinyAccountGroup'] . "' WHERE group_='" . $_POST['OriginalAccountGroup'] . "'";
$ErrMsg = _('An error occurred in moving the account group');
$DbgMsg = _('The SQL that was used to move the account group was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Groups') . '</a></div>';
prnMsg( _('All accounts in the account group:') . ' ' . $_POST['OriginalAccountGroup'] . ' ' . _('have been changed to the account group:') . ' ' . $_POST['DestinyAccountGroup'],'success');
}
@@ -72,7 +72,7 @@
$DbgMsg = _('The SQL that was used to retrieve the information was');
$ErrMsg = _('Could not check whether the group exists because');
- $result=DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
$myrow=DB_fetch_row($result);
if ($myrow[0] != 0 AND $_POST['SelectedAccountGroup'] == '') {
@@ -109,7 +109,7 @@
$DbgMsg = _('The SQL that was used to retrieve the information was');
$ErrMsg = _('Could not check whether the group is recursive because');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$ParentGroupRow = DB_fetch_array($result);
$_POST['SequenceInTB'] = $ParentGroupRow['sequenceintb'];
@@ -151,13 +151,13 @@
$ErrMsg = _('An error occurred in renaming the account group');
$DbgMsg = _('The SQL that was used to rename the account group was');
- $result = DB_query($sql, $db, $ErrMsg, $DbgMsg);
+ $result = DB_query($sql, $ErrMsg, $DbgMsg);
$sql = "UPDATE accountgroups
SET parentgroupname='" . $_POST['GroupName'] . "'
WHERE parentgroupname='" . $_POST['SelectedAccountGroup'] . "'";
- $result = DB_query($sql, $db, $ErrMsg, $DbgMsg);
+ $result = DB_query($sql, $ErrMsg, $DbgMsg);
DB_ReinstateForeignKeys($db);
}
@@ -194,7 +194,7 @@
if ($InputError!=1){
//run the SQL from either of the above possibilites
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
prnMsg($msg,'success');
unset ($_POST['SelectedAccountGroup']);
unset ($_POST['GroupName']);
@@ -208,7 +208,7 @@
$sql= "SELECT COUNT(group_) AS groups FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'";
$ErrMsg = _('An error occurred in retrieving the group information from chartmaster');
$DbgMsg = _('The SQL that was used to retrieve the information was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$myrow = DB_fetch_array($result);
if ($myrow['groups']>0) {
prnMsg( _('Cannot delete this account group because general ledger accounts have been created using this group'),'warn');
@@ -223,7 +223,7 @@
<td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="DestinyAccountGroup">';
$sql = "SELECT groupname FROM accountgroups";
- $GroupResult = DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ $GroupResult = DB_query($sql,$ErrMsg,$DbgMsg);
while ($GroupRow = DB_fetch_array($GroupResult) ) {
if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$GroupRow['groupname']) {
@@ -243,7 +243,7 @@
$sql = "SELECT COUNT(groupname) groupnames FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'";
$ErrMsg = _('An error occurred in retrieving the parent group information');
$DbgMsg = _('The SQL that was used to retrieve the information was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$myrow = DB_fetch_array($result);
if ($myrow['groupnames']>0) {
prnMsg( _('Cannot delete this account group because it is a parent account group of other account group(s)'),'warn');
@@ -253,7 +253,7 @@
$sql="DELETE FROM accountgroups WHERE groupname='" . $_GET['SelectedAccountGroup'] . "'";
$ErrMsg = _('An error occurred in deleting the account group');
$DbgMsg = _('The SQL that was used to delete the account group was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
prnMsg( $_GET['SelectedAccountGroup'] . ' ' . _('group has been deleted') . '!','success');
}
@@ -281,7 +281,7 @@
$DbgMsg = _('The sql that was used to retrieve the account group information was ');
$ErrMsg = _('Could not get account groups because');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" />' . ' ' . $Title . '</p><br />';
echo '<table class="selection">
@@ -353,7 +353,7 @@
$ErrMsg = _('An error occurred in retrieving the account group information');
$DbgMsg = _('The SQL that was used to retrieve the account group and that failed in the process was');
- $result = DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
if (DB_num_rows($result) == 0) {
prnMsg( _('The account group name does not exist in the database'),'error');
include('includes/footer.inc');
@@ -408,7 +408,7 @@
<td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">';
$sql = "SELECT groupname FROM accountgroups";
- $groupresult = DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ $groupresult = DB_query($sql,$ErrMsg,$DbgMsg);
if (!isset($_POST['ParentGroupName'])){
echo '<option selected="selected" value="">' ._('Top Level Group') . '</option>';
} else {
@@ -430,7 +430,7 @@
<td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . ' name="SectionInAccounts">';
$sql = "SELECT sectionid, sectionname FROM accountsection ORDER BY sectionid";
- $secresult = DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ $secresult = DB_query($sql,$ErrMsg,$DbgMsg);
while( $secrow = DB_fetch_array($secresult) ) {
if ($_POST['SectionInAccounts']==$secrow['sectionid']) {
echo '<option selected="selected" value="'.$secrow['sectionid'].'">' . $secrow['sectionname'].' ('.$secrow['sectionid'].')</option>';
Modified: trunk/AccountSections.php
===================================================================
--- trunk/AccountSections.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AccountSections.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -10,25 +10,25 @@
// SOME TEST TO ENSURE THAT AT LEAST INCOME AND COST OF SALES ARE THERE
$sql= "SELECT sectionid FROM accountsection WHERE sectionid=1";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
if( DB_num_rows($result) == 0 ) {
$sql = "INSERT INTO accountsection (sectionid,
sectionname)
VALUES (1,
'Income')";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
}
$sql= "SELECT sectionid FROM accountsection WHERE sectionid=2";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
if( DB_num_rows($result) == 0 ) {
$sql = "INSERT INTO accountsection (sectionid,
sectionname)
VALUES (2,
'Cost Of Sales')";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
}
// DONE WITH MINIMUM TESTS
@@ -54,7 +54,7 @@
$sql="SELECT sectionid
FROM accountsection
WHERE sectionid='".$_POST['SectionID']."'";
- $result=DB_query($sql, $db);
+ $result=DB_query($sql);
if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) {
$InputError = 1;
@@ -110,7 +110,7 @@
if ($InputError!=1){
//run the SQL from either of the above possibilites
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
prnMsg($msg,'success');
unset ($_POST['SelectedSectionID']);
unset ($_POST['SectionID']);
@@ -122,7 +122,7 @@
// PREVENT DELETES IF DEPENDENT RECORDS IN 'accountgroups'
$sql= "SELECT COUNT(sectioninaccounts) AS sections FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
if ($myrow['sections']>0) {
prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn');
@@ -133,12 +133,12 @@
} else {
//Fetch section name
$sql = "SELECT sectionname FROM accountsection WHERE sectionid='".$_GET['SelectedSectionID'] . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
$SectionName = $myrow['sectionname'];
$sql="DELETE FROM accountsection WHERE sectionid='" . $_GET['SelectedSectionID'] . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
prnMsg( $SectionName . ' ' . _('section has been deleted') . '!','success');
} //end if account group used in GL accounts
@@ -165,7 +165,7 @@
ORDER BY sectionid";
$ErrMsg = _('Could not get account group sections because');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" />' . ' ' . $Title . '</p><br />';
echo '<table class="selection">
@@ -218,7 +218,7 @@
FROM accountsection
WHERE sectionid='" . $_GET['SelectedSectionID'] ."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
if ( DB_num_rows($result) == 0 ) {
prnMsg( _('Could not retrieve the requested section please try again.'),'warn');
unset($_GET['SelectedSectionID']);
Modified: trunk/AddCustomerContacts.php
===================================================================
--- trunk/AddCustomerContacts.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AddCustomerContacts.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -19,7 +19,7 @@
}
echo '<a href="' . $RootPath . '/Customers.php?DebtorNo=' . $DebtorNo . '">' . _('Back to Customers') . '</a><br />';
$SQLname="SELECT name FROM debtorsmaster WHERE debtorno='" . $DebtorNo . "'";
-$Result = DB_query($SQLname,$db);
+$Result = DB_query($SQLname);
$row = DB_fetch_array($Result);
if (!isset($_GET['Id'])) {
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Contacts for Customer') . ': <b>' . htmlspecialchars($row['name'], ENT_QUOTES, 'UTF-8') . '</b></p><br />';
@@ -75,7 +75,7 @@
}
if ($InputError !=1) {
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo '<br />' . $sql;
echo '<br />';
@@ -97,7 +97,7 @@
$sql="DELETE FROM custcontacts
WHERE contid='" . $Id . "'
AND debtorno='" . $DebtorNo . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<br />';
prnMsg( _('The contact record has been deleted'), 'success');
@@ -118,7 +118,7 @@
FROM custcontacts
WHERE debtorno='".$DebtorNo."'
ORDER BY contid";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo '<br />' . $sql;
echo '<table class="selection">';
@@ -187,7 +187,7 @@
WHERE contid='".$Id."'
AND debtorno='".$DebtorNo."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
$_POST['Con_ID'] = $myrow['contid'];
Modified: trunk/AddCustomerNotes.php
===================================================================
--- trunk/AddCustomerNotes.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AddCustomerNotes.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -65,7 +65,7 @@
}
if ($InputError !=1) {
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo '<br />' . $sql;
echo '<br />';
@@ -85,7 +85,7 @@
$sql="DELETE FROM custnotes
WHERE noteid='".$Id."'
AND debtorno='".$DebtorNo."'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<br />';
prnMsg( _('The contact note record has been deleted'), 'success');
@@ -96,7 +96,7 @@
if (!isset($Id)) {
$SQLname="SELECT * FROM debtorsmaster
WHERE debtorno='".$DebtorNo."'";
- $Result = DB_query($SQLname,$db);
+ $Result = DB_query($SQLname);
$row = DB_fetch_array($Result);
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer').': <b>' .$row['name'] . '</b></p>
<br />';
@@ -110,7 +110,7 @@
FROM custnotes
WHERE debtorno='".$DebtorNo."'
ORDER BY date DESC";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<table class="selection">
<tr>
@@ -178,7 +178,7 @@
WHERE noteid='".$Id."'
AND debtorno='".$DebtorNo."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
Modified: trunk/AddCustomerTypeNotes.php
===================================================================
--- trunk/AddCustomerTypeNotes.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AddCustomerTypeNotes.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -62,7 +62,7 @@
}
if ($InputError !=1) {
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<br />';
prnMsg($msg, 'success');
@@ -78,7 +78,7 @@
$sql="DELETE FROM debtortypenotes
WHERE noteid='".$Id."'
AND typeid='".$DebtorType."'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<br />';
prnMsg( _('The contact group note record has been deleted'), 'success');
@@ -89,7 +89,7 @@
if (!isset($Id)) {
$SQLname="SELECT typename from debtortype where typeid='".$DebtorType."'";
- $result = DB_query($SQLname,$db);
+ $result = DB_query($SQLname);
$myrow = DB_fetch_array($result);
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer Type').': <b>' .$myrow['typename'] . '</b></p>
<br />';
@@ -103,7 +103,7 @@
FROM debtortypenotes
WHERE typeid='".$DebtorType."'
ORDER BY date DESC";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo '<br />' . $sql;
echo '<table class="selection">';
@@ -170,7 +170,7 @@
WHERE noteid=".$Id."
AND typeid='".$DebtorType."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
//echo '<br />' . $sql;
$myrow = DB_fetch_array($result);
Modified: trunk/AgedControlledInventory.php
===================================================================
--- trunk/AgedControlledInventory.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AgedControlledInventory.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -30,7 +30,7 @@
ORDER BY trandate";
$ErrMsg = _('The stock held could not be retrieved because');
-$LocStockResult = DB_query($sql, $db, $ErrMsg);
+$LocStockResult = DB_query($sql, $ErrMsg);
$NumRows = DB_num_rows($LocStockResult, $db);
$j = 1;
Modified: trunk/AgedDebtors.php
===================================================================
--- trunk/AgedDebtors.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AgedDebtors.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -261,7 +261,7 @@
debtortrans.ovdiscount -
debtortrans.alloc)) >0.005";
}
- $CustomerResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors handled below*/
+ $CustomerResult = DB_query($SQL,'','',False,False); /*dont trap errors handled below*/
if (DB_error_no($db) !=0) {
$Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... ';
@@ -364,7 +364,7 @@
$sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'";
}
- $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */
+ $DetailResult = DB_query($sql,'','',False,False); /*Dont trap errors */
if (DB_error_no($db) !=0) {
$Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....';
include('includes/header.inc');
@@ -489,7 +489,7 @@
$sql = "SELECT salesmancode, salesmanname FROM salesman";
- $result=DB_query($sql,$db);
+ $result=DB_query($sql);
echo '<option value="">' . _('All Sales people') . '</option>';
while ($myrow=DB_fetch_array($result)){
echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>';
@@ -503,7 +503,7 @@
$sql = "SELECT currency, currabrev FROM currencies";
- $result=DB_query($sql,$db);
+ $result=DB_query($sql);
while ($myrow=DB_fetch_array($result)){
if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){
echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>';
Modified: trunk/AgedSuppliers.php
===================================================================
--- trunk/AgedSuppliers.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AgedSuppliers.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -102,7 +102,7 @@
}
- $SupplierResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors */
+ $SupplierResult = DB_query($SQL,'','',False,False); /*dont trap errors */
if (DB_error_no($db) !=0) {
$Title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ;
@@ -190,7 +190,7 @@
AND supptrans.settled = 0
AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'";
- $DetailResult = DB_query($sql,$db,'','',False,False); /*dont trap errors - trapped below*/
+ $DetailResult = DB_query($sql,'','',False,False); /*dont trap errors - trapped below*/
if (DB_error_no($db) !=0) {
$Title = _('Aged Supplier Account Analysis - Problem Report');
include('includes/header.inc');
@@ -303,7 +303,7 @@
<td><select tabindex="4" name="Currency">';
$sql = "SELECT currency, currabrev FROM currencies";
- $result=DB_query($sql,$db);
+ $result=DB_query($sql);
while ($myrow=DB_fetch_array($result)){
if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){
Modified: trunk/Areas.php
===================================================================
--- trunk/Areas.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/Areas.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -33,7 +33,7 @@
//first off validate inputs sensible
$_POST['AreaCode'] = mb_strtoupper($_POST['AreaCode']);
$sql = "SELECT areacode FROM areas WHERE areacode='".$_POST['AreaCode']."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
// mod to handle 3 char area codes
if (mb_strlen($_POST['AreaCode']) > 3) {
$InputError = 1;
@@ -92,7 +92,7 @@
if ($InputError !=1) {
$ErrMsg = _('The area could not be added or updated because');
$DbgMsg = _('The SQL that failed was');
- $result = DB_query($sql, $db, $ErrMsg, $DbgMsg);
+ $result = DB_query($sql, $ErrMsg, $DbgMsg);
unset($SelectedArea);
unset($_POST['AreaCode']);
unset($_POST['AreaDescription']);
@@ -107,7 +107,7 @@
// PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorsMaster'
$sql= "SELECT COUNT(branchcode) AS branches FROM custbranch WHERE custbranch.area='$SelectedArea'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
if ($myrow['branches']>0) {
$CancelDelete = 1;
@@ -116,7 +116,7 @@
} else {
$sql= "SELECT COUNT(area) AS records FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
if ($myrow['records']>0) {
$CancelDelete = 1;
@@ -127,7 +127,7 @@
if ($CancelDelete==0) {
$sql="DELETE FROM areas WHERE areacode='" . $SelectedArea . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
prnMsg(_('Area Code') . ' ' . $SelectedArea . ' ' . _('has been deleted') .' !','success');
} //end if Delete area
unset($SelectedArea);
@@ -139,7 +139,7 @@
$sql = "SELECT areacode,
areadescription
FROM areas";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p><br />';
@@ -191,7 +191,7 @@
FROM areas
WHERE areacode='" . $SelectedArea . "'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
$_POST['AreaCode'] = $myrow['areacode'];
Modified: trunk/AuditTrail.php
===================================================================
--- trunk/AuditTrail.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/AuditTrail.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -32,7 +32,7 @@
$TableResult = DB_show_tables($db);
// Get list of users
-$UserResult = DB_query("SELECT userid FROM www_users ORDER BY userid",$db);
+$UserResult = DB_query("SELECT userid FROM www_users ORDER BY userid");
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">';
echo '<div>';
@@ -168,7 +168,7 @@
WHERE userid='".$_POST['SelectedUser']."'
AND transactiondate BETWEEN '".$FromDate."' AND '".$ToDate."'" . $ContainingText;
}
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<table border="0" width="98%" class="selection">
<tr>
Modified: trunk/BOMExtendedQty.php
===================================================================
--- trunk/BOMExtendedQty.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMExtendedQty.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -20,15 +20,15 @@
$_POST['Quantity'] = 1;
}
- $result = DB_query("DROP TABLE IF EXISTS tempbom",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom2",$db);
+ $result = DB_query("DROP TABLE IF EXISTS tempbom");
+ $result = DB_query("DROP TABLE IF EXISTS passbom");
+ $result = DB_query("DROP TABLE IF EXISTS passbom2");
$sql = "CREATE TEMPORARY TABLE passbom (
part char(20),
extendedqpa double,
sortpart text) DEFAULT CHARSET=utf8";
$ErrMsg = _('The SQL to create passbom failed with the message');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
$sql = "CREATE TEMPORARY TABLE tempbom (
parent char(20),
@@ -40,7 +40,7 @@
effectiveafter date,
effectiveto date,
quantity double) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db,_('Create of tempbom failed because'));
+ $result = DB_query($sql,_('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
// to link to PARENT in bom to find next lower level and accumulate
@@ -55,7 +55,7 @@
WHERE bom.parent ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$LevelCounter = 2;
// $LevelCounter is the level counter
@@ -82,7 +82,7 @@
WHERE bom.parent ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo "<br />sql is $sql<br />";
// This while routine finds the other levels as long as $ComponentCounter - the
// component counter finds there are more components that are used as
@@ -114,16 +114,16 @@
WHERE bom.parent = passbom.part
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
- $result = DB_query("DROP TABLE IF EXISTS passbom2",$db);
- $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom",$db);
+ $result = DB_query("DROP TABLE IF EXISTS passbom2");
+ $result = DB_query("ALTER TABLE passbom RENAME AS passbom2");
+ $result = DB_query("DROP TABLE IF EXISTS passbom");
$sql = "CREATE TEMPORARY TABLE passbom (part char(20),
extendedqpa decimal(10,3),
sortpart text) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "INSERT INTO passbom (part,
extendedqpa,
@@ -136,14 +136,14 @@
ON bom.parent = passbom2.part
WHERE bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "SELECT COUNT(bom.parent) AS components
FROM bom
INNER JOIN passbom
ON bom.parent = passbom.part
GROUP BY passbom.part";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
$ComponentCounter = $myrow['components'];
@@ -200,7 +200,7 @@
stockmaster.description,
stockmaster.decimalplaces,
stockmaster.mbflag";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$ListCount = DB_num_rows($result);
while ($myrow = DB_fetch_array($result,$db)){
Modified: trunk/BOMIndented.php
===================================================================
--- trunk/BOMIndented.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMIndented.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -16,16 +16,16 @@
$line_height=12;
$sql = "DROP TABLE IF EXISTS tempbom";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "DROP TABLE IF EXISTS passbom";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "DROP TABLE IF EXISTS passbom2";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "CREATE TEMPORARY TABLE passbom (
part char(20),
sortpart text) DEFAULT CHARSET=utf8";
$ErrMsg = _('The SQL to create passbom failed with the message');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
$sql = "CREATE TEMPORARY TABLE tempbom (
parent char(20),
@@ -37,7 +37,7 @@
effectiveafter date,
effectiveto date,
quantity double) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db,_('Create of tempbom failed because'));
+ $result = DB_query($sql,_('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
// to link to PARENT in bom to find next lower level and accumulate
@@ -51,7 +51,7 @@
WHERE bom.parent ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$LevelCounter = 2;
// $LevelCounter is the level counter
@@ -79,7 +79,7 @@
WHERE bom.parent ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
//echo "<br />sql is $sql<br />";
// This while routine finds the other levels as long as $ComponentCounter - the
// component counter - finds there are more components that are used as
@@ -112,21 +112,21 @@
INNER JOIN locationusers ON locationusers.loccode=loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1
WHERE bom.parent = passbom.part
AND bom.effectiveto >= '" . date('Y-m-d') . "' AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "DROP TABLE IF EXISTS passbom2";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "ALTER TABLE passbom RENAME AS passbom2";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "DROP TABLE IF EXISTS passbom";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "CREATE TEMPORARY TABLE passbom (
part char(20),
sortpart text) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "INSERT INTO passbom (part, sortpart)
@@ -136,11 +136,11 @@
WHERE bom.parent = passbom2.part
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_row($result);
$ComponentCounter = $myrow[0];
@@ -165,7 +165,7 @@
stockmaster.description
FROM stockmaster
WHERE stockid = " . "'" . $_POST['Part'] . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result,$db);
$assembly = $_POST['Part'];
$assemblydesc = $myrow['description'];
@@ -180,7 +180,7 @@
FROM tempbom,stockmaster
WHERE tempbom.component = stockmaster.stockid
ORDER BY sortpart";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
// $fill is used to alternate between lines with transparent and painted background
$fill = false;
Modified: trunk/BOMIndentedReverse.php
===================================================================
--- trunk/BOMIndentedReverse.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMIndentedReverse.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -16,15 +16,15 @@
$PageNumber=1;
$line_height=12;
- $result = DB_query("DROP TABLE IF EXISTS tempbom",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom2",$db);
+ $result = DB_query("DROP TABLE IF EXISTS tempbom");
+ $result = DB_query("DROP TABLE IF EXISTS passbom");
+ $result = DB_query("DROP TABLE IF EXISTS passbom2");
$sql = "CREATE TEMPORARY TABLE passbom (
part char(20),
sortpart text) DEFAULT CHARSET=utf8";
$ErrMsg = _('The SQL to create passbom failed with the message');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
$sql = "CREATE TEMPORARY TABLE tempbom (
parent char(20),
@@ -36,7 +36,7 @@
effectiveafter date,
effectiveto date,
quantity double) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db,_('Create of tempbom failed because'));
+ $result = DB_query($sql,_('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
// to link to PARENT in bom to find next lower level and accumulate
@@ -50,7 +50,7 @@
WHERE bom.component ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$LevelCounter = 2;
// $LevelCounter is the level counter
@@ -77,7 +77,7 @@
WHERE bom.component ='" . $_POST['Part'] . "'
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
// This while routine finds the other levels as long as $ComponentCounter - the
// component counter finds there are more components that are used as
@@ -108,17 +108,17 @@
WHERE bom.component = passbom.part
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
- $result = DB_query("DROP TABLE IF EXISTS passbom2",$db);
+ $result = DB_query("DROP TABLE IF EXISTS passbom2");
- $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db);
- $result = DB_query("DROP TABLE IF EXISTS passbom",$db);
+ $result = DB_query("ALTER TABLE passbom RENAME AS passbom2");
+ $result = DB_query("DROP TABLE IF EXISTS passbom");
$sql = "CREATE TEMPORARY TABLE passbom (
part char(20),
sortpart text) DEFAULT CHARSET=utf8";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$sql = "INSERT INTO passbom (part, sortpart)
@@ -128,8 +128,8 @@
WHERE bom.component = passbom2.part
AND bom.effectiveto >= '" . date('Y-m-d') . "'
AND bom.effectiveafter <= '" . date('Y-m-d') . "'";
- $result = DB_query($sql,$db);
- $result = DB_query("SELECT COUNT(*) FROM bom,passbom WHERE bom.component = passbom.part",$db);
+ $result = DB_query($sql);
+ $result = DB_query("SELECT COUNT(*) FROM bom,passbom WHERE bom.component = passbom.part");
$myrow = DB_fetch_row($result);
$ComponentCounter = $myrow[0];
@@ -154,7 +154,7 @@
stockmaster.description
FROM stockmaster
WHERE stockid = '" . $_POST['Part'] . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result,$db);
$Assembly = $_POST['Part'];
$AssemblyDesc = $myrow['description'];
@@ -171,7 +171,7 @@
ON tempbom.parent = stockmaster.stockid
INNER JOIN locationusers ON locationusers.loccode=tempbom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1
ORDER BY sortpart";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$ListCount = DB_num_rows($result);
Modified: trunk/BOMInquiry.php
===================================================================
--- trunk/BOMInquiry.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMInquiry.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -93,7 +93,7 @@
}
$ErrMsg = _('The SQL to find the parts selected failed with the message');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
} //one of keywords or StockCode was more than a zero length string
} //end of if search
@@ -178,7 +178,7 @@
OR bom.effectiveto='0000-00-00')";
$ErrMsg = _('The bill of material could not be retrieved because');
- $BOMResult = DB_query ($sql,$db,$ErrMsg);
+ $BOMResult = DB_query ($sql,$ErrMsg);
if (DB_num_rows($BOMResult)==0){
prnMsg(_('The bill of material for this part is not set up') . ' - ' . _('there are no components defined for it'),'warn');
Modified: trunk/BOMListing.php
===================================================================
--- trunk/BOMListing.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMListing.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -36,7 +36,7 @@
ORDER BY bom.parent,
bom.component";
- $BOMResult = DB_query($SQL,$db,'','',false,false); //dont do error trapping inside DB_query
+ $BOMResult = DB_query($SQL,'','',false,false); //dont do error trapping inside DB_query
if (DB_error_no($db) !=0) {
$Title = _('Bill of Materials Listing') . ' - ' . _('Problem Report');
@@ -73,7 +73,7 @@
$YPos -=$line_height;
}
$SQL = "SELECT description FROM stockmaster WHERE stockmaster.stockid = '" . $BOMList['parent'] . "'";
- $ParentResult = DB_query($SQL,$db);
+ $ParentResult = DB_query($SQL);
$ParentRow = DB_fetch_row($ParentResult);
$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,400-$Left_Margin,$FontSize,$BOMList['parent'] . ' - ' . $ParentRow[0],'left');
$ParentPart = $BOMList['parent'];
Modified: trunk/BOMs.php
===================================================================
--- trunk/BOMs.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BOMs.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -49,7 +49,7 @@
$sql = "SELECT component FROM bom WHERE parent='".$ComponentToCheck."'";
$ErrMsg = _('An error occurred in retrieving the components of the BOM during the check for recursion');
$DbgMsg = _('The SQL that was used to retrieve the components of the BOM and that failed in the process was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
if (DB_num_rows($result)!=0) {
while ($myrow=DB_fetch_array($result)){
@@ -100,7 +100,7 @@
$ErrMsg = _('Could not retrieve the BOM components because');
$DbgMsg = _('The SQL used to retrieve the components was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
//echo $TableHeader;
$RowCounter =0;
@@ -277,7 +277,7 @@
}
if($_POST['AutoIssue']==1 AND isset($_POST['Component'])){
$sql = "SELECT controlled FROM stockmaster WHERE stockid='" . $_POST['Component'] . "'";
- $CheckControlledResult = DB_query($sql,$db);
+ $CheckControlledResult = DB_query($sql);
$CheckControlledRow = DB_fetch_row($CheckControlledResult);
if ($CheckControlledRow[0]==1){
prnMsg(_('Only non-serialised or non-lot controlled items can be set to auto issue. These items require the lot/serial numbers of items issued to the works orders to be specified so autoissue is not an option. Auto issue has been automatically set to off for this component'),'warn');
@@ -308,7 +308,7 @@
$ErrMsg = _('Could not update this BOM component because');
$DbgMsg = _('The SQL used to update the component was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$msg = _('Details for') . ' - ' . $SelectedComponent . ' ' . _('have been updated') . '.';
UpdateCost($db, $SelectedComponent);
@@ -331,7 +331,7 @@
$ErrMsg = _('An error occurred in checking the component is not already on the BOM');
$DbgMsg = _('The SQL that was used to check the component was not already on the BOM and that failed in the process was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
if (DB_num_rows($result)==0) {
@@ -357,7 +357,7 @@
$ErrMsg = _('Could not insert the BOM component because');
$DbgMsg = _('The SQL used to insert the component was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
UpdateCost($db, $_POST['Component']);
$msg = _('A new component part') . ' ' . $_POST['Component'] . ' ' . _('has been added to the bill of material for part') . ' - ' . $SelectedParent . '.';
@@ -389,12 +389,12 @@
$ErrMsg = _('Could not delete this BOM components because');
$DbgMsg = _('The SQL used to delete the BOM was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
$ComponentSQL = "SELECT component
FROM bom
WHERE parent='" . $SelectedParent ."'";
- $ComponentResult = DB_query($ComponentSQL,$db);
+ $ComponentResult = DB_query($ComponentSQL);
$ComponentArray = DB_fetch_row($ComponentResult);
UpdateCost($db, $ComponentArray[0]);
@@ -423,7 +423,7 @@
$ErrMsg = _('Could not retrieve the description of the parent part because');
$DbgMsg = _('The SQL used to retrieve description of the parent part was');
- $result=DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
$myrow=DB_fetch_row($result);
@@ -459,7 +459,7 @@
$ErrMsg = _('Could not retrieve the description of the parent part because');
$DbgMsg = _('The SQL used to retrieve description of the parent part was');
- $result=DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
$ix = 0;
if( DB_num_rows($result) > 0 ) {
echo '<table class="selection">';
@@ -483,7 +483,7 @@
$ErrMsg = _('Could not retrieve the description of the parent part because');
$DbgMsg = _('The SQL used to retrieve description of the parent part was');
- $result=DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
if( DB_num_rows($result) > 0 ) {
echo '<table class="selection">';
echo '<tr><td><div class="centre">' . _('Assembly parent items').' : ';
@@ -508,7 +508,7 @@
$ErrMsg = _('Could not retrieve the description of the parent part because');
$DbgMsg = _('The SQL used to retrieve description of the parent part was');
- $result=DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
if( DB_num_rows($result) > 0 ) {
echo '<table class="selection">';
echo '<tr><td><div class="centre">' . _('Kit sets').' : ';
@@ -532,7 +532,7 @@
$ErrMsg = _('Could not retrieve the description of the parent part because');
$DbgMsg = _('The SQL used to retrieve description of the parent part was');
- $result=DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result=DB_query($sql,$ErrMsg,$DbgMsg);
if( DB_num_rows($result) > 0 ) {
echo '<table class="selection">
<tr>
@@ -619,7 +619,7 @@
WHERE parent='".$SelectedParent."'
AND component='".$SelectedComponent."'";
- $result = DB_query($sql, $db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
$_POST['Sequence'] = $myrow['sequence'];
@@ -686,7 +686,7 @@
$ErrMsg = _('Could not retrieve the list of potential components because');
$DbgMsg = _('The SQL used to retrieve the list of potential components part was');
- $result = DB_query($sql,$db,$ErrMsg, $DbgMsg);
+ $result = DB_query($sql,$ErrMsg, $DbgMsg);
while ($myrow = DB_fetch_array($result)) {
@@ -714,7 +714,7 @@
AND locationusers.userid='" . $_SESSION['UserID'] . "'
AND locationusers.canupd=1
WHERE locations.usedforwo = 1";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['LocCode']) AND $myrow['loccode']==$_POST['LocCode']) {
@@ -734,7 +734,7 @@
<td>' . _('Work Centre Added') . ': </td><td>';
$sql = "SELECT code, description FROM workcentres INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
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');
@@ -878,7 +878,7 @@
}
$ErrMsg = _('The SQL to find the parts selected failed with the message');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
} //one of keywords or StockCode was more than a zero length string
} //end of if search
Modified: trunk/BankAccountUsers.php
===================================================================
--- trunk/BankAccountUsers.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BankAccountUsers.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -55,7 +55,7 @@
WHERE accountcode= '" . $_POST['SelectedBankAccount'] . "'
AND userid = '" . $_POST['SelectedUser'] . "'";
- $checkresult = DB_query($checkSql,$db);
+ $checkresult = DB_query($checkSql);
$checkrow = DB_fetch_row($checkresult);
if ( $checkrow[0] >0) {
@@ -69,7 +69,7 @@
'" . $_POST['SelectedUser'] . "')";
$msg = _('User') . ': ' . $_POST['SelectedUser'].' '._('has been authorised to use') .' '. $_POST['SelectedBankAccount'] . ' ' . _('bank account');
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
prnMsg($msg,'success');
unset($_POST['SelectedUser']);
}
@@ -80,7 +80,7 @@
AND userid='".$SelectedUser."'";
$ErrMsg = _('The bank account user record could not be deleted because');
- $result = DB_query($sql,$db,$ErrMsg);
+ $result = DB_query($sql,$ErrMsg);
prnMsg(_('User').' '. $SelectedUser .' '. _('has been un-authorised to use').' '. $SelectedBankAccount .' '. _('bank account') ,'success');
unset($_GET['delete']);
}
@@ -101,7 +101,7 @@
bankaccountname
FROM bankaccounts";
- $result = DB_query($SQL,$db);
+ $result = DB_query($SQL);
echo '<option value="">' . _('Not Yet Selected') . '</option>';
while ($myrow = DB_fetch_array($result)) {
if (isset($SelectedBankAccount) and $myrow['accountcode']==$SelectedBankAccount) {
@@ -134,7 +134,7 @@
$SQLName = "SELECT bankaccountname
FROM bankaccounts
WHERE accountcode='" .$SelectedBankAccount."'";
- $result = DB_query($SQLName,$db);
+ $result = DB_query($SQLName);
$myrow = DB_fetch_array($result);
$SelectedBankName = $myrow['bankaccountname'];
@@ -152,7 +152,7 @@
WHERE bankaccountusers.accountcode='" . $SelectedBankAccount . "'
ORDER BY bankaccountusers.userid ASC";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
echo '<br />
<table class="selection">';
@@ -200,7 +200,7 @@
realname
FROM www_users";
- $result = DB_query($SQL,$db);
+ $result = DB_query($SQL);
if (!isset($_POST['SelectedUser'])){
echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>';
}
Modified: trunk/BankAccounts.php
===================================================================
--- trunk/BankAccounts.php 2014-10-25 19:25:12 UTC (rev 6940)
+++ trunk/BankAccounts.php 2014-10-26 23:18:08 UTC (rev 6941)
@@ -37,7 +37,7 @@
$sql="SELECT count(accountcode)
FROM bankaccounts WHERE accountcode='".$_POST['AccountCode']."'";
- $result=DB_query($sql, $db);
+ $result=DB_query($sql);
$myrow=DB_fetch_row($result);
if ($myrow[0]!=0 and !isset($SelectedBankAccount)) {
@@ -82,7 +82,7 @@
/*Check if there are already transactions against this account - cant allow change currency if there are*/
$sql = "SELECT banktransid FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'";
- $BankTransResult = DB_query($sql,$db);
+ $BankTransResult = DB_query($sql);
if (DB_num_rows($BankTransResult)>0) {
$sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "',
bankaccountcode='" . $_POST['BankAccountCode'] . "',
@@ -132,7 +132,7 @@
if( $InputError !=1 ) {
$ErrMsg = _('The bank account could not be inserted or modified because');
$DbgMsg = _('The SQL used to insert/modify the bank account details was');
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ $result = DB_query($sql,$ErrMsg,$DbgMsg);
prnMsg($msg,'success');
echo '<br />';
@@ -155,7 +155,7 @@
// PREVENT DELETES IF DEPENDENT RECORDS IN 'BankTrans'
$sql= "SELECT COUNT(bankact) AS accounts FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'";
- $result = DB_query($sql,$db);
+ $result = DB_query($sql);
$myrow = DB_fetch_array($result);
if ($myrow['accounts']>0) {
$CancelDelete = 1;
@@ -165,7 +165,7 @@
}
if (!$CancelDelete) {
$sql="DELETE FROM bankaccounts WHERE accountcode='" . $SelectedBankAccount . "'";
- $result = DB_query($sql,$db);
+ $...
[truncated message content] |