<?php 
	if (!$part)
	{
		$part = 1;
	}

	if ($doSubmit && $lastpart)
	{
		$part = $lastpart + 1;
	}

	if (($part < 1) || ($part > 6))
	{
		$part = 1;
	}

	$utils = new Utils;

	$db = new EO_DB;
	$db1 = new EO_DB;

	// Set this page to the Section title for the left navigation bar
	$thispagebookmark = "exbound";
	$expedition = new Expedition;
	
	$euser = new EUser;

	if (!trim($erusername)) // Couldn't get username; so redirect to Homepage
	{
		$utils->redirect("/");
		exit;
	}

	$fullname = $euser->getFirstName($erusername)." ".$euser->getLastName($erusername);


	require("Resume.inc");
	$resume = new Resume;	

	if ($doSubmit && $lastpart)
	{
		if ($lastpart == 1)
		{
			$resume->addResumeTitle($erusername,$resumetitle,$resumeemail);
			$resume->addPersonalProfile($erusername,$birthcity,$birthcountry,$birthday,$birthmonth,$birthyear,$maritalstatus,$noofdependents,$countryofcitizenship,$cboEducationLevel,$AccessLevels);
			$resume->addWorkExperience($erusername,$txtworkexp);
			$resume->addMilitaryExperience($erusername,$txtarmyexp);
			$resume->addFieldExperience($erusername,$txtpubexp);
			$resume->addPublicationExperience($erusername,$txtfieldexp);
		}
		else
		if ($lastpart == 2)
		{
			$resume->addEducation($erusername,$txteducation);
			$resume->addOutdoorProgram($erusername,$txtoutdoor); 
			$resume->addClub($erusername,$txtclubs);
			$resume->addCurrentExpedition($erusername,$txtcurrentproj);
			$resume->addPreviousExpeditionTravel($erusername,$txtprevproj);
			$resume->addPresentSport($erusername,$txtpresent);
			$resume->addEmergencyContact($erusername,$txtemergency);
			$resume->addPhysicalCondition($erusername,$txtphysical);
			$resume->addOther($erusername,$txtother);
		}
		else
		if ($lastpart == 3 OR $lastpart == 4)
		{

			if ($lastpart == 3)
			{
				$selectedChoices = '';
				for($i = 0;$i < $totalRecords; $i++)
				{
				  if ($chkSelect[$i])
				  {
					$selectedChoices .= '|'.$chkSelect[$i];
				  }
				}
				$resume->deleteQualificationChildExcepting($erusername,$selectedChoices);
			}

			for($i = 0;$i < $totalRecords; $i++)
			{
			  if($chkSelect[$i])
			  {
				$resume->addUserQualification($erusername,$chkSelect[$i]);
			  }
			}

			if($lastpart==4)
			{	
			   // Handle Resume Access and User Location Data
				$strResumeAccess = "";
				for($intCount=0;$intCount<6;$intCount++)
				{
					$varName ="chkResumeAccess".$intCount;					
					if($$varName )
					{
						$strResumeAccess.=$$varName."|";
					}
				}
				$strResumeAccess = substr($strResumeAccess,0,strlen($strResumeAccess)-1);
				$resume->addUserResumeAccess($erusername,$strResumeAccess);
				$resume->delUserLocation($erusername);
				for($intCount=1;$intCount<6;$intCount++)
				{
					$varNameDate ="txtDate".$intCount;					
					$varNameLoc ="txtLoc".$intCount;										
					if($$varNameDate)
					{
						$resume->addUserLocation($erusername,$$varNameDate,$$varNameLoc); 
					}
				}
			}

			if($lastpart==4)
			{
			  header("location:./BoundRegSuccess.ell");
			  exit;
			}

		}
	}
?>
<html>
<head>
<title>Expedition Quest - Resume</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" leftmargin=0 topmargin=0>
<table width="<?=$t1_width?>" border="0" cellspacing="0" cellpadding="0">
  <?php
	$UI = new UserInterface;
	$UI->DisplayHeader();
	$UI->DisplayTab($thispagebookmark);
  ?>
  <tr valign="top"> 
    <td> 
      <table border="0" cellspacing="0" cellpadding="0" width="<?=$t2_width?>">
        <tr> 
          <?php include "$BASE_DIR/ell/left_navigation_bar.inc"; ?>
          <td valign="top" width="<?=$t3_width?>"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td rowspan="3" width="30"><img src="/images/dot.GIF" width="20" height="1"></td>
                <td height="6"> <?php include "$BASE_DIR/ell/welcome_banner.ell"; ?> </td>
              </tr>
              <tr> 
                <td width="584">&nbsp;</td>
              </tr>
              <tr> 
                <td width="95%" valign="top" height="2"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td bgcolor="1E55DF" width="40%" height="7"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">&nbsp;File 
                        Your Resume - Step <?php echo $part  ?> of 4</font></b></font></td>
                      <td width="60%" valign="bottom" height="7"><img src="/images/sub_tab_right.gif"></td>
                    </tr>
                    <tr bgcolor="#666666"> 
                      <td colspan="2" height="1"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr bgcolor="#f5f5f5"> 
                      <td colspan="2" height="10"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
		    <tr valign="top" bgcolor="#f5f5f5"> 
                      <td colspan="2" height="15"><font face=arial size=1>If you are concerned about privacy, you might want to consider using a generic email address such as jsmith@yahoo .com or jsmith@hotmail.com.  You may also restrict who your resume is available to in the registration process.</font></td>
                    </tr>
                    <tr bgcolor="#f5f5f5"> 
                      <td colspan="2" height="10"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
		    <tr valign="top" bgcolor="#F5F5F5"> 
                      <td colspan="2"> 
                        <FORM METHOD=POST ACTION=FileResume.ell>
                          <?php
			if ($part == 1)
			{
				list($birthcity,$birthcountry,$birthdate,$maritalstatus,$noofdependents,$countryofcitizenship,$cboEducationLevel,$AccessLevels) = $resume->getPersonalProfile($erusername);
			?> 
                          <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
                            <tr> 
                              <td colspan="2" height=25><img src="../images/a2.gif">&nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#990000">General 
                                Details</font></b></font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Resume 
                                Owner : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <font size="2" face="Arial, Helvetica, sans-serif" color="#336633"><?php echo "<b>".$euser->getFirstName($erusername) . " " . $euser->getLastName($erusername)."</b>" ?> 
                                </font> </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="28"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Email Address: </font></td>
                              <td width="76%" height="28"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"> 
                                <input type=text name="resumeemail" size="25" value="<?php echo $resume->getResumeEmail($erusername); ?>">
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="28"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Resume 
                                Title : </font></td>
                              <td width="76%" height="28"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"> 
                                <input type=text name="resumetitle" size="40" value="<?php echo $resume->getResumeTitle($erusername); ?>">
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="15"><font face="Arial, Helvetica, sans-serif"></font></td>
                              <td width="76%" height="15"><font face="Arial, Helvetica, sans-serif"></font></td>
                            </tr>
                            <tr> 
                              <td colspan="2" height=25><img src="../images/a2.gif">&nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#990000">Personal 
                                Details</font></b></font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Birth 
                                City : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <INPUT TYPE=TEXT NAME=birthcity SIZE=20 VALUE="<?php echo "$birthcity" ?>">
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Birth 
                                Country : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $utils->printRightCountryCombo1($birthcountry,birthcountry); ?> 
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Birth 
                                Date : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $utils->printDateCombo("$birthdate","birthyear","birthmonth","birthday"); ?> 
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Marital 
                                Status : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $resume->printMaritalStatusCombo("$maritalstatus","maritalstatus"); ?> 
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">No 
                                of Dependents : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $resume->printDependentsCombo($noofdependents,"noofdependents"); ?> 
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Citizenship 
                                : </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $utils->printRightCountryCombo1($countryofcitizenship,countryofcitizenship); ?> 
                                </font></td>
                            </tr>
                            <tr> 
                              <td width="24%" height="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Education Level: </font></td>
                              <td width="76%" height="25"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#990000"> 
                                <?php $utils->getEducationLevelCombo("cboEducationLevel",$cboEducationLevel); ?>                                 </font></td>
                            </tr>
			    <?php
				print "<INPUT TYPE=hidden NAME=username VALUE=$erusername>\n";
				print "<INPUT TYPE=hidden NAME='AccessLevels' VALUE='$AccessLevels'>\n";
			  ?> 
                            <tr> 
                              <td colspan=2> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php
	  			$we = $resume->getWorkExperience($erusername);
				$me = $resume->getMilitaryExperience($erusername);
				$fe = $resume->getFieldExperience($erusername);
				$pe = $resume->getPublicationExperience($erusername);
				include "./FileResumeP2.ell";
			  ?> </font></td>
                            </tr>
                          </table>
                          <?php

			}
			else
			if ($part == 2)
			{
				$edu = $resume->getEducation($erusername);
				$out = $resume->getOutdoorProgram($erusername);
				$club = $resume->getClub($erusername);
				include "./FileResumeP3.ell";
				$ce = $resume->getCurrentExpedition($erusername);
				$pet = $resume->getPreviousExpeditionTravel($erusername);
				$ps = $resume->getPresentSport($erusername);
				include "./FileResumeP4.ell";
				$emergency = $resume->getEmergencyContact($erusername);
				$phycon = $resume->getPhysicalCondition($erusername);
				$other = $resume->getOther($erusername);
				include "./FileResumeP5.ell";
			}
			else
			if ($part == 3 || $part == 4)
			{
			?> 
            <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
            <?php
			$total = 1;
			$cntIterations = 3;
			if ($part == 4)
			{
			  $cntIterations = $totalRecords;
			}
			for ($i = 1;$i <= $cntIterations; $i++)
			{
				$catID = $i;
				if ($part == 4)
				{
				  $catID = $chkSelect[$i];
				}
				if ($catID > 0)
				{
			?> 
                            <tr> 
                              <td valign="top" colspan="3" height="30"> 
                                <img src="../images/a2.gif">&nbsp;<font face="Verdana,Arial, Helvetica, sans-serif" size="1" color=#990000><b><?php echo $resume->GetCategoryName($catID); ?></b></font>
                              </td>
                            </tr>
							<?php
								$total += $resume->printAllSubCat($catID,$total,1);
							?>
                            <tr>
                              <td valign="middle" align="right" colspan="2" height="15">
                              </td>
                            </tr>
                            <?php
				}
			}
			echo "<input type=\"hidden\" name=\"totalRecords\" value=\"$total\">";
			?> 
                          </table>
                          <?php
			}
			if($part==4)
			{
				include("./FileResumeP7.ell");
			}
			?> 
			</td>
                    </tr>
                    <tr bgcolor="#666666"> 
                      <td colspan="2" height="1"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
		    <tr> 
                      <td width="76%" height="32" colspan=2 valign=bottom>
                        <INPUT TYPE=hidden NAME=lastpart VALUE="<?php echo $part ?>">
                        <INPUT TYPE=hidden NAME=doSubmit VALUE=9>
                        <?php 
				echo "<input type=\"image\" border=\"0\" name=\"Submit\" src=\"../images/boundform_step".$part.".gif\">";
			?></td>
                    </tr>
		    <tr><td height=30></td></tr>
                  </table>
                </td>
              </tr>
            </table>                      
	    </form>
	    </td>
	  <td width=180>
<td width="170" align=center valign=top><br>
			<script type="text/javascript"><!--
google_ad_client = "pub-6599114083874796";
/* 160x600, created 12/2/08 */
google_ad_slot = "3186450160";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
			</td>

        </tr>
        <tr valign="top"> 
          <td colspan="2"> </td>
        </tr>
        <tr valign="top"> 
          <td colspan="2"> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<?php
	$UI->DisplayMap();
?>
</body>
</html>