-
Notifications
You must be signed in to change notification settings - Fork 0
/
printoption.php
130 lines (126 loc) · 4.07 KB
/
printoption.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
session_start();
if(isset($_GET['printer']) && !empty($_GET['printer'])) {
$_SESSION['user_printer'] = $_GET['printer'];
if ($_GET['color'] == "Black and White Printing Only"){
$_SESSION['user_color'] = $_GET['color'];
?>
<script>
var colorSelection = ["Monochrome/Black and White"];
</script>
<?php
}else{
?>
<script>
var colorSelection = ["Monochrome/Black and White", "Color"];
</script>
<?php
}
}
if(isset($_GET['err']) && !empty($_GET['err'])) {
?>
<script>
alert("Invalid Page Range!!");
</script>
<?php
}
echo "1";
?>
<!DOCTYPE html>
<html>
<head>
<title>Upload Document</title>
<!-- Import polymer HTML files-->
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/iron-input/iron-input.html">
<link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html">
<link rel="import" href="bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-listbox/paper-listbox.html">
<link rel="import" href="bower_components/font-roboto/roboto.html">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<style is="custom-style">
body {
font-size: 18px;
font-family: Roboto;
}
.indicator {
margin-right: 40px;
}
input{
font-size: 18px;
padding: 0.3em;
}
.number {
width: 36px;
}
.number-medium {
width: 72px;
}
.center{
max-width: 400px;
max-height: 500px;
margin: auto;
margin-top: 30px;
}
paper-button{
color: white;
width: 100%;
background: #65C6BB;
}
</style>
</head>
<body class="fullbleed vertical layout">
<template is="dom-bind" id="app">
<paper-header-panel class="flex">
<paper-toolbar>
<div><h1> Print's Options <h1></div>
</paper-toolbar>
<div class="center">
<form id="printfile" method="GET" action="processprint.php">
<table>
<tr>
<td><p class="indicator">Copies<p></td>
<td><input is="iron-input" class="number" allowed-pattern="[0-9]" bind-value={{copies}}></td>
</tr>
<tr>
<td><p class="indicator">Color<p></td>
<td>
<paper-dropdown-menu label="Color">
<paper-listbox class="dropdown-content" selected="{{select}}">
<template is="dom-repeat" items="[[colors]]" as="color">
<paper-item>[[color]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
</td>
</tr>
<tr>
<td><p class="indicator">Pages (0=ALL)<p></td>
<td><input is="iron-input" class="number-medium" allowed-pattern="[-0-9]" value="0" bind-value={{range}}></td>
</tr>
</table>
<input type="hidden" name="copies" id="copies">
<input type="hidden" name="color" id="color">
<input type="hidden" name="range" id="range">
</form>
<paper-button raised on-click="submitform">P R I N T</paper-button>
</div>
</paper-header-panel>
</template>
</body>
<script>
var app = document.querySelector("#app");
app.colors = colorSelection;
app.select = 0;
app.copies = 1;
app.submitform = function(event){
this.$.copies.value = this.copies;
this.$.color.value = this.select;
this.$.range.value = this.range;
this.$.printfile.submit();
}
</script>
</html>