###############################################################################
# CP_ManageAccounts.src                                                       #
###############################################################################
# UltraBoard 2000 by UltraScripts.com, Inc.                                   #
# Scripts written by Jacky Wing Wa Yung, WebMaster@UltraScripts.com           #
# Available from http://www.UltraBoard.org/                                   #
# =========================================================================== #
# COPYRIGHT NOTICE :                                                          #
#                                                                             #
# Copyright (c) 1999-2000 UltraScripts.com, Inc. All Rights Reserved.         #
#                                                                             #
# This program is being distributed as shareware. It may be used and modified #
# free for personal, government or non-profit. Any commercial use must be     #
# registered. However, modified versions cannot be sold or distributed. You   #
# cannot alter the copyright and "powered by" notices throughout the scripts. #
# These notices must be clearly visible to the end users.                     #
#                                                                             #
# WARRANTY DISCLAIMER:                                                        #
#                                                                             #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR       #
# FITNESS FOR A PARTICULAR PURPOSE.                                           #
###############################################################################

package Source;

sub ManageAccounts {
  my ($ERROR) = @_;

  (
    my ($DB) = &DB::Query (
      TABLE   => "Groups",
      COLUMNS => ["ID", "TITLE"]
    )
  ) || &HTML::Error("Members Accounts Management / Manage member account", "No group available for you to choose yet.<br>Sorry, you have to <a href=\"$SYSTEM::CP_URL/Panel.$SYSTEM::EXT?action=CreateGroup\" target=\"UBBODY\">create a new member group</a> first!");

  my $Groups;
  push (
    @{ $Groups },
    {
      KEY   => "*",
      VALUE => "all member groups"
    }
  );
  for (my $i = 0; $i <= $#{ $DB }; $i++) {
    push (
      @{ $Groups },
      {
        KEY   => $DB->[$i]{'ID'},
        VALUE => $DB->[$i]{'TITLE'}
      }
    );
  }

  my $Level = [
    {
      KEY   => "*",
      VALUE => "all members levels",
    },{
      KEY   => "30",
      VALUE => $GENERAL::MEMBER_LEVEL_30." (Level 30)",
    }, {
      KEY   => "50",
      VALUE => $GENERAL::MEMBER_LEVEL_50." (Level 50)",
    }, {
      KEY   => "70",
      VALUE => $GENERAL::MEMBER_LEVEL_70." (Level 70)",
    }
  ];

  my %FORM;
  $FORM{'FORM_LEVEL'}     = &HTML::Select (
    NAME      => "FORM_LEVEL",
    VALUE     => $Level     ,
    SELECTED  => [$UB::CGI->param('FORM_LEVEL')],
    EXTRA     => "style=\"width:100%\""
  );

  $FORM{'FORM_GROUP'}     = &HTML::Select (
    NAME      => "FORM_GROUP",
    VALUE     => $Groups     ,
    SELECTED  => [$UB::CGI->param('FORM_GROUP')],
    EXTRA     => "style=\"width:100%\""
  );

  &Standard::PrintHTMLHeader();
  print &HTML::Header;
  print<<HTML;
<form action="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT" method="post">
<input type="hidden" name="action" value="ListAccounts">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr bgcolor="Gray">
    <td><font color="White"><b>
      <a href="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT?action=body" target="UBBODY" class="address">Control Panel</a> / Members Accounts Management / Manage member account
    </b></font></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
          <td>
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td>
                      Fill out as many fields as possible to narrow search results.
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            &nbsp;<br>
            &nbsp;&nbsp;Search
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="100" valign="top" nowrap>Username</td>
                      <td width="100%"><input type="text" name="FORM_USERNAME" value="" style="width:100%" maxlength="64"></td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="enter a word for searching any members username that included.\n\ntips:\na word begin with ^ mean start with this word.\n\na word end with \$ mean end with this word."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Nickname</td>
                      <td width="100%"><input type="text" name="FORM_NICKNAME" value="" style="width:100%" maxlength="64"></td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="enter a word for searching any members nickname that included.\n\ntips:\na word begin with ^ mean start with this word.\n\na word end with \$ mean end with this word."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Level</td>
                      <td width="100%">$FORM{'FORM_LEVEL'}<td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="choose a level of members that you want to search for."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Member Group</td>
                      <td width="100%">$FORM{'FORM_GROUP'}</td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="choose a member group that you want to search for."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Status</td>
                      <td width="100%"><input type="Radio" name="FORM_STATUS" value="*" checked class="Radio">Both <input type="Radio" name="FORM_STATUS" value="50" class="Radio">Activated <input type="Radio" name="FORM_STATUS" value="30" class="Radio">Deactivated</td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="choose a status of members that you want to search for."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Last Post</td>
                      <td width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td nowrap><select name="FORM_LAST_POST_BOOLEAN" class="Select"><option value="GT">more</option><option value="LT">less</option></select></td>
                            <td nowrap>&nbsp;&nbsp;than&nbsp;&nbsp;</td>
                            <td width="100%"><select name="FORM_LAST_POST_DAYS" class="Select" style="width:100%"><option value="*">any days</option><option value="NA">N/A</option><option value="1">1 day</option><option value="2">2 days</option><option value="3">3 days</option><option value="7">7 days</option><option value="14">14 days</option><option value="30">30 days</option><option value="45">45 days</option><option value="60">60 days</option><option value="90">90 days</option><option value="180">180 days</option><option value="365">365 days</option></select></td>
                          </tr>
                        </table>
                      </td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="search all members that fit this expression."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Total Posts</td>
                      <td width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td nowrap><select name="FORM_TOTAL_POST_BOOLEAN" class="Select"><option value="GT">more</option><option value="LT">less</option></select></td>
                            <td nowrap>&nbsp;&nbsp;than&nbsp;&nbsp;</td>
                            <td width="100%"><select name="FORM_TOTAL_POST_NUMBER" class="Select" style="width:100%"><option value="*">any number</option><option value="NA">N/A</option><option value="25">25 messages</option><option value="50">50 messages</option><option value="75">75 messages</option><option value="100">100 messages</option><option value="150">150 messages</option><option value="200">200 messages</option><option value="250">250 messages</option><option value="300">300 messages</option><option value="350">350 messages</option><option value="400">400 messages</option><option value="450">450 messages</option><option value="500">500 messages</option></select></td>
                          </tr>
                        </table>
                      </td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="search all members that fit this expression."></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Sort Order</td>
                      <td width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td nowrap>Sort&nbsp;&nbsp;</td>
                            <td nowrap><select name="FORM_SORT_FIELD" class="Select"><option value="NICKNAME">nickname</option><option value="STATUS">status</option><option value="LEVEL">level</option><option value="GROUP">group</option><option value="TOTAL_POSTS">total posts</option><option value="REGISTERED_SECOND">registered date</option><option value="LAST_POST_SECOND">last post</option><option value="LAST_LOGIN_SECOND">last login</option></select></td>
                            <td nowrap>&nbsp;&nbsp;by&nbsp;&nbsp;</td>
                            <td width="100%"><select name="FORM_SORT_ORDER" class="Select" style="width:100%"><option value="A-Z">ascending</option><option value="Z-A">descending</option></select></td>
                            <td nowrap>&nbsp;&nbsp;order.</td>
                          </tr>
                        </table>
                      </td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="choose a field that you want to sort the order."></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            &nbsp;<br>
            &nbsp;&nbsp;Action
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="100%"><input type="Radio" name="FORM_ACTION" value="DeActivateAccounts" checked class="Radio">Activate/Deactivate members account<br><input type="Radio" name="FORM_ACTION" value="EmailAccounts" class="Radio">Email member(s)<br><input type="Radio" name="FORM_ACTION" value="ModifyAccount" class="Radio">Modify member account<br><input type="Radio" name="FORM_ACTION" value="MoveAccounts" class="Radio">Move member(s) account<br><input type="Radio" name="FORM_ACTION" value="RemoveAccounts" class="Radio">Remove member(s) account</td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="choose a action to manage your members account"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td align="right"><input type="submit" value="Search">&nbsp;&nbsp;<input type="Reset" value="Cancel"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>
</body>
</html>
HTML
}

###############################################################################
1; # end of CP_ManageAccounts.src file
###############################################################################