本文整理匯總了PHP中DB_data_seek函數的典型用法代碼示例。如果您正苦於以下問題:PHP DB_data_seek函數的具體用法?PHP DB_data_seek怎麽用?PHP DB_data_seek使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DB_data_seek函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
if (isset($_SESSION['Transfer']->StockLocationFrom)) {
if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationFrom) {
echo '<OPTION SELECTED Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
} else {
echo '<OPTION Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
}
} elseif ($myrow['loccode'] == $_SESSION['UserStockLocation']) {
echo '<OPTION SELECTED Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
$_SESSION['Transfer']->StockLocationFrom = $myrow['loccode'];
} else {
echo '<OPTION Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
}
}
echo '</SELECT></TD></TR>';
echo '<TR><TD>' . _('To Stock Location') . ': </TD><TD><SELECT name="StockLocationTo"> ';
DB_data_seek($resultStkLocs, 0);
while ($myrow = DB_fetch_array($resultStkLocs)) {
if (isset($_SESSION['Transfer']->StockLocationTo)) {
if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo) {
echo '<OPTION SELECTED Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
} else {
echo '<OPTION Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
}
} elseif ($myrow['loccode'] == $_SESSION['UserStockLocation']) {
echo '<OPTION SELECTED Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
$_SESSION['Transfer']->StockLocationTo = $myrow['loccode'];
} else {
echo '<OPTION Value="' . $myrow['loccode'] . '">' . $myrow['locationname'];
}
}
echo '</SELECT></TD></TR>';
示例2: locale_number_format
<td>' . $myrow['description'] . '</td>
<td>' . $myrow['serialno'] . '</td>
<td class="number">' . locale_number_format($myrow['cost'], $_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td class="number">' . locale_number_format($myrow['accumdepn'], $_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td>' . $myrow['ItemAssetLocation'] . '</td>';
echo '<td><select minlength="0" name="Location' . $myrow['assetid'] . '" onchange="ReloadForm(Move' . $myrow['assetid'] . ')">';
$ThisDropDownName = 'Location' . $myrow['assetid'];
while ($LocationRow = DB_fetch_array($LocationResult)) {
if (isset($_POST[$ThisDropDownName]) and $_POST[$ThisDropDownName] == $LocationRow['locationid']) {
echo '<option selected="selected" value="' . $LocationRow['locationid'] . '">' . $LocationRow['locationdescription'] . '</option>';
} elseif ($LocationRow['locationid'] == $myrow['ItemAssetLocation']) {
echo '<option selected="selected" value="' . $LocationRow['locationid'] . '">' . $LocationRow['locationdescription'] . '</option>';
} else {
echo '<option value="' . $LocationRow['locationid'] . '">' . $LocationRow['locationdescription'] . '</option>';
}
}
DB_data_seek($LocationResult, 0);
echo '</select></td>';
echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'] . '" />';
echo '<input type="hidden" name="AssetLocation" value="' . $_POST['AssetLocation'] . '" />';
echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'] . '" />';
echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'] . '" />';
echo '<input type="hidden" name="Search" value="' . $_POST['Search'] . '" />';
echo '<td><input type="submit" name="Move' . $myrow['assetid'] . '" value="Move" /></td>';
echo '</tr>';
}
echo '</table>
</div>
</form>';
}
include 'includes/footer.inc';
示例3: DB_fetch_row
$myrow = DB_fetch_row($Result);
$CurrencyRate = $myrow[0];
$SQL = "SELECT taxprovinceid FROM locations WHERE loccode='" . $RecurrOrderRow['fromstkloc'] . "'";
$ErrMsg = _('Could not retreive the tax province of the location from where the order was fulfilled because:');
$Result = DB_query($SQL, $db, $ErrMsg);
$myrow = DB_fetch_row($Result);
$DispTaxProvinceID = $myrow[0];
/*Now Get the next invoice number - function in SQL_CommonFunctions*/
$InvoiceNo = GetNextTransNo(10, $db);
$PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db);
/*Start an SQL transaction */
$SQL = "BEGIN";
$Result = DB_query($SQL, $db);
$TotalFXNetInvoice = 0;
$TotalFXTax = 0;
DB_data_seek($LineItemsResult, 0);
$LineCounter = 0;
while ($RecurrOrderLineRow = DB_fetch_array($LineItemsResult)) {
$LineNetAmount = $RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] * (1 - floatval($RecurrOrderLineRow['discountpercent']));
/*Gets the Taxes and rates applicable to this line from the TaxGroup of the branch and TaxCategory of the item
and the taxprovince of the dispatch location */
$SQL = "SELECT taxgrouptaxes.calculationorder,\n\t\t\t\t\ttaxauthorities.description,\n\t\t\t\t\ttaxgrouptaxes.taxauthid,\n\t\t\t\t\ttaxauthorities.taxglcode,\n\t\t\t\t\ttaxgrouptaxes.taxontax,\n\t\t\t\t\ttaxauthrates.taxrate\n\t\t\tFROM taxauthrates INNER JOIN taxgrouptaxes ON\n\t\t\t\ttaxauthrates.taxauthority=taxgrouptaxes.taxauthid\n\t\t\t\tINNER JOIN taxauthorities ON\n\t\t\t\ttaxauthrates.taxauthority=taxauthorities.taxid\n\t\t\tWHERE taxgrouptaxes.taxgroupid=" . $RecurrOrderRow['taxgroupid'] . "\n\t\t\tAND taxauthrates.dispatchtaxprovince=" . $DispTaxProvinceID . "\n\t\t\tAND taxauthrates.taxcatid = " . $RecurrOrderLineRow['taxcatid'] . "\n\t\t\tORDER BY taxgrouptaxes.calculationorder";
$ErrMsg = _('The taxes and rates for this item could not be retreived because');
$GetTaxRatesResult = DB_query($SQL, $db, $ErrMsg);
$LineTaxAmount = 0;
$TaxTotals = array();
while ($myrow = DB_fetch_array($GetTaxRatesResult)) {
if (!isset($TaxTotals[$myrow['taxauthid']]['FXAmount'])) {
$TaxTotals[$myrow['taxauthid']]['FXAmount'] = 0;
}
$TaxAuthID = $myrow['taxauthid'];
示例4: while
<input type="hidden" name="CompareVal' . $x . '" value="' . $CompareVal . '" />
</td>
<td>' . $myrow['method'] . '</td>
<td>' . $RangeDisplay . '</td>
<td>' . $myrow['targetvalue'] . ' ' . $myrow['units'] . '</td>
<td><input type="text" class="date" name="TestDate' . $x . '" size="10" maxlength="10" value="' . $TestDate . '" /> </td>
<td><select name="TestedBy' . $x . '"/>';
while ($techrow = DB_fetch_array($techresult)) {
if ($techrow['userid'] == $myrow['testedby']) {
echo '<option selected="selected" value="' . $techrow['userid'] . '">' . $techrow['realname'] . '</option>';
} else {
echo '<option value="' . $techrow['userid'] . '">' . $techrow['realname'] . '</option>';
}
}
echo '</select>';
DB_data_seek($techresult, 0);
echo '<td>' . $TestResult . '</td>
<td>' . $ShowOnCert . '</td>
<td>' . $Delete . '</td>
</tr>';
}
echo '</table><div class="centre">
<input type="hidden" name="TestResultsCounter" value="' . $x . '" />
<input type="submit" name="submit" value="' . _('Enter Information') . '" />
</div>
</div>
</form>';
echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?ListTests=yes&SelectedSampleID=' . $SelectedSampleID . '">' . _('Add More Tests') . '</a></div>';
echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?CopyResults=yes&SelectedSampleID=' . $SelectedSampleID . '">' . _('Copy These Results') . '</a></div>';
if ($CanCert == 1) {
echo '<div class="centre"><a target="_blank" href="' . $RootPath . '/PDFCOA.php?LotKey=' . $LotKey . '&ProdSpec=' . $ProdSpec . '">' . _('Print COA') . '</a></div>';
示例5: _
$sql = "SELECT stockmaster.stockid,\n\t\t\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\t\t\tstockmaster.units\n\t\t\t\t\t\tFROM stockmaster INNER JOIN stockcategory\n\t\t\t\t\t\tON stockmaster.categoryid=stockcategory.categoryid\n\t\t\t\t\t\tINNER JOIN purchdata \n\t\t\t\t\t\tON stockmaster.stockid=purchdata.stockid\n\t\t\t\t\t\tWHERE stockmaster.mbflag<>'D'\n\t\t\t\t\t\tAND stockmaster.mbflag<>'K'\n\t\t\t\t\t\tAND stockmaster.mbflag<>'G'\n\t\t\t\t\t\tAND purchdata.supplierno='" . $_SESSION['PO' . $identifier]->SupplierID . "'\n\t\t\t\t\t\tAND stockmaster.discontinued<>1\n\t\t\t\t\t\tAND stockmaster.categoryid='" . $_POST['StockCat'] . "'\n\t\t\t\t\t\tORDER BY stockmaster.stockid\n\t\t\t\t\t\tLIMIT " . $_SESSION['DefaultDisplayRecordsMax'];
} else {
$sql = "SELECT stockmaster.stockid,\n\t\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\t\tstockmaster.units\n\t\t\t\t\tFROM stockmaster INNER JOIN stockcategory\n\t\t\t\t\tON stockmaster.categoryid=stockcategory.categoryid\n\t\t\t\t\tWHERE stockmaster.mbflag<>'D'\n\t\t\t\t\tAND stockmaster.mbflag<>'K'\n\t\t\t\t\tAND stockmaster.mbflag<>'G'\n\t\t\t\t\tAND stockmaster.discontinued<>1\n\t\t\t\t\tAND stockmaster.categoryid='" . $_POST['StockCat'] . "'\n\t\t\t\t\tORDER BY stockmaster.stockid\n\t\t\t\t\tLIMIT " . $_SESSION['DefaultDisplayRecordsMax'];
}
}
}
$ErrMsg = _('There is a problem selecting the part records to display because');
$DbgMsg = _('The SQL statement that failed was');
$SearchResult = DB_query($sql, $db, $ErrMsg, $DbgMsg);
if (DB_num_rows($SearchResult) == 0 and $debug == 1) {
prnMsg(_('There are no products to display matching the criteria provided'), 'warn');
}
if (DB_num_rows($SearchResult) == 1) {
$myrow = DB_fetch_array($SearchResult);
$_GET['NewItem'] = $myrow['stockid'];
DB_data_seek($SearchResult, 0);
}
}
//end of if search
if (!isset($_GET['Edit'])) {
$sql = "SELECT categoryid,\n\t\t\t\tcategorydescription\n\t\t\tFROM stockcategory\n\t\t\tWHERE stocktype<>'L'\n\t\t\tAND stocktype<>'D'\n\t\t\tORDER BY categorydescription";
$ErrMsg = _('The supplier category details could not be retrieved because');
$DbgMsg = _('The SQL used to retrieve the category details but failed was');
$result1 = DB_query($sql, $db, $ErrMsg, $DbgMsg);
echo '<table class="selection">
<tr>
<th colspan="3"><h3>' . _('Search For Stock Items') . ':</h3></th>';
echo '</tr>
<tr><td>' . _('Item Category') . ': <select name="StockCat">';
echo '<option selected="selected" value="All">' . _('All') . '</option>';
while ($myrow1 = DB_fetch_array($result1)) {
示例6: _
</div>';
}
echo '<table cellpadding="2">';
echo '<tr>
<th>' . _('Code') . '</th>
<th>' . _('Description') . '</th>
<th>' . _('Total Qty On Hand') . '</th>
<th>' . _('Units') . '</th>
<th>' . _('Stock Status') . '</th>
</tr>';
$j = 1;
$k = 0;
//row counter to determine background colour
$RowIndex = 0;
if (DB_num_rows($searchresult) != 0) {
DB_data_seek($searchresult, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']);
}
while ($myrow = DB_fetch_array($searchresult) and $RowIndex != $_SESSION['DisplayRecordsMax']) {
if ($k == 1) {
echo '<tr class="EvenTableRows">';
$k = 0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}
if ($myrow['mbflag'] == 'D') {
$qoh = _('N/A');
} else {
$qoh = locale_number_format($myrow['qoh'], $myrow['decimalplaces']);
}
if ($myrow['discontinued'] == 1) {
示例7: DB_data_seek
} else {
echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' (' . $myrow['accountcode'] . ')</option>';
}
}
//end while loop
echo '</select></td></tr>';
DB_data_seek($PnLAccountsResult, 0);
echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">';
while ($myrow = DB_fetch_array($PnLAccountsResult)) {
if (isset($_POST['DisposalAct']) and $myrow['accountcode'] == $_POST['DisposalAct']) {
echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' (' . $myrow['accountcode'] . ')' . '</option>';
} else {
echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' (' . $myrow['accountcode'] . ')' . '</option>';
}
}
//end while loop
echo '</select></td></tr>';
DB_data_seek($BSAccountsResult, 0);
echo '<tr><td>' . _('Balance Sheet Accumulated Depreciation GL Code') . ':</td><td><select name="AccumDepnAct">';
while ($myrow = DB_fetch_array($BSAccountsResult)) {
if (isset($_POST['AccumDepnAct']) and $myrow['accountcode'] == $_POST['AccumDepnAct']) {
echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' (' . $myrow['accountcode'] . ')' . '</option>';
} else {
echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' (' . $myrow['accountcode'] . ')' . '</option>';
}
}
//end while loop
echo '</select></td></tr></table><br />';
echo '<div class="centre"><button type="submit" name="submit">' . _('Enter Information') . '</button></div>';
echo '</form><br />';
include 'includes/footer.inc';
示例8: _
//end while loop
echo '</select></td></tr>';
echo '<tr><td>' . _('Post Sales to GL Account') . ":</td><td><select name='SalesGLCode'>";
DB_free_result($result);
$SQL = "SELECT chartmaster.accountcode,\n\t\t\tchartmaster.accountname\n\t\tFROM chartmaster,\n\t\t\taccountgroups\n\t\tWHERE chartmaster.group_=accountgroups.groupname\n\t\tAND accountgroups.pandl=1\n\t\tORDER BY accountgroups.sequenceintb, \n\t\t\tchartmaster.accountcode";
$result = DB_query($SQL, $db);
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['SalesGLCode']) and $myrow['accountcode'] == $_POST['SalesGLCode']) {
echo "<option selected VALUE='";
} else {
echo "<option VALUE='";
}
echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname'];
}
//end while loop
DB_data_seek($result, 0);
echo '</td></tr>
<tr><td>' . _('Post Discount to GL Account') . ":</td>\n\t\t\t<td><select name='DiscountGLCode'>";
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['DiscountGLCode']) and $myrow['accountcode'] == $_POST['DiscountGLCode']) {
echo "<option selected VALUE='";
} else {
echo "<option VALUE='";
}
echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname'];
}
//end while loop
echo '</select></td>
</tr>
</table>';
echo "<div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>";
示例9: date
<td><input type="text" class="number" size="11" value="1" name="LeadTime0" /></td>';
echo '<td><input type="checkbox" name="Preferred0" /></td>';
echo '<td><input type="text" class="date" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom0" /></td>
<td><input type="text" size="20" maxlength="50" value="" name="SupplierPartNo0" /></td>
<td><input type="text" class="number" size="11" value="1" name="MinOrderQty0" /></td>
<td><button type="submit" style="width:100%;text-align:left" title="' . _('Insert this record') . '" name="Insert"><img width="15px" src="' . $rootpath . '/css/' . $theme . '/images/tick.png" /></button></td>
</tr>';
}
$RowCounter = 1;
while ($myrow = DB_fetch_array($result)) {
echo '<tr>
<td><input type="hidden" value="' . $myrow['stockid'] . '" name="StockID' . $RowCounter . '" />' . $myrow['stockid'] . '</td>
<td>' . $myrow['description'] . '</td>
<td><input type="text" class="number" size="11" value="' . $myrow['price'] . '" name="Price' . $RowCounter . '" /></td>
<td><select name="SuppUOM' . $RowCounter . '">';
DB_data_seek($UOMResult, 0);
while ($UOMRow = DB_fetch_array($UOMResult)) {
if ($UOMRow['unitid'] == $myrow['suppliersuom']) {
echo '<option selected="selected" value="' . $UOMRow['unitid'] . '">' . $UOMRow['unitname'] . '</option>';
} else {
echo '<option value="' . $UOMRow['unitid'] . '">' . $UOMRow['unitname'] . '</option>';
}
}
echo '</select></td>
<td><input type="text" class="number" size="11" value="' . $myrow['conversionfactor'] . '" name="ConversionFactor' . $RowCounter . '" /></td>
<td><input type="text" class="number" size="11" value="' . $myrow['uomdecimalplaces'] . '" name="DecimalPlaces' . $RowCounter . '" /></td>
<td><input type="text" size="30" maxlength="50" value="' . $myrow['supplierdescription'] . '" name="SupplierDescription' . $RowCounter . '" /></td>
<td><input type="text" class="number" size="11" value="' . $myrow['leadtime'] . '" name="LeadTime' . $RowCounter . '" /></td>';
if ($myrow['preferred'] == 1) {
echo '<td><input type="checkbox" checked="checked" name="Preferred' . $RowCounter . '" /></td>';
} else {
示例10: _
}
//**************Check to see if freight was added could do this in Substitution, skip if 0 freight
//Get the message lines, replace variable names with data, write the output to a file one line at a time
$sql = "SELECT section, linetext FROM edimessageformat WHERE partnercode='" . $CustDetails['debtorno'] . "' AND messagetype='INVOIC' ORDER BY sequenceno";
$ErrMsg = _('An error occurred in getting the EDI format template for') . ' ' . $CustDetails['debtorno'] . ' ' . _('because');
$MessageLinesResult = DB_query($sql, $ErrMsg);
if (DB_num_rows($MessageLinesResult) > 0) {
$DetailLines = array();
$ArrayCounter = 0;
while ($MessageLine = DB_fetch_array($MessageLinesResult)) {
if ($MessageLine['section'] == 'Detail') {
$DetailLines[$ArrayCounter] = $MessageLine['linetext'];
$ArrayCounter++;
}
}
DB_data_seek($MessageLinesResult, 0);
$EDITransNo = GetNextTransNo(99, $db);
$fp = fopen('EDI_INV_' . $TransNo . '.txt', 'w');
while ($LineDetails = DB_fetch_array($MessageLinesResult)) {
if ($LineDetails['section'] == 'Heading') {
$MsgLineText = $LineDetails['linetext'];
include 'includes/EDIVariableSubstitution.inc';
$LastLine = 'Heading';
}
if ($LineDetails['section'] == 'Detail' and $LastLine == 'Heading') {
/*This must be the detail section
need to get the line details for the invoice or credit note
for creating the detail lines */
if ($TransDetails['type'] == 10) {
/*its an invoice */
$sql = "SELECT stockmoves.stockid,\n\t\t\t\t\t\t \t\tstockmaster.description,\n\t\t\t\t\t\t\t\t-stockmoves.qty as quantity,\n\t\t\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\t\t\t((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * -stockmoves.qty) AS fxnet,\n\t\t\t\t\t\t\t\t(stockmoves.price * " . $ExchRate . ") AS fxprice,\n\t\t\t\t\t\t\t\tstockmaster.units\n\t\t\t\t\t\t\tFROM stockmoves,\n\t\t\t\t\t\t\t\tstockmaster\n\t\t\t\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\tAND stockmoves.type=10\n\t\t\t\t\t\t\tAND stockmoves.transno=" . $TransNo . "\n\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1";
示例11: _
<td>' . $WORow['locationname'] . '</td>
<td class="label">' . _('Required By') . ':</td>
<td>' . ConvertSQLDate($WORow['requiredby']) . '</td>
</tr>
<tr>
<td class="label">' . 'Item' . '</td>
<td class="label">' . _('Quantity Ordered') . ':</td>
<td class="label">' . _('Already Received') . ':</td>
<td class="label">' . _('Unit') . ':</td>
</tr>';
if ($WORow['closed'] == 1) {
prnMsg(_('The selected work order has been closed and variances calculated and posted. No more issues of materials and components can be made against this work order.'), 'info');
include 'includes/footer.inc';
exit;
}
DB_data_seek($WOResult, 0);
while ($WORow = DB_fetch_array($WOResult)) {
echo '<tr>
<td>' . $WORow['stockid'] . ' - ' . $WORow['description'] . '</td>
<td class="number">' . locale_number_format($WORow['qtyreqd'], $WORow['decimalplaces']) . '</td>
<td class="number">' . locale_number_format($WORow['qtyrecd'], $WORow['decimalplaces']) . '</td>
<td>' . $WORow['units'] . '</td>
</tr>';
}
echo '<tr>
<td class="label">' . _('Date Material Issued') . ':</td>
<td><input type="text" name="IssuedDate" value="' . Date($_SESSION['DefaultDateFormat']) . '" class="date" size="10" alt="' . $_SESSION['DefaultDateFormat'] . '" /></td>
<td class="label">' . _('Issued From') . ':</td>
<td>';
if (!isset($_POST['IssueItem'])) {
$LocResult = DB_query("SELECT loccode, locationname FROM locations", $db);
示例12: prnMsg
$DataError = 1;
echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>';
echo '<tr><td colspan=2>' . prnMsg(_('No sales types/price lists defined'), 'error') . '</td></tr>';
} else {
echo '<tr><td>' . _('Price List') . ':</td>
<td><select tabindex="9" name="SalesType">';
echo '<option value=""></option>';
while ($TypeRow = DB_fetch_array($TypeResult)) {
if ($TypeRow['typeabbrev'] == $myrow['salestype']) {
echo '<option selected="selected" value="' . $TypeRow['typeabbrev'] . '">' . $TypeRow['sales_type'] . '</option>';
} else {
echo '<option value="' . $TypeRow['typeabbrev'] . '">' . $TypeRow['sales_type'] . '</option>';
}
}
//end while loopre
DB_data_seek($TypeResultesult, 0);
echo '</select></td></tr>';
}
$sql = "SELECT reasoncode,\n\t\t\t\treasondescription\n\t\t\t\tFROM holdreasons";
$SexResult = DB_query($sql, $db);
echo '<tr><td>' . _('Sex') . ':</td>';
echo '<td><select name="Sex">';
echo '<option value=""></option>';
while ($SexRow = DB_fetch_array($SexResult)) {
if ($SexRow['reasoncode'] == $myrow['holdreason']) {
echo '<option selected="selected" value="' . $SexRow['reasoncode'] . '">' . $SexRow['reasondescription'] . '</option>';
} else {
echo '<option value="' . $SexRow['reasoncode'] . '">' . $SexRow['reasondescription'] . '</option>';
}
}
echo '</select></td></tr>';
示例13: ShowCustomerSearchFields
function ShowCustomerSearchFields($rootpath, $theme, $db)
{
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers') . '</p>';
echo '<table cellpadding="3" class="selection">';
echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>';
if (isset($_POST['Keywords'])) {
echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />';
} else {
echo '<input type="text" name="Keywords" size="20" maxlength="25" />';
}
echo '</td><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</td><td>';
if (isset($_POST['CustCode'])) {
echo '<input type="text" name="CustCode" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />';
} else {
echo '<input type="text" name="CustCode" size="15" maxlength="18" />';
}
echo '</td></tr><tr><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Phone Number') . ':</td><td>';
if (isset($_POST['CustPhone'])) {
echo '<input type="text" name="CustPhone" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />';
} else {
echo '<input type="text" name="CustPhone" size="15" maxlength="18" />';
}
echo '</td>';
echo '<td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter part of the Address') . ':</td><td>';
if (isset($_POST['CustAdd'])) {
echo '<input type="text" name="CustAdd" value="' . $_POST['CustAdd'] . '" size="20" maxlength="25" />';
} else {
echo '<input type="text" name="CustAdd" size="20" maxlength="25" />';
}
echo '</td></tr>';
/* End addded search feature. Gilles Deacur */
echo '<tr><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Choose a Type') . ':</td><td>';
if (isset($_POST['CustType'])) {
// Show Customer Type drop down list
$result2 = DB_query("SELECT typeid, typename FROM debtortype", $db);
// Error if no customer types setup
if (DB_num_rows($result2) == 0) {
$DataError = 1;
echo '<a href="CustomerTypes.php?" target="_parent">Setup Types</a>';
echo '<tr><td colspan="2">' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>';
} else {
// If OK show select box with option selected
echo '<select name="CustType">';
echo '<option value="ALL">' . _('Any') . '</option>';
while ($myrow = DB_fetch_array($result2)) {
if ($_POST['CustType'] == $myrow['typename']) {
echo '<option selected="True" value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>';
} else {
echo '<option value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>';
}
}
//end while loop
DB_data_seek($result2, 0);
echo '</select></td>';
}
} else {
// No option selected yet, so show Customer Type drop down list
$result2 = DB_query("SELECT typeid, typename FROM debtortype", $db);
// Error if no customer types setup
if (DB_num_rows($result2) == 0) {
$DataError = 1;
echo '<a href="CustomerTypes.php?" target="_parent">Setup Types</a>';
echo '<tr><td colspan="2">' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>';
} else {
// if OK show select box with available options to choose
echo '<select name="CustType">';
echo '<option value="ALL">' . _('Any') . '</option>';
while ($myrow = DB_fetch_array($result2)) {
echo '<option value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>';
}
//end while loop
DB_data_seek($result2, 0);
echo '</select></td>';
}
}
/* Option to select a sales area */
echo '<td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Choose an Area') . ':</td><td>';
$result2 = DB_query("SELECT areacode, areadescription FROM areas", $db);
// Error if no sales areas setup
if (DB_num_rows($result2) == 0) {
$DataError = 1;
echo '<a href="Areas.php?" target="_parent">Setup Types</a>';
echo '<tr><td colspan="2">' . prnMsg(_('No Sales Areas defined'), 'error') . '</td></tr>';
} else {
// if OK show select box with available options to choose
echo '<select name="Area">';
echo '<option value="ALL">' . _('Any') . '</option>';
while ($myrow = DB_fetch_array($result2)) {
if (isset($_POST['Area']) and $_POST['Area'] == $myrow['areacode']) {
echo '<option selected="True" value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>';
} else {
echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>';
}
}
//end while loop
DB_data_seek($result2, 0);
echo '</select></td></tr>';
}
//.........這裏部分代碼省略.........
示例14: _
<td>' . _('Cash Assigner') . ':</td><td><select name="SelectAssigner">';
DB_data_seek($UsersResult);
echo '<option value=""></option>';
while ($myrow = DB_fetch_array($UsersResult)) {
if (isset($_POST['SelectAssigner']) and $myrow['userid'] == $_POST['SelectAssigner']) {
echo '<option selected="True" value="' . $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>';
} else {
echo '<option value="' . $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>';
}
}
//end while loop get authorizer
echo '</select></td></tr>';
echo '<tr>
<td>' . _('Authorizer') . ':</td>
<td><select name="SelectAuthorizer">';
DB_data_seek($UsersResult);
echo '<option value=""></option>';
while ($myrow = DB_fetch_array($UsersResult)) {
if (isset($_POST['SelectAuthorizer']) and $myrow['userid'] == $_POST['SelectAuthorizer']) {
echo '<option selected="True" value="' . $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>';
} else {
echo '<option value="' . $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>';
}
}
//end while loop get authorizer
echo '</select></td></tr>';
echo '<tr>
<td>' . _('GL Account Cash Assignment') . ':</td>
<td><select name="glaccountcash">';
DB_free_result($result);
$SQL = "SELECT chartmaster.accountcode, chartmaster.accountname\r\n\t\tFROM chartmaster, bankaccounts\r\n\t\tWHERE chartmaster.accountcode = bankaccounts.accountcode\r\n\t\tORDER BY chartmaster.accountcode";
示例15: DB_data_seek
echo '</tr>';
}
DB_data_seek($Result, 0);
echo '<tr><td>' . _('Check every Invoice has a Tax Entry') . '</td></tr>';
while ($myrow = DB_fetch_array($Result)) {
$SQL3 = "SELECT debtortransid\n\t\t\t\tFROM debtortranstaxes\n\t\t\t\tWHERE debtortransid = '" . $myrow['id'] . "'";
$Result3 = DB_query($SQL3, $db);
if (DB_num_rows($Result3) == 0) {
echo '<td>' . _('Invoice ') . ' ' . $myrow['transno'] . ' : </td>';
echo '<td><font color=red>' . _('has no Tax Entry') . '</font></td>';
} else {
echo '<td></td><td><font class="good">' . _('Tax Entry Exists') . '</font></td>';
}
echo '</tr>';
}
DB_data_seek($Result, 0);
echo '<br /><br />' . _('Check every Invoice has a GL Entry') . '<br />';
while ($myrow = DB_fetch_array($Result)) {
$SQL4 = "SELECT typeno\n\t\t\t\tFROM gltrans\n\t\t\t\tWHERE type = 10\n\t\t\t\tAND typeno = '" . $myrow['transno'] . "'";
$Result4 = DB_query($SQL4, $db);
if (DB_num_rows($Result4) == 0) {
echo '<br />' . _('Invoice') . ' ' . $myrow['transno'] . ' : ';
echo '<font color=red>' . _('has no GL Entry') . '</font>';
}
}
echo '<br /><br />' . _('Check for orphan GL Entries') . '<br />';
$SQL = "SELECT DISTINCT typeno,\n\t\t\t\t\tcounterindex\n\t\t\t\tFROM gltrans\n\t\t\t\tWHERE type = 10";
$Result = DB_query($SQL, $db);
while ($myrow = DB_fetch_array($Result)) {
$SQL2 = "SELECT id,\n\t\t\t\t\ttransno,\n\t\t\t\t\ttrandate\n\t\t\t\tFROM debtortrans\n\t\t\t\tWHERE type = 10\n\t\t\t\tAND transno = '" . $myrow['typeno'] . "'";
$Result2 = DB_query($SQL2, $db);