<?php
session_start();
ob_start();
include("config/database.php");
$conct  = new connectionCreat();
$conct->connectToDB();
$conct->selectDB();
include "config/function.php";
$take_action1   = new actionDo();
$i				= 0;
$j				= 0;
$k				= 0; 
$sql			= mysql_query(" SELECT * FROM `tbl_match_data` ORDER BY `emp_name` ASC ")or die(mysql_error());
while($row		= mysql_fetch_array($sql))
{
	$sql_2		= mysql_query(" SELECT *,count(`id`) FROM `tbl_emp_records` where `emp_name`='".$row['emp_name']."' and `fname`='".$row['fname']."' ")or die(mysql_error());
	$row_2		= mysql_fetch_array($sql_2);
	if($row_2['count(`id`)']>1)
	{
		$i++;
	}
	else
	{
		$sql_3	= mysql_query(" UPDATE `tbl_emp_records` SET `dob`='".date("Y-m-d",strtotime($row['dob']))."',`marital_st`='".strtoupper(strtolower($row['marieed']))."',`aadhar_no`='".$row['aadhar_no']."',`uan_status`='Done' where `emp_name`='".$row['emp_name']."' and `fname`='".$row['fname']."' ")or die(mysql_error());
		$j++;
			
	}	
}
echo "Max one : ".$i;
echo "<br>";
echo "Total update: ".$j;
?>