-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdriver_list.php
42 lines (35 loc) · 1.2 KB
/
driver_list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include('inc/common.php');
$drivertypes = array(
"ghostscript" => 'Ghostscript built-in',
"uniprint" => 'Ghostscript Uniprint',
"filter" => 'Filter',
"ijs" => 'IJS',
"cups" => 'CUPS Raster',
"opvp" => 'OpenPrinting Vector',
"postscript" => 'PostScript');
$SMARTY->assign("drivertypes",$drivertypes);
$PAGE->setPageTitle('Printer Driver List');
$PAGE->setActiveID('driver');
$PAGE->addBreadCrumb('Drivers',$CONF->baseURL.'drivers/');
$res = $DB->query("
SELECT dra.id AS id, name, execution, shortdescription, printerCount,
package FROM
(SELECT id, dr.name AS name, execution, shortdescription,
printerCount, driver_package.name AS package FROM
(SELECT id, name, execution, shortdescription,
pj.count as printerCount FROM
driver
LEFT JOIN
(SELECT driver_id, count(printer_id) as count
FROM driver_printer_assoc
GROUP BY driver_id) AS pj
ON pj.driver_id = driver.id) AS dr
LEFT JOIN driver_package
ON dr.id=driver_package.driver_id) AS dra
ORDER BY name
");
$r = $res->toArray('id');
$SMARTY->assign("drivers",$r);
$SMARTY->display('drivers/list.tpl');
?>