<?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);
				
				
							$upp1=$_FILES['upp1']['name'];
							$upp2=$_FILES['upp2']['name'];
							$upp3=$_FILES['upp3']['name'];
							$imgveh=$_FILES['imgveh']['name'];
							$img=$_FILES['img']['name']; 
							$img22=$_FILES['img22']['name'];
							$uimg=$_FILES['uimg']['name'];
							
if($upp1==NULL)
{
	$upp1 = $upp121;
}	
else {
		$upp1=$_FILES['upp1']['name'];
$move11d=move_uploaded_file($_FILES['upp1']['tmp_name'],"user/".$upp1);
}

if($upp2==NULL)
{
	$upp2 = $upp122;
}	
else {
		$upp2=$_FILES['upp2']['name'];
$move11c=move_uploaded_file($_FILES['upp2']['tmp_name'],"user/".$upp2);
}

if($upp3==NULL)
{
	$upp3 = $upp123;
}	
else {
		$upp3=$_FILES['upp3']['name'];
$move11e=move_uploaded_file($_FILES['upp3']['tmp_name'],"user/".$upp3);
}

							
if($imgveh==NULL)
{
	$imgveh = $imgveh2;
}	
else {
		$imgveh=$_FILES['imgveh']['name'];
$move11=move_uploaded_file($_FILES['imgveh']['tmp_name'],"user/".$imgveh);
}

if($img==NULL)
{
	$img = $img2;
}	
else {
$img=$_FILES['img']['name'];
$move111=move_uploaded_file($_FILES['img']['tmp_name'],"user/".$img);
}

if($img22==NULL)
{
	$img22 = $img222;
}	
else {
$img22=$_FILES['img22']['name'];
$move111=move_uploaded_file($_FILES['img22']['tmp_name'],"user/".$img22);
}

if($uimg==NULL)
{
$uimg = $uimg2;
}	
else {
		$uimg=$_FILES['uimg']['name'];
$move115=move_uploaded_file($_FILES['uimg']['tmp_name'],"user/".$uimg); 
}
$mfin2 = $mfin2;
$address1 = $address1;
$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'];
				}
				$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 );
				
				
				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));	
$insert=mysqli_query($conn, "update mcust set designation = '$designation',  
    gage = '$gage',  
    cage = '$cage',  
    sname = '$sname',  
    spnoresi2 = '$spnoresi2',  
    dname = '$dname',  
    dpnoresi2 = '$dpnoresi2',  
    geooff = '$geooff',  
    name = '$name',  
    hpl = '$hpl',  
    hplt = '$hplt',  
    pno = '$pno',  
    spname = '$spname',  
    pnoresi = '$poresi',  
    fname = '$fname',  
    pnoresi1 = '$pnoresi1',  
    mname = '$mname',  
    pnoresi2 = '$pnoresi2',  
    address = '$address',  
    address1 = '$address1',  
    address2 = '$address2',  
    houserent = '$houserent',  
    geo = '$geo',  
    ogeo = '$ogeo',  
    bba = '$bba',  
    pgramo = '$pgramo',  
    intert = '$intert',  
    rname = '$rname',  
    upp4 = '$upp4',  
    oaddress = '$oaddress',  
    oaddress1 = '$oaddress1',  
    oaddress2 = '$oaddress2',  
    refpno = '$refpno',  
    rdate = '$rdate',  
    area = '$area',  
    dob = '$dob',  
    gi1 = '$gi1',  
    gg1 = '$gg1',  
    gi2 = '$gi2',  
    g2 = '$g2',  
    upp1 = '$upp1',  
    upp2 = '$upp2',  
    upp3 = '$upp3',  
    lmark = '$lmark',  
    rrname = '$rrname',  
    mfin = '$mfin',  
    nname = '$nname',  
    npno = '$npno',  
    nspname = '$nspname',  
    npnoresi = '$npnoresi',  
    nfname = '$nfname',  
    npnoresi1 = '$npnoresi1',  
    nmname = '$nmname',  
    npnoresi2 = '$npnoresi2',  
    naddress = '$naddress',  
    naddress1 = '$naddress1',  
    naddress2 = '$naddress2',  
    nhouserent = '$nhouserent',  
    ngeo = '$ngeo',  
    nbba = '$nbba',  
    npgramo = '$npgramo',  
    nintert = '$nintert',  
    nrname = '$nrname',  
    nupp4 = '$nupp4',  
    noaddress = '$noaddress',  
    noaddress1 = '$noaddress1',  
    noaddress2 = '$noaddress2',  
    nrefpno = '$nrefpno',  
    narea = '$narea',  
    ndob = '$ndob',  
    ngi1 = '$ngi1',  
    ngg1 = '$ngg1',  
    ngi2 = '$ngi2',  
    ng2 = '$ng2',  
    nupp1 = '$nupp1',  
    nupp2 = '$nupp2',  
    nupp3 = '$nupp3',  
    nlmark = '$nlmark',  
    nrrname = '$nrrname'  where id='$idd'");

 																					
									if($insert)
								{
								echo "<script>alert('Updated successfully');window.location.href='all.php'</script><br>";
																
								}
								else
								{
									echo "Failure";
								}
							} 
?>
</html>