Add child entry in membership form
parent
326daca881
commit
a3961dc2c1
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
// Use a random ID for each child, so we can tell 100% which inputs go together
|
||||
$randomid = mt_rand(0, 9999999999);
|
||||
?>
|
||||
|
||||
<div class="list-group-item">
|
||||
<input type="hidden" name="child[ids][]" value="<?php echo $randomid; ?>" />
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-4">
|
||||
<div class="form-group">
|
||||
<label>Name:</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-user-graduate"></i></span>
|
||||
</div>
|
||||
<input type="text" name="child[name][<?php echo $randomid; ?>]" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-3">
|
||||
<div class="form-group">
|
||||
<label>Birth month:</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-calendar"></i></span>
|
||||
</div>
|
||||
<select name="child[month][<?php echo $randomid; ?>]" class="form-control">
|
||||
<option value=1>January</option>
|
||||
<option value=2>February</option>
|
||||
<option value=3>March</option>
|
||||
<option value=4>April</option>
|
||||
<option value=5>May</option>
|
||||
<option value=6>June</option>
|
||||
<option value=7>July</option>
|
||||
<option value=8>August</option>
|
||||
<option value=9>September</option>
|
||||
<option value=10>October</option>
|
||||
<option value=11>November</option>
|
||||
<option value=12>December</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-3">
|
||||
<div class="form-group">
|
||||
<label>Birth year:</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
<input type="number" name="child[year][<?php echo $randomid; ?>]" class="form-control" min="1980" max="<?php echo date('Y'); ?>" value="<?php echo date('Y', strtotime('now - 10 years')); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-2">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" value="1" name="child[graduate][<?php echo $randomid; ?>]">
|
||||
<label class="form-check-label">Graduated</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
|
||||
$("#add_child_row").click(function () {
|
||||
$.get("parts/template_child_entry.php", {}, function (resp) {
|
||||
$("#child_list").append(resp);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue