<?php
 	session_start(); 

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}



$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");

	
	//$collegetypename=$_POST['collegetypename'];
	$collegetypename=str_replace ("'","\'",$_POST['collegetypename']);
	$collegetypename=str_replace ('"','\"',$collegetypename);
	
	
	$attechment="";
	/* if(empty($_FILES['attechment']['name']) == false  )
	{
		$attechment = date("YmdHis").$_FILES['attechment']['name'];
		$path = "docs/";
		move_uploaded_file( $_FILES['attechment']['tmp_name'], $path ."/". $attechment );
	
	}
	 */
	
	
		
	
		$eve1 = "INSERT INTO res_collegetype_master (collegetypename) VALUES('$collegetypename')";
		$re1 = mysqli_query($conn, $eve1);
		
			$delete_checkbox_array = $_POST['pname'];
		
			foreach ($delete_checkbox_array as $one_by_one_sid) 
			{
				$pname=$one_by_one_sid;
					
				$pdepartment=$_POST['pdepartment'][$n];
				$pemail=$_POST['pemail'][$n];
				$pmobile=$_POST['pmobile'][$n];
				$n = $n + 1;
			
				
				if($pname=='')
				{
				}
				else
				{	
					$eve2="insert into res_mobile_detail (bumid,pname,pdepartment,pemail,pmobile) values($last_id,'$pname','$pdepartment','$pemail','$pmobile')";
					$re2 = mysqli_query($conn, $eve2);
				}	
				
			}	
		
	
	
?>