本文整理匯總了PHP中Mktime函數的典型用法代碼示例。如果您正苦於以下問題:PHP Mktime函數的具體用法?PHP Mktime怎麽用?PHP Mktime使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Mktime函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _
echo '</select>
</td>
</tr>
<tr>
<td>' . _('Sales Person') . '</td>
<td><select name="SalesPerson">
<option selected="selected" value="">' . _('All') . '</option>';
while ($SalesPersonRow = DB_fetch_array($SalesFolkResult)) {
echo '<option value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>';
}
echo '</select>
</td>
</tr>
<tr>
<td>' . _('Date From') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - $_SESSION['NumberOfMonthMustBeShown'], Date('d'), Date('Y'))) . '" /></td>
</tr>
<tr>
<td>' . _('Date To') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td>
</tr>
<tr>
<td>' . _('Create CSV') . ':</td>
<td><input type="checkbox" name="CreateCSV" value=""></td>
</tr>
</table>
<br />
<div class="centre">
<input tabindex="4" type="submit" name="RunReport" value="' . _('Show Customer Balance Movements') . '" />
</div>
示例2: GetCurrentPeriod
function GetCurrentPeriod(&$db)
{
$TransDate = time();
//The current date to find the period for
/* Find the unix timestamp of the last period end date in periods table */
$sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods";
$result = DB_query($sql, $db);
$myrow = DB_fetch_row($result);
if (is_null($myrow[0])) {
$InsertFirstPeriodResult = api_DB_query("INSERT INTO periods VALUES (0,'" . Date('Y-m-d', mktime(0, 0, 0, Date('m') + 1, 0, Date('Y'))) . "')", $db);
$InsertFirstPeriodResult = api_DB_query("INSERT INTO periods VALUES (1,'" . Date('Y-m-d', mktime(0, 0, 0, Date('m') + 2, 0, Date('Y'))) . "')", $db);
$LastPeriod = 1;
$LastPeriodEnd = mktime(0, 0, 0, Date('m') + 2, 0, Date('Y'));
} else {
$Date_Array = explode('-', $myrow[0]);
$LastPeriodEnd = mktime(0, 0, 0, $Date_Array[1] + 1, 0, (int) $Date_Array[0]);
$LastPeriod = $myrow[1];
}
/* Find the unix timestamp of the first period end date in periods table */
$sql = "SELECT MIN(lastdate_in_period), MIN(periodno) from periods";
$result = api_DB_query($sql, $db);
$myrow = DB_fetch_row($result);
$Date_Array = explode('-', $myrow[0]);
$FirstPeriodEnd = mktime(0, 0, 0, $Date_Array[1], 0, (int) $Date_Array[0]);
$FirstPeriod = $myrow[1];
/* If the period number doesn't exist */
if (!PeriodExists($TransDate, $db)) {
/* if the transaction is after the last period */
if ($TransDate > $LastPeriodEnd) {
$PeriodEnd = mktime(0, 0, 0, Date('m', $TransDate) + 1, 0, Date('Y', $TransDate));
while ($PeriodEnd >= $LastPeriodEnd) {
if (Date('m', $LastPeriodEnd) <= 13) {
$LastPeriodEnd = mktime(0, 0, 0, Date('m', $LastPeriodEnd) + 2, 0, Date('Y', $LastPeriodEnd));
} else {
$LastPeriodEnd = mktime(0, 0, 0, 2, 0, Date('Y', $LastPeriodEnd) + 1);
}
$LastPeriod++;
CreatePeriod($LastPeriod, $LastPeriodEnd, $db);
}
} else {
/* The transaction is before the first period */
$PeriodEnd = mktime(0, 0, 0, Date('m', $TransDate), 0, Date('Y', $TransDate));
$Period = $FirstPeriod - 1;
while ($FirstPeriodEnd > $PeriodEnd) {
CreatePeriod($Period, $FirstPeriodEnd, $db);
$Period--;
if (Date('m', $FirstPeriodEnd) > 0) {
$FirstPeriodEnd = mktime(0, 0, 0, Date('m', $FirstPeriodEnd), 0, Date('Y', $FirstPeriodEnd));
} else {
$FirstPeriodEnd = mktime(0, 0, 0, 13, 0, Date('Y', $FirstPeriodEnd));
}
}
}
} else {
if (!PeriodExists(mktime(0, 0, 0, Date('m', $TransDate) + 1, Date('d', $TransDate), Date('Y', $TransDate)), $db)) {
/* Make sure the following months period exists */
$sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods";
$result = DB_query($sql, $db);
$myrow = DB_fetch_row($result);
$Date_Array = explode('-', $myrow[0]);
$LastPeriodEnd = mktime(0, 0, 0, $Date_Array[1] + 2, 0, (int) $Date_Array[0]);
$LastPeriod = $myrow[1];
CreatePeriod($LastPeriod + 1, $LastPeriodEnd, $db);
}
}
/* Now return the period number of the transaction */
$MonthAfterTransDate = Mktime(0, 0, 0, Date('m', $TransDate) + 1, Date('d', $TransDate), Date('Y', $TransDate));
$GetPrdSQL = "SELECT periodno\n\t\t\t\t\t\tFROM periods\n\t\t\t\t\t\tWHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "'\n\t\t\t\t\t\tAND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'";
$ErrMsg = _('An error occurred in retrieving the period number');
$GetPrdResult = DB_query($GetPrdSQL, $db, $ErrMsg);
$myrow = DB_fetch_row($GetPrdResult);
return $myrow[0];
}
示例3: _
<option selected="selected" value="All">' . _('All sales folk') . '</option>';
$sql = "SELECT salesmancode, salesmanname FROM salesman";
$SalesFolkResult = DB_query($sql, $db);
while ($myrow = DB_fetch_array($SalesFolkResult)) {
echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>';
}
echo '</select></td></tr>';
echo '<tr><td>' . _('Level Of Activity') . ':</td>
<td><select name="Activity">
<option selected="selected" value="All">' . _('All customers') . '</option>
<option value="GreaterThan">' . _('Sales Greater Than') . '</option>
<option value="LessThan">' . _('Sales Less Than') . '</option>
</select></td>
<td>';
echo '<input type="text" class="number" name="ActivityAmount" size="8" maxlength="8" value="0" /></td>
</tr>';
$DefaultActivitySince = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - 6, 0, Date('y')));
echo '<tr>
<td>' . _('Activity Since') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ActivitySince" size="10" maxlength="10" value="' . $DefaultActivitySince . '" /></td>
</tr>';
echo '</table>
<br />
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
</div>';
echo '</div>
</form>';
include 'includes/footer.inc';
}
/*end of else not PrintPDF */
示例4: _
$ViewTopic = 'GeneralLedger';
$BookMark = 'TrialBalance';
include 'includes/header.inc';
echo '<p class="page_title_text">
<img src="' . $RootPath . '/css/' . $Theme . '/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $Title . '
</p>';
echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if (Date('m') > $_SESSION['YearEnd']) {
/*Dates in SQL format */
$DefaultFromDate = Date('Y-m-d', Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y')));
$FromDate = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y')));
} else {
$DefaultFromDate = Date('Y-m-d', Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y') - 1));
$FromDate = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y') - 1));
}
/*GetPeriod function creates periods if need be the return value is not used */
$NotUsedPeriodNo = GetPeriod($FromDate, $db);
/*Show a form to allow input of criteria for TB to show */
echo '<table class="selection">
<tr>
<td>' . _('Select Period From:') . '</td>
<td><select name="FromPeriod">';
$NextYear = date('Y-m-d', strtotime('+1 Year'));
$sql = "SELECT periodno,\n\t\t\t\t\tlastdate_in_period\n\t\t\t\tFROM periods\n\t\t\t\tWHERE lastdate_in_period < '" . $NextYear . "'\n\t\t\t\tORDER BY periodno DESC";
$Periods = DB_query($sql, $db);
while ($myrow = DB_fetch_array($Periods, $db)) {
if (isset($_POST['FromPeriod']) and $_POST['FromPeriod'] != '') {
if ($_POST['FromPeriod'] == $myrow['periodno']) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
示例5: unset
$InputError = 1;
unset($_POST['ToDate']);
}
if (isset($_POST['FromDate']) and isset($_POST['ToDate']) and Date1GreaterThanDate2($_POST['FromDate'], $_POST['ToDate'])) {
$msg = _('The date to must be after the date from');
$InputError = 1;
unset($_POST['ToDate']);
unset($_POST['FromoDate']);
}
if (!isset($_POST['FromDate']) or !isset($_POST['ToDate']) or $InputError == 1) {
include 'includes/header.inc';
if ($InputError == 1) {
prnMsg($msg, 'error');
}
echo "<FORM METHOD='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>";
echo '<CENTER><TABLE><TR><TD>' . _('Enter the date from which orders are to be listed') . ":</TD><TD><INPUT TYPE=text NAME='FromDate' MAXLENGTH=10 SIZE=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d') - 1, Date('y'))) . "'></TD></TR>";
echo '<TR><TD>' . _('Enter the date to which orders are to be listed') . ":</TD>\n \t\t<TD><INPUT TYPE=text NAME='ToDate' MAXLENGTH=10 SIZE=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></TD></TR>";
echo '<TR><TD>' . _('Inventory Category') . '</TD><TD>';
$sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'";
$result = DB_query($sql, $db);
echo "<SELECT NAME='CategoryID'>";
echo "<OPTION SELECTED VALUE='All'>" . _('Over All Categories');
while ($myrow = DB_fetch_array($result)) {
echo '<OPTION VALUE=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'];
}
echo '</SELECT></TD></TR>';
echo '<TR><TD>' . _('Inventory Location') . ":</TD><TD><SELECT NAME='Location'>";
echo "<OPTION SELECTED VALUE='All'>" . _('All Locations');
$result = DB_query('SELECT loccode, locationname FROM locations', $db);
while ($myrow = DB_fetch_array($result)) {
echo "<OPTION VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname'];
示例6: _
echo '<tr><td>' . _('Tax Authority To Report On:') . ':</td>
<td><select name="TaxAuthority">';
$result = DB_query("SELECT taxid, description FROM taxauthorities", $db);
while ($myrow = DB_fetch_array($result)) {
echo '<option value="' . $myrow['taxid'] . '">' . $myrow['description'] . '</option>';
}
echo '</select></td></tr>';
echo '<tr>
<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">
示例7: unset
$InputError = 1;
unset($_POST['ToDate']);
}
if (isset($_POST['FromDate']) and isset($_POST['ToDate']) and Date1GreaterThanDate2($_POST['FromDate'], $_POST['ToDate'])) {
$msg = _('The date to must be after the date from');
$InputError = 1;
unset($_POST['ToDate']);
unset($_POST['FromoDate']);
}
if (!isset($_POST['FromDate']) or !isset($_POST['ToDate']) or $InputError == 1) {
include 'includes/header.inc';
if ($InputError == 1) {
prnMsg($msg, 'error');
}
echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>";
echo '<table><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d') - 1, Date('y'))) . "'></td></tr>";
echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td>\n \t\t<td><input type=text class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>";
echo '<tr><td>' . _('Inventory Category') . '</td><td>';
$sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'";
$result = DB_query($sql, $db);
echo "<select name='CategoryID'>";
echo "<option selected VALUE='All'>" . _('Over All Categories');
while ($myrow = DB_fetch_array($result)) {
echo '<option VALUE=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'];
}
echo '</select></td></tr>';
echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>";
echo "<option selected VALUE='All'>" . _('All Locations');
$result = DB_query('SELECT loccode, locationname FROM locations', $db);
while ($myrow = DB_fetch_array($result)) {
echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname'];
示例8: DB_query
$sql = "SELECT bankaccounts.accountcode, \n\t\t\t\tbankaccounts.bankaccountname \n\t\tFROM bankaccounts, bankaccountusers\n\t\tWHERE bankaccounts.accountcode=bankaccountusers.accountcode\n\t\t\tAND bankaccountusers.userid = '" . $_SESSION['UserID'] . "'\n\t\tORDER BY bankaccounts.bankaccountname";
$resultBankActs = DB_query($sql, $db);
while ($myrow = DB_fetch_array($resultBankActs)) {
if (isset($_POST['BankAccount']) and $myrow['accountcode'] == $_POST['BankAccount']) {
echo '<option selected="selected" value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>';
} else {
echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>';
}
}
echo '</select></td>
</tr>';
if (!isset($_POST['BeforeDate']) or !Is_Date($_POST['BeforeDate'])) {
$_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']);
}
if (!isset($_POST['AfterDate']) or !Is_Date($_POST['AfterDate'])) {
$_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - 3, Date('d'), Date('y')));
}
// Change to allow input of FROM DATE and then TO DATE, instead of previous back-to-front method, add datepicker
echo '<tr>
<td>' . _('Show') . ' ' . $TypeName . ' ' . _('from') . ':</td>
<td><input tabindex="3" type="text" name="AfterDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="12" maxlength="10" required="required" onchange="isDate(this, this.value, ' . "'" . $_SESSION['DefaultDateFormat'] . "'" . ')" value="' . $_POST['AfterDate'] . '" /></td>
</tr>';
echo '<tr>
<td>' . _('to') . ':</td>
<td><input tabindex="2" type="text" name="BeforeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="12" maxlength="10" required="required" onchange="isDate(this, this.value, ' . "'" . $_SESSION['DefaultDateFormat'] . "'" . ')" value="' . $_POST['BeforeDate'] . '" /></td>
</tr>';
echo '<tr>
<td colspan="3">' . _('Choose outstanding') . ' ' . $TypeName . ' ' . _('only or all') . ' ' . $TypeName . ' ' . _('in the date range') . ':</td>
<td><select tabindex="4" name="Ostg_or_All">';
if ($_POST['Ostg_or_All'] == 'All') {
echo '<option selected="selected" value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>';
示例9: _
$SelectADifferentPeriod = _('Select A Different Period');
}
}
if (!isset($_POST['FromPeriod']) or !isset($_POST['ToPeriod']) or $SelectADifferentPeriod == _('Select A Different Period')) {
echo '<form onSubmit="return VerifyForm(this);" method="post" class="noPrint" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text noPrint" ><img src="' . $RootPath . '/css/' . $Theme . '/images/sales.png" title="' . _('Select criteria') . '" alt="' . _('Select criteria') . '" />' . ' ' . $Title . '</p>';
echo '<table class="selection" summary="' . _('Criteria for the sales graph') . '">
<tr><td>' . _('Select Period From:') . '</td>
<td><select minlength="0" name="FromPeriod">';
if (Date('m') > $_SESSION['YearEnd']) {
/*Dates in SQL format */
$DefaultFromDate = Date('Y-m-d', Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y')));
} else {
$DefaultFromDate = Date('Y-m-d', Mktime(0, 0, 0, $_SESSION['YearEnd'] + 2, 0, Date('Y') - 1));
}
$sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno";
$Periods = DB_query($sql, $db);
while ($myrow = DB_fetch_array($Periods, $db)) {
if (isset($_POST['FromPeriod']) and $_POST['FromPeriod'] != '') {
if ($_POST['FromPeriod'] == $myrow['periodno']) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
}
} else {
if ($myrow['lastdate_in_period'] == $DefaultFromDate) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
示例10: _
echo "<br><div class='centre'><a href='" . $rootpath . "/SelectCustomer.php?" . SID . "'>" . _('Select a Customer to Inquire On') . '</a><br></div>';
include 'includes/footer.inc';
exit;
} else {
if (isset($_GET['CustomerID'])) {
$_SESSION['CustomerID'] = $_GET['CustomerID'];
}
$CustomerID = $_SESSION['CustomerID'];
}
if (!isset($_POST['TransAfterDate'])) {
$sql = 'SELECT confvalue
FROM `config`
WHERE confname ="numberOfMonthMustBeShown"';
$result = DB_query($sql, $db, $ErrMsg);
$row = DB_fetch_array($result);
$_POST['TransAfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - $row['confvalue'], Date('d'), Date('Y')));
}
$SQL = 'SELECT debtorsmaster.name,
currencies.currency,
paymentterms.terms,
debtorsmaster.creditlimit,
holdreasons.dissallowinvoices,
holdreasons.reasondescription,
SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount
- debtortrans.alloc) AS balance,
SUM(CASE WHEN (paymentterms.daysbeforedue > 0) THEN
CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue
THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END
ELSE
CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, ' . INTERVAL('1', 'MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ')) >= 0 THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END
END) AS due,
示例11: elseif
if (isset($_POST['StockLocation']) and $_POST['StockLocation'] != 'All') {
if ($myrow['loccode'] == $_POST['StockLocation']) {
echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
} else {
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
}
} elseif ($myrow['loccode'] == $_SESSION['UserStockLocation']) {
echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
$_POST['StockLocation'] = $myrow['loccode'];
} else {
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
}
}
echo '</select></td>';
if (!isset($_POST['OnHandDate'])) {
$_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date("m"), 0, Date("y")));
}
echo '<td>' . _('On-Hand On Date') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="OnHandDate" size="12" maxlength="12" value="' . $_POST['OnHandDate'] . '" /></td></tr>';
echo '<tr><td colspan="6"><div class="centre"><button type="submit" name="ShowStatus">' . _('Show Stock Status') . '</button></div></td></tr></table>';
echo '</form>';
$TotalQuantity = 0;
if (isset($_POST['ShowStatus']) and Is_Date($_POST['OnHandDate'])) {
if ($_POST['StockCategory'] == 'All') {
$sql = "SELECT stockid,\n\t\t\t\tdescription,\n\t\t\t\tdecimalplaces\n\t\t\tFROM stockmaster\n\t\t\tWHERE (mbflag='M' OR mbflag='B')";
} else {
$sql = "SELECT stockid,\n\t\t\t\tdescription,\n\t\t\t\tdecimalplaces\n\t\t\tFROM stockmaster\n\t\t\tWHERE categoryid = '" . $_POST['StockCategory'] . "'\n\t\t\tAND (mbflag='M' OR mbflag='B')";
}
$ErrMsg = _('The stock items in the category selected cannot be retrieved because');
$DbgMsg = _('The SQL that failed was');
$StockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg);
示例12: _
//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>';
// always figure out the SQL required from the inputs available
if (!isset($_GET['SupplierID']) and !isset($_SESSION['SupplierID'])) {
echo '<br>' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . "<br><div class='centre'>><a href='" . $rootpath . "/SelectSupplier.php'>" . _('Select a Supplier to Inquire On') . '</a></div>';
exit;
} else {
if (isset($_GET['SupplierID'])) {
$_SESSION['SupplierID'] = $_GET['SupplierID'];
}
$SupplierID = $_SESSION['SupplierID'];
}
if (isset($_GET['FromDate'])) {
$_POST['TransAfterDate'] = $_GET['FromDate'];
}
if (!isset($_POST['TransAfterDate']) or !Is_Date($_POST['TransAfterDate'])) {
$_POST['TransAfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date("m") - 12, Date("d"), Date("Y")));
}
$SQL = 'SELECT suppliers.suppname,
currencies.currency,
paymentterms.terms,
SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance,
SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN
CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue
THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END
ELSE
CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1', 'MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END
END) AS due,
SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN
CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) > paymentterms.daysbeforedue
AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays1'] . ')
THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END
示例13: _
$InputError = 0;
if (isset($_POST['FromDate']) and !Is_Date($_POST['FromDate'])) {
$msg = _('The date from must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat'];
$InputError = 1;
}
if (isset($_POST['ToDate']) and !Is_Date($_POST['ToDate'])) {
$msg = _('The date to must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat'];
$InputError = 1;
}
if (!isset($_POST['FromDate']) or !isset($_POST['ToDate']) or $InputError == 1) {
$title = _('Delivery Differences Report');
include 'includes/header.inc';
echo '<div class="centre"><p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Delivery Differences Report') . '</p>';
echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class="selection"><tr><td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - 1, 0, Date('y'))) . '" /></td></tr>';
echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td></tr>';
echo '<tr><td>' . _('Inventory Category') . '</td><td>';
$sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'";
$result = DB_query($sql, $db);
echo '<select name="CategoryID">';
echo '<option selected="True" value="All">' . _('Over All Categories') . '</option>';
while ($myrow = DB_fetch_array($result)) {
echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>';
}
echo '</select></td></tr>';
echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>";
echo '<option selected="True" value="All">' . _('All Locations') . '</option>';
$result = DB_query("SELECT loccode, locationname FROM locations", $db);
while ($myrow = DB_fetch_array($result)) {
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
示例14: date
<td>' . $_SESSION['Items' . $identifier]->Comments . '</td></tr>';
if (!isset($_POST['StartDate'])) {
$_POST['StartDate'] = date($_SESSION['DefaultDateFormat']);
}
if ($NewRecurringOrder == 'Yes') {
echo '<tr>
<td>' . _('Start Date') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="StartDate" size="11" maxlength="10" value="' . $_POST['StartDate'] . '" /></td></tr>';
} else {
echo '<tr>
<td>' . _('Last Recurrence') . ':</td>
<td>' . $_POST['StartDate'];
echo '<input type="hidden" name="StartDate" value="' . $_POST['StartDate'] . '" /></td></tr>';
}
if (!isset($_POST['StopDate'])) {
$_POST['StopDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d') + 1, Date('y') + 1));
}
echo '<tr>
<td>' . _('Finish Date') . ':</td>
<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="StopDate" size="11" maxlength="10" value="' . $_POST['StopDate'] . '" /></td></tr>';
echo '<tr>
<td>' . _('Frequency of Recurrence') . ':</td>
<td><select name="Frequency">';
if (isset($_POST['Frequency']) and $_POST['Frequency'] == 52) {
echo '<option selected="selected" value="52">' . _('Weekly') . '</option>';
} else {
echo '<option value="52">' . _('Weekly') . '</option>';
}
if (isset($_POST['Frequency']) and $_POST['Frequency'] == 26) {
echo '<option selected="selected" value="26">' . _('Fortnightly') . '</option>';
} else {
示例15: _
</tr>
<tr>
<td>' . _('Quantity') . ': </td>
<td><input tabindex="4" type="text" class="number" name="Quantity" size="10" required="required" minlength="1" maxlength="8" value="';
if (isset($_POST['Quantity'])) {
echo $_POST['Quantity'];
} else {
echo 1;
}
echo '" /></td>
</tr>';
if (!isset($_POST['EffectiveTo']) or $_POST['EffectiveTo'] == '') {
$_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d'), Date('y') + 20));
}
if (!isset($_POST['EffectiveAfter']) or $_POST['EffectiveAfter'] == '') {
$_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d') - 1, Date('y')));
}
echo '<tr>
<td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
<td><input tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="11" required="required" minlength="1" maxlength="10" value="' . $_POST['EffectiveAfter'] . '" /></td>
</tr>
<tr>
<td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
<td><input tabindex="6" type="text" name="EffectiveTo" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="11" required="required" minlength="1" maxlength="10" value="' . $_POST['EffectiveTo'] . '" /></td>
</tr>';
if ($ParentMBflag == 'M' or $ParentMBflag == 'G') {
echo '<tr>
<td>' . _('Auto Issue this Component to Work Orders') . ':</td>
<td>
<select required="required" minlength="1" tabindex="7" name="AutoIssue">';
if (!isset($_POST['AutoIssue'])) {