本文整理汇总了PHP中ConvertSQLDate函数的典型用法代码示例。如果您正苦于以下问题:PHP ConvertSQLDate函数的具体用法?PHP ConvertSQLDate怎么用?PHP ConvertSQLDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ConvertSQLDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetExpiryDate
function GetExpiryDate($StockID, $LocCode, $BundleRef)
{
global $db;
$SQL = "SELECT expirationdate \n\t\t\t\tFROM stockserialitems\n\t\t\t\tWHERE stockid = '" . $StockID . "'\n\t\t\t\tAND loccode = '" . $LocCode . "'\n\t\t\t\tAND serialno = '" . $BundleRef . "'";
$Result = DB_query($SQL);
if (DB_num_rows($Result) == 0) {
return '0000-00-00';
} else {
$myrow = DB_fetch_row($Result);
return ConvertSQLDate($myrow[0]);
}
}
示例2: Load
function Load($WONumber)
{
global $db;
$sql = "SELECT loccode,\n\t\t\t\t\t\trequiredby,\n\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\tcostissued,\n\t\t\t\t\t\tclosed\n\t\t\t\t\tFROM workorders\n\t\t\t\t\tWHERE workorders.wo='" . $WONumber . "'";
$WOResult = DB_query($sql, $db);
if (DB_num_rows($WOResult) == 1) {
$myrow = DB_fetch_array($WOResult);
$this->StartDate = ConvertSQLDate($myrow['startdate']);
$this->CostIssued = $myrow['costissued'];
$this->Closed = $myrow['closed'];
$this->RequiredBy = ConvertSQLDate($myrow['requiredby']);
$this->LocationCode = $myrow['loccode'];
$this->OrderNumber = $WONumber;
$ErrMsg = _('Could not get the work order items');
$WOItemsResult = DB_query("SELECT stockid,\n\t\t\t\t\t\t\t\t\t\t\t\tqtyreqd,\n\t\t\t\t\t\t\t\t\t\t\t\tqtyrecd,\n\t\t\t\t\t\t\t\t\t\t\t\tstdcost,\n\t\t\t\t\t\t\t\t\t\t\t\tnextlotsnref\n\t\t\t\t\t\t\t\t\t\t\tFROM woitems\n\t\t\t\t\t\t\t\t\t\t\tWHERE wo='" . $WONumber . "'", $db, $ErrMsg);
$NumberOfOutputs = DB_num_rows($WOItemsResult);
$i = 1;
while ($WOItem = DB_fetch_array($WOItemsResult)) {
$this->Items[$i] = new WOItem($WOItem['stockid'], $WOItem['qtyreqd'], $WOItem['qtyrecd'], $WOItem['nextlotsnref'], $this->LocationCode, $i);
$i++;
}
$this->NumberOfItems = $i;
}
}
示例3: _
$LineItemsSQL = "SELECT salesorderdetails.orderlineno,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.stkcode,\n\t\t\t\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\t\t\t\tstockmaster.volume,\n\t\t\t\t\t\t\t\t\tstockmaster.kgs,\n\t\t\t\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\t\t\t\tstockmaster.nextserialno,\n\t\t\t\t\t\t\t\t\tstockmaster.eoq,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.unitprice,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.quantity,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.discountpercent,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.actualdispatchdate,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.qtyinvoiced,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.narrative,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.itemdue,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.poline,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.conversionfactor,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.pricedecimals,\n\t\t\t\t\t\t\t\t\tlocstock.quantity/salesorderdetails.conversionfactor as qohatloc,\n\t\t\t\t\t\t\t\t\tstockmaster.mbflag,\n\t\t\t\t\t\t\t\t\tstockmaster.discountcategory,\n\t\t\t\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\t\t\t\tstockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost,\n\t\t\t\t\t\t\t\t\tsalesorderdetails.completed\n\t\t\t\t\t\t\t\t\tFROM salesorderdetails INNER JOIN stockmaster\n\t\t\t\t\t\t\t\t\tON salesorderdetails.stkcode = stockmaster.stockid\n\t\t\t\t\t\t\t\t\tINNER JOIN locstock ON locstock.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\t\tWHERE locstock.loccode = '" . $myrow['fromstkloc'] . "'\n\t\t\t\t\t\t\t\t\tAND salesorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "'\n\t\t\t\t\t\t\t\t\tORDER BY salesorderdetails.orderlineno";
$ErrMsg = _('The line items of the order cannot be retrieved because');
$LineItemsResult = DB_query($LineItemsSQL, $db, $ErrMsg);
if (DB_num_rows($LineItemsResult) > 0) {
while ($myrow = DB_fetch_array($LineItemsResult)) {
if ($myrow['completed'] == 0) {
$PropertiesSQL = "SELECT stkcatpropid,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t\t\t\tFROM stockorderitemproperties\n\t\t\t\t\t\t\t\t\t\t\tWHERE orderno='" . $_GET['ModifyOrderNumber'] . "'\n\t\t\t\t\t\t\t\t\t\t\t\tAND orderlineno='" . $myrow['orderlineno'] . "'";
$PropertiesResult = DB_query($PropertiesSQL, $db);
if (DB_num_rows($PropertiesResult) == 0) {
$PropertiesArray = array();
} else {
while ($MyPropertiesRow = DB_fetch_array($PropertiesResult)) {
$PropertiesArray[$MyPropertiesRow['stkcatpropid']] = $MyPropertiesRow['value'];
}
}
$_SESSION['Items' . $identifier]->add_to_cart($myrow['stkcode'], $myrow['quantity'], $myrow['description'], $myrow['unitprice'], $myrow['discountpercent'], $myrow['units'], $myrow['volume'], $myrow['kgs'], $myrow['qohatloc'], $myrow['mbflag'], $myrow['actualdispatchdate'], $myrow['qtyinvoiced'], $myrow['discountcategory'], 0, 0, $myrow['serialised'], $myrow['decimalplaces'], $myrow['pricedecimals'], $myrow['narrative'], 'No', $myrow['orderlineno'], 0, ConvertSQLDate($myrow['itemdue']), $myrow['poline'], $myrow['standardcost'], $myrow['eoq'], $myrow['nextserialno'], $ExRate, $myrow['conversionfactor'], $PropertiesArray);
/*Just populating with existing order - no DBUpdates */
}
$LastLineNo = $myrow['orderlineno'];
}
/* line items from sales order details */
$_SESSION['Items' . $identifier]->LineCounter = $LastLineNo + 1;
}
//end of checks on returned data set
}
}
if (!isset($_SESSION['Items' . $identifier])) {
/* It must be a new order being created $_SESSION['Items'.$identifier] would be set up from the order
modification code above if a modification to an existing order. Also $ExistingOrder would be
set to 1. The delivery check screen is where the details of the order are either updated or
inserted depending on the value of ExistingOrder */
示例4: ReSequenceEffectiveDates
function ReSequenceEffectiveDates($Item, $PriceList, $CurrAbbrev, $QuantityBreak, $db)
{
/*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where one price falls inside another effective date range except in the case of a blank end date - ie no end date - the default price for the currency/salestype.
I first thought that we would need to update the previous default price (blank end date), when a new default price is entered, to have an end date of the startdate of this new default price less 1 day - but this is converting a default price into a special price which could result in having two special prices over the same date range - best to leave it unchanged and use logic in the GetPrice.inc to ensure the correct default price is returned
*
* After further discussion (Ricard) if the new price has a blank end date - i.e. no end then the pre-existing price with no end date should be changed to have an end date just prior to the new default (no end date) price commencing
*/
//this is just the case where debtorno='' - see the Prices_Customer.php script for customer special prices
$SQL = "SELECT price,\r\n\t\t\t\t\t\tstartdate,\r\n\t\t\t\t\t\tenddate\r\n\t\t\t\tFROM pricematrix\r\n\t\t\t\tWHERE stockid='" . $Item . "'\r\n\t\t\t\tAND currabrev='" . $CurrAbbrev . "'\r\n\t\t\t\tAND salestype='" . $PriceList . "'\r\n\t\t\t\tAND quantitybreak='" . $QuantityBreak . "'\r\n\t\t\t\tORDER BY startdate, enddate";
$result = DB_query($SQL);
while ($myrow = DB_fetch_array($result)) {
if (isset($NextStartDate)) {
if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']), $NextStartDate)) {
$NextStartDate = ConvertSQLDate($myrow['startdate']);
//Only if the previous enddate is after the new start date do we need to look at updates
if (Date1GreaterThanDate2(ConvertSQLDate($EndDate), ConvertSQLDate($myrow['startdate']))) {
/*Need to make the end date the new start date less 1 day */
$SQL = "UPDATE pricematrix SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate, 'd', -1)) . "'\r\n\t\t\t\t\t\t\t\t\t\tWHERE stockid ='" . $Item . "'\r\n\t\t\t\t\t\t\t\t\t\tAND currabrev='" . $CurrAbbrev . "'\r\n\t\t\t\t\t\t\t\t\t\tAND salestype='" . $PriceList . "'\r\n\t\t\t\t\t\t\t\t\t\tAND startdate ='" . $StartDate . "'\r\n\t\t\t\t\t\t\t\t\t\tAND enddate = '" . $EndDate . "'\r\n\t\t\t\t\t\t\t\t\t\tAND quantitybreak ='" . $QuantityBreak . "'";
$UpdateResult = DB_query($SQL);
}
}
//end of if startdate after NextStartDate - we have a new NextStartDate
} else {
$NextStartDate = ConvertSQLDate($myrow['startdate']);
}
$StartDate = $myrow['startdate'];
$EndDate = $myrow['enddate'];
$Price = $myrow['price'];
}
// end of loop around all prices
}
示例5: DB_query
$Tot_Val = 0;
$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
$fill = false;
$pdf->SetFillColor(224, 235, 255);
while ($myrow = DB_fetch_array($result, $db)) {
$YPos -= $line_height;
$FontSize = 8;
$FormatedEffectiveAfter = ConvertSQLDate($myrow['effectiveafter']);
$FormatedEffectiveTo = ConvertSQLDate($myrow['effectiveto']);
if ($_POST['Fill'] == 'yes') {
$fill = !$fill;
}
// Parameters for addTextWrap are defined in /includes/class.pdf.php
// 1) X position 2) Y position 3) Width
// 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor
// and False to set to transparent
$pdf->addTextWrap($Left_Margin + $myrow['level'] * 5, $YPos, 90, $FontSize, $myrow['component'], '', 0, $fill);
$pdf->addTextWrap(160, $YPos, 20, $FontSize, $myrow['mbflag'], '', 0, $fill);
$pdf->addTextWrap(180, $YPos, 180, $FontSize, $myrow['description'], '', 0, $fill);
$pdf->addTextWrap(360, $YPos, 30, $FontSize, $myrow['loccode'], 'right', 0, $fill);
$pdf->addTextWrap(390, $YPos, 25, $FontSize, $myrow['workcentreadded'], 'right', 0, $fill);
$pdf->addTextWrap(415, $YPos, 45, $FontSize, number_format($myrow['quantity'], 2), 'right', 0, $fill);
$pdf->addTextWrap(460, $YPos, 55, $FontSize, $FormatedEffectiveAfter, 'right', 0, $fill);
$pdf->addTextWrap(515, $YPos, 50, $FontSize, $FormatedEffectiveTo, 'right', 0, $fill);
示例6: _
<th>' . _('Order Date') . '</th>
<th>' . _('Delivery Date') . '</th>
<th>' . _('Order Amount') . '</th>
<th>' . _('Currency') . '</th>
</tr> ';
$k = 0;
while ($row = DB_fetch_array($SalesOrdersResult)) {
if ($k == 1) {
echo '<tr class="EvenTableRows">';
$k = 0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}
$FormatedOrderValue = locale_number_format($row['ordervalue'], $row['currdecimalplaces']);
$OrderDate = ConvertSQLDate($row['orddate']);
$DelDate = ConvertSQLDate($row['deliverydate']);
$TotalSalesOrders += $row['ordervalue'];
echo ' <td> ' . $row['orderno'] . ' </td>
<td> ' . $row['name'] . ' </td>
<td>' . $OrderDate . '</td>
<td>' . $DelDate . '</td>
<td class="number">' . $FormatedOrderValue . '</td>
<td>' . $row['currcode'] . '</td>
</tr>';
}
echo '<tr>
<td colspan=3>' . _('Total') . '</td>
<td colspan=3 class="number">' . locale_number_format($TotalSalesOrders, $row['currdecimalplaces']) . '</td>
</tr>';
echo '</table>';
示例7: _
(stockmoves.price * ' . $ExchRate . ') AS fxprice,
stockmoves.narrative,
stockmaster.units
FROM stockmoves,
stockmaster
WHERE stockmoves.stockid = stockmaster.stockid
AND stockmoves.type=10
AND stockmoves.transno=' . $FromTransNo . '
AND stockmoves.show_on_inv_crds=1';
} else {
/* then its a credit note */
echo "<table WIDTH=50%><tr>\n\t\t\t\t \t\t<td align=left bgcolor='#BBBBBB'><b>" . _('Branch') . ":</b></td>\n\t\t\t\t\t\t</tr>";
echo "<tr>\n\t\t\t\t \t\t<td bgcolor='#EEEEEE'>" . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>
</tr></table>';
echo "<hr><table class='table1'><tr>\n\t\t\t\t \t\t<td align=left bgcolor='#BBBBBB'><b>" . _('Date') . "</b></td>\n\t\t\t\t\t\t<td align=left bgcolor='#BBBBBB'><b>" . _('Sales Person') . "</font></b></td>\n\t\t\t\t\t</tr>";
echo "<tr>\n\t\t\t\t \t\t<td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td>\n\t\t\t\t\t\t<td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . '</td>
</tr></table>';
$sql = 'SELECT stockmoves.stockid,
stockmaster.description,
stockmoves.qty as quantity,
stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * ' . $ExchRate . ' * stockmoves.qty) AS fxnet,
(stockmoves.price * ' . $ExchRate . ') AS fxprice,
stockmaster.units
FROM stockmoves,
stockmaster
WHERE stockmoves.stockid = stockmaster.stockid
AND stockmoves.type=11
AND stockmoves.transno=' . $FromTransNo . '
AND stockmoves.show_on_inv_crds=1';
}
echo '<hr>';
示例8: date
$pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Balance_Sheet_' . date('Y-m-d') . '.pdf');
$pdf->__destruct();
}
exit;
} else {
$ViewTopic = 'GeneralLedger';
$BookMark = 'BalanceSheet';
include 'includes/header.inc';
echo '<form onSubmit="return VerifyForm(this);" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<input type="hidden" name="BalancePeriodEnd" value="' . $_POST['BalancePeriodEnd'] . '" />';
$RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings'];
$sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['BalancePeriodEnd'] . "'";
$PrdResult = DB_query($sql, $db);
$myrow = DB_fetch_row($PrdResult);
$BalanceDate = ConvertSQLDate($myrow[0]);
/*Calculate B/Fwd retained earnings */
$SQL = "SELECT Sum(CASE WHEN chartdetails.period='" . $_POST['BalancePeriodEnd'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS accumprofitbfwd,\n\t\t\tSum(CASE WHEN chartdetails.period='" . ($_POST['BalancePeriodEnd'] - 12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lyaccumprofitbfwd\n\t\tFROM chartmaster INNER JOIN accountgroups\n\t\tON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails\n\t\tON chartmaster.accountcode= chartdetails.accountcode\n\t\tWHERE accountgroups.pandl=1";
$AccumProfitResult = DB_query($SQL, $db, _('The accumulated profits brought forward could not be calculated by the SQL because'));
$AccumProfitRow = DB_fetch_array($AccumProfitResult);
/*should only be one row returned */
$SQL = "SELECT accountgroups.sectioninaccounts,\n\t\t\taccountgroups.groupname,\n\t\t\taccountgroups.parentgroupname,\n\t\t\tchartdetails.accountcode,\n\t\t\tchartmaster.accountname,\n\t\t\tSum(CASE WHEN chartdetails.period='" . $_POST['BalancePeriodEnd'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS balancecfwd,\n\t\t\tSum(CASE WHEN chartdetails.period='" . ($_POST['BalancePeriodEnd'] - 12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lybalancecfwd\n\t\tFROM chartmaster INNER JOIN accountgroups\n\t\tON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails\n\t\tON chartmaster.accountcode= chartdetails.accountcode\n\t\tWHERE accountgroups.pandl=0\n\t\tGROUP BY accountgroups.groupname,\n\t\t\tchartdetails.accountcode,\n\t\t\tchartmaster.accountname,\n\t\t\taccountgroups.parentgroupname,\n\t\t\taccountgroups.sequenceintb,\n\t\t\taccountgroups.sectioninaccounts\n\t\tORDER BY accountgroups.sectioninaccounts,\n\t\t\taccountgroups.sequenceintb,\n\t\t\taccountgroups.groupname,\n\t\t\tchartdetails.accountcode";
$AccountsResult = DB_query($SQL, $db, _('No general ledger accounts were returned by the SQL because'));
echo '<p class="page_title_text noPrint" ><img src="' . $RootPath . '/css/' . $Theme . '/images/preview.gif" title="' . _('HTML View') . '" alt="' . _('HTML View') . '" /> ' . _('HTML View') . '</p>';
echo '<div class="invoice">
<table class="selection" summary="' . _('HTML View') . '">
<tr>
<th colspan="6">
<h2>' . _('Balance Sheet as at') . ' ' . $BalanceDate . '
<img src="' . $RootPath . '/css/' . $Theme . '/images/printer.png" class="PrintIcon noPrint" title="' . _('Print') . '" alt="' . _('Print') . '" onclick="window.print();" />
</h2>
示例9: DB_fetch_array
$LocRow = DB_fetch_array($LocResult);
echo '<table class="selection">';
echo '<tr><th colspan="4" class="header">' . _('Pending Transfers Into') . ' ' . $LocRow['locationname'] . '</th></tr>';
echo '<tr>
<th>' . _('Transfer Ref') . '</th>
<th>' . _('Transfer From') . '</th>
<th>' . _('Dispatch Date') . '</th>
</tr>';
$k = 0;
while ($myrow = DB_fetch_array($TrfResult)) {
if ($k == 1) {
echo '<tr class="EvenTableRows">';
$k = 0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}
echo '<td class="number">' . $myrow['reference'] . '</td>
<td>' . $myrow['trffromloc'] . '</td>
<td>' . ConvertSQLDate($myrow['shipdate']) . '</td>
<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Trf_ID=' . $myrow['reference'] . '">' . _('Receive') . '</a></td></tr>';
}
echo '</table>';
} else {
if (!isset($_POST['ProcessTransfer'])) {
prnMsg(_('There are no incoming transfers to this location'), 'info');
}
}
echo '</form>';
}
include 'includes/footer.inc';
示例10: prnMsg
if ($WORow['closed'] == 1) {
prnMsg(_('The selected work order has been closed and variances calculated and posted. No more receipts of manufactured items can be received against this work order. You should make up a new work order to receive this item against.'), 'info');
include 'includes/footer.inc';
exit;
}
if (!isset($_POST['ReceivedDate'])) {
$_POST['ReceivedDate'] = Date($_SESSION['DefaultDateFormat']);
}
echo '<table cellpadding="2" class="selection">
<tr><td>' . _('Receive work order') . ':</td>
<td>' . $_POST['WO'] . '</td><td>' . _('Item') . ':</td>
<td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr>
<tr><td>' . _('Manufactured at') . ':</td>
<td>' . $WORow['locationname'] . '</td>
<td>' . _('Required By') . ':</td>
<td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr>
<tr><td>' . _('Quantity Ordered') . ':</td>
<td class="number">' . locale_number_format($WORow['qtyreqd'], $WORow['decimalplaces']) . '</td>
<td colspan="2">' . $WORow['units'] . '</td></tr>
<tr><td>' . _('Already Received') . ':</td>
<td class="number">' . locale_number_format($WORow['qtyrecd'], $WORow['decimalplaces']) . '</td>
<td colspan="2">' . $WORow['units'] . '</td></tr>
<tr><td>' . _('Date Received') . ':</td>
<td>' . Date($_SESSION['DefaultDateFormat']) . '</td>
<td>' . _('Received Into') . ':</td><td>
<select name="IntoLocation">';
if (!isset($_POST['IntoLocation'])) {
$_POST['IntoLocation'] = $WORow['loccode'];
}
$LocResult = DB_query("SELECT loccode, locationname FROM locations", $db);
while ($LocRow = DB_fetch_array($LocResult)) {
示例11: ConvertSQLDate
$CurrCode = $PriceList['currabrev'];
$FontSize = 8;
}
if ($Category != $PriceList['categoryid']) {
$FontSize = 10;
$YPos -= 2 * $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 300 - $Left_Margin, $FontSize, $PriceList['categoryid'] . ' - ' . $PriceList['categorydescription']);
$Category = $PriceList['categoryid'];
$CategoryName = $PriceList['categorydescription'];
$FontSize = 8;
}
$YPos -= $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 80, $FontSize, $PriceList['stockid']);
$LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 47, $FontSize, ConvertSQLDate($PriceList['startdate']));
if ($PriceList['enddate'] != '0000-00-00') {
$DisplayEndDate = ConvertSQLDate($PriceList['enddate']);
} else {
$DisplayEndDate = _('No End Date');
}
$LeftOvers = $pdf->addTextWrap($Left_Margin + 100 + 47, $YPos, 47, $FontSize, $DisplayEndDate);
$LeftOvers = $pdf->addTextWrap($Left_Margin + 130 + 47 + 47, $YPos, 130, $FontSize, $PriceList['description']);
$DisplayUnitPrice = locale_number_format($PriceList['price'], $PriceList['decimalplaces']);
$LeftOvers = $pdf->addTextWrap($Left_Margin + 110 + 47 + 47 + 130, $YPos, 180, $FontSize, $DisplayUnitPrice, 'right');
if ($PriceList['price'] != 0) {
$DisplayGPPercent = locale_number_format(($PriceList['price'] - $PriceList['standardcost']) * 100 / $PriceList['price'], 1) . '%';
} else {
$DisplayGPPercent = 0;
}
if ($_POST['ShowGPPercentages'] == 'Yes') {
$LeftOvers = $pdf->addTextWrap($Left_Margin + 135 + 47 + 47 + 130 + 65, $YPos, 20, $FontSize, $DisplayGPPercent, 'right');
}
示例12: while
echo $TableHeader;
/* show the GRNs outstanding to be invoiced that could be reversed */
$RowCounter = 0;
$k = 0;
while ($myrow = DB_fetch_array($result)) {
if ($k == 1) {
echo '<tr class="EvenTableRows">';
$k = 0;
} else {
echo '<tr class="OddTableRows">';
$k = 1;
}
$DisplayQtyRecd = locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']);
$DisplayQtyInv = locale_number_format($myrow['quantityinv'], $myrow['decimalplaces']);
$DisplayQtyRev = locale_number_format($myrow['qtytoreverse'], $myrow['decimalplaces']);
$DisplayDateDel = ConvertSQLDate($myrow['deliverydate']);
$LinkToRevGRN = '<a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>';
printf('<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td class="number">%s</td>
<td class="number">%s</td>
<td class="number">%s</td>
<td>%s</td>
</tr>', $myrow['grnno'], $myrow['itemcode'], $myrow['itemdescription'], $DisplayDateDel, $DisplayQtyRecd, $DisplayQtyInv, $DisplayQtyRev, $LinkToRevGRN);
$RowCounter++;
if ($RowCounter > 20) {
$RowCounter = 0;
echo $TableHeader;
}
示例13: locale_number_format
echo '<input type="hidden" name="StockID' . $i . '" value="' . $MyItemRow['stockid'] . '" />';
echo '<input type="hidden" name="ItemDescription' . $i . '" value="' . $MyItemRow['description'] . '" />';
echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>';
echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>';
echo '<td>' . $MyItemRow['units'] . '</td>';
echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>';
if ($MyItemRow['suppliersuom'] == '') {
$MyItemRow['suppliersuom'] = $MyItemRow['units'];
}
echo '<td><input type="text" class="number" size="10" name="Qty' . $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>';
echo '<input type="hidden" name="UOM' . $i . '" value="' . $MyItemRow['units'] . '" />';
echo '<input type="hidden" name="DecimalPlaces' . $i . '" value="' . $MyItemRow['decimalplaces'] . '" />';
echo '<td>' . $MyItemRow['suppliersuom'] . '</td>';
echo '<td>' . $myrow['currcode'] . '</td>';
echo '<td><input type="text" class="number" size="10" name="Price' . $i . '" value="0.00" /></td>';
echo '<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="RequiredByDate' . $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>';
$i++;
}
echo '</form>';
}
echo '</table>';
}
if (isset($_POST['Search'])) {
/*ie seach for stock items */
echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from') . ' ' . $Supplier . '</p>';
if ($_POST['Keywords'] and $_POST['StockCode']) {
prnMsg(_('Stock description keywords have been used in preference to the Stock code extract entered'), 'info');
}
if ($_POST['Keywords']) {
示例14: _
<td>' . _('Return Covering') . ':</td>
<td><select name="NoOfPeriods">
<option value="1">' . _('One Month') . '</option>' . '<option selected="selected" value="2">' . _('Two Months') . '</option>' . '<option value="3">' . _('Quarter') . '</option>' . '<option value="6">' . _('Six Months') . '</option>' . '</select></td>
</tr>';
echo '<tr>
<td>' . _('Return To') . ':</td>
<td><select name="ToPeriod">';
$DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), 0, Date('Y'))), $db);
$sql = "SELECT periodno,\n\t\t\tlastdate_in_period\n\t\tFROM periods";
$ErrMsg = _('Could not retrieve the period data because');
$Periods = DB_query($sql, $db, $ErrMsg);
while ($myrow = DB_fetch_array($Periods, $db)) {
if ($myrow['periodno'] == $DefaultPeriod) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>';
}
}
echo '</select></td>
</tr>';
echo '<tr>
<td>' . _('Detail Or Summary Only') . ':</td>
<td><select name="DetailOrSummary">
<option value="Detail">' . _('Detail and Summary') . '</option>
<option selected="selected" value="Summary">' . _('Summary Only') . '</option>
</select></td>
</tr>';
echo '</table>
<br />
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
示例15: ShowDays
function ShowDays(&$db)
{
//####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_####
// List all records in date range
$FromDate = FormatDateForSQL($_POST['FromDate']);
$ToDate = FormatDateForSQL($_POST['ToDate']);
$sql = "SELECT calendardate,\n\t\t\t\t daynumber,\n\t\t\t\t manufacturingflag,\n\t\t\t\t DAYNAME(calendardate) as dayname\n\t\t\tFROM mrpcalendar\n\t\t\tWHERE calendardate >='" . $FromDate . "'\n\t\t\tAND calendardate <='" . $ToDate . "'";
$ErrMsg = _('The SQL to find the parts selected failed with the message');
$result = DB_query($sql, $ErrMsg);
echo '<br />
<table class="selection">
<tr>
<th>' . _('Date') . '</th>
<th>' . _('Manufacturing Date') . '</th>
</tr>';
$ctr = 0;
while ($myrow = DB_fetch_array($result)) {
$flag = _('Yes');
if ($myrow['manufacturingflag'] == 0) {
$flag = _('No');
}
printf('<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>', ConvertSQLDate($myrow[0]), _($myrow[3]), $flag);
}
//END WHILE LIST LOOP
echo '</table>';
echo '<br /><br />';
unset($ChangeDate);
ShowInputForm($db, $ChangeDate);
}