Jump to content

Show 10 newest clients on admin


Patty

Recommended Posts

This will show the newest 10 clients on the admin homepage. Just place the following code after the last </table> on file admin/templates/homepage.tpl

 

Based on the contribution by jasonhk here http://forum.whmcs.com/showthread.php?t=18507

I just improved it a little to show the IP and host and increased the listing to 10.

 

All credits go to jasonhk.

 

<h1>New clients - <a href="clients.php">View All</a></h1>
<table width=100% bgcolor="#cccccc" cellspacing=1>
<tr style="background-color:#efefef;font-weight:bold;text-align:center"><td width="33%" align="center">Client Name</td><td width="20%">Sign up Date</td>
 <td width="12%">IP</td>
 <td width="35%">Host</td>
</tr>
{php}
$sql = 'SELECT *  FROM `tblclients` ORDER BY `tblclients`.`datecreated`  DESC limit 10';
$result=mysql_query($sql) or die(mysql_error());  
//-create  while loop and loop through result set 
 while($row=mysql_fetch_array($result)){ 
    $name =$row['firstname']; 
    $surname =$row['lastname']; 
    $datecreated =$row['datecreated'];
    $id =$row['id'];
    $ip =$row['ip'];
    $host =$row['host'];
    print '<tr bgcolor="#ffffff"><td align="center"><a href="clientssummary.php?userid='.$id.'"/>'.$name.' '.$surname.'</a></td><td align="center">'.$datecreated.'</td>
      <td align="center">'.$ip.'</td>
      <td align="center">'.$host.'</td>
    </tr>';
 }
 {/php}
</table>

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated