Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 manhattanpaul

manhattanpaul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 11 September 2006 - 11:13 AM

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


The pages consists of the following code:
<?
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);




?>

#2 manhattanpaul

manhattanpaul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 12 September 2006 - 09:01 AM

Any thoughts ??

I am really desperate to get this sorted for a friend.

Regards

Paul





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users