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


PHP invoice::count方法代码示例

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


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

示例1: isset

$having = isset($_GET['having']) ? $_GET['having'] : "";
$page = isset($_POST['page']) ? $_POST['page'] : "1";
//$sql = "SELECT * FROM ".TB_PREFIX."invoices LIMIT $start, $limit";
$invoice = new invoice();
$invoice->sort = $sort;
if ($auth_session->role_name == 'customer') {
    $invoice->customer = $auth_session->user_id;
} elseif ($auth_session->role_name == 'biller') {
    $invoice->biller = $auth_session->user_id;
}
$invoice->query = isset($_REQUEST['query']) ? $_REQUEST['query'] : null;
$invoice->qtype = isset($_REQUEST['qtype']) ? $_REQUEST['qtype'] : null;
$large_dataset = getDefaultLargeDataset();
if ($large_dataset == $LANG['enabled']) {
    $sth = $invoice->select_all('large', $dir, $rp, $page, $having);
    $sth_count_rows = $invoice->count();
    $invoice_count = $sth_count_rows->fetch(PDO::FETCH_ASSOC);
    $invoice_count = $invoice_count['count'];
} else {
    $sth = $invoice->select_all('', $dir, $rp, $page, $having);
    $sth_count_rows = $invoice->select_all('count', $dir, $rp, $page, $having);
    $invoice_count = $sth_count_rows->rowCount();
}
$invoices = $sth->fetchAll(PDO::FETCH_ASSOC);
$xml = "";
$xml .= "<rows>";
$xml .= "<page>{$page}</page>";
$xml .= "<total>" . $invoice_count . "</total>";
foreach ($invoices as $row) {
    $xml .= "<row id='" . $row['id'] . "'>";
    $xml .= "<cell>\n\t\t\t\t\t<![CDATA[<a class='index_table' title='" . $LANG['quick_view_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . "' href='index.php?module=invoices&view=quick_view&id=" . $row['id'] . "'> <img src='images/common/view.png' class='action' /></a>\n\t\t<a class='index_table' title='" . $LANG['edit_view_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . "' href='index.php?module=invoices&view=details&id=" . $row['id'] . "&action=view'><img src='images/common/edit.png' class='action' /></a>\n\t\t<!--2 Print View -->\n\t\t\t<a class='index_table' title='" . $LANG['print_preview_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . "' href='index.php?module=export&view=invoice&id=" . $row['id'] . "&format=print'>\n\t\t\t\t<img src='images/common/printer.png' class='action' /><!-- print -->\n\t\t\t</a>\n\t\t<!--3 EXPORT DIALOG -->\n\t\t\t<a title='" . $LANG['export_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . "' class='invoice_export_dialog' href='#' rel='" . $row['id'] . "'>\n\t\t\t\t<img src='images/common/page_white_acrobat.png' class='action' />\n\t\t\t</a>\n\n\t\t<!--3 EXPORT DIALOG  onclick='export_invoice(" . $row['id'] . ", \"" . $config->export->spreadsheet . "\", \"" . $config->export->wordprocessor . "\");'> -->\t\n\t\t<!--3 EXPORT TO PDF <a title='" . $LANG['export_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . "' class='index_table' href='pdfmaker.php?id=" . $row['id'] . "'><img src='images/common/page_white_acrobat.png' class='action' /></a> -->\n\t\t<!--4 XLS <a title='" . $LANG['export_tooltip'] . " " . $row['preference'] . " " . $row['index_id'] . " " . $LANG['export_xls_tooltip'] . $config->export->spreadsheet . " " . $LANG['format_tooltip'] . "' class='index_table' href='index.php?module=invoices&view=templates/template&invoice='" . $row['id'] . "&action=view&location=print&export=" . $config->export->spreadsheet . "'><img src='images/common/page_white_excel.png' class='action' /></a> -->\n\t\t";
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:xml.php


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