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:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 
<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines http://www.simplemachines.org
 * @copyright 2019 Simple Machines and individual contributors
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.1 RC1
 */

/**
 * The admin member search form
 */
function template_search_members()
{
    global $context, $scripturl, $txt;

    echo '
        <form action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" id="admin_form_wrapper">
            <input type="hidden" name="sa" value="query">
            <div class="cat_bar">
                <h3 class="catbg">
                    <span class="floatleft">', $txt['search_for'], '</span>
                    <span class="smalltext floatright">', $txt['wild_cards_allowed'], '</span>
                </h3>
            </div>
            <div class="windowbg">
                <div class="flow_hidden">
                    <div class="msearch_details floatleft">
                        <dl class="settings right">
                            <dt class="righttext">
                                <strong><label for="mem_id">', $txt['member_id'], ':</label></strong>
                                <select name="types[mem_id]">
                                    <option value="--">&lt;</option>
                                    <option value="-">&lt;=</option>
                                    <option value="=" selected>=</option>
                                    <option value="+">&gt;=</option>
                                    <option value="++">&gt;</option>
                                </select>
                            </dt>
                            <dd>
                                <input type="number" name="mem_id" id="mem_id" value="" size="6">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="age">', $txt['age'], ':</label></strong>
                                <select name="types[age]">
                                    <option value="--">&lt;</option>
                                    <option value="-">&lt;=</option>
                                    <option value="=" selected>=</option>
                                    <option value="+">&gt;=</option>
                                    <option value="++">&gt;</option>
                                </select>
                            </dt>
                            <dd>
                                <input type="number" name="age" id="age" value="" size="6">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="posts">', $txt['member_postcount'], ':</label></strong>
                                <select name="types[posts]">
                                    <option value="--">&lt;</option>
                                    <option value="-">&lt;=</option>
                                    <option value="=" selected>=</option>
                                    <option value="+">&gt;=</option>
                                    <option value="++">&gt;</option>
                                </select>
                            </dt>
                            <dd>
                                <input type="number" name="posts" id="posts" value="" size="6">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="reg_date">', $txt['date_registered'], ':</label></strong>
                                <select name="types[reg_date]">
                                    <option value="--">&lt;</option>
                                    <option value="-">&lt;=</option>
                                    <option value="=" selected>=</option>
                                    <option value="+">&gt;=</option>
                                    <option value="++">&gt;</option>
                                </select>
                            </dt>
                            <dd>
                                <input type="date" name="reg_date" id="reg_date" value="" size="10"><span class="smalltext">', $txt['date_format'], '</span>
                            </dd>
                            <dt class="righttext">
                                <strong><label for="last_online">', $txt['viewmembers_online'], ':</label></strong>
                                <select name="types[last_online]">
                                    <option value="--">&lt;</option>
                                    <option value="-">&lt;=</option>
                                    <option value="=" selected>=</option>
                                    <option value="+">&gt;=</option>
                                    <option value="++">&gt;</option>
                                </select>
                            </dt>
                            <dd>
                                <input type="date" name="last_online" id="last_online" value="" size="10"><span class="smalltext">', $txt['date_format'], '</span>
                            </dd>
                        </dl>
                    </div><!-- .msearch_details -->
                    <div class="msearch_details floatright">
                        <dl class="settings right">
                            <dt class="righttext">
                                <strong><label for="membername">', $txt['username'], ':</label></strong>
                            </dt>
                            <dd>
                                <input type="text" name="membername" id="membername" value="">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="email">', $txt['email_address'], ':</label></strong>
                            </dt>
                            <dd>
                                <input type="email" name="email" id="email" value="">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="website">', $txt['website'], ':</label></strong>
                            </dt>
                            <dd>
                                <input type="url" name="website" id="website" value="">
                            </dd>
                            <dt class="righttext">
                                <strong><label for="ip">', $txt['ip_address'], ':</label></strong>
                            </dt>
                            <dd>
                                <input type="text" name="ip" id="ip" value="">
                            </dd>
                        </dl>
                    </div><!-- .msearch_details -->
                    <div class="msearch_details floatright">
                        <fieldset>
                            <legend>', $txt['activation_status'], '</legend>
                            <label for="activated-0"><input type="checkbox" name="activated[]" value="1" id="activated-0" checked> ', $txt['activated'], '</label>&nbsp;&nbsp;
                            <label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked> ', $txt['not_activated'], '</label>
                        </fieldset>
                    </div>
                </div><!-- .flow_hidden -->
            </div><!-- ..windowbg -->
            <div class="cat_bar">
                <h3 class="catbg">', $txt['member_part_of_these_membergroups'], '</h3>
            </div>
            <table class="table_grid">
                <thead>
                    <tr class="title_bar">
                        <th scope="col">', $txt['membergroups'], '</th>
                        <th scope="col" class="centercol quarter_table">', $txt['primary'], '</th>
                        <th scope="col" class="centercol quarter_table">', $txt['additional'], '</th>
                    </tr>
                </thead>
                <tbody>';

    foreach ($context['membergroups'] as $membergroup)
        echo '
                    <tr class="windowbg">
                        <td>', $membergroup['name'], '</td>
                        <td class="centercol">
                            <input type="checkbox" name="membergroups[1][]" value="', $membergroup['id'], '" checked>
                        </td>
                        <td class="centercol">
                            ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', '
                        </td>
                    </tr>';

    echo '
                    <tr class="windowbg">
                        <td>
                            <em>', $txt['check_all'], '</em>
                        </td>
                        <td class="centercol">
                            <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[1]\');" checked>
                        </td>
                        <td class="centercol">
                            <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[2]\');" checked>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table class="table_grid">
                <thead>
                    <tr class="title_bar">
                        <th scope="col">
                            ', $txt['membergroups_postgroups'], '
                        </th>
                        <th class="quarter_table"></th>
                    </tr>
                </thead>
                <tbody>';

    foreach ($context['postgroups'] as $postgroup)
        echo '
                    <tr class="windowbg">
                        <td>
                            ', $postgroup['name'], '
                        </td>
                        <td class="centercol">
                            <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked>
                        </td>
                    </tr>';

    echo '
                    <tr class="windowbg">
                        <td>
                            <em>', $txt['check_all'], '</em>
                        </td>
                        <td class="centercol">
                            <input type="checkbox" onclick="invertAll(this, this.form, \'postgroups[]\');" checked>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br>
            <input type="submit" value="', $txt['search'], '" class="button">
        </form>';
}

/**
 * The admin member list.
 */
function template_admin_browse()
{
    global $context, $scripturl, $txt;

    template_show_list('approve_list');

    // If we have lots of outstanding members try and make the admin's life easier.
    if ($context['approve_list']['total_num_items'] > 20)
    {
        echo '
        <br>
        <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" name="postFormOutstanding" id="postFormOutstanding" onsubmit="return onOutstandingSubmit();">
            <div class="cat_bar">
                <h3 class="catbg">', $txt['admin_browse_outstanding'], '</h3>
            </div>
            <script>
                function onOutstandingSubmit()
                {
                    if (document.forms.postFormOutstanding.todo.value == "")
                        return;

                    var message = "";
                    if (document.forms.postFormOutstanding.todo.value.indexOf("delete") != -1)
                        message = "', $txt['admin_browse_w_delete'], '";
                    else if (document.forms.postFormOutstanding.todo.value.indexOf("reject") != -1)
                        message = "', $txt['admin_browse_w_reject'], '";
                    else if (document.forms.postFormOutstanding.todo.value == "remind")
                        message = "', $txt['admin_browse_w_remind'], '";
                    else
                        message = "', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], '";

                    if (confirm(message + " ', $txt['admin_browse_outstanding_warn'], '"))
                        return true;
                    else
                        return false;
                }
            </script>

            <div class="windowbg">
                <dl class="settings">
                    <dt>
                        ', $txt['admin_browse_outstanding_days_1'], ':
                    </dt>
                    <dd>
                        <input type="text" name="time_passed" value="14" maxlength="4" size="3"> ', $txt['admin_browse_outstanding_days_2'], '.
                    </dd>
                    <dt>
                        ', $txt['admin_browse_outstanding_perform'], ':
                    </dt>
                    <dd>
                        <select name="todo">
                            ', $context['browse_type'] == 'activate' ? '
                            <option value="ok">' . $txt['admin_browse_w_activate'] . '</option>' : '', '
                            <option value="okemail">', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '' : '
                            <option value="require_activation">' . $txt['admin_browse_w_approve_require_activate'] . '</option>', '
                            <option value="reject">', $txt['admin_browse_w_reject'], '</option>
                            <option value="rejectemail">', $txt['admin_browse_w_reject'], ' ', $txt['admin_browse_w_email'], '</option>
                            <option value="delete">', $txt['admin_browse_w_delete'], '</option>
                            <option value="deleteemail">', $txt['admin_browse_w_delete'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '
                            <option value="remind">' . $txt['admin_browse_w_remind'] . '</option>' : '', '
                        </select>
                    </dd>
                </dl>
                <input type="submit" value="', $txt['admin_browse_outstanding_go'], '" class="button">
                <input type="hidden" name="type" value="', $context['browse_type'], '">
                <input type="hidden" name="sort" value="', $context['approve_list']['sort']['id'], '">
                <input type="hidden" name="start" value="', $context['approve_list']['start'], '">
                <input type="hidden" name="orig_filter" value="', $context['current_filter'], '">
                <input type="hidden" name="sa" value="approve">', !empty($context['approve_list']['sort']['desc']) ? '
                <input type="hidden" name="desc" value="1">' : '', '
            </div><!-- .windowbg -->
            <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
        </form>';
    }
}

?>