-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathform.php
52 lines (49 loc) · 1.6 KB
/
form.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
<?php
add_shortcode('pdf-form', function(){
//security
if (!is_user_logged_in()) {
return 'please log in';
} elseif (!current_user_can('edit_posts')) {
return 'you do not have access to view this page';
}
return '
<h3>Generate PDF</h3>
<form method="get" class="form-horizontal" action="' . admin_url('admin-ajax.php') . '">
<input type="hidden" name="action" value="pdf">
<div class="form-group">
<label for="start" class="col-sm-3 control-label">Starting Page Number</label>
<div class="col-sm-9">
<select class="form-control" name="start" id="start">' .
implode(array_map(function($i){
return '<option value="' . $i . '">' . $i . '</option>';
}, range(1, 26))) .
'</select>
</div>
</div>
<div class="form-group">
<label for="index" class="col-sm-3 control-label">Show Index for Types</label>
<div class="col-sm-9">
<select class="form-control" name="index" id="index">
<option value="yes" selected>Yes</option>
<option value="no">No</option>
</select>
</div>
</div>
<div class="form-group">
<label for="index" class="col-sm-3 control-label">Paper Size</label>
<div class="col-sm-9">
<div class="radio">
<label><input type="radio" name="size" value="letter" checked>US Letter (8.5×11")</label>
</div>
<div class="radio">
<label><input type="radio" name="size" value="book">Meeting Book (6.5×9.5")</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<button class="btn btn-primary" type="submit">Generate PDF</button>
</div>
</div>
</form>';
});