<?php ob_start(); session_start(); ?>
	<!DOCTYPE html>
	<html>
	<?php include "layouts/db_connect.php";
				
				
				if($_SESSION['uname']==""&&$_SESSION['pwd']=="")
				{
				
					header("location:index.php");
				}
				
	if(isset($_SESSION['code'])) {
	  $code = $_SESSION['code'];
	  $scode = $_SESSION['code'];
	   $mfin = $_SESSION['mfin'];
		$staff = $_SESSION['name'];
		 $postt = $_SESSION['postt'];
	}
							if(isset($_POST))
							{
							    extract($_POST);
			$name = strtoupper($name);
			$fname = strtoupper($fname);
			$profession = strtoupper($profession);
			$co = strtoupper($co);
			$co01 = strtoupper($co01);
			$co02 = strtoupper($co02);
			$coaland = strtoupper($coaland);
			$lmark = strtoupper($lmark);
			$address = strtoupper($address);
			$address1 = strtoupper($address1);
			$address2 = strtoupper($address2);
			$oaddress = strtoupper($oaddress);
			$oaddress1 = strtoupper($oaddress1);
			$oaddress2 = strtoupper($oaddress2);
			$cobname = strtoupper($cobname);
			$cobname2 = strtoupper($cobname2);
				$remarks = strtoupper($remarks);
			
							    $selected_date2=$hpdate;
		  	$selected_date=strtotime( $selected_date2 );
	
								
				$geo = $geo;
				if($geo!=NULL){
					$sql55 = mysqli_query($conn, "select * from geo where code='$geo'");
					$row55 = mysqli_fetch_array($sql55);
					$lat = $row55['lat'];
					$lang = $row55['lang'];
				}
						date_default_timezone_set('Asia/Kolkata');
$date33 = date('h:i:s a m/d/y');
$dddttt =  date('h:i:s a d/m/y', strtotime($date33));			
			
			
		
$upp1=$_FILES['upp1']['name'];
							$upp2=$_FILES['upp2']['name']; 
							$upp3=$_FILES['upp3']['name'];
							$nupp1=$_FILES['nupp1']['name'];
							$nupp2=$_FILES['nupp2']['name'];
							$nupp3=$_FILES['nupp3']['name'];
				
			$insert = mysqli_query($conn, "INSERT INTO mcust (  designation,gage,cage,sname,spnoresi2,dname,dpnoresi2,geooff,name, hpl, hplt, pno, spname, pnoresi, fname, pnoresi1, mname, pnoresi2, 
                                                                address, address1, address2, houserent, geo,ogeo, bba, pgramo, intert, rname, upp4, 
                                                                oaddress, oaddress1, oaddress2, refpno, rdate, area, dob, gi1, gg1, gi2, g2, 
                                                                upp1, upp2, upp3, lmark, rrname,mfin,nname, npno, nspname, npnoresi, nfname, npnoresi1, nmname, npnoresi2, 
                                                                naddress, naddress1, naddress2, nhouserent, ngeo, nbba, npgramo, nintert, nrname, nupp4, 
                                                                noaddress, noaddress1, noaddress2, nrefpno, narea, ndob, ngi1, ngg1, ngi2, ng2, 
                                                                nupp1, nupp2, nupp3, nlmark, nrrname)
                                            VALUES ('$designation','$gage','$cage','$sname','$spnoresi2','$dname','$dpnoresi2','$geooff','$name', '$hpl', '$hplt', '$pno', '$spname', '$poresi', '$fname', '$pnoresi1', '$mname', '$pnoresi2', 
                                                    '$address', '$address1', '$address2', '$houserent', '$geo','$ogeo', '$bba', '$pgramo', '$intert', '$rname', '$upp4', 
                                                    '$oaddress', '$oaddress1', '$oaddress2', '$refpno', '$rdate', '$area', '$dob', '$gi1', '$gg1', '$gi2', '$g2', 
                                                    '$upp1', '$upp2', '$upp3', '$lmark', '$rrname','$mfin','$nname', '$npno', '$nspname', '$npnoresi', '$nfname', '$npnoresi1', '$nmname', '$npnoresi2', 
                                                    '$naddress', '$naddress1', '$naddress2', '$nhouserent', '$ngeo', '$nbba', '$npgramo', '$nintert', '$nrname', '$nupp4', 
                                                    '$noaddress', '$noaddress1', '$noaddress2', '$nrefpno', '$narea', '$ndob', '$ngi1', '$ngg1', '$ngi2', '$ng2', 
                                                    '$nupp1', '$nupp2', '$nupp3', '$nlmark', '$nrrname')");



					
									
								if($insert)
								{
								    
								    $move=move_uploaded_file($_FILES['upp1']['tmp_name'],"user/".$upp1);
									$move55=move_uploaded_file($_FILES['upp2']['tmp_name'],"user/".$upp2);
					                $move1=move_uploaded_file($_FILES['upp3']['tmp_name'],"user/".$upp3);
									$move133=move_uploaded_file($_FILES['nupp1']['tmp_name'],"user/".$nupp1);
						            $move11=move_uploaded_file($_FILES['nupp2']['tmp_name'],"user/".$nupp2);
						            $move113=move_uploaded_file($_FILES['nupp3']['tmp_name'],"user/".$nupp3);
									if($move&&$move1)
									{
										echo "  Image Upload";
									}
									else 
									{
										echo "Image Upload failure";
									}
								
						echo "Success";
								
									
									header("Location:mcust.php?fid=$idd");		
								
								}
								else
								{
									echo "Failure";
								}
							}
?>
</html>