Ejemplo n.º 1
0
     
        </tbody>
        </table>
 		</div>
		</div>
		<?php 
}
if ($active_tab == 'addmembership') {
    $membership_id = 0;
    if (isset($_REQUEST['membership_id'])) {
        $membership_id = $_REQUEST['membership_id'];
    }
    $edit = 0;
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
        $edit = 1;
        $result = $obj_membership->get_single_membership($membership_id);
    }
    ?>
		
       <div class="panel-body">
        <form name="membership_form" action="" method="post" class="form-horizontal" id="membership_form" enctype="multipart/form-data">
         <?php 
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'insert';
    ?>
		<input type="hidden" name="action" value="<?php 
    echo $action;
    ?>
">
		<input type="hidden" name="membership_id" value="<?php 
    echo $membership_id;
    ?>
Ejemplo n.º 2
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;
    }
}