<?php ob_start(); session_start();include("session.php");require_once('dbcon.php');

	$id = $session_id;
	//echo $id;
	
	
	$sql = "delete from airtime_contacts where customer_id = '$id' ";
	$result = mysql_query($sql) or die (mysql_error());
	 
	if($result)
	{
		echo '
			<script type="text/javascript"> alert("All Contacts Deleted. Please Upload New Contacts."); window.location = "addnewcontact.php";</script>
		';
		
		$qry = mysql_query("select * from airtime_logs where id = '$session_lid' ");
		$sdata=mysql_fetch_array($qry);
		$actions=$sdata['user_actions'];
		mysql_query("update airtime_logs set user_actions = '$actions Deleted all contacts from Contacts List.' where id = '$session_lid' "); 
	}
	else
	{
		echo '
			<script type="text/javascript"> alert("Error Deleting Contacts. Please try Again."); window.location = "addnewcontact.php";</script>
		';
	}




?>