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


PHP Printer::getSimple方法代码示例

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


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

示例1: Printer

$date_to = fCRUD::getSearchValue('date_to');
/**
 * Default action - show report of consumable installation
 */
if ($action == 'list') {
    // Set the users to be sortable by name or email, defaulting to name
    $sort = fCRUD::getSortColumn(array('events.date', 'models.name', 'printers.name', 'consumables.name', 'events.cost'));
    // Set the sorting to default to ascending
    $dir = fCRUD::getSortDirection('desc');
    // Redirect the user if one of the values was loaded from the session
    fCRUD::redirectWithLoadedValues();
    // Determine search parameters
    $sql_where = '';
    if ($printer_id) {
        $printer = new Printer($printer_id);
        $sql_where .= ' AND events.printer_id = ' . $db->escape('integer', $printer_id);
    }
    if ($date_from) {
        $sql_where .= ' AND DATE(events.date) >= ' . $db->escape('date', $date_from);
    }
    if ($date_to) {
        $sql_where .= ' AND DATE(events.date) <= ' . $db->escape('date', $date_to);
    }
    // Get recordset object from tables
    $sql = "SELECT\n\t\t\t\tCAST(CONCAT(manufacturers.name, ' ', models.name) AS CHAR) AS model,\n\t\t\t\tprinters.name AS printer_name,\n\t\t\t\tprinters.ipaddress,\n\t\t\t\tconsumables.name AS consumable_name,\n\t\t\t\tconsumables.col_c, consumables.col_y, consumables.col_m, consumables.col_k,\n\t\t\t\tconsumables.chargeback,\n\t\t\t\tevents.*\n\t\t\tFROM events\n\t\t\tLEFT JOIN consumables ON events.consumable_id = consumables.id\n\t\t\tLEFT JOIN printers ON events.printer_id = printers.id\n\t\t\tLEFT JOIN models ON printers.model_id = models.id\n\t\t\tLEFT JOIN manufacturers ON models.manufacturer_id = manufacturers.id\n\t\t\tWHERE 1 = 1\n\t\t\t{$sql_where}\n\t\t\tORDER BY {$sort} {$dir}";
    $events = $db->query($sql)->asObjects();
    // Get list of printers for dropdown box
    $printers = Printer::getSimple($db);
    // Include page to show table
    include 'views/reports/index.php';
}
开发者ID:mrjwc,项目名称:printmaster,代码行数:31,代码来源:reports.php


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