-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlist.php
executable file
·67 lines (66 loc) · 2.66 KB
/
list.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
<?php
require_once( 'civi.php' );
if ( isset( $_GET['q'] ) && $_GET['q'] == "delete" ) {
if ( ! empty( $_GET['id'] ) ) {
$wpdb->civi_member_sync = $wpdb->prefix . 'civi_member_sync';
$rid = $_GET['id'];
$delete = $wpdb->get_results( $wpdb->prepare( "DELETE FROM $wpdb->civi_member_sync WHERE `id`= %d", $rid ) );
}
}
$addNew_url = get_bloginfo( 'url' ) . "/wp-admin/admin.php?&page=" . CIV_MEMB_SYNC_BASE . "settings.php";
$manual_sync_url = get_bloginfo( 'url' ) . "/wp-admin/admin.php?&page=" . CIV_MEMB_SYNC_BASE . "manual_sync.php";
?>
<div id="icon-edit-pages" class="icon32"></div>
<div class="wrap">
<h2>LIST ASSOCIATION RULE(S)<a class="add-new-h2"
href=<?php echo $addNew_url ?>>Add
Association Rule</a><a class="add-new-h2"
href=<?php echo $manual_sync_url ?>>Manually
Synchronize</a></h2>
</div>
<?php
$tablename = $wpdb->prefix . 'civi_member_sync';
$select = $wpdb->get_results( $wpdb->prepare( " SELECT * FROM $tablename ", $tablename ) );
?>
<table cellspacing="0" class="wp-list-table widefat fixed users">
<thead>
<tr>
<th style="" class="manage-column column-role" id="role" scope="col">
Civi Membership Type
</th>
<th style="" class="manage-column column-role" id="role" scope="col">
Wordpress Role
</th>
<th style="" class="manage-column column-role" id="role" scope="col">
Current Codes
</th>
<th style="" class="manage-column column-role" id="role" scope="col">
Expired Codes
</th>
<th style="" class="manage-column column-role" id="role" scope="col">
Expiry Assign Role
</th>
</tr>
</thead>
<tbody class="list:civimember-role-sync" id="the-list">
<?php foreach ( $select as $key => $value ) { ?>
<tr>
<td><?php echo get_names( $value->civi_mem_type, $MembershipType ); ?>
<br/>
<?php $edit_url = get_bloginfo( 'url' ) . "/wp-admin/admin.php?&q=edit&id=" . $value->id . "&page=" . CIV_MEMB_SYNC_BASE . "settings.php"; ?>
<?php $delete_url = get_bloginfo( 'url' ) . "/wp-admin/admin.php?&q=delete&id=" . $value->id . "&page=" . CIV_MEMB_SYNC_BASE . "list.php"; ?>
<div class="row-actions">
<span class="edit">
<a href="<?php echo $edit_url ?>">Edit</a> | </span>
<span class="delete"><a href="<?php echo $delete_url ?>"
class="submitdelete">Delete</a></span>
</div>
</td>
<td><?php echo $value->wp_role; ?></td>
<td><?php echo get_names( $value->current_rule, $MembershipStatus ); ?></td>
<td><?php echo get_names( $value->expiry_rule, $MembershipStatus ); ?></td>
<td><?php echo $value->expire_wp_role; ?></td>
</tr>
<?php } ?>
</tbody>
</table>