Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N
<?php
require('vicidial/dbconnect.php');
$ct=0;
if (isset($_POST['list_id'])) {
print '<a href="orphan_lists.php?list_id=' . $_POST['list_id'] . '">Click to delete orphan list ' . $_POST['list_id'] . '</a><br><br>';
}
if (isset($_GET['list_id'])) {
mysql_query('delete vicidial_list.* from vicidial_list where list_id=' . $_GET['list_id']);
print 'Orphan list ' . $_GET['list_id'] . ' has been deleted.<br><br>';
}
print '<h3>Orphan Lists</h3>';
$rows=mysql_query('select vicidial_list.list_id,count(lead_id) as lead_count from vicidial_list left join vicidial_lists on ' .
'vicidial_list.list_id=vicidial_lists.list_id where vicidial_lists.list_id is null group by vicidial_list.list_id ' .
'order by vicidial_list.list_id');
while ($row=mysql_fetch_assoc($rows)) {
if ($ct==0) print '<table><tr><td style="background-color:#BBBBBB">List ID</td>' .
'<td style="background-color:#BBBBBB">Lead Count</td><td style="background-color:#BBBBBB"> </td></tr>';
print '<tr><td>' . $row['list_id'] . '</td><td>' . $row['lead_count'] .
'<td><form style="margin-top:0;margin-bottom:0" method=post><input type=hidden name="list_id" value=' . $row['list_id'] .
'><input type=submit value=Delete></form>' .
'</td></tr>';
$ct++;
}
print ($ct==0 ? '<b>There are no orphan lists.</b><br>' : '</table>');
?>
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
$list_id = ereg_replace("[^0-9]","",$list_id);
Users browsing this forum: Bing [Bot] and 61 guests