<?php
include_once 'connection.php';
if(isset($_POST['submit']))
{	 
    $initial = $_POST['initial'];
	 $first_name = $_POST['first_name'];
	 $middle = $_POST['middle'];
	 $last_name = $_POST['last_name'];
	 $organization = $_POST['organization'];
	 $designation = $_POST['designation'];
	 $address = $_POST['address'];
	 $city = $_POST['city'];
	 $state = $_POST['state'];
	 $country = $_POST['country'];
	 $pincode = $_POST['pincode'];
	 $contact_no = $_POST['contact_no'];
	 $email = $_POST['email'];
	 $mmc_id = $_POST['mmc_id'];

	 $payment_date = $_POST['payment_date'];
	 $amount = $_POST['amount'];
	 $transaction_details = $_POST['transaction_details'];
	//  $created_at= date("Y-m-d H:i:s");
	$checkbox1 = $_POST['conference_package'];
	$member_type = $_POST['member_type'];
	$member_type2 = $_POST['member_type2'];
	$room_type = $_POST['room_type'];
	$total_days = $_POST['total_days'];
	$payment_mode = $_POST['payment_mode'];
	// $payment_date= date("Y-m-d H:i:s");
	$chk="";  
    foreach($checkbox1 as $chk1)  
       {  
          $chk.= $chk1.",";  
       }
	 $sql = "INSERT INTO registration(initial,first_name,middle,last_name,organization,designation,address,city,state,country,pincode,contact_no,email,mmc_id,payment_date,amount,transaction_details,conference_package,member_type,member_type2,room_type,total_days,payment_mode)
	 VALUES ('$initial','$first_name','$middle','$last_name','$organization','$designation','$address','$city','$state','$country','$pincode','$contact_no','$email','$mmc_id','$payment_date','$amount','$transaction_details','$chk','$member_type','$member_type2','$room_type','$total_days','$payment_mode')";
	 if (mysqli_query($conn, $sql)) {
		
	 } else {
		echo "Error: " . $sql . "
" . mysqli_error($conn);
	 }
	 mysqli_close($conn);
	 header("Location:thankyou.php");
}
?>