当前位置: 首页>>代码示例>>PHP>>正文


PHP payment::select_all方法代码示例

本文整理汇总了PHP中payment::select_all方法的典型用法代码示例。如果您正苦于以下问题:PHP payment::select_all方法的具体用法?PHP payment::select_all怎么用?PHP payment::select_all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在payment的用法示例。


在下文中一共展示了payment::select_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lastOfMonth

{
    return date("Y-m-d", strtotime('01-' . date('m') . '-' . date('Y') . ' 00:00:00'));
}
function lastOfMonth()
{
    return date("Y-m-d", strtotime('-1 second', strtotime('+1 month', strtotime('01-' . date('m') . '-' . date('Y') . ' 00:00:00'))));
}
isset($_POST['start_date']) ? $start_date = $_POST['start_date'] : ($start_date = firstOfMonth());
isset($_POST['end_date']) ? $end_date = $_POST['end_date'] : ($end_date = lastOfMonth());
$sql = "select \n        e.amount as expense, \n        e.status as status, \n        ea.name as account,\n        (select sum(tax_amount) from si_expense_item_tax where expense_id = e.id) as tax,\n        (select tax + e.amount) as total,\n        (CASE WHEN status = 1 THEN '" . $LANG['paid'] . "'\n              WHEN status = 0 THEN '" . $LANG['not_paid'] . "'\n         END) AS status_wording\n    from \n        si_expense e, \n        si_expense_account ea \n    where \n        e.expense_account_id = ea.id \n        and \n        e.date between '{$start_date}' and '{$end_date}'";
$sth = $db->query($sql);
$accounts = $sth->fetchAll();
$payment = new payment();
$payment->start_date = $start_date;
$payment->end_date = $end_date;
$payment->filter = "date";
$payments = $payment->select_all();
$invoice = new invoice();
$invoice->start_date = $start_date;
$invoice->end_date = $end_date;
$invoice->having = "date_between";
$invoice->sort = "preference";
$invoice_all = $invoice->select_all();
$invoices = $invoice_all->fetchAll();
$smarty->assign('accounts', $accounts);
$smarty->assign('payments', $payments);
$smarty->assign('invoices', $invoices);
$smarty->assign('start_date', $start_date);
$smarty->assign('end_date', $end_date);
$smarty->assign('pageActive', 'report');
$smarty->assign('active_tab', '#home');
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:31,代码来源:report_summary.php


注:本文中的payment::select_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。