예제 #1
0
파일: members.php 프로젝트: huynp/Critical
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_MembersView();
$showSearch = false;
//only show 'export csv' option if current user is an administrator
global $current_user;
$showCsvExportButton = false;
if (isset($current_user) && isset($current_user->ID)) {
    $employee = MM_Employee::findByUserId($current_user->ID);
    if ($employee->isValid() && ($employee->getRoleId() == MM_Role::$ROLE_ADMINISTRATOR || $employee->doAllowExport())) {
        $showCsvExportButton = true;
    }
    echo "<input type='hidden' id='mm-admin-id' value='{$current_user->ID}' />";
    // determine if this user's preference is to have the advanced search open
    $showSearchOptionName = MM_OptionUtils::$OPTION_KEY_SHOW_MBRS_SEARCH . "-" . $current_user->ID;
    $showSearchOptionValue = MM_OptionUtils::getOption($showSearchOptionName);
    if ($showSearchOptionValue == "1") {
        $showSearch = true;
    }
}
?>
<div class="mm-wrap">
	<?php 
if (count(MM_MembershipLevel::getMembershipLevelsList()) > 0) {
    ?>
		<div style="margin-top:20px;" class="mm-button-container">			
예제 #2
0
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$useCustomField = isset($_REQUEST["mm_member_custom_field"]) ? true : false;
$useCustomField2 = isset($_REQUEST["mm_member_custom_field2"]) ? true : false;
$doGenerateCsv = isset($_REQUEST["csv"]) ? true : false;
// get data based on search criteria and datagrid settings
$view = new MM_MembersView();
$searchByDate = "user_registered";
if (!empty($_REQUEST["mm_member_search_by_date"])) {
    $searchByDate = $_REQUEST["mm_member_search_by_date"];
}
$dataGrid = new MM_DataGrid($_REQUEST, "", "desc");
$data = $view->search($_REQUEST, $dataGrid, $doGenerateCsv);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "member";
// define datagrid headers
$headers = array('last_name' => array('content' => '<a onclick="mmjs.sort(\'last_name\');" href="#">Name</a>'), 'user_email' => array('content' => '<a onclick="mmjs.sort(\'user_email\');" href="#">Email</a>'), 'phone' => array('content' => '<a onclick="mmjs.sort(\'phone\');" href="#">Phone</a>'), 'membership_level_id' => array('content' => '<a onclick="mmjs.sort(\'membership_level_id\');" href="#">Membership Level</a>'), 'bundles' => array('content' => 'Bundles'));
if ($useCustomField) {
    $field = new MM_CustomField($_REQUEST["mm_member_custom_field"]);
    if ($field->isValid()) {
        $headers["mm_custom_field"] = array('content' => $field->getDisplayName());
    } else {
        $useCustomField = false;
    }
}
if ($useCustomField2) {