<?
ob_start();
session_start();
if($_SESSION['uname']=='' || $_SESSION['pwd']=='')
		{
			header("location:login.php");
		}
 	include("../include/db.inc.php");
 	include("../include/pager.php");	
 
   $db1=new db;
   $db1->open();
    mysql_query("SET NAMES 'utf8'");
   if($_GET['del']){
		
		   $del_query=mysql_query("delete from t123go_newsletter where nid=".$_GET['del']);
			
		}
		$sql_news="select * from t123go_newsletter order by submit_date DESC";
		$sel_query=mysql_query(dopaging($sql_news,10));	
   
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>NEWADMIN</title>
<script language="JavaScript" src="../js/common.js"></script>
<link href="../css/stylesheet.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
	function newsletter_veiw(id){
		window.open('newsletter_view.php?id='+id,'','width=650,height=450,top=50,left=280');		
	}
</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/back.jpg" style="background-position:top; background-repeat:repeat-x" >

<div class="admin_wrapper">
<div class="logo_show"><? include("minorlogout.php");?></div>
<div style="float:left; width:200px">
<div class="topg_links_show"><? include("left.php");	?></div>
<div class="top_links_show"><? include("belowleft1.php");	?></div></div>
<div style="float:left; width:800px">
<div class="maximum">


<!-- ImageReady Slices (NEWADMIN.psd) -->
<table id="Table_01" width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
	<tr>
		<td colspan="2" align="center" valign="top"><? //include("header.php");?></td>
	</tr>
    <tr>
		<?php /*?><td valign="top" align="center" width="190px" ><? include("left.php");?></td><?php */?>
	    <td width="85%" bgcolor="#FFFFFF" valign="top">
<table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="15" valign="top">&nbsp;</td>
          <td valign="top"><br> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
              <tr> 
                <td width="33" valign="top"><img src="img/03.gif" width="33" height="23"></td>
                 <td background="img/bg01.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="20%"><strong>NEWSLETTER LISTING</strong></td>
				<td width="22%" align="right"><a href="new_newsletter.php" class="link5" >Create New Newsletter</a></td>
				</tr>
                  </table></td>
                <td width="35"><img src="img/04.gif" width="35" height="23"></td>
              </tr>
            </table>
            <table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
              <tr> 
                <td width="22" valign="top" background="img/tbl-left04.gif"><img src="img/tbl-left04.gif" width="22" height="13"></td>
                <td valign="top" align="center"><br> 
                  <form action="" method="post">
                    <table width="100%" border="1" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#FED267">
                      <tr bgcolor="#FED267"> 
                        <td width="40%" height="20" style="padding-left:2px">&nbsp;&nbsp; 
                          <strong><font color="#FFFFFF">Subject</font></strong> </td>
						   <td width="16%" align="center"><strong><font color="#FFFFFF">Send Newsletter</font></strong></td>
                        <td width="20%" align="center"><strong><font color="#FFFFFF">Date</font></strong></td>
                        <td width="12%" align="center"><strong><font color="#FFFFFF">Edit</font></strong></td>
                        <td width="12%" align="center" height="20"><strong><font color="#FFFFFF">Delete</font></strong></td>
                      </tr>
                      <? 
					  $i=1;
					 
				while($myrow=mysql_fetch_array($sel_query)){
				
					
			?>
                      <tr <?php /*?><? if($i%2==0)echo 'bgcolor="#E6E4E3"';?><?php */?> onMouseOver="this.style.backgroundColor='#FFECBF'" onMouseOut="this.style.backgroundColor='#ffffff'"> 
                        <td style="padding-left:2px">&nbsp;&nbsp;<a href="javascript:newsletter_veiw(<?=$myrow['nid']?>)" class="link2"><? echo $myrow['subject'];?></a> 
                        </td>
						 <td align="center"> 
                          <a href="newsletter_user.php?letter=<?=$myrow['nid']?>">Send Newsletter</a>
                        </td>
                        <td align="center"> 
                          <?=$myrow['submit_date'];?>
                        </td>
                        <td align="center"><a href="newsletter_edit.php?id=<?=$myrow['nid']?>" class="link5">Edit</a></td>
                        <td align="center"><a href="newsletter_list.php?del=<?=$myrow['nid']?>" onClick="return confirm('Are you sure to delete this Newsletter ?');"><img src="../images/category/imgdelete.gif" border="0"></a> 
                          
                        </td>
                      </tr>
                     <?
				$i++;
			}	// end of while loop
		
			if(rightpaging()){	// if there are more than one pages then only display paging
		?>
				<tr>
					<td colspan="3" align="center"><br><? echo rightpaging(); ?></td>
				</tr>
		<?
			}	// end of paging display
		?>
                    </table>
                    
                  </form>
				  
                  
                  <br> </td>
                <td width="19" valign="top" background="img/tbl-right04.gif"><img src="img/tbl-right04.gif" width="19" height="9"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
              <tr> 
                <td width="33"><img src="img/tbl-bot01.gif" width="33" height="12"></td>
                <td  width="709" align="right" background="img/tbl-bg.gif"></td>
                <td width="33"><img src="img/tbl-right05.gif" width="35" height="12"></td>
              </tr>
            </table>
            
            
           
          </td>
          <td width="15" valign="top">&nbsp;</td>
        </tr>
      </table>
        </td>
    </tr>
    <tr>	</tr>
</table>
	</div></div>
<div class="bottom_links_show"><? include("footer.php");	?></div>
</div>

<!-- End ImageReady Slices -->
</body>
</html>