<?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 );
		$hpdate = date( 'd-m-Y', $selected_date );
		
			$hpdate5 = date( 'Y-m-d', $selected_date );
			$month = date( 'm', $selected_date );
			$day = date( 'd', $selected_date );
				$year = date( 'Y', $selected_date );
				$selected_date22=$hpdate2;
		  	$selected_date222=strtotime( $selected_date22 );
				$hpdate2 = date( 'd-m-Y', $selected_date222 );
				$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'];
				}
				if($geow!=NULL){
					$sql55 = mysqli_query($conn, "select * from geo where code='$geow'");
					$row55 = mysqli_fetch_array($sql55);
					$latw = $row55['lat'];
					$langw = $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'];
								$img2=$_FILES['img2']['name'];
								$imgveh=$_FILES['imgveh']['name'];
										$imgveh5=$_FILES['imgveh5']['name'];
								$insert=mysqli_query($conn, "insert into entry(sbname,mname,pnof,pnom,pnos,doo,imgveh5,geow,sonn,holdd,latw,langw,bba,bbd,hch,idate,uname,pwd,vehval,dob,downpay,dealeramt,pmode2,img2,netamt,rctype,cobpno22,cobpno11,hplt,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,bb1,bb2,bb3,bi1,bi2,bi3,nname)
								values('$sbname','$mname','$pnof','$pnom','$pnos','$doo','$imgveh5','$geow','$sonn','$holdd','$latw','$langw','$bba','$bbd','$hch','$idate','$uname','$pwd','$vehval','$dob','$downpay','$dealeramt','$pmode2','$img2','$netamt','$rctype','$cobpno22','$cobpno11','$hpl','$dddttt','$hpdate5','$day','$month','$year','Entry','$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','$bb1','$bb2','$bb3','$bi1','$bi2','$bi3','$nnamef')");
							
								
								if($insert)
								{
								echo "<script>alert('Register successfully');window.location.href='eview.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);
									$move133=move_uploaded_file($_FILES['img2']['tmp_name'],"user/".$img2);
						$move11=move_uploaded_file($_FILES['imgveh']['tmp_name'],"user/".$imgveh);
						$move115=move_uploaded_file($_FILES['imgveh5']['tmp_name'],"user/".$imgveh5);
									if($move&&$move1)
									{
										echo "  Image Upload";
									}
									else 
									{
										echo "Image Upload failure";
									}
								}
								else
								{
									echo "Failure";
								}
							}
?>
</html>