Jump to content

Archived

This topic is now archived and is closed to further replies.

manhattanpaul

Can someone take a look at this to see what the heck I have done !

Recommended Posts

Hi there

I am currently trying to create a new display on the following page - mysite4singles.com/manager/users3.php

I want to be able to see at a glance which members have upgraded.

The only problem is, that the members who have upgraded are then repeated under 'Waiting to be registered' and 'Aleady registered' again !

Any thoughts (code below)

Cheers

Paul


[quote]The pages consists of the following code:
[color=purple]<?
include ("../config.php");
include ("../functii_mail.php");
db_connect($dbserver,$dbuser,$dbpass,$dbname);
function get_picture($user_id,$mod=0)
{
//mod daca apare sau nu butonul radio
    $sql="select nume,id from pictures where user_id=$user_id";
    $result=mysql_query($sql);
    $num=mysql_numrows($result);
    if ($num<>0)
    {

      $i=0;
    while ($i<$num)
      {
      $nume=mysql_result($result,$i,"nume");
      $id=mysql_result($result,$i,"id");
      ?>
<p><img src="../user_pic/ <?=$nume?>">
      <?
      if ($mod==1)
      {
      }
      else
      {
      ?>
      <input type="radio" name="id" value="<?=$id?>">
      <br>
  <?}
      $i++;
      }
    }
    else
    {
    echo "This user have no pictures uploaded !";
    }

}

function last_user($aproved=0)
{
  $sql="SELECT count(*) FROM users where approvved=$aproved ";
  $result=mysql_query($sql);
if($result)
{ $count=mysql_result($result,0,"count(*)");
echo '('.$count.')';
}

  $sql="SELECT id,nick FROM users where approvved=$aproved order by data desc ";
  $result=mysql_query($sql);
  $num=mysql_numrows($result);
  if ($num<>0)
  {
    $i=0;
  while ($i<$num)
  {
    $nick=mysql_result($result,$i,"nick");
    $id=mysql_result($result,$i,"id");
    if ($i==$num-1)
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>
  <?is_online($id);
    }
    else
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>,
  <?is_online($id);
    }
  $i++;
  }
  }
 
 
 
  $sql="SELECT id,nick FROM users where upgraded='1' order by data desc ";
  $result=mysql_query($sql);
  $num=mysql_numrows($result);
  if ($num<>0)
  {
    $i=0;
  while ($i<$num)
  {
    $nick=mysql_result($result,$i,"nick");
    $id=mysql_result($result,$i,"id");
    if ($i==$num-1)
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>,
  <?is_online($id);
    }
    else
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
</a>, </p>
<?is_online($id);
    }
  $i++;
  }
  }
 
 
}
echo "Waiting to be registered:";
last_user();
echo "<br>Already registered:";
last_user(1);
echo "<br>Upgraded:";
last_user(2);[/quote]



?>[/color]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.