<?php require_once('../Connections/oprmConn.php'); ?>
<?php
mysql_select_db($database_oprmConn, $oprmConn);
$query_getUsree = "select * FROM weby_profiles where weby_profiles.user_id = '$_SESSION[user_id]' and weby_profiles.status = 'A'";
$getUsree = mysql_query($query_getUsree, $oprmConn) or die(mysql_error());
$row_getUsree = mysql_fetch_assoc($getUsree);
$totalRows_getUsree = mysql_num_rows($getUsree);
	
	$date = date('Y-m-d H:i:s');
	mysql_select_db($database_oprmConn, $oprmConn);

	$query_Re = "update weby_profiles set status = 'D', updated_by = '$_SESSION[user_id]' WHERE user_id = '$_SESSION[user_id]' AND status = 'A'";

	$Re = mysql_query($query_Re, $oprmConn) or die(mysql_error());
	
mysql_select_db($database_oprmConn, $oprmConn);
$q = "INSERT INTO weby_profiles (`full_name`, `job_title`, `skill_set`, `profile_pic`, `cv_file`, `passport_file`, `visa_file`, `ni_number`, `holiday_sheet`, `other_docs`, `other_info`, `bank_account`, `bank_sortcode`, `bank_address`,`date_of_birth`, `passport_number`, `visa_number`, `passport_edate`, `visa_edate`, `citizen_of`, `contact_phone`, `contact_address`, `kin_name`, `kin_phone`, `kin_email`, `kin_address`, `created_by`, `created_date`, `updated_by`, `user_id`) VALUES ( '$row_getUsree[full_name]', '$row_getUsree[job_title]', '$row_getUsree[skill_set]', '$row_getUsree[profile_pic]', '$row_getUsree[cv_file]', '$row_getUsree[passport_file]', '$row_getUsree[visa_file]', '$row_getUsree[ni_number]', '$row_getUsree[holiday_sheet]', '$row_getUsree[other_docs]', '$row_getUsree[other_info]', '$row_getUsree[bank_account]', '$row_getUsree[bank_sortcode]', '$row_getUsree[bank_address]',  '$row_getuseree[date_of_birth]','$row_getUsree[passport_number]', '$row_getUsree[visa_number]',  '$row_getUsree[passport_edate]', '$row_getUsree[visa_edate]', '$row_getUsree[citizen_of]', '$row_getUsree[contact_phone]', '$row_getUsree[contact_address]', '$row_getUsree[kin_name]', '$row_getUsree[kin_phone]', '$row_getUsree[kin_email]', '$row_getUsree[kin_address]', '$row_getUsree[created_by]', '$date', '$_SESSION[user_id]', '$_SESSION[user_id]')";
$query_getProj3 = $q;
$getProj3 = mysql_query($query_getProj3, $oprmConn) or die(mysql_error());

$cn = $_REQUEST[cn];
$profile = $_REQUEST[prid];
mysql_select_db($database_oprmConn, $oprmConn);
$query_getProfile = "update weby_profiles set $cn='' where weby_profiles.user_id = '$_SESSION[user_id]' AND weby_profiles.status = 'A'";
$getProfile = mysql_query($query_getProfile, $oprmConn) or die(mysql_error());
header("Location: index.php?msg=Deleted Successfully");

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>
