Location: PHPKode > projects > NmnNewsletter > NmnNewsletter1.0.8/waitingList.php
<?php
		/*
    NmnNewsletter is a library that provides newsletter service 
	management for websites running php and mysql.
    Copyright (C) 2006  Ivan Preziosi from netmeans.net - Rome.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

    For more informations or to join the development of the library contact
    the author at: hide@address.com
    */
	require_once("includes/config.php");
	sessCtrl();
	require_once("includes/CalcDate.php");

	$subscribers = NewsletterUsers::getWaitingList();
	
	

	
	if($_GET["action"] == "delete")
	{	
		if (NewsletterUsers::deleteUser($_GET["id_to_del"])){
			$msg = "<div class=message>".WAITING_LIST_DELETE_OK."</div><br>";
		}else{
			$msg = "<div class=message>".WAITING_LIST_DELETE_KO."</div><br>";
		}

		$subscribers = NewsletterUsers::getWaitingList(true);
		
	}

		if($_GET["action"] == "confirm")
	{	
		if (NewsletterUsers::confirmSubscription($_GET["id_to_conf"],sha1($_GET["id_to_conf"].ENC_KEY))){
			$msg = "<div class=message>".WAITING_LIST_CONFIRM_OK."</div><br>";
		}else{
			$msg = "<div class=message>".WAITING_LIST_CONFIRM_KO."</div><br>";
		}

		$subscribers = NewsletterUsers::getWaitingList(true);
		
	}


	

	$main .= "
			<div class=page_heading>".WAITING_LIST_TITLE."</div>
			$msg
			<table width=95%>
			<tr>
			<td align=right>
			<span ><a href=\"subscribers.php\">".WAITING_LIST_SUBSCRIBERS_LINK."</a></span>
				</td>

			 </tr>
			

			
			 <tr>
				<td align=center>
				<div class=page_heading>".WAITING_LIST_SUBTITLE."</div><br>
				";



					foreach ($subscribers as $idSubscriber => $subscriber){
						$datediff = '';

						$CalcDateObject = new CalcDate(); 
						$timestamp = $CalcDateObject->CalculateTimestampFromCurrDatetime($subscriber[1]);
						$dateDiff = $CalcDateObject->CalculateDateDifference($timestamp); 


						$main .= "<div style='border-bottom:1px solid #DFE8FF;'><table width=95%><tr><td colspan='2' >$subscriber[0]</td></tr><tr><td align='left'>".WAITING_LIST_CONFIRMATION_SENT_ON." $subscriber[1] (".$dateDiff['days']." ".WAITING_LIST_CONFIRMATION_DAYS.")</td><td align=\"right\"> | [<a href=\"javascript:confirmClick('Are you shure you want to delete this subscriber?','waitingList.php?action=delete&id_to_del=$idSubscriber');\">".WAITING_LIST_DELETE_LINK."</a>] | [<a href=\"javascript:confirmClick('".WAITING_LIST_CONFIRM_TEXT."?','waitingList.php?action=confirm&id_to_conf=$idSubscriber');\">".WAITING_LIST_CONFIRM_LINK."</a>]</td></tr></table></div>";
					}
					
				
				
			 $main .= "<br><br>
			 <input type=hidden name=action value=delete>
		
			 
			 </td>
			 </tr>
			 </table>";
	
	$page = "subscribers";
	require_once("includes/template.php");
?>
Return current item: NmnNewsletter