-
Notifications
You must be signed in to change notification settings - Fork 6
/
printer_manufacturer.php
89 lines (73 loc) · 2.5 KB
/
printer_manufacturer.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
include('inc/common.php');
$escapedManufacturer = htmlspecialchars($_GET['manufacturer'], ENT_QUOTES, 'UTF-8');
$PAGE->setPageTitle('Printers by Manufacturer');
$PAGE->setActiveID('printer');
$PAGE->addBreadCrumb('Printers',$CONF->baseURL.'printers/');
$PAGE->addBreadCrumb($escapedManufacturer);
if($_GET['manufacturer'] ==""){
header('location: /printers');
}
$SMARTY->assign('manufacturer',$escapedManufacturer);
$resPerfect = $DB->query("
SELECT id, make, model
FROM printer
WHERE printer.make=? AND
printer.functionality='A'
ORDER BY model", $_GET['manufacturer']);
$dataPerfect = array();
while($rowPerfect = $resPerfect->getRow()){
$dataPerfect[] = $rowPerfect;
}
$resMostly = $DB->query("
SELECT id, make, model
FROM printer
WHERE printer.make=? AND
printer.functionality='B'
ORDER BY model", $_GET['manufacturer']);
$dataMostly = array();
while($rowMostly = $resMostly->getRow()){
$dataMostly[] = $rowMostly;
}
$resPartially = $DB->query("
SELECT id, make, model
FROM printer
WHERE printer.make=? AND
printer.functionality='D'
ORDER BY model", $_GET['manufacturer']);
$dataPartially = array();
while($rowPartially = $resPartially->getRow()){
$dataPartially[] = $rowPartially;
}
$resUnknown = $DB->query("
SELECT id, make, model
FROM printer
WHERE printer.make=? AND
printer.functionality=''
ORDER BY model", $_GET['manufacturer']);
$dataUnknown = array();
while($rowUnknown = $resUnknown->getRow()){
$dataUnknown[] = $rowUnknown;
}
$resPaperweight = $DB->query("
SELECT id, make, model
FROM printer
WHERE printer.make=? AND
printer.functionality='F'
ORDER BY model", $_GET['manufacturer']);
$dataPaperweight = array();
while($rowPaperweight = $resPaperweight->getRow()){
$dataPaperweight[] = $rowPaperweight;
}
$SMARTY->assign('dataPerfect',$dataPerfect);
$SMARTY->assign('dataPerfectCnt', count($dataPerfect));
$SMARTY->assign('dataMostly',$dataMostly);
$SMARTY->assign('dataMostlyCnt', count($dataMostly));
$SMARTY->assign('dataPartially',$dataPartially);
$SMARTY->assign('dataPartiallyCnt', count($dataPartially));
$SMARTY->assign('dataUnknown',$dataUnknown);
$SMARTY->assign('dataUnknownCnt', count($dataUnknown));
$SMARTY->assign('dataPaperweight',$dataPaperweight);
$SMARTY->assign('dataPaperweightCnt', count($dataPaperweight));
$SMARTY->display('printers/detail_manufacturer.tpl');
?>