<?php
 	session_start();
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);	

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

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

	//$umid=$_SESSION['umid'];
	
	 $collegemid = $_POST['collegemid'];
	
	 $eve23 = "select * from res_contact_master where clinkid=$collegemid and clinktype='College'";
	$re23 = mysqli_query($conn, $eve23);
	while($rt23 = mysqli_fetch_assoc($re23))
	{
		$scaddress1=$rt23['caddress1'];
		$scaddress2=$rt23['caddress2'];
		$sccountry=$rt23['ccountry'];
		$scstate=$rt23['cstate'];
		$sccity=$rt23['ccity'];
		$scarea=$rt23['carea'];
		$scpostalcode=$rt23['cpostalcode'];
		$sccompanyname=$rt23['ccompanyname'];
	}
	$scontactname=str_replace ("'","\'",$_POST['scontactname']);
	$scontactname=str_replace ('"','\"',$scontactname);
	
	$scmiddlename=str_replace ("'","\'",$_POST['scmiddlename']);
	$scmiddlename=str_replace ('"','\"',$scmiddlename);
	
	$scsurname=str_replace ("'","\'",$_POST['scsurname']);
	$scsurname=str_replace ('"','\"',$scsurname);
	
		$scontactnumber=str_replace ("'","\'",$_POST['scontactnumber']);
	$scontactnumber=str_replace ('"','\"',$scontactnumber);
	$smobilecode=$_POST['smobilecode'];
	$scontactnumber=$smobilecode."".$scontactnumber;
	$scmobilenumber=str_replace ("'","\'",$_POST['scmobilenumber']);
	$scmobilenumber=str_replace ('"','\"',$scmobilenumber);
	$shomemobilecode=$_POST['shomemobilecode'];
	$scmobilenumber=$shomemobilecode."".$scmobilenumber;
	$scontactemail=str_replace ("'","\'",$_POST['scontactemail']);
	$scontactemail=str_replace ('"','\"',$scontactemail);
	$scaltenateemail=str_replace ("'","\'",$_POST['scaltenateemail']);
	$scaltenateemail=str_replace ('"','\"',$scaltenateemail);
	$scontactdepartmnet=str_replace ("'","\'",$_POST['scontactdepartmnet']);
	$scontactdepartmnet=str_replace ('"','\"',$scontactdepartmnet);
	$scposition=str_replace ("'","\'",$_POST['scposition']);
	$scposition=str_replace ('"','\"',$scposition);
	$scremarks=str_replace ("'","\'",$_POST['scremarks']);
	$scremarks=str_replace ('"','\"',$scremarks);
	
	
	$scmsgappname=str_replace ("'","\'",$_POST['scmsgappname']);
	$scmsgappname=str_replace ('"','\"',$scmsgappname);
	
	$scmsgappid=$_POST['scmsgappid'];
	$contacttype=$_POST['contacttype'];
	
	
	$scvideoappname=str_replace ("'","\'",$_POST['scvideoappname']);
	$scvideoappname=str_replace ('"','\"',$scvideoappname);
	
	$scvideoappid=$_POST['scvideoappid'];
	
	
	
	
	
	
	
			
			
			
			 $eve3 = "INSERT INTO res_contact_master (contactname, contactemail,contactnumber,cmobilenumber,contactdepartmnet,cposition,cremarks,caltenateemail,caddress1,caddress2,ccountry,cstate,ccity,carea,cpostalcode,cmiddlename,csurname,cmsgappname,cmsgappid,cvideoappname,cvideoappid,ccompanyname,clinktype,clinkid,contacttype) VALUES('$scontactname','$scontactemail','$scontactnumber','$scmobilenumber','$scontactdepartmnet','$scposition','$scremarks','$scaltenateemail','$scaddress1','$scaddress2','$sccountry','$scstate','$sccity','$scarea','$scpostalcode','$scmiddlename','$scsurname','$scmsgappname','$scmsgappid','$scvideoappname','$scvideoappid','$sccompanyname','College','$collegemid','$contacttype')";
			
		
		$re3 = mysqli_query($conn, $eve3);
			
		
		
		
		
		
		header('Location: collegedetail.php?id='.$collegemid);
	
?>