<?php
ob_start();
session_start();
//if(!isset($_SESSION['login_user'])){
//header("Location: admin.php");}

if (($_SESSION['sap_u_741']==""))
{
	header("Location: index.php");
	exit();	
}

require_once("lib/personalDetails.php");

$ob = new personalDetails();
$uid = $_SESSION['sap_u_741'];

require_once("lib/saptrainingDetails.php");
$sapob = new saptrainingDetails();
$countsap = "0";

if(isset($_POST) && !empty($_POST)){
	if(isset($_POST['pd']) && $_POST['pd'] != ""){
	//echo $_POST['pd'];exit;

		$result = $ob->updateDetails($_POST);	
	} else {
		$result = $ob->addDetails($_POST);
	}
	//exit;
	header("Location:education_details.php?page=pd");
} else {
	$details = $ob->getDetails($uid);
	$sapdetails = $sapob->getDetails($uid);
	if(!empty($details)){
		$countsap = count($sapdetails);
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if IE 6 ]> <html  xml:lang="en" lang="en" class="ie6" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if !(IE 6)]><!-->
<!--[if IE 7 ]> <html  xml:lang="en" lang="en" class="ie7" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if !(IE 7)]><!-->
<!--[if IE 8 ]> <html  xml:lang="en" lang="en" class="ie8" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if !(IE 8)]><!-->
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
<![endif]-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Language" content="en-US" />
<meta name="skin" content="experience" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" media="all" href="global/ui/css/sapcom.css" />
<link rel="stylesheet" type="text/css" media="print" href="global/ui/css/print.css" />
<!-- for date picker -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<!-- <script type="text/javascript" src="jquery_1.8.2_min.js"></script>
<script type="text/javascript" src="jquery.validate.min.js"></script>
<script type="text/javascript" src="validation.js"></script> -->
<script type="text/javascript" src="firebug.js"></script>
<script type="text/javascript" src="date.js"></script>
<script type="text/javascript" src="jquery.datePicker.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="datePicker.css">
<link rel="stylesheet" type="text/css" media="screen" href="demo.css">
<script src="cities.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
    $(function(){
		$('.date-pick').datePicker(
			{
				startDate: '01/01/1930',
				endDate: (new Date()).asString()
			}
		);
	});
	
	
</script>
<!-- end for date picker addition -->
<title>SAP</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<script src="emailchk.js" type="text/javascript"></script>
<script language="JavaScript">
$(document).ready(function() {
<?if(empty($details)) { ?>
// Add the blackoutpage to page
		$('#page').append('<div id="blackoutpage"></div>');
		$('#blackoutpage').fadeIn(300);
	document.getElementById('showmsg').style.display='block';
	<?}?>
});

function closeblackout(){
$(' #showmsg').fadeOut(300 , function() {
		$('#blackoutpage').remove();  
	}); 
	return false;
<?//}?>
}
function validate_data(){
	title=document.f1.title[document.f1.title.selectedIndex].value;
	personal_email=document.f1.personal_email.value;
	first_name=document.f1.first_name.value;
	date1=document.f1.date1.value;
	last_name=document.f1.last_name.value;
	city=document.f1.city[document.f1.city.selectedIndex].value;
	official_email=document.f1.official_email.value;
	resume_file=document.f1.resume_file.value;
	if(document.f1.resume_file_hdn != undefined){
		resume_file_hdn=document.f1.resume_file_hdn.value;
	}
	mobile=document.f1.mobile.value;

	if (trim(title)==""){
		alert("Select Title");
		document.f1.title.focus();
		return false;
	}
	if (trim(personal_email)=="")
	{
		alert("Please enter email:")
		document.f1.personal_email.focus();
		return false;
	}
	
       var apos= personal_email.indexOf("@");
       var  dotpos=personal_email.indexOf(".");
        if(apos>0 && dotpos>0) 
		{ 
		  //   correct
		} else 
		{
		     alert("Please enter email:")
			document.f1.personal_email.focus();
	         return false;
	    }
	
	if (trim(first_name)==""){
		alert("Enter First Name");
		document.f1.first_name.focus();
		return false;
	}
	if (trim(date1)==""){
		alert("Select Date of Birth");
		document.f1.date1.focus();
		return false;
	}
	
	
	if (trim(last_name)==""){
		alert("Enter Last Name");
		document.f1.last_name.focus();
		return false;
	}
	if (trim(city)==""){
		alert("Select City");
		document.f1.city.focus();
		return false;
	}
	if (trim(official_email)=="")
	{
		alert("Please enter email:")
		document.f1.official_email.focus();
		return false;
	}
	
       var apos= official_email.indexOf("@");
       var  dotpos=official_email.indexOf(".");
        if(apos>0 && dotpos>0) 
		{ 
		  //   correct
		} else 
		{
		     alert("Please enter email:")
			document.f1.official_email.focus();
	         return false;
	    }
	if (trim(resume_file)=="" && resume_file_hdn =="undifined"){
		alert("Upload Your Resume");
		document.f1.resume_file.focus();
		return false;
	}
	if (trim(mobile)=="")
	{
		alert("Please enter Mobile No:")
		document.f1.mobile.focus();
		return false;
	}
	
	flag=confirm("Please ensure that the entry is correct. You will not be able to edit your Details again.")
	if (flag)
		document.f1.submit();
	else
		return false;
}

</script>

</head>

<body id="secondary">
<div id="showmsg" style="padding:10px;position:absolute;display:none;z-index:99999;background-color:#ffffff;color:#666666;line-height:25px;opacity:0.95;top: 50%;left: 45%;width:550px;height:190px;margin-top: -125px;margin-left: -200px;border: 0px solid;background-color: #eeeeee;overflow: auto;">
<div align="right"><a href="javascript:void(0);" onclick="closeblackout()" style='color:#333333;text-decoration:none;'><strong>Close X </strong></a></div>
<div style="padding:25px;">Please update your profiles at the first instance. If SAP does NOT approve the profile on the basis of incorrect or  incomplete information, you will not be allowed to update your profiles or re-apply for direct certification for the next 6 months. Once profile is approved, the same will not be re-validated. Re-validation of profile will take please once in six months.<br /></div>
</div>



<div id="page">
  <!--begin header content-->
  <!--googleoff: index-->
  <div id="headercontent">
    <div id="header">
      <q><a href="/" title="SAP"><img src="global/ui/images/logos/sap-logo.png" alt="SAP" /><span>The Best-Run Businesses Run SAP</span></a></q>
      <ul id="nav-utilitytop">
        <li><a href="#" id="utilitynav-locationselect" title="Change Country/Language">Newsletter<span>(change Country/Language)</span></a></li>
        <li><a href="#" id="utilitynav-buy" title="Buy SAP Products Online">Contact Us</a></li>
        <li><a href="#" id="utilitynav-flash" title="Subsribe to SAP Flash">Your SAP.com</a></li>
        <!-- <li class="login"><a href="#" title="Log In To SAP.com">My SAP Profile</a></li> -->
      </ul>
      <!-- END UTILITY NAV TOP -->
      <ul id="nav-utilitybtm">
        <!--begin-ajax-update-region targetid="nav-utilitybtm"-->
        <li id="utilitynav-phone"><a href="" class="clearfix">+91-80-6655771/1-800-255-2208(India)</a></li>
      <!--   <li><a href="#" title="Have Us Call You">Call Me Now</a></li>
        <li><a href="#" title="Chat Online With Us">Chat Now</a></li>
        <li><a href="#" title="E-Mail SAP">Contact Us</a></li> -->
        <!--end-ajax-update-region-->
      </ul>
      <!-- END UTILITY NAV BOTTOM -->
     <!--  <form action="#" method="post"  class="search" id="searchsite" title="Search SAP.com">
        <fieldset>
          <label for="searchsite-input">Search</label>
          <input type="text" class="search-input focusClear" id="searchsite-input" name="searchsite-input" />
          <input type="submit" class="search-submit" id="searchsite-submit" value="" />
        </fieldset>
      </form> -->
      <!-- END SEARCH FORM -->
    </div>
    <!-- END HEADER-->
  </div>
  <!--end header content-->
  <!--googleon: index-->
  <div id="page-content">
    <div>
	
      <div id="nav-main">
	  <p><strong><a href="#">SAP<br />
          Site Section</a></strong></p>
        <ul>
          <li><a href="http://www.sap.com/india/index.epx" target="_blank"><span>SAP India</span></a></li>
          <li><a href="http://www.sap.com/india/training-and-education/index.epx" target="_blank"><span>SAP India Education Services</span></a></li>
          <!-- <li><a href="http://www.sap.com/asia/services/education/centres/partners.epx" target="_blank"><span>SAP Education Partners</span></a></li>-->
          <li><a href="https://training.sap.com/in/" target="_blank"><span>SAP Training & Certification</span></a></li>
          <!-- <li><a href="http://www.sap.com/india/services/education/markyourcalendar.epx" target="_blank"><span>Course Schedule</span></a></li>-->
          <li><a href="https://training.sap.com/in/en/search" target="_blank"><span>SAP Training Search</span></a></li>
        </ul>
      </div>
      <!-- END MAIN NAV -->
    </div>
    <div id="breadcrumb">
      <ul>
        <li><a href="index.php"><span>SAP Microsite</span></a></li>
        <li><a href="certification_main.php"><span>SAP Certification</span></a></li>
        <li><a href="direct_certification.php"><span>Direct Certification</span></a></li>
		<li><a href="guidelines.php"><span>Guidelines</span></a></li>
        <li><span>Profiling</span></li>
      </ul>
	  
	  <div class="welcometext">Welcome <?php echo $uid;?> | <a href="log_out.php">Log Out</a></div>
    </div>
    
	<!-- prash content -->
	
	<div id="sub">
      <div id="subtop" class="clearfix diag-bkg">
        <ul id="nav-sub" class="clearfix">
          <li><a href="<?php if(isset($details) & !empty($details)) echo 'personal_details.php'; else echo '#';?>" class="on"><span>Personal Details</span></a></li>
          <li><a href="<?php if(isset($details) & !empty($details)) echo 'education_details.php'; else echo '#';?>"><span>Educational Details</span></a></li>
          <li><a href="<?php if(isset($details) & !empty($details)) echo 'sap_experience.php'; else echo '#';?>"><span>SAP Experience</span></a></li>
		  <li><a href="<?php if(isset($details) & !empty($details)) echo 'functional_experience.php'; else echo '#';?>"><span>Functional Experience</span></a></li>
		  <li><a href="<?php if(isset($details) & !empty($details)) echo 'employment_details.php'; else echo '#';?>"><span>Employment Details</span></a></li>
		  <li><a href="<?php if(isset($details) & !empty($details)) echo 'sap_training.php'; else echo '#';?>"><span>SAP Training</span></a></li>
        </ul>
        <div align="right" style="background-color:#ffffff;font-size:11px;height:20px;">An <font color="#ff0000">*</font> indicates required field.</div>
        <div id="subtop-left-content"><br />		
<form name="f1" id="f1" method="post" enctype="multipart/form-data" action="personal_details.php">
<table border="0" cellspacing="1" cellpadding="2" width="880" align="center">
<?php if(!empty($details) && $countsap == "0") { ?>
<tr><td align="right" colspan="5"><a href="#" class="alinks" onclick="javascript:validate_data()">Edit&nbsp;<span>&#8250;</span></a></td></tr>
<?php } ?>
<tr>
	<td align="right" height="35" width="90"><font color="#ff0000">*</font>Title:</td>
	<td>
		<select name="title" <?php if($countsap != "0") echo "disabled";?>>
			<option value="">Please Select
			<option value="Mr" <?php if(isset($details['title'])) if($details['title'] == "Mr") echo "selected";?>>Mr
			<option value="Mrs" <?php if(isset($details['title'])) if($details['title'] == "Mrs") echo "selected";?>>Mrs.
		</select>
	</td>
	<td>&nbsp;</td>
	<td align="right"><font color="#ff0000">*</font>Personal Email:</td><td width="370"><input type="text" name="personal_email" value="<?php if(isset($details['personal_email'])) echo $details['personal_email'];?>" class="txt1bg" style="width:200px;" <?php if($countsap != "0") echo "disabled";?>></td>
</tr>

<tr><td colspan="5"></td></tr>
<tr>
	<td align="right" height="35"><font color="#ff0000">*</font>First Name:</td><td><input type="text" name="first_name" value="<?php if(isset($details['first_name'])) echo $details['first_name'];?>" class="txt1bg" style="width:200px;"  <?php if($countsap != "0") echo "disabled";?>></td>
	<td><img src="images/b.gif" width="30" height="1" alt="" /></td><td align="right"><font color="#ff0000">*</font>Date of Birth:</td><td><!-- <select name="title">
			<option value="">Please select date</select>&nbsp;<select name="title">
			<option value="">Please select month</select>&nbsp;<select name="title">
			<option value="">Please select year</select> -->
			<?if(isset($details['date_of_birth']) && $countsap != "0"){ ?><input type="text" name="date1" style="background-color: #EFEFEF;border: 1px solid #DDDDDD;color: #000000;font-size: 11px;" readonly="readonly" value="<?=$details['date_of_birth'];?>" >
			<?}else{?>
			<input id="start-date" class="date-pick" name="date1" style="background-color: #EFEFEF;border: 1px solid #DDDDDD;color: #000000;font-size: 11px;" readonly="readonly" value="<?=$details['date_of_birth'];?>" />
			<?}?>
</td>
</tr>
<tr><td colspan="5"></td></tr>
<tr>
	<td align="right" height="35"><font color="#ff0000">*</font>Last Name:</td><td><input type="text" name="last_name" value="<?php if(isset($details['first_name'])) echo $details['last_name'];?>" class="txt1bg" style="width:200px;"  <?php if($countsap != "0") echo "disabled";?>></td>
	<td></td><td align="right"><font color="#ff0000">*</font>Current&nbsp;Location:</td><td><select name="city"  <?php if($countsap != "0") echo "disabled";?>>
	<?php if(isset($details['city'])) echo '<option value="'.$details['city'].'" selected>'.$details['city'].'</option>';?>
	<option value="">City</option>
	<script language="javascript">
		for(i=0;i<cityarray.length;i++)
		{
			document.write("<option value="+cityarray[i][1]+">"+cityarray[i][1])
		}
	</script>
	</select></td>
</tr>
<tr><td colspan="5"></td></tr>
<tr>
	<td align="right" height="35"><font color="#ff0000">*</font>Official&nbsp;Email:</td><td><input type="text" name="official_email" value="<?php if(isset($details['official_email'])) echo $details['official_email'];?>" class="txt1bg" style="width:200px;" <?php if($countsap != "0") echo "disabled";?>></td>
	<td></td><td align="right"><font color="#ff0000">*</font>Upload Resume:</td><td>
	<?if(isset($details['resume_file'])){?>
	<input type="file" name="resume_file" value="<?=$details['resume_file']?>" class="txt1bg" style="width:200px;" <?php if($countsap != "0") echo "disabled";?>>
	<a href="resumes/<?=$details['resume_file']?>" target="_blank">View Resume</a>
	<input type="hidden" name="resume_file_hdn" value="<?=$details['resume_file']?>" />
	<?}else{?>
	<input type="file" name="resume_file" value="" class="txt1bg" style="width:200px;">
	<?}?>


</td>
</tr>
<tr><td colspan="5"></td></tr>
<tr>
	<td align="right" height="35"><font color="#ff0000">*</font>Mobile:</td><td><input type="text" name="mobile" value="<?php if(isset($details['mobile'])) echo $details['mobile'];?>" class="txt1bg" style="width:200px;" <?php if($countsap != "0") echo "disabled";?>></td><td colspan="3">&nbsp;</td>
</tr>
			
</table><br /><br />
<input type="hidden" value="<?php if(isset($details['id'])) echo $details['id'];?>" name="pd" />
</form>


        </div>
   
      </div>
<?php 
if(empty($details)) { ?>
<table width="870" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height="40"><a href="guidelines.php" class="alinks"><span>&#8249;</span> Back</a></td><td align="right"><a href="#" class="alinks" onclick="javascript:validate_data()">Proceed&nbsp;<span>&#8250;</span></a></td></tr>
</table>
<?php } ?>
    </div>
	
	<!-- prash content ends -->
	
	
	
    <!-- SPACE RESERVED FOR ANALYTICS -->
    <div id="sap-news">
      <p class="news-heading rm_newsExpand"><a href="">Profiling</a></p>
      <div id="sap-news-wrapper">
        <ul>
          <li> <a href="#"> <span>We want to know you more</span>Make yourself completely SAP Certification ready.
Kindly fill in all the required forms.</a> </li>
          <li> <a href="#"> <span>July 28, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 25, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 22, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 19, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 18, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 16, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 11, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 11, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
          <li> <a href="#"> <span>July 10, 2011</span> Lorem ipsum dolor sit amet adipiscing elit pellentesque sed &#8250; </a> </li>
        </ul>
      </div>
    </div>
    <!-- END SAP NEWS -->
  </div>
  <!-- END PAGE CONTENT -->
  <div id="footer">
    <!--googleoff: index-->
    <ul id="footer-lefttop">
      <li class="short"><a href="#">Site Map</a></li>
      <li id="quick-links"> <a href="">Quick Links</a>
        <ul>
          <li><a href="#">Quick Link 1</a></li>
          <li><a href="#">Quick Link 2</a></li>
          <li><a href="#">Quick Link 3</a></li>
          <li><a href="#">Quick Link 4</a></li>
          <li><a href="#">Quick Link 5</a></li>
          <li><a href="#">Quick Link 6</a></li>
          <li><a href="#">Quick Link 7</a></li>
          <li><a href="#">Quick Link 8</a></li>
          <li><a href="#">Quick Link 9</a></li>
          <li><a href="#">Quick Link 10</a></li>
        </ul>
      </li>
      <li><a href="#" target="_blank">Using SAP</a></li>
      <li><a href="#" target="_blank">SAP Offices</a></li>
      <li><a href="#" target="_blank">Investors</a></li>
      <li class="short"><a href="#" target="_blank">Careers</a></li>
      <li><a href="http://scn.sap.com/welcome" id="footerlink-communities">SAP&nbsp;Communitie</a></li>
    </ul>
    <ul id="footer-leftbtm">
      <li class="short"><a href="#" target="_blank">Privacy</a></li>
      <li><a href="#" target="_blank">Terms of Use</a></li>
      <li><a href="#" target="_blank">Legal Disclosure</a></li>
      <li><a href="#" target="_blank">Copyright</a></li>
      <li><a href="" id="footer-textview">Text View</a></li>
      <li class="short"><a href="" id="footer-printview">Print View</a></li>
    </ul>
    <div id="footer-right"> <a href="#" id="social-network">Follow SAP</a> </div>
    <!--googleon: index-->
  </div>
  <!-- END FOOTER -->
</div>
</body>
</html>






