Location: PHPKode > scripts > WebsiteMemberManager > members-section/admin/php/view.php
<?php
include_once("member-class.php");
$continue=true;
$dbc = dbc::instance();
if (isset($the_action))
{
 switch($the_action)
 {
    case 'delete';
      $member=new WMMmembers();
      $member->delete($id);
      $feedback->setShow("Member deleted");
      unset($the_action);//so we do not go through here again
    break;

    case 'search';
        //$continue=false;
        $name=preg_split("/,/", $name);
        $s_query = "SELECT * FROM wmm_members WHERE ".$name[1]." LIKE '%".$name[0]."%' ORDER by ".$name[2]." ";
        $results_title= "<font color=\"#0000FF\"><br><b>Displaying search results: where '".$name[1]."' is LIKE '".$name[0]."' and ordering by '".$name[2]."'</font></b>";
    break;

    case 'char_search';
        //$continue=false;
        $s_query="SELECT * FROM wmm_members where `name` LIKE '$name%' ORDER by name";
        $results_title= "<font color=\"#0000FF\"><br><b>Displaying members with the first name starting with: ".$name."</font></b>";
    break;

    case 'modify';
        $continue=false;
        $date_now = time();
        $get_query = "SELECT * from wmm_members where id='$id'";
        $result = $dbc->prepare($get_query);
        $rows = $dbc->executeGetRows($result);
        $row=$rows[0];
        include("modify.html");
    break;

    case 'save';
        $member=new WMMmembers();
        $member->update($id,$_POST);
        $feedback->setShow("Member:<br>$name ($email) updated");
    break;

    default;

    break;
 }
}
if ($continue)
{
  include("search_box.html");
  echo "<center>Click on a letter below to view all members with names starting with that letter.<br>|";
  for ($i="A"; $i != "AA"; $i++) echo "<a href=\"javascript:action('view.php','','$i','','char_search')\"> - $i: -</a> | ";
  echo ' - <a href="activate.php">List none activated accounts</a>';

  if (!isset($s_query) AND !isset($show_not_activated))
  {
   $s_query="SELECT * FROM wmm_members order by id limit 10";
   $results_title= "<font color=\"#008000\"><br><br><b>Displaying upto 10 of the most recent members below:</b></font>";
  }
  elseif (isset($show_not_activated))
  {
   $s_query="SELECT * FROM wmm_members where activated='0' ";
   include("activate-extra.html");
  }
  if(isset($results_title)) echo $results_title;
  $result = $dbc->prepare($s_query);
  $rows = $dbc->executeGetRows($result);
  if (count($rows)>0)
  {
   $i = 0;
   while ($i < count($rows))
    {
     $id=$rows[$i]['id'];
     $activated_date=$rows[$i]['activated_date'];
     $expire_date=$rows[$i]['expire_date'];
     $activated=$rows[$i]['activated'];
     $name = htmlentities($rows[$i]['name']);
     $companyname = htmlentities($rows[$i]['companyname']);
     $postcode = $rows[$i]['postcode'];
     $email = $rows[$i]['email'];
     if ($activated) $show_activate="";
     else
     {
      $show_activate=" | <font color=\"red\"> *NOT activated</font> <a href=\"javascript:action('activate.php','$id','".addslashes($name)."','','activate')\">ACTIVATE Now...</a> (admin can login as the member, but the member can not yet login)";
     }
     echo "<div align=\"center\" style=\"padding:5px\"><fieldset class=\"ui-widget-content ui-corner-all\" ><legend class=\"ui-widget-header ui-corner-all\"><b>".reverse_clean($name)."</b></legend>
           <div align=\"left\">Company: ".reverse_clean($companyname).", Post/zipcode: $postcode, email:<b> $email</b>";
     if ($activated) echo ", Activate date: ".strftime("%d %b, %Y",$activated_date);
     echo ", Expiry date: "
           .strftime("%d %b, %Y",$expire_date)."<br>
           <a href=\"view.php?id=$id&the_action=modify&name=$name\">View/Modify</a> |
           <a href=\"javascript:action('view.php','$id','".addslashes($name)."','','delete')\">Delete...</a> |
           <a href=\"javascript:action('login-records.php','$id','".addslashes($name)."','','login_records')\">View Login records</a>$show_activate |
           <a href=\"../members/admin-login-as-member.php?id=$id\" target=\"_blank\">*LOGIN as this member^</a>
           </div></fieldset></div>";

     $i++;
    }
  }
  else echo "<br><br><center><h3>Currently no members.</h3><hr width=30%><br><br><br>";
  echo "</div></div>";
}
?>
Return current item: WebsiteMemberManager