<?php
	include 'connection.php';
	error_reporting(0);
	$number=rand(1111,9999);
	$random="DGRC/RAN/";
	$grievance_id=$random.$number;
	$phone=$_POST['t1'];
	$altphone=$_POST['t4'];
	$fname=ucwords($_POST['ta2']);
	$mname=ucwords($_POST['tb2']);
	$lname=ucwords($_POST['tc2']);
	$gname=ucwords($_POST['t3']);
	$email=$_POST['t5'];
	$gender=$_POST['t6'];
	$aadhar=$_POST['t7'];
	$area=$_POST['t10'];
	$dist=$_POST['t8'];
	$occupation=$_POST['t9'];
	$muncipiltiy=$_POST['t11'];
	$block=$_POST['t12'];
	$panchayat=$_POST['t13'];
	$vill=$_POST['vill'];
	$ward=$_POST['t15'];
	$landmark=$_POST['t16'];
	$ps=$_POST['t17'];
	$vs=$_POST['t18'];
	$ls=$_POST['t19'];
	$complaint_mode=$_POST['t20'];
	$call_nature=$_POST['t21'];
	$desc=$_POST['t22'];
	$c_area=$_POST['c1'];
	$c_muncipility=$_POST['c2'];
	$c_block=$_POST['c3'];
	$c_panchayat=$_POST['c4'];
	$c_village=$_POST['c5'];
	$c_ward=$_POST['c6'];
	$c_landmark=$_POST['c7'];
	$date=date("Y-m-d");

	$query="INSERT INTO grievence_from(grievance_id,mobile,alternate_mobile,first_name,middle_name,last_name,guardian_name,email,gender,aadhar,district,occupation,area,muncipility,block,panchayat,village,ward,landmark,police_station,vidhan_sabha,lok_sabha,complain_mode,call_nature,c_area,c_muncipility,c_block,c_panchayat,c_village,c_ward,c_landmark,description,reg_date) 
	VALUES('$grievance_id','$phone','$altphone','$fname','$mname','$lname','$gname','$email','$gender','$aadhar','$dist','$occupation','$area','$muncipiltiy','$block','$panchayat','$vill','$ward','$landmark','$ps','$vs','$ls','$complaint_mode','$call_nature','$c_area','$c_muncipility','$c_block','$c_panchayat','$c_village','$c_ward','$c_landmark','$desc','$date')";
	if (mysqli_query($con,$query)) {
		echo "Data Insert";
	}
	else{
		echo "something wrong";
	}

?>