Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Identify Duplicate Accounts

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 08-30-2005, 10:28 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Identify Duplicate Accounts

Here's a Free mod to identify accounts with the same first and last name:
http://www.websitecm.com/store/customer/product.php?productid=98
Reply With Quote
  #2  
Old 03-18-2006, 10:59 AM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Default

Jon, i used your duplicate account script, great work, thank you for this.

I have a small problem, when i use this on 4.0.18 it works great but then when i go to the users, with this script still open in a new window, i have to re log into admin.

I get:
Main page :: Warning

Access denied !
You are not allowed to access that resource!

Error ID: 37

I presume you wrote this to show in a new window so you can go to the users in admin and delete the duplicate accounts.

So is there a way where i dont have to re log in as an admin.

Code is below you supplied, i posted it because you offer it free as well, hope you dont mind.

I of cause edited my shopcart/skin1/admin/menu_admin.tpl and yes i put in a _blank command to show in a new window, code below.


I have the duplicate_accounts.php in my shopcart/admin directory

Code:
<?php # # WebsiteCM.com - Free Script # This script will list duplicate accounts # require "./auth.php"; require $xcart_dir."/include/security.php"; echo " <font face=arial size=3>Duplicate Accounts by First and Last Name</font></p>"; $duplicates = func_query("select login,firstname,lastname,email,count(*) as duplicate from xcart_customers WHERE usertype='C' GROUP BY lastname,firstname ORDER BY duplicate DESC"); echo "<table border=0 cellpadding=3 cellspacing=2>"; echo "<tr>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>First Name</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Last Name</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Accounts</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Login Names</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Emails</font></td>"; echo "</tr>"; $bgcolor = ""; if (!empty($duplicates)) { foreach ($duplicates as $key=>$value) { if ($value[duplicate] > 1) { if ($bgcolor == "") { $bgcolor = "#EEEEEE"; } else { $bgcolor = ""; } $logins = func_query("select login from xcart_customers WHERE firstname='$value[firstname]' AND lastname = '$value[lastname]'"); $login_names = ""; foreach ($logins as $login) { $login_names .= $login[login] . " "; } $emails = func_query("select email from xcart_customers WHERE firstname='$value[firstname]' AND lastname = '$value[lastname]'"); $email_addys = ""; foreach ($emails as $email) { $email_addys .= $email[email] . " "; } echo "<tr>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[firstname] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[lastname] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[duplicate] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $login_names . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $email_addys . "</font></td>"; echo "</tr>"; } } } else { echo "<tr><td><font face=arial size=2>There are no duplicate accounts to list.</font></td></tr>"; } echo "</table>"; echo " <font face=arial size=3>Duplicate Accounts by Email Address</font></p>"; $duplicates = func_query("select login,firstname,lastname,email,count(*) as duplicate from xcart_customers WHERE usertype='C' GROUP BY email ORDER BY duplicate DESC"); echo "<table border=0 cellpadding=3 cellspacing=2>"; echo "<tr>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>First Name</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Last Name</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Accounts</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Login Names</font></td>"; echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Email</font></td>"; echo "</tr>"; $bgcolor = ""; if (!empty($duplicates)) { foreach ($duplicates as $key=>$value) { if ($value[duplicate] > 1) { if ($bgcolor == "") { $bgcolor = "#EEEEEE"; } else { $bgcolor = ""; } $logins = func_query("select login from xcart_customers WHERE email = '$value[email]'"); $login_names = ""; foreach ($logins as $login) { $login_names .= $login[login] . " "; } echo "<tr>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[firstname] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[lastname] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[duplicate] . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $login_names . "</font></td>"; echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[email] . "</font></td>"; echo "</tr>"; } } } else { echo "<tr><td><font face=arial size=2>There are no duplicate accounts to list.</font></td></tr>"; } echo "</table>"; ?>
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:10 AM.

   

 
X-Cart forums © 2001-2020