Ejemplo n.º 1
0
<?php

$obj_membership = new Gmgtmembership();
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'membershiplist';
?>

<!-- POP up code -->
<div class="popup-bg">
    <div class="overlay-content">
    <div class="modal-content">
    <div class="category_list">
     </div>
     
    </div>
    </div> 
    
</div>
<!-- End POP-UP Code -->
<div class="page-inner" style="min-height:1631px !important">
<div class="page-title">
		<h3><img src="<?php 
echo get_option('gmgt_system_logo');
?>
" class="img-circle head_logo" width="40" height="40" /><?php 
echo get_option('gmgt_system_name');
?>
</h3>
	</div>
	<?php 
if (isset($_POST['save_membership'])) {
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
Ejemplo n.º 2
0
<?php

$obj_membership = new Gmgtmembership();
$active_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'membershiplist';
if (isset($_POST['save_membership'])) {
    if (isset($_FILES['gmgt_membershipimage']) && !empty($_FILES['gmgt_membershipimage']) && $_FILES['gmgt_membershipimage']['size'] != 0) {
        if ($_FILES['gmgt_membershipimage']['size'] > 0) {
            $member_image = load_documets($_FILES['gmgt_membershipimage'], 'gmgt_membershipimage', 'pimg');
        }
        $member_image_url = content_url() . '/uploads/gym_assets/' . $member_image;
    } else {
        if (isset($_REQUEST['hidden_upload_user_avatar_image'])) {
            $member_image = $_REQUEST['hidden_upload_user_avatar_image'];
        }
        $member_image_url = $member_image;
    }
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
        $result = $obj_membership->gmgt_add_membership($_POST);
        $returnans = $obj_membership->update_membershipimage($_REQUEST['membership_id'], $member_image_url);
        if ($returnans) {
            wp_redirect(home_url() . '?dashboard=user&page=membership&tab=membershiplist&message=2');
        } elseif ($result) {
            wp_redirect(home_url() . '?dashboard=user&page=membership&tab=membershiplist&message=2');
        }
    } else {
        $result = $obj_membership->gmgt_add_membership($_POST, $member_image_url);
        if ($result) {
            wp_redirect(home_url() . '?dashboard=user&page=membership&tab=membershiplist&message=1');
        }
    }
}
Ejemplo n.º 3
0
 </option>
						<?php 
        }
    }
    ?>
			</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="membership"><?php 
    _e('Membership', 'gym_mgt');
    ?>
<span class="require-field">*</span></label>
			<div class="col-sm-8">
				<?php 
    $obj_membership = new Gmgtmembership();
    $membershipdata = $obj_membership->get_all_membership();
    ?>
				<?php 
    if ($edit) {
        $membership_id = $result->membership_id;
    } elseif (isset($_POST['membership_id'])) {
        $membership_id = $_POST['membership_id'];
    } else {
        $membership_id = '';
    }
    ?>
				<select name="membership_id" class="form-control payment_membership_detail validate[required] " id="membership_id">
				<option value=""><?php 
    _e('Seleccionar membresía ', 'gym_mgt');
    ?>
Ejemplo n.º 4
0
function gmgt_check_membership($userid)
{
    $obj_membership = new Gmgtmembership();
    $membershipid = get_user_meta($userid, 'membership_id', true);
    $membershistatus = get_user_meta($userid, 'membership_status', true);
    $joiningdate = get_user_meta($userid, 'begin_date', true);
    $autorenew = get_user_meta($userid, 'auto_renew', true);
    $membership = $obj_membership->get_single_membership($membershipid);
    $validity = $membership->membership_length_id;
    $expiredate = "";
    $today = date("Y-m-d");
    $expiredate = date('Y-m-d', strtotime($joiningdate . ' + ' . $validity . ' days'));
    if ($membershistatus != "Dropped") {
        if ($today < $expiredate) {
            $returnans = update_user_meta($userid, 'membership_status', 'Continue');
            return $expiredate;
        } elseif ($autorenew == "Yes") {
            $returnans = update_user_meta($userid, 'begin_date', $today);
            $bigindate = get_user_meta($userid, 'begin_date', true);
            return $expiredate = date('Y-m-d', strtotime($bigindate . ' + ' . $validity . ' days'));
        } else {
            $returnans = update_user_meta($userid, 'membership_status', 'Expired');
            return $expiredate;
        }
    } else {
        return $expiredate;
    }
}