<?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 );
		$upp1=$_FILES['upp1']['name'];
								$upp2=$_FILES['upp2']['name'];
								$upp3=$_FILES['upp3']['name'];
								$upp4=$_FILES['upp4']['name'];
									$upp5=$_FILES['upp5']['name'];
				$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));			
			
			
			$img12 = $_POST['image'];
    $folderPath = "user/";
  
    $image_parts = explode(";base64,", $img12);
    $image_type_aux = explode("image/", $image_parts[0]);
    $image_type = $image_type_aux[1];
  
    $image_base64 = base64_decode($image_parts[1]);
    $fileName = uniqid() . '.png';
  
    $file = $folderPath . $fileName;
    file_put_contents($file, $image_base64);
	
	
							$uimg=$fileName;
							
							$img22 = $_POST['image1'];
    $folderPath = "user/";
  
    $image_parts = explode(";base64,", $img22);
    $image_type_aux = explode("image1/", $image_parts[0]);
    $image_type = $image_type_aux[1];
  
    $image_base64 = base64_decode($image_parts[1]);
    $fileName2 = uniqid() . '.png';
  
    $file = $folderPath . $fileName2;
    file_put_contents($file, $image_base64);
	
	
								$img=$fileName2;

				
								//// card 1
			$insert=mysqli_query($conn, "insert into mcust(dob,bba,upp1,upp2,upp3,upp4,upp5,hplt,name,fname,address,address1,address2,lmark,pno,pnoresi,area,gg1,uimg,mfin,scode,hpl,img)
	  values('$dob','$bba','$upp1','$upp2','$upp3','$upp4','$upp5','$hplt','$name','$fname','$address','$address1','$address2','$lmark','$pno','$pnoresi','$area','$gg1','$uimg','$mfin','$scode','$hpl','$img')");


$hpl=$ohp;

							$move=move_uploaded_file($_FILES['upp1']['tmp_name'],"user/".$upp1);
									$move1=move_uploaded_file($_FILES['upp2']['tmp_name'],"user/".$upp2);
									$move133=move_uploaded_file($_FILES['upp3']['tmp_name'],"user/".$upp3);
						$move11=move_uploaded_file($_FILES['upp4']['tmp_name'],"user/".$upp4);
						$move121=move_uploaded_file($_FILES['upp5']['tmp_name'],"user/".$upp5);
									
								if($insert)
								{
								
						echo "Success";
								
									
									header("Location:mcust.php?fid=$idd");		
								//	echo "<script>alert('Register successfully');window.location.href='register11ss.php?fid=".$idd."'</script><br>"; 
								}
								else
								{
									echo "Failure";
								}
							}
?>
</html>