Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed table width issues #129

Merged
merged 19 commits into from
Apr 17, 2017
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
$personalEmail = $user->getEmails()[0]['address'];
$dm_email = $user->getPrimaryEmail();

$founding_bool = boolval($user->getCustomSchemas()['roles']['founding-member']);

$founding_true_check = $founding_bool ? 'checked="checked"' : '';
$founding_false_check = !$founding_bool ? 'checked="checked"' : '';

function isSelected($option, $target) {
if ($option == $target) {
echo "selected";
Expand Down Expand Up @@ -79,6 +84,13 @@ <h3 class="panel-title mas-title">Update Member</h3>
<input type="date" name="subscriptionExp" class="form-control" value= <?php echo $expDate; ?> >
</div>

<div class="form-group">
<label for="foundingTrue" class="control-label">Founding Member</label>
<br>
<input type="radio" id="foundingTrue" <?php echo $founding_true_check ?> value="true" name="founding"> True<br>
<input type="radio" id="foundingFalse" <?php echo $founding_false_check ?> value="false" name="founding"> False
</div>

<input type="hidden" name="action" value="update_member">
<input type="hidden" name="username" value="<?php echo $user->getPrimaryEmail();?>">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@
date_default_timezone_set('EST');
$creation_string = date("m-d-Y", $creation_time);

$founding_bool = boolval($user->getCustomSchemas()['roles']['founding-member']);
$founding_member = $founding_bool ?
'<i class="fa fa-check" aria-hidden="true"><span style="display: none">1</span></i>' : '<i class="fa fa-times" aria-hidden="true"><span style="display: none">0</span></i>';

$pass_filter =
(!isset($_GET["before"]) || $creation_time <= strtotime($_GET["before"])) &&
(!isset($_GET["since"]) || $creation_time >= strtotime($_GET["since"])) &&

// TODO Add founding member check
(!isset($_GET["founding"]) || true) &&
(!isset($_GET["founding"]) || (strtolower($_GET["founding"]) == ($founding_bool ? "true" : "false"))) &&

(!isset($_GET["type"]) || $_GET["type"] == $type) &&
(!isset($_GET["status"]) || $_GET["status"] == $status);
Expand All @@ -56,6 +59,7 @@
<td>$type</td>
<td>$status</td>
<td>$creation_string</td>
<td>$founding_member</td>
</tr>
END;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
} );
</script>
<br>
<div class="container" style="margin-right: 0px; width: 1000px; margin-left: 0px;">
<div class="container-fluid">

<table id="member_table" class="table table-striped table-bordered" width="100%">
<thead>
Expand All @@ -23,6 +23,7 @@
<th>Membership Plan</th>
<th>Subscription Status</th>
<th>Member Since</th>
<th>Founding Member</th>
</tr>
</thead>
<tbody>
Expand Down
3 changes: 3 additions & 0 deletions mas.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function mas_admin_enqueue_styles($hook) {
return;
}

// FontAwesome
wp_enqueue_style( 'fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');

// Bootstrap
wp_enqueue_style( 'bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');

Expand Down
2 changes: 2 additions & 0 deletions postable/admin-member-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function prefix_admin_update_member() {
$rfidNumber = $_POST['rfidNumber'];
$subscriptionType = $_POST['membershipPlan'];
$subscriptionExpiry = $_POST['subscriptionExp'];
$founding_member = $_POST['founding'];

if ($subscriptionType === 'none') {
$subscriptionType = '';
Expand All @@ -31,6 +32,7 @@ function prefix_admin_update_member() {

$properties['customSchemas']['Subscription_Management']['Subscription_Type'] = $subscriptionType;
$properties['customSchemas']['roles']['rfid-id'] = $rfidNumber;
$properties['customSchemas']['roles']['founding-member'] = $founding_member == "true";
if (!empty($subscriptionExpiry)) {
$properties['customSchemas']['Subscription_Management']['Subscription_Expiration'] = $subscriptionExpiry;
}
Expand Down