	<?php ob_start(); ?>
	<!DOCTYPE html>
	<html>
	<?php include "layouts/db_connect.php";
				session_start('ERP');
				
				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);
							    $selected_date2=$hpdate;
		  	$selected_date=strtotime( $selected_date2 );
		
			$hpdate5 = date( 'Y-m-d', $selected_date );
			$month = date( 'm', $selected_date );
			$day = date( 'd', $selected_date );
				$year = date( 'Y', $selected_date );
				$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));			
							$defamt	= $defamt/12;
							$uimg=$_FILES['uimg']['name'];
								$img=$_FILES['img']['name'];
								$imgveh=$_FILES['imgveh']['name'];
								$insert=mysqli_query($conn, "insert into fincust(pan,accname,bankname,bankno,ifsc,branch,createdate,hpdate5,dd,mm,yy,status,cow01,cow02,address1,address2,oaddress1,oaddress2,co01,co02,co201,co202,coaland,coaland2,hname,lmark,cofname,cofname2,pmode,cow,cow2,oaddress,fname,eno,cno,area,hlamt,hlreturn,hpdate2,cobname2,cobpno2,co2,pnooffice,pnoresi,profession,dealer,chqamt,defamt,irr,remarks,imgveh,mfin,scode,hpl,lat,lang,uimg,vno,model,vname,color,hpamount,inter,hpdate,duemnt,dueamt,interest,total,name,pno,address,cobname,cobpno,co,img,bname,bcommission,document,totalhpamt,g1,g2,g3,gi1,gi2,gi3,b1,b2,b3,bi1,bi2,bi3,nname)
								values('$pan','$accname','$bankname','$bankno','$ifsc','$branch','$dddttt','$hpdate5','$day','$month','$year','Active','$cow01','$cow02','$address1','$address2','$oaddress1','$oaddress2','$co01','$co02','$co201','$co202','$coaland','$coaland2','$hname','$lmark','$cofname','$cofname2','$pmode','$cow','$cow2','$oaddress','$fname','$eno','$cno','$area','$hlamt','$hlreturn','$hpdate2','$cobname2','$cobpno2','$co2','$pnooffice','$pnoresi','$profession','$dealer','$chqamt','$defamt','$irr','$remarks','$imgveh','$mfin55','$scode','$hpl','$lat','$lang','$uimg','$vno','$model','$vname','$color','$hpamount','$inter','$hpdate','$duemnt','$dueamt','$interest','$total','$name','$pno','$address','$cobname','$cobpno','$co','$img','$bname','$bcommission','$document','$totalhpamt','$g1','$g2','$g3','$gi1','$gi2','$gi3','$b1','$b2','$b3','$bi1','$bi2','$bi3','$nnamef')");
								$insert2=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$name','$name','$cobname','$cobname')");
							//	$fname = "S/O ".$fname;
							//	$cofname = "S/O ".$cofname;
							//	$cofname2 = "S/O ".$cofname2;
								$insert3=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$fname','$profession','$cofname',)");
								$insert4=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$address','$oaddress','$co','$cow')");
								$insert5=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$address1','$oaddress1','$co01','$cow01')");
								$insert6=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$address2','$oaddress2','$co02','$cow02')");
								$insert7=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$lmark','-','$coaland',)");
								$insert8=mysqli_query($conn, "insert into finaddr(mfin,hpl,addr,oadd,co,co2)
								values('$mfin55','$hpl','$pno','$pnooffice','$cobpno','$cobpno2')");
								
								if($insert)
								{
								echo "<script>alert('Register successfully');window.location.href='finregister11.php'</script><br>";
						//header("location:register1.php");
									$move=move_uploaded_file($_FILES['uimg']['tmp_name'],"user/".$uimg);
									$move1=move_uploaded_file($_FILES['img']['tmp_name'],"user/".$img);
						$move11=move_uploaded_file($_FILES['imgveh']['tmp_name'],"user/".$imgveh);
									if($move&&$move1)
									{
										echo "  Image Upload";
									}
									else
									{
										echo "Image Upload failure";
									}
								}
								else
								{
									echo "Failure";
								}
							}
?>
</html>