-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_retainer_type.php
610 lines (508 loc) · 20.5 KB
/
create_retainer_type.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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
<?php
session_start();
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: index.php");
}
?>
<!doctype html>
<html>
<head>
<title>Monkehh's DM Tools</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap-select.min.js"></script>
<!-- (Optional) Latest compiled and minified JavaScript translation files -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/i18n/defaults-*.min.js"></script>
<!-- CHANGE TEXT AREAS TO RTF-->
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
<script type='text/javascript'>
function preview_image(event)
{
var reader = new FileReader();
reader.onload = function()
{
var output = document.getElementById('output_image');
output.src = reader.result;
}
reader.readAsDataURL(event.target.files[0]);
document.getElementById("image-button").innerHTML = "Upload New Image";
}
function URL_add_parameter(url, param, value)
{
var hash = {};
var parser = document.createElement('a');
parser.href = url;
var parameters = parser.search.split(/\?|&/);
for(var i=0; i < parameters.length; i++) {
if(!parameters[i])
continue;
var ary = parameters[i].split('=');
hash[ary[0]] = ary[1];
}
hash[param] = value;
var list = [];
Object.keys(hash).forEach(function (key) {
list.push(key + '=' + hash[key]);
});
parser.search = '?' + list.join('&');
// return parser.href;
location.href = parser.search;
}
$(document).ready(function(){
// Initialize select2
$("#skills").select2();
// Read selected option
$('#but_read').click(function(){
var username = $('#skills option:selected').text();
var userid = $('#skills').val();
$('#result').html("id : " + userid + ", name : " + username);
});
// Initialize select2
$("#saves").select2();
// Read selected option
$('#but_read').click(function(){
var username = $('#saves option:selected').text();
var userid = $('#saves').val();
$('#result').html("id : " + userid + ", name : " + username);
});
});
</script>
<!-- Script -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src='select2/dist/js/select2.min.js' type='text/javascript'></script>
<!-- CSS -->
<link href='select2/dist/css/select2.min.css' rel='stylesheet' type='text/css'>
<link href="dmtools.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include "page-header.php"; ?>
<hr>
<br/>
<div id='result'></div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item"><a>My Retainers</a></li>
</ol>
</nav>
<?php
if (!empty($_SESSION['username'])) {
include "db_connect.php";
// $stmt = $mysqli->prepare("SELECT `id`, `name` FROM classes");
// $stmt->execute();
// $classes = [];
// $classids = [];
// $userid = $_SESSION['user_id'];
//
// foreach ($stmt->get_result() as $row) {
// $classes[] = $row['name'];
// $classids[] = $row['id'];
// }
?>
<div style="padding:2rem;">
<form method="post" action="/add_retainer_type.php" enctype="multipart/form-data">
<fieldset>
<div class="row">
<div class="col-md-12 col-lg-6 cust-form-col">
<div class="user-control-part">
<legend class="form-legend">Basics</legend>
<hr>
<div class="form-group">
<label class="col-md-12 control-label" for="retainername">Name</label>
<div class="col-md-12">
<input id="retainername" name="retainername" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-12 control-label" for="RetainerBaseClass">Class</label>
<div class="col-md-12">
<select id="RetainerBaseClass" name="RetainerBaseClass" class="form-control">
<?php
$stmt = "SELECT `id`, `name` FROM classes";
$result = $mysqli->query($stmt);
while ($row = $result->fetch_assoc())
{
echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
}
?>
</select>
<a class="help-block">Select the class that this retainer is based on.</a>
</div>
</div>
<!-- Select Basic -->
<div class="form-group" style="margin-bottom:1.5rem;">
<label class="col-md-12 control-label" for="armor-type">Armor</label>
<div class="col-md-12">
<select id="armor-type" name="armor-type" class="form-control">
<option value="1">Light</option>
<option value="2">Medium</option>
<option value="3">Heavy</option>
</select>
<a class="help-block">Light: 13 AC | Medium: 15 AC | Heavy: 18 AC</a>
</div>
</div>
</div>
</div>
<div class="col-md-12 col-lg-6 cust-form-col">
<div class="user-control-part">
<legend class="form-legend">Stats</legend>
<hr>
<div class="col-12">
<strong>Abilities</strong>
</div>
<div class="col-12" style="margin-bottom:1rem;">
<a>Select a primary ability for the character, and a secondary (if applicable)</a>
</div>
<div class="col-6 form-col"><strong>Primary Ability</strong></div>
<div class="col-5 form-col" style="margin-bottom:1rem;">
<select id="Retainer-Pri-Abi" name="Retainer-Pri-Abi" class="form-control" style="width: 119%;">
<option value="1">Strength</option>
<option value="2">Dexterity</option>
<option value="3">Constitution</option>
<option value="4">Intelligence</option>
<option value="5">Wisdom</option>
<option value="6">Charisma</option>
</select>
</div>
<div class="col-6 form-col">
<div class="checkbox">
<strong style="padding-left:0rem;">Secondary Ability</strong>
</div>
</div>
<div class="col-5 form-col" >
<select id="Retainer-Sec-Abi" name="Retainer-Sec-Abi" class="form-control" value="0" style="width: 119%;">
<option value="0">None</option>
<option value="1">Strength</option>
<option value="2">Dexterity</option>
<option value="3">Constitution</option>
<option value="4">Intelligence</option>
<option value="5">Wisdom</option>
<option value="6">Charisma</option>
</select>
</div>
<div class="col-6 form-col" style="margin-top: 1.25rem;">
<div class="checkbox">
<strong style="padding-left:0rem;">Saves</strong>
</div>
</div>
<div class="col-5 form-col" >
<select id='saves' name="saves[]" class="selectpicker" style="width:119%; margin-left: -5%;" multiple>
<option value="1">Strength</option>
<option value="2">Dexterity</option>
<option value="3">Constitution</option>
<option value="4">Intelligence</option>
<option value="5">Wisdom</option>
<option value="6">Charisma</option>
</select>
</div>
<hr>
<div class="col-12" style="margin-bottom: 0.25rem;">
<strong>Skills</strong>
</div>
<div class="col-12" style="margin-bottom:.75rem;">
<select id='skills' name="skills[]" class="selectpicker" style="width:100%; margin-left: -5%;" multiple>
<?php
$stmt = "SELECT `Skill ID`, `Skill Name` FROM skills";
$result = $mysqli->query($stmt);
while ($row = $result->fetch_assoc())
{
echo '<option value="' . $row['Skill ID'] . '">' . $row['Skill Name'] . '</option>';
}
?>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 cust-form-coll">
<div class="user-control-part">
<legend class="form-legend">Actions</legend>
<hr>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-6">
<label class="control-label">Signature Attack</label>
<div class="form-group">
<div class="action-text-box">
<!-- <div class="col-md-12">-->
<input id="retainer-action-name" name="sig-one-name" type="text" placeholder="Name" class="form-control input-md" required="">
<!-- </div>-->
</div>
<div class="action-text-box">
<!-- <div class="col-md-12"> -->
<textarea class="form-control" id="sig-one-text" name="sig-one-text" placeholder="+6 to hit, reach 5ft, one target. Hit: 9 (2d6+2) slashing damage."></textarea>
<!-- </div>-->
</div>
<!--<div class="form-group">-->
<div class="action-text-box">
<input id="retainer-action-type" name="sig-one-type" type="text" placeholder="Melee Weapon Attack" class="form-control input-md" required="">
</div>
<!--</div>-->
<!-- Text input-->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-duration">Duration</label>
<div class="action-text-box">
<input id="retainer-action-duration" name="sig-one-duration" type="text" placeholder="Action" class="form-control input-md" required="">
</div>
<!--</div>-->
<!-- Multiple Radios (inline) -->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-uses">Uses per day</label>
<div class="" style="display:flex; justify-content: space-around">
<label class="radio-inline" for="retainer-action-uses-0">
<input type="radio" name="sig-one-uses" id="retainer-action-uses-0" value="null" checked="checked">
At Will
</label>
<label class="radio-inline" for="retainer-action-uses-1">
<input type="radio" name="sig-one-uses" id="retainer-action-uses-1" value="1">
1
</label>
<label class="radio-inline" for="retainer-action-uses-2">
<input type="radio" name="sig-one-uses" id="retainer-action-uses-2" value="3">
3
</label>
<label class="radio-inline" for="retainer-action-uses-3">
<input type="radio" name="sig-one-uses" id="retainer-action-uses-3" value="5">
5
</label>
</div>
<!--</div>-->
</div>
<label href="#Sig-Attack-2" class="form-button" data-toggle="collapse" data-target="#Sig-Attack-2" style="width:100%;padding-top:0.5rem; margin-left: 0;"> + Second Signature Attack</label>
</div>
<div id="Sig-Attack-2" class="col-sm-12 col-md-12 col-lg-6 collapse in">
<label class="control-label">Signature Attack</label>
<div class="form-group">
<div class="action-text-box">
<!-- <div class="col-md-12">-->
<input id="retainer-action-name" name="sig-two-name" type="text" placeholder="Name" class="form-control input-md" >
<!-- </div>-->
</div>
<div class="action-text-box">
<!-- <div class="col-md-12"> -->
<textarea class="form-control" id="retainer-action-text" name="sig-two-text" placeholder="+6 to hit, reach 5ft, one target. Hit: 9 (2d6+2) slashing damage."></textarea>
<!-- </div>-->
</div>
<!--<div class="form-group">-->
<div class="action-text-box">
<input id="retainer-action-type" name="sig-two-type" type="text" placeholder="Melee Weapon Attack" class="form-control input-md" >
</div>
<!--</div>-->
<!-- Text input-->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-duration">Duration</label>
<div class="action-text-box">
<input id="retainer-action-duration" name="sig-two-duration" type="text" placeholder="Action" class="form-control input-md" >
</div>
<!--</div>-->
<!-- Multiple Radios (inline) -->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-uses">Uses per day</label>
<div class="" style="display:flex; justify-content: space-around">
<label class="radio-inline" for="retainer-action-uses-0">
<input type="radio" name="sig-two-uses" id="retainer-action-uses-0" value="null" checked="checked">
At Will
</label>
<label class="radio-inline" for="retainer-action-uses-1">
<input type="radio" name="sig-two-uses" id="retainer-action-uses-1" value="1">
1
</label>
<label class="radio-inline" for="retainer-action-uses-2">
<input type="radio" name="sig-two-uses" id="retainer-action-uses-2" value="3">
3
</label>
<label class="radio-inline" for="retainer-action-uses-3">
<input type="radio" name="sig-two-uses" id="retainer-action-uses-3" value="5">
5
</label>
</div>
<!--</div>-->
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<label class="control-label">Level 3 Action</label>
<div class="form-group">
<div class="action-text-box">
<!-- <div class="col-md-12">-->
<input id="retainer-action-name" name="spec-act-one-name" type="text" placeholder="Name" class="form-control input-md" required="">
<!-- </div>-->
</div>
<div class="action-text-box">
<!-- <div class="col-md-12"> -->
<textarea class="form-control" id="spec-act-one-text" name="spec-act-one-text" placeholder="+6 to hit, reach 5ft, one target. Hit: 9 (2d6+2) slashing damage."></textarea>
<!-- </div>-->
</div>
<!--<div class="form-group">-->
<div class="action-text-box">
<input id="retainer-action-type" name="spec-act-one-type" type="text" placeholder="Melee Weapon Attack" class="form-control input-md" >
</div>
<!--</div>-->
<!-- Text input-->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-duration">Duration</label>
<div class="action-text-box">
<input id="retainer-action-duration" name="spec-act-one-duration" type="text" placeholder="Action" class="form-control input-md" required="">
</div>
<!--</div>-->
<!-- Multiple Radios (inline) -->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-uses">Uses per day</label>
<div class="" style="display:flex; justify-content: space-around">
<label class="radio-inline" for="retainer-action-uses-0">
<input type="radio" name="spec-act-two-uses" id="retainer-action-uses-0" value="null" checked="checked">
At Will
</label>
<label class="radio-inline" for="retainer-action-uses-1">
<input type="radio" name="spec-act-one-uses" id="retainer-action-uses-1" value="1">
1
</label>
<label class="radio-inline" for="retainer-action-uses-2">
<input type="radio" name="spec-act-one-uses" id="retainer-action-uses-2" value="3">
3
</label>
<label class="radio-inline" for="retainer-action-uses-3">
<input type="radio" name="spec-act-one-uses" id="retainer-action-uses-3" value="5">
5
</label>
</div>
<!--</div>-->
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<label class="control-label">Level 5 Action</label>
<div class="form-group">
<div class="action-text-box">
<!-- <div class="col-md-12">-->
<input id="retainer-action-name" name="spec-act-two-name" type="text" placeholder="Name" class="form-control input-md" required="">
<!-- </div>-->
</div>
<div class="action-text-box">
<!-- <div class="col-md-12"> -->
<textarea class="form-control" id="spec-act-one-text" name="spec-act-two-text" placeholder="+6 to hit, reach 5ft, one target. Hit: 9 (2d6+2) slashing damage."></textarea>
<!-- </div>-->
</div>
<!--<div class="form-group">-->
<div class="action-text-box">
<input id="retainer-action-type" name="spec-act-two-type" type="text" placeholder="Melee Weapon Attack" class="form-control input-md">
</div>
<!--</div>-->
<!-- Text input-->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-duration">Duration</label>
<div class="action-text-box">
<input id="retainer-action-duration" name="spec-act-two-duration" type="text" placeholder="Action" class="form-control input-md" required="">
</div>
<!--</div>-->
<!-- Multiple Radios (inline) -->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-uses">Uses per day</label>
<div class="" style="display:flex; justify-content: space-around">
<label class="radio-inline" for="retainer-action-uses-0">
<input type="radio" name="spec-act-two-uses" id="retainer-action-uses-0" value="null" checked="checked">
At Will
</label>
<label class="radio-inline" for="retainer-action-uses-1">
<input type="radio" name="spec-act-two-uses" id="retainer-action-uses-1" value="1">
1
</label>
<label class="radio-inline" for="retainer-action-uses-2">
<input type="radio" name="spec-act-two-uses" id="retainer-action-uses-2" value="3">
3
</label>
<label class="radio-inline" for="retainer-action-uses-3">
<input type="radio" name="spec-act-two-uses" id="retainer-action-uses-3" value="5">
5
</label>
</div>
<!--</div>-->
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<label class="control-label">Level 7 Action</label>
<div class="form-group">
<div class="action-text-box">
<!-- <div class="col-md-12">-->
<input id="retainer-action-name" name="spec-act-three-name" type="text" placeholder="Name" class="form-control input-md" required="">
<!-- </div>-->
</div>
<div class="action-text-box">
<!-- <div class="col-md-12"> -->
<textarea class="form-control" id="spec-act-three-text" name="spec-act-three-text" placeholder="+6 to hit, reach 5ft, one target. Hit: 9 (2d6+2) slashing damage."></textarea>
<!-- </div>-->
</div>
<!--<div class="form-group">-->
<div class="action-text-box">
<input id="retainer-action-type" name="spec-act-three-type" type="text" placeholder="Melee Weapon Attack" class="form-control input-md">
</div>
<!--</div>-->
<!-- Text input-->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-duration">Duration</label>
<div class="action-text-box">
<input id="retainer-action-duration" name="spec-act-three-duration" type="text" placeholder="Action" class="form-control input-md" required="">
</div>
<!--</div>-->
<!-- Multiple Radios (inline) -->
<!--<div class="form-group">-->
<label class="control-label" for="retainer-action-uses">Uses per day</label>
<div class="" style="display:flex; justify-content: space-around">
<label class="radio-inline" for="retainer-action-uses-0">
<input type="radio" name="spec-act-three-uses" id="retainer-action-uses-0" value="null" checked="checked">
At Will
</label>
<label class="radio-inline" for="retainer-action-uses-1">
<input type="radio" name="spec-act-three-uses" id="retainer-action-uses-1" value="1">
1
</label>
<label class="radio-inline" for="retainer-action-uses-2">
<input type="radio" name="spec-act-three-uses" id="retainer-action-uses-2" value="3">
3
</label>
<label class="radio-inline" for="retainer-action-uses-3">
<input type="radio" name="spec-act-three-uses" id="retainer-action-uses-3" value="5">
5
</label>
</div>
<!--</div>-->
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="user-control-part">
<div class="form-group">
<label class="col-md-10 control-label" for="createretainer"></label>
<div class="col-md-10">
<button id="createretainer" name="createretainer" class="btn form-button" style="width:100%;height:100%;font-size:20px;"><strong>Add Retainer</strong></button>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</form>
</div>
<?php
}
else {
?>
<a>You must be </a><a href="login.php">logged in</a><a> in to create retainers, if you just want to test the tool, use the </a><a href="quickretainercreator.php">Quick Retainer Creator</a><a>.</a>
<?php
} ?>
</body>
</html>