本文整理汇总了PHP中sql2date函数的典型用法代码示例。如果您正苦于以下问题:PHP sql2date函数的具体用法?PHP sql2date怎么用?PHP sql2date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sql2date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
public function actionView()
{
global $systypes_array;
//require_once(Yii::app()->basePath . '/vendors/frontaccounting/ui.inc');
$bfw = Pe::get_balance_before_for_bank_account($_POST['from_date'], $_POST['bank_act']);
$arr['data'][] = array('type' => 'Saldo Awal - ' . sql2date($_POST['from_date']), 'ref' => '', 'tgl' => '', 'debit' => $bfw >= 0 ? number_format($bfw, 2) : '', 'kredit' => $bfw < 0 ? number_format($bfw, 2) : '', 'neraca' => '', 'person' => '');
$credit = $debit = 0;
$running_total = $bfw;
if ($bfw > 0) {
$debit += $bfw;
} else {
$credit += $bfw;
}
$result = Pe::get_bank_trans_for_bank_account($_POST['bank_act'], $_POST['from_date'], $_POST['to_date']);
foreach ($result as $myrow) {
$running_total += $myrow->amount;
$jemaat = get_jemaat_from_user_id($myrow->users_id);
$arr['data'][] = array('type' => $systypes_array[$myrow->type], 'ref' => $myrow->ref, 'tgl' => sql2date($myrow->trans_date), 'debit' => $myrow->amount >= 0 ? number_format($myrow->amount, 2) : '', 'kredit' => $myrow->amount < 0 ? number_format(-$myrow->amount, 2) : '', 'neraca' => number_format($running_total, 2), 'person' => $jemaat->real_name);
if ($myrow->amount > 0) {
$debit += $myrow->amount;
} else {
$credit += $myrow->amount;
}
}
$arr['data'][] = array('type' => 'Saldo Akhir - ' . sql2date($_POST['to_date']), 'ref' => '', 'tgl' => '', 'debit' => number_format($debit, 2), 'kredit' => number_format(-$credit, 2), 'neraca' => number_format($debit + $credit, 2), 'person' => '');
echo CJSON::encode($arr);
Yii::app()->end();
}
示例2: display_rate_edit
function display_rate_edit()
{
global $selected_id, $Ajax, $xr_providers, $dflt_xr_provider;
$xchg_rate_provider = isset($xr_providers) && isset($dflt_xr_provider) ? $xr_providers[$dflt_xr_provider] : 'ECB';
start_table(TABLESTYLE2);
if ($selected_id != "") {
//editing an existing exchange rate
$myrow = get_exchange_rate($selected_id);
$_POST['date_'] = sql2date($myrow["date_"]);
$_POST['BuyRate'] = maxprec_format($myrow["rate_buy"]);
hidden('selected_id', $selected_id);
hidden('date_', $_POST['date_']);
label_row(_("Date to Use From:"), $_POST['date_']);
} else {
$_POST['date_'] = Today();
$_POST['BuyRate'] = '';
date_row(_("Date to Use From:"), 'date_');
}
if (isset($_POST['get_rate'])) {
$_POST['BuyRate'] = maxprec_format(retrieve_exrate($_POST['curr_abrev'], $_POST['date_']));
$Ajax->activate('BuyRate');
}
amount_row(_("Exchange Rate:"), 'BuyRate', null, '', submit('get_rate', _("Get"), false, _('Get current rate from') . ' ' . $xchg_rate_provider, true), 'max');
end_table(1);
submit_add_or_update_center($selected_id == '', '', 'both');
display_note(_("Exchange rates are entered against the company currency."), 1);
}
示例3: get_domestic_price
function get_domestic_price($myrow, $stock_id, $qty, $old_std_cost, $old_qty)
{
if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT) {
$price = $myrow['price'];
if ($myrow['type'] == ST_SUPPRECEIVE) {
// Has the supplier invoice increased the receival price?
$sql = "SELECT DISTINCT act_price FROM " . TB_PREF . "purch_order_details pod INNER JOIN " . TB_PREF . "grn_batch grn ON pod.order_no =\n\t\t\t\tgrn.purch_order_no WHERE grn.id = " . $myrow['trans_no'] . " AND pod.item_code = '{$stock_id}'";
$result = db_query($sql, "Could not retrieve act_price from purch_order_details");
$row = db_fetch_row($result);
if ($row[0] > 0 and $row[0] != $myrow['price']) {
$price = $row[0];
}
}
if ($myrow['person_id'] > 0) {
// Do we have foreign currency?
$supp = get_supplier($myrow['person_id']);
$currency = $supp['curr_code'];
$ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date']));
$price /= $ex_rate;
}
} elseif ($myrow['type'] != ST_INVADJUST) {
// calcutale the price from avg. price
$price = ($myrow['standard_cost'] * $qty - $old_std_cost * $old_qty) / $myrow['qty'];
} else {
$price = $myrow['standard_cost'];
}
// Item Adjustments just have the real cost
return $price;
}
示例4: get_bank_trans_view
static function get_bank_trans_view()
{
global $systypes_array;
$bfw = Mt::get_balance_before_for_bank_account($_POST['trans_date_mulai'], $_POST['bank_act']);
$arr['data'][] = array('type' => 'Saldo Awal - ' . sql2date($_POST['trans_date_mulai']), 'ref' => '', 'tgl' => '', 'debit' => $bfw >= 0 ? number_format($bfw, 2) : '', 'kredit' => $bfw < 0 ? number_format($bfw, 2) : '', 'neraca' => '', 'person' => '');
$credit = $debit = 0;
$running_total = $bfw;
if ($bfw > 0) {
$debit += $bfw;
} else {
$credit += $bfw;
}
$result = Mt::get_bank_trans_for_bank_account($_POST['bank_act'], $_POST['trans_date_mulai'], $_POST['trans_date_sampai']);
foreach ($result as $myrow) {
$running_total += $myrow->amount;
$jemaat = get_jemaat_from_user_id($myrow->users_id);
$arr['data'][] = array('type' => $systypes_array[$myrow->type], 'ref' => $myrow->ref, 'tgl' => sql2date($myrow->trans_date), 'debit' => $myrow->amount >= 0 ? number_format($myrow->amount, 2) : '', 'kredit' => $myrow->amount < 0 ? number_format(-$myrow->amount, 2) : '', 'neraca' => number_format($running_total, 2), 'person' => $jemaat->real_name);
if ($myrow->amount > 0) {
$debit += $myrow->amount;
} else {
$credit += $myrow->amount;
}
}
$arr['data'][] = array('type' => 'Saldo Akhir - ' . sql2date($_POST['trans_date_sampai']), 'ref' => '', 'tgl' => '', 'debit' => $running_total >= 0 ? number_format($running_total, 2) : '', 'kredit' => $running_total < 0 ? number_format(-$running_total, 2) : '', 'neraca' => '', 'person' => '');
return $arr;
}
示例5: print_list_of_journal_entries
function print_list_of_journal_entries()
{
global $path_to_root;
include_once $path_to_root . "reporting/includes/pdf_report.inc";
$from = $_REQUEST['PARAM_0'];
$to = $_REQUEST['PARAM_1'];
$systype = $_REQUEST['PARAM_2'];
$comments = $_REQUEST['PARAM_3'];
$dec = user_price_dec();
$cols = array(0, 100, 240, 300, 400, 460, 520, 580);
$headers = array(tr('Type/Account'), tr('Account Name'), tr('Date/Dim.'), tr('Person/Item/Memo'), tr('Debit'), tr('Credit'));
$aligns = array('left', 'left', 'left', 'left', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => tr('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => tr('Type'), 'from' => systypes::name($systype), 'to' => ''));
$rep = new FrontReport(tr('List of Journal Entries'), "JournalEntries.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->Header();
if ($systype == -1) {
$systype = null;
}
$trans = get_gl_transactions($from, $to, -1, null, 0, $systype);
$typeno = 0;
while ($myrow = db_fetch($trans)) {
if ($typeno != $myrow['type_no']) {
if ($typeno != 0) {
$rep->Line($rep->row + 4);
$rep->NewLine();
}
$typeno = $myrow['type_no'];
$TransName = systypes::name($myrow['type']);
$rep->TextCol(0, 2, $TransName . " # " . $myrow['type_no']);
$rep->TextCol(2, 3, sql2date($myrow['tran_date']));
$coms = payment_person_types::person_name($myrow["person_type_id"], $myrow["person_id"]);
$memo = get_comments_string($myrow['type'], $myrow['type_no']);
if ($memo != '') {
$coms .= $coms != "" ? "/" : "" . $memo;
}
$rep->TextCol(3, 6, $coms);
$rep->NewLine(2);
}
$rep->TextCol(0, 1, $myrow['account']);
$rep->TextCol(1, 2, $myrow['account_name']);
$dim_str = get_dimension_string($myrow['dimension_id']);
$dim_str2 = get_dimension_string($myrow['dimension2_id']);
if ($dim_str2 != "") {
$dim_str .= "/" . $dim_str2;
}
$rep->TextCol(2, 3, $dim_str);
$rep->TextCol(3, 4, $myrow['memo_']);
if ($myrow['amount'] > 0.0) {
$rep->TextCol(4, 5, number_format2(abs($myrow['amount']), $dec));
} else {
$rep->TextCol(5, 6, number_format2(abs($myrow['amount']), $dec));
}
$rep->NewLine(1, 2);
}
$rep->Line($rep->row + 4);
$rep->End();
}
示例6: render
function render($id, $title)
{
global $path_to_root, $systypes_array;
include_once $path_to_root . "/includes/ui.inc";
$start_date = add_days(Today(), -$this->days_past);
$end_date = add_days(Today(), $this->days_future);
$result = get_bank_trans_for_bank_account($this->bank_act, $start_date, $end_date);
start_table(TABLESTYLE, 'width=98%');
$th = array(_("#"), _("Date"), _("Receipt"), _("Payment"), _("Balance"), _("Person/Item"), _("Memo"), "");
table_header($th);
$bfw = get_balance_before_for_bank_account($this->bank_act, $start_date);
$credit = $debit = 0;
start_row("class='inquirybg' style='font-weight:bold'");
label_cell(_("Opening Balance") . " - " . $start_date, "colspan=4");
display_debit_or_credit_cells($bfw);
label_cell("");
label_cell("", "colspan=2");
end_row();
$running_total = $bfw;
if ($bfw > 0) {
$debit += $bfw;
} else {
$credit += $bfw;
}
$j = 1;
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
alt_table_row_color($k);
$running_total += $myrow["amount"];
label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"]));
$trandate = sql2date($myrow["trans_date"]);
label_cell($trandate);
display_debit_or_credit_cells($myrow["amount"]);
amount_cell($running_total);
label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"]));
label_cell(get_comments_string($myrow["type"], $myrow["trans_no"]));
label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
end_row();
if ($myrow["amount"] > 0) {
$debit += $myrow["amount"];
} else {
$credit += $myrow["amount"];
}
if ($j == 12) {
$j = 1;
table_header($th);
}
$j++;
}
//end of while loop
start_row("class='inquirybg' style='font-weight:bold'");
label_cell(_("Ending Balance") . " - " . $end_date, "colspan=4");
amount_cell($debit + $credit);
label_cell("");
label_cell("", "colspan=2");
end_row();
end_table(2);
}
示例7: check_overdue
function check_overdue($row)
{
global $trans_type;
if ($trans_type == ST_SALESQUOTE) {
return date1_greater_date2(Today(), sql2date($row['delivery_date']));
} else {
return $row['type'] == 0 && date1_greater_date2(Today(), sql2date($row['ord_date'])) && $row['TotDelivered'] < $row['TotQuantity'];
}
}
示例8: calculate_from
function calculate_from($myrow)
{
if ($myrow["last_sent"] == '0000-00-00') {
$from = sql2date($myrow["begin"]);
} else {
$from = sql2date($myrow["last_sent"]);
}
return $from;
}
示例9: print_audit_trail
function print_audit_trail()
{
global $path_to_root, $systypes_array;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$systype = $_POST['PARAM_2'];
$user = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
$destination = $_POST['PARAM_6'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(0, 60, 120, 180, 240, 340, 400, 460, 520);
$headers = array(_('Date'), _('Time'), _('User'), _('Trans Date'), _('Type'), _('#'), _('Action'), _('Amount'));
$aligns = array('left', 'left', 'left', 'left', 'left', 'left', 'left', 'right');
$usr = get_user($user);
$user_id = $usr['user_id'];
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Type'), 'from' => $systype != -1 ? $systypes_array[$systype] : _('All'), 'to' => ''), 3 => array('text' => _('User'), 'from' => $user != -1 ? $user_id : _('All'), 'to' => ''));
$rep = new FrontReport(_('Audit Trail'), "AuditTrail", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$trans = getTransactions($from, $to, $systype, $user);
while ($myrow = db_fetch($trans)) {
$rep->TextCol(0, 1, sql2date(date("Y-m-d", $myrow['unix_stamp'])));
if (user_date_format() == 0) {
$rep->TextCol(1, 2, date("h:i:s a", $myrow['unix_stamp']));
} else {
$rep->TextCol(1, 2, date("H:i:s", $myrow['unix_stamp']));
}
$rep->TextCol(2, 3, $myrow['user_id']);
$rep->TextCol(3, 4, sql2date($myrow['gl_date']));
$rep->TextCol(4, 5, $systypes_array[$myrow['type']]);
$rep->TextCol(5, 6, $myrow['trans_no']);
if ($myrow['gl_seq'] == null) {
$action = _('Changed');
} else {
$action = _('Closed');
}
$rep->TextCol(6, 7, $action);
if ($myrow['amount'] != null) {
$rep->AmountCol(7, 8, $myrow['amount'], $dec);
}
$rep->NewLine(1, 2);
}
$rep->Line($rep->row + 4);
$rep->End();
}
示例10: actionViewJurnalUmum
public function actionViewJurnalUmum()
{
global $systypes_array;
$from = $_POST['from_date'];
$to = $_POST['to_date'];
$row = Mt::get_general_ledger_trans($from, $to);
foreach ($row as $myrow) {
$arr['data'][] = array('type' => $systypes_array[$myrow['type']], 'type_no' => $myrow['type_no'], 'tgl' => sql2date($myrow['tran_date']), 'account' => $myrow['account'], 'debit' => $myrow['amount'] >= 0 ? number_format($myrow['amount'], 2) : '', 'kredit' => $myrow['amount'] < 0 ? number_format(-$myrow['amount'], 2) : '');
}
echo CJSON::encode($arr);
Yii::app()->end();
}
示例11: display_gl_heading
function display_gl_heading($myrow)
{
global $table_style;
$trans_name = systypes::name($_GET['type_id']);
start_table("{$table_style} width=95%");
$th = array(tr("General Ledger Transaction Details"), tr("Date"), tr("Person/Item"));
table_header($th);
start_row();
label_cell("{$trans_name} #" . $_GET['trans_no']);
label_cell(sql2date($myrow["tran_date"]));
label_cell(payment_person_types::person_name($myrow["person_type_id"], $myrow["person_id"]));
end_row();
comments_display_row($_GET['type_id'], $_GET['trans_no']);
end_table(1);
}
示例12: display_gl_heading
function display_gl_heading($myrow)
{
global $systypes_array;
$trans_name = $systypes_array[$_GET['type_id']];
start_table(TABLESTYLE, "width='95%'");
$th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"));
table_header($th);
start_row();
label_cell("{$trans_name} #" . $_GET['trans_no']);
label_cell($myrow["reference"]);
label_cell(sql2date($myrow["tran_date"]));
label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"]));
end_row();
comments_display_row($_GET['type_id'], $_GET['trans_no']);
end_table(1);
}
示例13: can_process
function can_process()
{
global $wo_details;
if (!references::is_valid($_POST['ref'])) {
display_error(tr("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], 29)) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
if (!check_num('quantity', 0)) {
display_error(tr("The quantity entered is not a valid number or less then zero."));
set_focus('quantity');
return false;
}
if (!is_date($_POST['date_'])) {
display_error(tr("The entered date is invalid."));
set_focus('date_');
return false;
} elseif (!is_date_in_fiscalyear($_POST['date_'])) {
display_error(tr("The entered date is not in fiscal year."));
set_focus('date_');
return false;
}
if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) {
display_error(tr("The production date cannot be before the release date of the work order."));
set_focus('date_');
return false;
}
// if unassembling we need to check the qoh
if ($_POST['ProductionType'] == 0 && !sys_prefs::allow_negative_stock()) {
$wo_details = get_work_order($_POST['selected_id']);
$qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $date_);
if (-$_POST['quantity'] + $qoh < 0) {
display_error(tr("The unassembling cannot be processed because there is insufficient stock."));
set_focus('quantity');
return false;
}
}
return true;
}
示例14: display_gl_heading
function display_gl_heading($myrow)
{
global $systypes_array;
$title = "";
//moodlearning
if ($myrow['type'] == 55 || $myrow['type'] == 1) {
if ($myrow['type'] == 0) {
$title = "JV No.";
$num = substr($ser['year'], 2);
}
if ($myrow['type'] == 55) {
$voucher_type = "Check Voucher";
$title = "CV No.";
$myDateTime = DateTime::createFromFormat('Y-m-d', $myrow['tran_date']);
$newDateString = $myDateTime->format('d-m-Y');
$year = substr($newDateString, 8) . "-";
}
}
$trans_name = $systypes_array[$_GET['type_id']];
start_table(TABLESTYLE, "width=95%");
if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) {
$th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"), $title);
} else {
$th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"));
}
table_header($th);
start_row();
if ($custom == 0) {
label_cell("{$trans_name} #" . $_GET['type_id']);
} else {
label_cell("{$trans_name} #" . get_customized_no($myrow['type'], $myrow['type_no']));
}
label_cell($myrow["reference"]);
label_cell(sql2date($myrow["tran_date"]));
label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"]));
if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) {
label_cell($year . str_pad(get_customized_no($myrow['type'], $myrow['type_no']), 4, 0, STR_PAD_LEFT));
}
//moodlearning
end_row();
comments_display_row($_GET['type_id'], $_GET['trans_no']);
end_table(1);
}
示例15: display_wo_production
function display_wo_production($prod_id)
{
$myrow = get_work_order_produce($prod_id);
br(1);
start_table(TABLESTYLE);
$th = array(_("Production #"), _("Reference"), _("For Work Order #"), _("Item"), _("Quantity Manufactured"), _("Date"));
table_header($th);
start_row();
label_cell($myrow["id"]);
label_cell($myrow["reference"]);
label_cell(get_trans_view_str(ST_WORKORDER, $myrow["workorder_id"]));
label_cell($myrow["stock_id"] . " - " . $myrow["StockDescription"]);
qty_cell($myrow["quantity"], false, get_qty_dec($myrow["stock_id"]));
label_cell(sql2date($myrow["date_"]));
end_row();
comments_display_row(ST_MANURECEIVE, $prod_id);
end_table(1);
is_voided_display(ST_MANURECEIVE, $prod_id, _("This production has been voided."));
}