<? ob_start();
session_start();
require_once("../dbconnect.php");
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<? require_once("title.php"); ?>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="ajaxvalid.js"></script>
<style type="text/css">
   .select1, .ul1 { height: 150px; overflow: auto; width: 300px; border: 1px solid #000; }
   .ul1 { list-style-type: none; margin: 0; padding: 0; overflow-x: hidden; }
   .li1 { margin: 0; padding: 0; }
   .label1 { display: block; color: WindowText; background-color: Window; margin: 0; padding: 0; width: 100%; }
   .label1:hover { background-color: Highlight; color: HighlightText; }
  .style3 {font-weight: bold}
</style>
  
  <script>
  function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
    }
  </script>
  <script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce_src.js"></script>
<script type='text/javascript'>

      tinyMCE.init({mode : "exact",theme : "advanced",width: 450, height:350,
      theme_advanced_toolbar_align : "justify",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,fontselect,fontsizeselect",
      elements : "message",theme_advanced_toolbar_location : "top"});
</script>


</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><? require_once("header.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            
              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="30" class="cate_pro">Email Organizer</td>
                      <td>&nbsp;</td>
                      <td class="index_text" align="right">&nbsp;</td>
                      <td width="20">&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td>
				<? if($_GET['suc']=="suc"){?>
				<table width="70%" align="center" cellpadding="0" cellspacing="0">
                
                  <tr>
				  <td><span class="style3">Email(s) sent successfully </span>&nbsp; <a href="emailorganizer.php">
				  <img src="images/button_send_mail.gif" border="0" />
				  </a>				  </td>
				  </tr>
				   
				  
				 
				
				  
				  </table>
				
				
				<? } else {?>
				<table width="70%" align="center" cellpadding="0" cellspacing="0">
                
                  <tr>
                    <td>
                       <form name="frm" action="bulk.php?action=sendemail" method="post">
                    <table border="0" cellpadding="2" cellspacing="0" width="100%">
                        <tbody>
                          <tr>
                            
                            <td><table border="0" cellpadding="0" cellspacing="0">
                                <tbody>
                                  <tr>
                                    <td colspan="2"><img src="http://localhost/zen/zen/admin/<? echo $baseurl; ?>images/pixel_trans.gif" alt="" border="0" width="1" height="10" /></td>
                                  </tr>
                                  <tr>
                                    <td width="132"><strong>Customers :</strong></td>
                                    <td width="547">
								<?php	$sql = "Select * from bulkemail where Status=1"; 
								        $catres = mysql_query($sql); 
										
										
										
								?>
									 
		 
		 
		 <input name="fav" id="fav" value="" type="checkbox"  onclick="checkUncheckAll(this);" />                     
								
         <span class="style3">Check All</span> 
         <ul class="ul1">
   <li class="li1">
    <? while($catrow=mysql_fetch_array($catres))
	                                    {?>
      <label class="label1"  for="chk1">
	 
	 <input type="checkbox" name="email[]" value="<?=$catrow["email"]?>" id="email"><?=$catrow["email"]; ?>
	  </label>
	   <? } ?>
   </li>
</ul><strong style="color:#F00;"><?= $_GET['msg'];?></strong>                                  </td>
                                  </tr>
                                  <tr>
                                    <td colspan="2"><img src="http://localhost/zen/zen/admin/<? echo $baseurl; ?>images/pixel_trans.gif" alt="" border="0" width="1" height="10" /></td>
                                  </tr>
								  <tr><td>&nbsp;</td></tr>
								 
                                  <tr>
                                    <td colspan="2"><img src="http://localhost/zen/zen/admin/<? echo $baseurl; ?>images/pixel_trans.gif" alt="" border="0" width="1" height="10" /></td>
                                  </tr>
                                  <tr>
                                    <td><strong>Subject:</strong></td>
                                    <td>
									<textarea id="message" name="message" rows="20" cols="75"></textarea>									</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2"></td>
                                  </tr>
                                  <tr>
                                    <td colspan="2"></td>
                                  </tr>
                                  <tr>
                                    <td valign="top">&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>
								  <tr>
                                    <td valign="top">&nbsp;</td>
                                    <td><span style="padding-left:60px;">
                                      <input name="image" type="image"  onclick="return DoTheCheck();" src="images/button_send_mail.gif" />
                                      <a href="emailorganizer.php"><img src="images/button_cancel.gif" alt=" " border="0"/></a></span></td>
                                  </tr>
                                  <tr>
                                    <td colspan="2"></td>
                                  </tr>
                                  <tr>
                                    <td colspan="2" align="left" style="padding-left:60px;"><a href="coupons.php"></a>                </td>
                                  </tr>
                                </tbody>
                            </table></td>
                          </tr>
                        </tbody>
                    </table>
                    </form>
                    </td>
                  </tr>
                </table>               
				
				<? } ?>
				
				 </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>

          <tr>
            <td><? require_once("footer.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp; </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
