jasonhk Posted March 8, 2009 Share Posted March 8, 2009 Something I remembered that was in Clientexec. I just coded this. Edit whmcs\admin\templates\homepage.tpl, you can put it after the network status table look for the </table> part and paste this. <h1>Last 5 Client Logins</h1> <table width=100% bgcolor="#cccccc" cellspacing=1> <tr style="background-color:#efefef;font-weight:bold;text-align:center"><td align="center">Client Name</td><td>Login Date/Time</td></tr> {php} $sql = 'SELECT * FROM `tblclients` ORDER BY `tblclients`.`lastlogin` DESC limit 5'; $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']; $lastlogin =$row['lastlogin']; $id =$row['id']; print '<tr bgcolor="#ffffff"><td align="center"><a href="clientssummary.php?userid='.$id.'"/>'.$name.' '.$surname.'</a></td><td align="center">'.$lastlogin.'</td></tr>'; } {/php} </table> 0 Quote Link to comment Share on other sites More sharing options...
Seb Posted March 8, 2009 Share Posted March 8, 2009 Works great - thanks very much. 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted March 8, 2009 Share Posted March 8, 2009 Very nice. Thank you! 0 Quote Link to comment Share on other sites More sharing options...
R-n-R Posted March 10, 2009 Share Posted March 10, 2009 You know, I really didn't realize how much I used this until I switched from CE to WHMCS. thank's for this, its great. 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted March 10, 2009 Share Posted March 10, 2009 Very nice... 0 Quote Link to comment Share on other sites More sharing options...
readywire Posted March 10, 2009 Share Posted March 10, 2009 I love it! Thanks for the contribution. 0 Quote Link to comment Share on other sites More sharing options...
mojowill Posted March 10, 2009 Share Posted March 10, 2009 nice and simple addition thanks! 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 10, 2009 Author Share Posted March 10, 2009 Pleasure guys, anyone got a screenshot of this? I didn't make one because I would of had to blank out the client info.. but someone who has some time can 0 Quote Link to comment Share on other sites More sharing options...
R-n-R Posted March 10, 2009 Share Posted March 10, 2009 Here you go, I change my code to reflect the last 8, but you will get the idea. 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted March 11, 2009 Share Posted March 11, 2009 prefect! thank you!!! 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted March 11, 2009 Share Posted March 11, 2009 (edited) I changed it a little to show the newest clients. Here: http://forum.whmcs.com/showthread.php?p=95985 Tks jasonhk! Edited March 11, 2009 by Patty 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted March 11, 2009 Share Posted March 11, 2009 ops... sorry 0 Quote Link to comment Share on other sites More sharing options...
Alain Posted March 11, 2009 Share Posted March 11, 2009 Nice one, thanks. 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 11, 2009 Author Share Posted March 11, 2009 New version, changed to last 10, added IP and hostname. <h1>Last 10 Client Logins</h1> <table width=100% bgcolor="#cccccc" cellspacing=1> <tr style="background-color:#efefef;font-weight:bold;text-align:center"><td align="center">Client Name</td><td>Login Date/Time</td><td>IP</td><td>Host</td></tr> {php} $sql = 'SELECT * FROM `tblclients` ORDER BY `tblclients`.`lastlogin` 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']; $lastlogin =$row['lastlogin']; $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">'.$lastlogin.'</td><td align="center">'.$ip.'</td><td align="center">'.$host.'</td> </tr>'; } {/php} </table> 0 Quote Link to comment Share on other sites More sharing options...
mcraedesigns Posted March 11, 2009 Share Posted March 11, 2009 The simplest things are always the best. Works great. 0 Quote Link to comment Share on other sites More sharing options...
Impact-John Posted March 12, 2009 Share Posted March 12, 2009 very very nice i like the simple add ons that everyone comes up with they are great 0 Quote Link to comment Share on other sites More sharing options...
Svann Posted March 18, 2009 Share Posted March 18, 2009 nice , i like it 0 Quote Link to comment Share on other sites More sharing options...
joe123 Posted March 19, 2009 Share Posted March 19, 2009 this is a nice addition but for some reason it does not update the list , same 10 logins since i installed it . i have some clients opened support tickets from the client area but they are not on the list. 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 20, 2009 Author Share Posted March 20, 2009 this is a nice addition but for some reason it does not update the list , same 10 logins since i installed it . i have some clients opened support tickets from the client area but they are not on the list. Try clear the template cache.. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.