<?php
include_once("../include/main.inc.php");
check_session('MyCpanel','index.php');
?>
<script type="text/javascript">
function chk_valid_date() {
	if (document.bannerFrm.validFrom.value==0) {
		alert("Please select Validity Period");
		return false;
	}
	if (document.bannerFrm.validTo.value==0) {
		alert("Please select Validity Period");
		return false;
	}
}
</script>
<?php
################ Paging Starts From Here ##################
@extract($_REQUEST);
$start = (intval($start)<0 or $start=="")?0:$start;
$pagesize = intval($pagesize)==0?$pagesize=20:$pagesize;

$heading="Manage Newletter";
$record_type="mail";
$script_name="manage_emails.php";
$table_name="mailer_list";
$table_name1="member_tbl";
####################################################



admin_header("");
?>
<h3>Manage Newletter - Active</h3>
<table width="100%"  border="0" cellpadding="0" cellspacing="2">
 <tr>
  <td align="center"><input type="button" class="button" value="Add New Mailers" onclick="window.location.href='http://www.naturaltherapypages.in/sitepanel/add-new-mail.php';"></td><br><br><br>
 </tr>
</table><br />
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">


	 <form name="pg_form" action="<?=$PHP_SELF?>" method="post" style="margin:0px;padding:0px;">

	
	   <?



	$urlqry=mysql_query("select * from mailer_list where status='I' ORDER BY mailer_id");

    while($urlres=mysql_fetch_array($urlqry)) {
$mailer_id=$urlres[mailer_id];

$mailer_country=$urlres[country]; 
$member_Type=$urlres[memberType];
$keyword=$urlres[keyword];
	?>
<tr  bgcolor="#f9f9f9">
	  <td align="left"></td>
	  <td align="left" class="">
	   <b><?=$urlres['mailer_title'];?> - <?=$urlres['mailer_id'];?></b>
	   	  </td>
	 
	
	 
	  <td class="" align="left">
	   <?
       
 $allsqlpro=NumRows(db_query("select mailID from mass_mail where mailerID='$mailer_id'"));
 $allsqlpro1=NumRows(db_query("select mailID from mass_mail where status='N' and mailerID='$mailer_id'"));
  $allsqlpro2=NumRows(db_query("select mailID from mass_mail where status='Y' and mailerID='$mailer_id'"));
 ?>
                  
                   <a href="add-new-mail.php?id=delete_record&mailer_id=<?=$mailer_id;?>" onClick="return confirm('Are you sure to delete this mailer...');"><img src="images/cancel.gif" alt="Delete This Mailer" title="Delete This Category" border="0"></a>

               <a href="sent-newsletter.php?mailer_id=<?=$mailer_id;?>" onClick="return confirm('Are you sure You want to send this mail');">Sent Email  </a> Total=<?=$allsqlpro;?> | Pending=<?=$allsqlpro1;?> | Mail Sent=<?=$allsqlpro2;?>
               
      
	   	  
	  </td>
	 </tr>
	 
	 <?
 }
	//header('Refresh: 0.1');      

	



     



?>

	

	<table width="100%"  border="0" cellpadding="0" cellspacing="2">
 <tr><br><br><br>
  <td align="center"><input type="button" class="button" value="Add New Mailers" onclick="window.location.href='http://www.naturaltherapypages.in/sitepanel/add-new-mail.php';"></td>
 </tr>
</table><br />

	   
</table>





<?php

admin_footer();	

exit;

?>
