<?php

	session_start();

	$session_id = $_SESSION['ses_acc_id'];

	session_write_close();

  	include("../config/mysql_connect.php");

  	$del_id = $_REQUEST['id'];

  	$strSQL = "SELECT * FROM tb_number WHERE num_id='$del_id'";
	$objQuery = mysqli_query($link,$strSQL);
	$Result_acc = mysqli_fetch_array($objQuery);
	$num_type = $Result_acc['num_type'];

  	$sql_del = "delete from tb_number where num_id='$del_id' and acc_id='$session_id'";
	$objQuery = mysqli_query($link,$sql_del);

	if($objQuery){

		if($num_type == 'a'){
			echo "<meta http-equiv=refresh content=0;url=page1.php>";
		}
		elseif($num_type == 'b'){
			echo "<meta http-equiv=refresh content=0;url=page2.php>";
		}
		elseif($num_type == 'c'){
			echo "<meta http-equiv=refresh content=0;url=page3.php>";
		}
		else{
			echo "<meta http-equiv=refresh content=0;url=page4.php>";
		}

	}

	else{
		echo "<div class='alert alert-danger'>
		<button type='button' class='close' data-dismiss='alert'>&times;</button>
		<strong>Alerts!</strong> ล้มเหลว </div>";
	}

?>