<?php require_once('../Connections/oprmConn.php'); 



if(!isset($_SESSION['user_id']))



{

	header("location: ../index.php");

}



 $msg = ""; if(isset($_REQUEST['msg'])) $msg = $_REQUEST['msg'];  $msg1 = ""; if(isset($_REQUEST['msg1'])) $msg1 = $_REQUEST['msg1']; 



mysql_select_db($database_oprmConn, $oprmConn);

$query_getUsree = "select weby_profiles.*, weby_users.* FROM weby_profiles, weby_users 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);





if(isset($_POST['new_password'])) {



mysql_select_db($database_oprmConn, $oprmConn);



$query_Recordset1 = "SELECT * FROM weby_users WHERE weby_users.user_id = '$_SESSION[user_id]' AND weby_users.user_role = '2'";



$Recordset1 = mysql_query($query_Recordset1, $oprmConn) or die(mysql_error());



$row_Recordset1 = mysql_fetch_assoc($Recordset1);



$totalRows_Recordset1 = mysql_num_rows($Recordset1);







$olp = md5($_REQUEST['current_password']);



if($olp == $row_Recordset1['password']) {



mysql_select_db($database_oprmConn, $oprmConn);



$np = md5($_REQUEST['new_password']);



$query_Recordset1 = "update weby_users set password = '$np' WHERE weby_users.user_id = '$_SESSION[user_id]'";



$Recordset1 = mysql_query($query_Recordset1, $oprmConn) or die(mysql_error());

header("Location:index.php?msg");

//$msg = "Password changed successfully";



} else {

header("Location:index.php?msgw1");

//$msgw1 = "Old Password is wrong. Please try one more time.";



}



} else {



if (!function_exists("GetSQLValueString")) {



function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 



{



  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;







  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);







  switch ($theType) {



    case "text":



      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";



      break;    



    case "long":



    case "int":



      $theValue = ($theValue != "") ? intval($theValue) : "NULL";



      break;



    case "double":



      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";



      break;



    case "date":



      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";



      break;



    case "defined":



      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;



      break;



  }



  return $theValue;



}



}







$editFormAction = $_SERVER['PHP_SELF'];



if (isset($_SERVER['QUERY_STRING'])) {



  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);



}







if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "edit_profile")) {

if($_POST['date_of_birth']){
	$dob = date("Y-m-d",strtotime($_POST['date_of_birth']));
} else { $dob = 0; }	


if($_POST['passport_edate']){
	$pd = date("Y-m-d",strtotime($_POST['passport_edate']));
} else { $pd = 0; }

if($_POST['visa_edate']){
	$vd = date("Y-m-d",strtotime($_POST['visa_edate']));
} else{ $vd = 0; }


 if(($_POST['full_name'] == $row_getUsree['full_name']) && ($_POST['job_title'] == $row_getUsree['job_title']) && ($_POST[notes_text]
 == $row_getUsree['notes_text']) && ($_POST['skill_set'] == $row_getUsree['skill_set']) && ($_POST['ni_number'] == $row_getUsree['ni_number']) && ($_POST['other_info'] == $row_getUsree['other_info']) && ($_POST['bank_account'] == $row_getUsree['bank_account']) && ($_POST['bank_sortcode'] == $row_getUsree['bank_sortcode']) && ($_POST['bank_address'] == $row_getUsree['bank_address']) && ($dob == $row_getUsree['date_of_birth'])
 && ($_POST['passport_number'] == $row_getUsree['passport_number']) && ($_POST['visa_number'] == $row_getUsree['visa_number']) && ($pd == $row_getUsree['passport_edate']) && ($vd == $row_getUsree['visa_edate']) && ($_POST['citizen_of'] == $row_getUsree['citizen_of']) && ($_POST['contact_phone'] == $row_getUsree['contact_phone']) && ($_POST['contact_address'] == $row_getUsree['contact_address']) && ($_POST['kin_name'] == $row_getUsree['kin_name']) && ($_POST['kin_phone'] == $row_getUsree['kin_phone']) && ($_POST['kin_email'] == $row_getUsree['kin_email']) && ($_POST['kin_address'] == $row_getUsree['kin_address'])){

 

  

if($_POST['email_address'] != $row_getUsree['email_address']){
	$rml = $row_getUsree['email_address'];	
mysql_select_db($database_oprmConn, $oprmConn);
$q = "INSERT INTO weby_change_mail (`email_address`, `deleted_by`) VALUES ( '$rml', '$_SESSION[user_id]')";
$query_getProj3 = $q;
$getProj3 = mysql_query($query_getProj3, $oprmConn) or die(mysql_error());
mysql_select_db($database_oprmConn, $oprmConn);
	$query_Recordset111 = "update weby_users set email_address = '$_POST[email_address]', updated_by = '$_SESSION[user_id]' WHERE weby_users.user_id = '$_SESSION[user_id]'";
	$Recordset111 = mysql_query($query_Recordset111, $oprmConn) or die(mysql_error());
	$user_email = $_POST['email_address'];
	$user_email1 = "mailsendinfo@ipglobalservices.co.uk";
	$user_email2 = $rml;
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $SERVER_EMAIL" . "\r\n" ;
	$subject = "SS WEB TECHNOLOGIES. - Email Address Change Notification";
	$subject1 = "SS WEB TECHNOLOGIES - $row_getUsree[full_name]: Email Address Change Notification"; 
	$body1 = "Hi admin,<br>This is to inform you that  $_POST[full_name] Mail Address Has been changed. <br";
	$body = "Hi $row_getUsree[full_name],<br>This is to inform you that your Email Address Changed Successfully. <br";
	$t = "br>
	From $rml to $_POST[email_address].
<br>
<br>
	If you have any queries, please contact admin.
	<br>
	Thanks,<br>
	SS WEB TECHNOLOGIES .";
	$body .= $t;
	$body1 .= $t;
	mail($user_email, $subject, $body, $headers);
	mail($ADMIN_EMAIL, $subject1, $body1, $headers);
	mail($user_email2, $subject, $body, $headers);
}
  header("Location:index.php?msg1=Profile Updated");
}else{
if($_POST['email_address'] != $row_getUsree['email_address']){
$rml = $row_getUsree['email_address'];	
mysql_select_db($database_oprmConn, $oprmConn);
$q = "INSERT INTO weby_change_mail (`email_address`, `deleted_by`) VALUES ( '$rml', '$_SESSION[user_id]')";
$query_getProj3 = $q;
$getProj3 = mysql_query($query_getProj3, $oprmConn) or die(mysql_error());
mysql_select_db($database_oprmConn, $oprmConn);
	$query_Recordset111 = "update weby_users set email_address = '$_POST[email_address]', updated_by = '$_SESSION[user_id]' WHERE weby_users.user_id = '$_SESSION[user_id]'";
	$Recordset111 = mysql_query($query_Recordset111, $oprmConn) or die(mysql_error());
	$user_email = $_POST['email_address'];
	//$user_email1 = "info@ipglobalservices.co.uk";
	$user_email2 = $rml;
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $SERVER_EMAIL" . "\r\n" ;
	$subject = "SS WEB TECHNOLOGIES. - Email Address Change Notification";
	$subject1 = "SS WEB TECHNOLOGIES. - $row_getUsree[full_name]: Email Address Change Notification"; 
	$body1 = "Hi admin,<br>This is to inform you that  $_POST[full_name] Mail Address Has been changed. <br";
	$body = "Hi $row_getUsree[full_name],<br>This is to inform you that your Email Address Changed Successfully. <br";
	$t = "br>
	From $rml to $_POST[email_address].
<br>		
<br>
	If you have any queries, please contact admin.
	<br>
	Thanks,<br>
	SS WEB TECHNOLOGIES.";
	$body .= $t;
	$body1 .= $t;
	mail($user_email, $subject, $body, $headers);
	mail($ADMIN_EMAIL, $subject1, $body1, $headers);
	mail($user_email2, $subject, $body, $headers);
} 

$date = date('Y-m-d H:i:s');

//check user profile already submit
mysql_select_db($database_oprmConn, $oprmConn);
$query_checkProfile = "select user_id, profile_id FROM weby_profiles where status = 'P' AND user_id = '$_SESSION[user_id]'";
$checkProfile = mysql_query($query_checkProfile, $oprmConn) or die(mysql_error());
$row_checkProfile = mysql_fetch_assoc($checkProfile);
$totalRows_checkProfile = mysql_num_rows($checkProfile);
if($totalRows_checkProfile==0){

  //$full_name = REPLACE("$_POST[full_name]", "'", "/'");
  $full_name = mysql_real_escape_string(trim($_POST[full_name]));
  
    //$job_title = REPLACE("$_POST[job_title]", "'", "/'");
  $job_title = mysql_real_escape_string(trim($_POST[job_title]));
  
    //$notes_text = REPLACE("$_POST[notes_text]", "'", "/'");
    $notes_text = mysql_real_escape_string(trim($_POST[notes_text]));
    
      //$skill_set = REPLACE("$_POST[skill_set]", "'", "/'");
    $skill_set = mysql_real_escape_string(trim($_POST[skill_set]));
    
     //$other_info = REPLACE("$_POST[other_info]", "'", "/'");
    $other_info = mysql_real_escape_string(trim($_POST[other_info]));
    
     //$bank_address = REPLACE("$_POST[bank_address]", "'", "/'");
   $bank_address = mysql_real_escape_string(trim($_POST[bank_address]));
   
    //$citizen_of = REPLACE("$_POST[citizen_of]", "'", "/'");
   $citizen_of = mysql_real_escape_string(trim($_POST[citizen_of]));
   
    //$contact_address = REPLACE("$_POST[contact_address]", "'", "/'");
   $contact_address = mysql_real_escape_string(trim($_POST[contact_address]));
   
     //$kin_name = REPLACE("$_POST[kin_name]", "'", "/'");
   $kin_name = mysql_real_escape_string(trim($_POST[kin_name]));
   
      //$kin_address = REPLACE("$_POST[kin_address]", "'", "/'");
   $kin_address = mysql_real_escape_string(trim($_POST[kin_address]));
    
   
  
    
    
$q = "INSERT INTO weby_profiles (`full_name`, `job_title`, `notes_text`, `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`, `status`, `created_by`, `created_date`, `updated_by`, `user_id`) VALUES ( '$full_name', '$job_title', '$notes_text', '$skill_set', '$_POST[profile_pic1]', '$_POST[cv_file1]', '$_POST[passport_file1]', '$_POST[visa_file1]', '$_POST[ni_number]', '$_POST[holiday_sheet1]', '$_POST[other_docs1]', '$other_info', '$_POST[bank_account]', '$_POST[bank_sortcode]', '$bank_address','$dob', '$_POST[passport_number]', '$_POST[visa_number]',  '$pd', '$vd', '$citizen_of', '$_POST[contact_phone]', '$contact_address', '$kin_name', '$_POST[kin_phone]', '$_POST[kin_email]', '$kin_address', 'P', '$_POST[created_by]', '$date', '$_SESSION[user_id]', '$_SESSION[user_id]')";
$query_getProj3 = $q;
$getProj3 = mysql_query($query_getProj3, $oprmConn) or die(mysql_error());
} else {
      //$full_name = REPLACE("$_POST[full_name]", "'", "/'");
  $full_name = mysql_real_escape_string(trim($_POST[full_name]));
    
    //$job_title = REPLACE("$_POST[job_title]", "'", "/'");
  $job_title = mysql_real_escape_string(trim($_POST[job_title]));

    // $notes_text = REPLACE("$_POST[notes_text]", "'", "/'");
    $notes_text = mysql_real_escape_string(trim($_POST[notes_text]));
    
      //$skill_set = REPLACE("$_POST[skill_set]", "'", "/'");
    $skill_set = mysql_real_escape_string(trim($_POST[skill_set]));
    
     //$other_info = REPLACE("$_POST[other_info]", "'", "/'");
    $other_info = mysql_real_escape_string(trim($_POST[other_info]));
    
     //$bank_address = REPLACE("$_POST[bank_address]", "'", "/'");
   $bank_address = mysql_real_escape_string(trim($_POST[bank_address]));
   
     //$citizen_of = REPLACE("$_POST[citizen_of]", "'", "/'");
   $citizen_of = mysql_real_escape_string(trim($_POST[citizen_of]));
    
    //$contact_address = REPLACE("$_POST[contact_address]", "'", "/'");
   $contact_address = mysql_real_escape_string(trim($_POST[contact_address]));
   
     //$kin_name = REPLACE("$_POST[kin_name]", "'", "/'");
   $kin_name = mysql_real_escape_string(trim($_POST[kin_name]));
   
     //$kin_address = REPLACE("$_POST[kin_address]", "'", "/'");
   $kin_address = mysql_real_escape_string(trim($_POST[kin_address]));
    
    
    
    $query_updatepro = "update weby_profiles set full_name = '$full_name', job_title = '$job_title', notes_text = '$notes_text', skill_set = '$skill_set', profile_pic = '$_POST[profile_pic1]', cv_file = '$_POST[cv_file1]', passport_file = '$_POST[passport_file1]', visa_file = '$_POST[visa_file1]', ni_number = '$_POST[ni_number]', holiday_sheet = '$_POST[holiday_sheet1]', other_docs = '$_POST[other_docs1]', other_info = '$other_info', bank_account = '$_POST[bank_account]', bank_sortcode = '$_POST[bank_sortcode]', bank_address = '$bank_address',date_of_birth =
        '$dob', passport_number = '$_POST[passport_number]', visa_number = '$_POST[visa_number]', passport_edate = '$pd', visa_edate = '$vd', citizen_of = '$citizen_of', contact_phone = '$_POST[contact_phone]', contact_address = '$contact_address', kin_name = '$kin_name', kin_phone = '$_POST[kin_phone]', kin_email = '$_POST[kin_email]', kin_address = '$kin_address', status = 'P', updated_by = '$_SESSION[user_id]' WHERE user_id = '$_SESSION[user_id]' AND status = 'P'";
$updatepro = mysql_query($query_updatepro, $oprmConn) or die(mysql_error());
}

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $SERVER_EMAIL" . "\r\n" ;
$subject1 = "SS WEB TECHNOLOGIES. - $row_getUsree[full_name] Updated Profile.";
$body1 = "Hi admin,<br>$row_getUsree[full_name] has updated profile.<br><br><a href='http://vteksolutions.co.uk/RM/admin/pending-resources-view.php?user_id=$row_getUsree[user_id]'>Click</a> here to view this profile.<br><br>Thanks,<br>SS WEB TECHNOLOGIES";
	mail($ADMIN_EMAIL, $subject1, $body1, $headers);
//mail('info@SS WEB TECHNOLOGIES.com', $subject1, $body1, $headers);
header("Location:index.php?msg1=Profile Updated. But it is under admin review, your changes will be shown after admin approval");
}

 

}







}







mysql_select_db($database_oprmConn, $oprmConn);



$query_getProfile = "SELECT p.*, weby_users.email_address, weby_users.employee_id, weby_users.user_role FROM weby_profiles p, weby_users WHERE p.user_id = '$_SESSION[user_id]' AND weby_users.user_id = p.user_id AND p.status = 'A'";



$getProfile = mysql_query($query_getProfile, $oprmConn) or die(mysql_error());



$row_getProfile = mysql_fetch_assoc($getProfile);



$totalRows_getProfile = mysql_num_rows($getProfile);











mysql_select_db($database_oprmConn, $oprmConn);



$query_getDoclist = "SELECT d.*, d.profile_id AS proid, weby_profiles.profile_id, weby_profiles.user_id, weby_users.user_id FROM weby_otherdoc d, weby_profiles, weby_users WHERE d.user_id = '$_SESSION[user_id]' AND weby_profiles.user_id = d.user_id AND d.status = 'A' AND weby_profiles.status = 'A' group by d.doc_id";







//"SELECT distinct d.doc_id, d.profile_id, d.other_docs, profiles.profile_id, profiles.user_id, weby_users.user_id FROM otherdoc d, profiles, weby_users WHERE profiles.user_id = $_REQUEST[user_id] AND (d.profile_id = profiles.profile_id AND d.status = 'A') group by d.doc_id"; 



$getDoclist = mysql_query($query_getDoclist, $oprmConn) or die(mysql_error());



$row_getDoclist = mysql_fetch_assoc($getDoclist);



$totalRows_getDoclist = mysql_num_rows($getDoclist);



?>

<!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>SS WEB TECHNOLOGIES. - Tool Resource Projects</title>

<link rel="stylesheet" href="../css/style.css" type="text/css">

<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<style>
.act_index { background: #373938;
  color: #fff;}
  .rightbtn{
	  float: right;
	      background: #004183;
    color: white;
    padding: 5px 15px;
  }
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>

<script src="//code.jquery.com/ui/1.9.1/jquery-ui.js"></script>



<!-- IE Fix for HTML5 Tags -->



<!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 



	<![endif]-->



<script type="text/javascript">



<!--



function MM_validateForm() { //v4.0



  if (document.getElementById){



    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;



    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);



      if (val) { nm=val.name; if ((val=val.value)!="") {



        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');



          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';



        } else if (test!='R') { num = parseFloat(val);



          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';



          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');



            min=test.substring(8,p); max=test.substring(p+1);



            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';



      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }



    } if (errors) alert('The following error(s) occurred:\n'+errors);



    document.MM_returnValue = (errors == '');



} }



//-->








function checkP(){



if(document.getElementById("new_password").value != document.getElementById("confirm_password").value) {



alert("New password and Confirm password should be same");



document.getElementById("new_password").focus();



return false;



}



}



function MM_openBrWindow(theURL,winName,features) { //v2.0



  window.open(theURL,winName,features);



}















		







</script>

<script>



$(function() {



	
$( "#date_of_birth" ).datepicker({ dateFormat:'dd-mm-yy',    changeMonth: true,  changeYear: true   });


    $( "#passport_edate" ).datepicker({ dateFormat:'dd-mm-yy',   changeMonth: true,  changeYear: true   });



	 $( "#visa_edate" ).datepicker({ dateFormat:'dd-mm-yy',   changeMonth: true,  changeYear: true   });



	



  



});







</script>

</head>



<body>



<!-- Wrapper Starts -->


<div class="wrapper">

    <?php  require_once('../includes/header.php'); ?>
    
<?php  require_once('../includes/tools-menu.php'); ?>
  

  <!-- Content Goes here -->

  

  <article class="inside_wrapper clear_fix"> 

    

    <!-- Main Content Goes here -->

    

    <section class="main_content">

      <h2 style="float: left;">My Profile</h2>
<?php mysql_select_db($database_oprmConn, $oprmConn);
$query_getUsree = "select weby_profiles.*, weby_users.* FROM weby_profiles, weby_users where weby_profiles.user_id = '$_SESSION[user_id]' and weby_profiles.status = 'P' and weby_users.user_id = '$_SESSION[user_id]' and weby_users.status = 'A' ";
$getUsree = mysql_query($query_getUsree, $oprmConn) or die(mysql_error());
$row_getUsree = mysql_fetch_assoc($getUsree);
$totalRows_getUsree = mysql_num_rows($getUsree);
if($totalRows_getUsree>0){ ?>
<a href="preview-pending-profile.php" class='rightbtn'>Preview Pending Profile</a><?php } ?>
      <?php if(isset($_REQUEST['msg']) ){ ?>

      <div class="msg_cancel"><font color="#FF0000"><?php echo $msg; ?><a href="index.php"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a></font></div>

      <?php } ?>

      <?php if(isset($_REQUEST['msg1']) ){ ?>

     <div class="msg_cancel"> <font color="#00FF00"><?php echo $msg1; ?><a href="index.php"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a></font></div>

      <?php } ?>

      <!--<div class="welcome_box">



                <div class="timesheet_type"><div class="welcome_txt arrow">Welcome <?php echo $row_getProfile['full_name']; ?>



                <?php $pweek = date('W');



		  $pyear = date('Y'); ?>



            <ul> <li><a href="index.php">Dashboard</a></li>



              <!--<li><a href="profile.php">Profile</a></li> <li><a href="timesheet.php">Timesheet</a></li> <li><a href="manage-leave.php">Manage Leaves</a></li>



            	<li><a href="logout.php">Logout</a></li>



            	</ul>	



                </div>



                </div>	



             </div>-->

      <article class="resource_profile">

        <div class="current_profile"> 

          

          <!-- <h3>Hr Rate: &pound;<?php echo $row_getProfile['hr_rate']; ?></h3> -->

          

          <p><b>Current Profile Pic</b></p>

          <p><img src="/RM/images/<?php if(!empty($row_getProfile['profile_pic'])){ echo $row_getProfile['profile_pic'];?> <?php } else{ echo "black-img.jpg";} ?>" width="68" />&nbsp;<a href="profile-delete.php?prid=<?php echo $row_getProfile['profile_id']; ?>&cn=profile_pic" onclick="return confirm('Are you sure you want to delete Profile Pic?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a></p>
			<p><b>Employee ID:</b> <?php echo 'YDS0'.$row_getProfile['employee_id']; ?></p>
          <p><b>Current CV:</b><br/>

            <?php if($row_getProfile['cv_file'] != NULL) { ?>

            <a href="../documents/<?php echo $row_getProfile['cv_file']; ?>" target="_blank"><?php echo $row_getProfile['cv_file']; ?></a>&nbsp;<a href="profile-delete.php?prid=<?php echo $row_getProfile['profile_id']; ?>&cn=cv_file" onclick="return confirm('Are you sure you want to delete CV?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a>

            <?php } else {echo "Not uploaded";} ?>

          </p>

          <p><b>Passport Copy:</b><br/>

            <?php if($row_getProfile['passport_file'] != NULL) { ?>

            <a href="../documents/<?php echo $row_getProfile['passport_file']; ?>" target="_blank"><?php echo $row_getProfile['passport_file']; ?></a>&nbsp;<a href="profile-delete.php?prid=<?php echo $row_getProfile['profile_id']; ?>&cn=passport_file" onclick="return confirm('Are you sure you want to delete Passport?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a>

            <?php } else {echo "Not uploaded";} ?>

          </p>

          <p><b>Visa Copy:</b><br/>

            <?php if($row_getProfile['visa_file'] != NULL) { ?>

            <a href="../documents/<?php echo $row_getProfile['visa_file']; ?>" target="_blank"><?php echo $row_getProfile['visa_file']; ?></a>&nbsp;<a href="profile-delete.php?prid=<?php echo $row_getProfile['profile_id']; ?>&cn=visa_file" onclick="return confirm('Are you sure you want to delete Visa?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a>

            <?php } else {echo "Not uploaded";} ?>

          </p>

          <p><b>Holiday Sheet:</b><br/>

            <?php if($row_getProfile['holiday_sheet'] != NULL) { ?>

            <a href="../documents/<?php echo $row_getProfile['holiday_sheet']; ?>" target="_blank"> <?php echo $row_getProfile['holiday_sheet']; ?></a>&nbsp;<a href="profile-delete.php?prid=<?php echo $row_getProfile['profile_id']; ?>&cn=holiday_sheet" onclick="return confirm('Are you sure you want to delete Holdiay Sheet?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a>

            <?php } else {echo "Not uploaded";} ?>

          </p>

          <p><b>Other/Academic Certificates:</b><br/>

          

          <ol>

            <?php if($row_getDoclist['other_docs'] != NULL) { ?>

            <?php do {?>

            <li> <a href="../documents/<?php echo $row_getDoclist['other_docs']; ?>" target="_blank"><?php echo $row_getDoclist['other_docs']; ?></a>&nbsp;<a href="doc-delete.php?prid=<?php echo $row_getDoclist['proid']; ?>&oid=<?php echo $row_getDoclist['doc_id']; ?>" onclick="return confirm('Are you sure you want to delete Other Doc?');"><img src="/RM/images/cross.png" width="12" height="12" alt="delete"></a></li>

            <?php } while ($row_getDoclist = mysql_fetch_assoc($getDoclist)); } else {echo "Not uploaded";} ?>

          </ol>

          </p>

        </div>

        <div class="edit_profile">

          <div class="edit_profile">

            <form name="edit_profile" method="POST" action="<?php echo $editFormAction; ?>" id="edit_profile">

              <div class="field_item">

                <label>Full Name:</label>

                <input name="full_name" type="text" id="full_name" value="<?php echo $row_getProfile['full_name']; ?>" />

              </div>

              <div class="field_item">

                <label>Job title:</label>

                <input name="job_title" type="text" id="job_title" value="<?php echo $row_getProfile['job_title']; ?>" />

              </div>

              <div class="field_item">

                <label>Email Address:</label>

                <input type="email" readonly name="email_address" id="email_address" value="<?php echo $row_getProfile['email_address']; ?>" />

              </div>
			  <div class="field_item">

                <label>Notes:</label>

                <textarea name="notes_text" id="notes_text" rows="4" /><?php echo $row_getProfile['notes_text']; ?></textarea>
				
		

              </div>

              <div class="field_item">

                <label>Skillset:</label>

                <textarea name="skill_set" id="skill_set" rows="4" /><?php echo $row_getProfile['skill_set']; ?></textarea>

                <input type="hidden" id="created_by" name="created_by" value="<?php echo $row_getProfile['created_by']; ?>" />

                <input name="profile_id" type="hidden" id="profile_id" value="<?php echo $row_getProfile['profile_id']; ?>" />

                <div class="field_item"> </div>

                <p>Supports JPG, PNG, GIF</p>

                <label>Profile Picture:

                  <input name="profile_pic1" type="hidden" id="profile_pic1" value="<?php echo $row_getProfile['profile_pic']; ?>" />

                </label>

                <input type="button" onclick="MM_openBrWindow('upload.php?uptype=1','UPLOAD','width=500,height=220')" value="Upload Profile Picture" />

              </div>

              <div class="field_item">

                <p>Supports PDF, doc, docx</p>

                <label>Upload CV:

                  <input name="cv_file1" type="hidden" id="cv_file1" value="<?php echo $row_getProfile['cv_file']; ?>" />

                </label>

                <input type="button" onclick="MM_openBrWindow('upload.php?uptype=2','UPLOAD','width=500,height=220')" value="Upload CV" />

              </div>

              <div class="field_item">

                <p>Supports PDF, DOC, DOCX, JPG, PNG, GIF</p>

                <label>

                  <input name="passport_file1" type="hidden" id="passport_file1" value="<?php echo $row_getProfile['passport_file']; ?>" />

                  Passport Copy:</label>

                <input type="button" onclick="MM_openBrWindow('upload.php?uptype=3','UPLOAD','width=500,height=220')" value="Upload Passport" />

              </div>

              <div class="field_item">

                <p>Supports PDF, DOC, DOCX, JPG, PNG, GIF</p>

                <label>

                  <input name="visa_file1" type="hidden" id="visa_file1" value="<?php echo $row_getProfile['visa_file']; ?>" />

                  Visa Copy:</label>

                <input type="button" onclick="MM_openBrWindow('upload.php?uptype=6','UPLOAD','width=500,height=220')" value="Upload Visa" />

              </div>

              

              <div class="field_item">

                <p>Supports PDF, xls, xlsx</p>

                <label>Holiday Sheet:

                  <input name="holiday_sheet1" type="hidden" id="holiday_sheet1" value="<?php echo $row_getProfile['holiday_sheet']; ?>" />

                </label>

                <input type="button" onclick="MM_openBrWindow('upload.php?uptype=4','UPLOAD','width=500,height=220')" value="Upload Holiday Sheet" />

              </div>

              <div class="field_item">

                <p>Supports PDF, doc, docx,xls,xlsx</p>

                <label>Other/Academic Certificates:

                  <input name="other_docs1" type="hidden" id="other_docs1" value="<?php echo $row_getProfile['other_docs']; ?>" />

                </label>

                <input type="button" onclick="MM_openBrWindow('upload_other.php?prid=<?php echo $row_getProfile['profile_id']; ?>&uptype=1','UPLOAD','width=500,height=220')" value="Upload Other documents" />

              </div>

              <div class="field_item">

                <label>Other Info:</label>

                <textarea name="other_info" id="other_info" rows="4" /><?php echo $row_getProfile['other_info']; ?></textarea>

                </textarea>

              </div>

              <h3>Bank Details</h3>

              <div class="field_item">

                <label>Account No.:</label>

                <input name="bank_account" type="text" id="bank_account" value="<?php echo $row_getProfile['bank_account']; ?>" />

              </div>

              <div class="field_item">

                <label>Sort Code:</label>

                <input name="bank_sortcode" type="text" id="bank_sortcode" value="<?php echo $row_getProfile['bank_sortcode']; ?>" />

              </div>

              <div class="field_item">

                <label>Bank Name and Address:</label>

                <textarea name="bank_address" id="bank_address" rows="4" /><?php echo $row_getProfile['bank_address']; ?></textarea>

              </div>

              <h3>Personal Details</h3>
              
               <div class="field_item"><p>(DD-MM-YYYY)</p>

                <label>Date Of Birth</label>

                <input  name="date_of_birth" type="text" id="date_of_birth" value="<?php if($row_getProfile['date_of_birth'] != 0) { echo date('d-m-Y',strtotime($row_getProfile['date_of_birth'])); } else { echo ''; } ?>" />

              </div>


              <div class="field_item">

                <label>Passport Number</label>

                <input  name="passport_number" type="text" id="passport_number" value="<?php echo $row_getProfile['passport_number']; ?>"  />

              </div>

              <div class="field_item"><p>(DD-MM-YYYY)</p>

                <label>Passport Expiry Date</label>

                <input  name="passport_edate" type="text" id="passport_edate" value="<?php if($row_getProfile['passport_edate'] != 0) { echo date('d-m-Y',strtotime($row_getProfile['passport_edate'])); } else { echo ''; } ?>"/>

              </div>

              <div class="field_item">

                <label>Visa Number</label>

                <input  name="visa_number" type="text" id="visa_number" value="<?php echo $row_getProfile['visa_number']; ?>"  />

              </div>

              <div class="field_item"><p>(DD-MM-YYYY)</p>

                <label>Visa Expiry Date</label>

                <input  name="visa_edate" type="text" id="visa_edate" value="<?php if($row_getProfile['visa_edate'] != 0) { echo date('d-m-Y',strtotime($row_getProfile['visa_edate'])); } else { echo ''; } ?>" />

              </div>

              <div class="field_item">

                <label>NI Number:</label>

                <input name="ni_number" type="text" id="ni_number" value="<?php echo $row_getProfile['ni_number']; ?>" />

              </div>

              <div class="field_item">

                <label>Citizen of</label>

                <input  name="citizen_of" type="text" id="citizen_of" value="<?php echo $row_getProfile['citizen_of']; ?>"  />

              </div>

              <div class="field_item">

                <label>Contact Phone</label>

                <input  name="contact_phone" type="text" id="contact_phone" value="<?php echo $row_getProfile['contact_phone']; ?>"  />

              </div>

              <div class="field_item">

                <label>Contact Address</label>

                <textarea name="contact_address" id="contact_address" rows="4" /><?php echo $row_getProfile['contact_address']; ?></textarea>

              </div>

              <h3>Emergency Contact Details</h3>

               <div class="field_item">

                <label>Contact Person</label>

                <input  name="kin_name" type="text" id="kin_name" value="<?php echo $row_getProfile['kin_name']; ?>"  />

              </div>

               <div class="field_item">

                <label>Contact Phone</label>

                <input  name="kin_phone" type="text" id="kin_phone" value="<?php echo $row_getProfile['kin_phone']; ?>"  />

              </div>

               <div class="field_item">

                <label>Contact Email Address</label>

                <input  name="kin_email" type="text" id="kin_email" value="<?php echo $row_getProfile['kin_email']; ?>"  />

              </div>

              <div class="field_item">

                <label>Contact Address</label>

<textarea name="kin_address" id="kin_address" rows="4" /><?php echo $row_getProfile['kin_address']; ?></textarea>

               

              </div>

              <div class="action_items">

                <input name="submit2" type="submit" class="save_btn" onclick="MM_validateForm('full_name','','R','job_title','','R','bank_account','','R','contact_phone','','R','skill_set','','R');return document.MM_returnValue" value="Save">

                

                <!--<input type="reset" value="Cancel" class="reset_btn">--> 

                

              </div>

              <input type="hidden" name="MM_update" value="edit_profile" />

            </form>

          </div>

        </div>

        <div class="clear-fix">&nbsp;</div>

      </article>

    </section>

    

    <!-- Sidebar Goes here -->

    

    <aside class="sidebar">

      <div class="featured">

        <h2 class="white_txt">Change Password</h2>

        <form method="post" action="#" id="change_password" onsubmit="return checkP()">

          <div class="field_item">

            <label>Current Password:</label>

            <input type="password" name="current_password" id="current_password" >

          </div>

          <div class="field_item">

            <label>New Password:</label>

            <input type="password" name="new_password" id="new_password" >

          </div>

          <div class="field_item">

            <label>Confirm Password:</label>

            <input type="password" name="confirm_password" id="confirm_password" >

          </div>

          <div class="action_items">

            <input name="submit" type="submit" class="save_btn" onclick="MM_validateForm('current_password','','R','new_password','','R','confirm_password','','R');return document.MM_returnValue" value="Save">

            <input type="reset" value="Cancel" class="reset_btn">

          </div>

        </form>

        <div class="clear-fix">&nbsp;</div>

      </div>

      <!--<h3>Recent Activity</h3>-->

      <?php #include("recent-ac.php"); ?>

    </aside>

    <div class="clear-fix">&nbsp;</div>

  </article>

  <div class="clear-fix">&nbsp;</div>

  

  <!-- Footer Goes here -->

   <?php  require_once('../includes/footer.php'); ?>
</div>

</body>

</html>

