<?php
//include "../../authheader.php";
if($block != true)
{
?>
<?php
$isdel = $_POST['daina'];
$groupn = $_POST['delgroup'];
$delmess = $_POST['delids'];
include "header.txt";
//$link = mysql_connect($hostn, $usern,$passn);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname,$link);
?>
<html>
<head>
<!-- Welcome to the scripts database of HIOX INDIA -->
<!-- This tool is developed and a copyright -->
<!-- product of HIOX INDIA. -->
<!-- For more information visit http://www.hscripts.com -->
<style>
.cent{ TEXT-DECORATION: none; font-family: san-serif; font-weight: 600; color: #ffffff; font-size: 17px; height: 22px;}
.cent:hover{TEXT-DECORATION: none; color: #000000;}
</style>
<script language=javascript>
function change(sss)
{
document.delf.submit();
}
</script>
</head>
</td></tr>
<tr align=center height=90% width=100% bgcolor="#0f7f0f">
<td align=center width=100%>
<div style="height: 100%;">
<table width=100% height=100% align=center border=0>
<tr height=100%>
<?php
if($delmess != "" && $delmess != null)
{
$tok = strtok($delmess, ":");
echo "<td bgcolor=#efefef><table>";
while($tok)
{
$qers = "delete from mailid where name like '$tok%'";
//echo $qers;
$result = mysql_query($qers,$link);
if($result)
{
echo "<tr><td><div align=center style=\"color: #9a9a9a;\">$tok</div></td>";
echo "<td bgcolor=green> Deleted </td></tr>";
}
else
{
echo "<tr><td><div align=center style=\"color: #9a9a9a;\">$tok</div></td>";
echo "<td bgcolor=red> Not-Deleted </td></tr>";
}
$tok = strtok(":");
}
echo "</table></td>";
}
?>
<td align=center width=60% style="border: 2px #47a985 solid;" align=center bgcolor="#efffef">
<table align=center width=80% style="color: #888888; font-weight: bold; padding-left: 10%;" border=0>
<tr><td align=center>
<br><br>
<form name=delf method=post action="deletemail.php">
Choose A Group
<?php
$qer = "select * from groupname";
//echo($qer);
$result = mysql_query($qer,$link);
echo "<select name=delgroup onChange=change(this)>";
echo "<option>-</option>";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
foreach ($line as $col_value)
{
if($col_value != "")
{
if($col_value == $groupn)
echo "<option selected>$col_value</option>";
else
echo "<option>$col_value</option>";
}
}
}
echo "</select>";
?>
</form>
</td></tr>
<tr valign=top><td valign=top align=center>
<table valign=top align=center><tr>
<td valign=top>
<font color=red>Existing MailID</font><br>
<form name=exmail>
<select name=xxx multiple size=15 style="width:150;">
<?php
$str = "select name from mailid where groupn like '$groupn'";
$result = mysql_query($str,$link);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
foreach ($line as $col_value)
{
echo("<option name=".$col_value." value=".$col_value.">".$col_value."</option>");
}
}
?>
</select>
</form>
</td>
<td>
<form>
<input type=button value=">>" onclick=moveoutid()><br>
<input type=button value="<<" onclick=moveinid()>
</form>
</td>
<td>
<font color=red>MailID To Delete</font><br>
<form name=eymail method=post action="deletemail.php">
<select name=yyy multiple size=15 style="width:150;">
</select>
</form>
</td>
</tr></table>
<!-- Mailid Moving Javascript Code -->
<script language=javascript>
function moveoutid()
{
var sda = document.exmail.xxx;
var len = sda.length;
var sda1 = document.eymail.yyy;
for(var j=0; j<len; j++)
{
if(sda[j].selected)
{
var opti= sda.getElementsByTagName("option").item(j);
sda1.appendChild(opti);
sda.removeChild(opti);
}
}
}
function moveinid()
{
var sda = document.exmail.xxx;
var sda1 = document.eymail.yyy;
var len = sda1.length;
for(var j=0; j<len; j++)
{
if(sda1[j].selected)
{
var opti= sda1.getElementsByTagName("option").item(j);
sda.appendChild(opti);
sda1.removeChild(opti);
}
}
}
</script>
<!-- Mailid Moving Javascript Code -->
</td></tr>
<tr><td align=center>
<form name=delma method=post action="deletemail.php" onsubmit="setid()">
<input type=hidden name=delids value="">
<input type=hidden name=daina value="daina">
<input type=submit value=" DELETE "
style="background-color: red; color: #adada3; width: 65px; border: #451023 px outset;">
</form>
<script language=javascript>
var name = "";
function setid()
{
var sdsa = document.eymail.yyy;
var lean = sdsa.length;
for(var j=0; j<lean; j++)
{
name=name+":"+sdsa[j].value;
}
document.delma.delids.value= name;
}
</script>
</td></tr>
</table>
</td>
<?php
//Second row second column
include "links.txt";
?>
</tr>
</table>
</div>
</td></tr></table>
</body>
</html>
<?php
}
?>