-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
162 lines (123 loc) · 3.04 KB
/
index.php
File metadata and controls
162 lines (123 loc) · 3.04 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
session_start();
?>
<!doctype html>
<html lang="en">
<head>
<title>printpuppy</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js"></script>
<script type="text/javascript" src="resources/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="resources/jquery/jquery.form.js"></script>
<script type="text/javascript">
<?php
include('getVenueNameList.php');
?>
function clickVenue(venue)
{
$('#dropdown').hide();
$("#place").attr({
value: venue.value
});
$("#place_id").attr({
value: venue.id
});
}
function checkList()
{
options=" ";
counter =0;
$('#dropdown').html(" ");
$('#dropdown').show();
if($('#place').attr('value').length>=1){
for(i=0;i<list.length;i=i+1){
if(counter <5){
pattern = new RegExp($('#place').attr('value'), 'i');
matches = list[i]['venue_name'].match(pattern);
if(matches != null){
options = options + '<input id="'+list[i]['venue_id']+'" onClick="clickVenue(this);" type=button value="'+list[i]['venue_name']+'"/><br/>';
counter++;
}
}
}
}
$('#dropdown').html(options);
}
$(document).ready(function() {
var validator = $('#print_form').validate({
/*
// submit action
submitHandler: function(form) {
$(form).ajaxSubmit();
return false;
},
// error messages
errorPlacement: function(error, element) {
error.appendTo(element.prev());
},
*/
// rules
rules: {
price: {
required: true
},
place: {
required: true
},
time: {
required: true
},
file: {
required: true
}
},
// error messages
messages: {
price: {
required: 'Price is required!'
},
place: {
required: 'Place is required!'
},
time: {
required: 'Time is required!'
},
file: {
required: 'File is required!'
}
}
});
});
function printButtonDown() {
$('#print_button').attr('src', 'images/print_down.png');
}
function printButtonUp() {
$('#print_button').attr('src', 'images/print_up.png');
}
</script>
</head>
<body>
<div id="container">
<form name="print_form" id="print_form" method="post" action="putRequest.php" enctype="multipart/form-data">
<input type="image" id="print_button" src="images/print_up.png" onmousedown="printButtonDown();" onmouseup="printButtonUp();" />
<label>price to pay:</label>
<input type="text" name="price" id="price" />
<br />
<label>place to meet:</label>
<input type="text" id="place" name="place" onkeyup="checkList();" />
<input type="hidden" name="place_id" id="place_id" />
<div id="dropdown"></div>
<br />
<label>time to meet:</label>
<input type="text" name="time" id="time" />
<br />
<label>file to print:</label>
<input type="file" name="file" id="file" />
</form>
<hr />
<?php
echo 'Hi! <a href="helpPrint.php">Help print?</a>';
?>
</div>
</body>
</html>