                                <?php /* $Id: Edit.tpl 3695 2007-11-26 22:01:04Z brian $ */ ?>
<?php TemplateUtility::printHeader('Candidates', array('modules/candidates/validator.js', 'js/sweetTitles.js', 'js/listEditor.js', 'js/doubleListEditor.js')); ?>
<?php TemplateUtility::printHeaderBlock(); ?>
<?php TemplateUtility::printTabs($this->active); ?>
<link href="/ontc/theme/css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/ontc/jquery-latest.js"></script>

<script src="/ontc/theme/js/jquery-ui-1.8.18.custom.min.js"></script>
    <div id="main">
        <?php TemplateUtility::printQuickSearch(); 
date_default_timezone_set("Asia/Muscat");
                                $industry = $this->data['industry'];
                                $func = $this->data['function'];
				$gender = $this->data['gender'];
				$region = $this->data['region'];
  			        $wilayat = $this->data['wilayat'];
 			        $discipline = $this->data['discipline'];
				$quali = $this->data['qualification'];
				$university = $this->data['university'];
				$institute = $this->data['institute'];
				$nationality = $this->data['nationality'];
				$year = $this->data['year'];
				$min_dt = date('Y-m-d', strtotime('1984-01-01'));
				$max_dt = date('Y-m-d', strtotime('1996-12-31'));
				
				$rsUniv = mysql_query("SELECT * FROM university");
				while($rwUniv = mysql_fetch_array($rsUniv)){
				$univer[] = $rwUniv['university'];
				}
				$cand_id = $this->data['candidateID'];
				$rsjobord_id = mysql_query("SELECT * FROM candidate_joborder WHERE candidate_id='$cand_id'");
                                $rwjobord_id = mysql_fetch_array($rsjobord_id);  
                                $jobord_id = $rwjobord_id['joborder_id'];
				
   echo '<script>';
   echo '$(function() {';
   echo '$( "#dob" ).datepicker({ dateFormat: "yy-mm-dd",minDate: "'.$min_dt.'",maxDate: "'.$max_dt.'",changeMonth: true, changeYear: true });';
   echo '});';
   echo '</script>';
   
   $rsApplied = mysql_query("SELECT * FROM candidate_as_applied WHERE candidate_id='$cand_id'");
   $rwApplied = mysql_fetch_array($rsApplied);
   $gen = $rwApplied['gender'];
   if($gen ==1){
   $gender_app = 'Male';
   }else if($gen ==2){
   $gender_app = 'Female';
   }
   
   $regi = $rwApplied['region'];
   $rsRegi = mysql_query("SELECT * FROM cm_region WHERE id='$regi'");
   $rwRegi = mysql_fetch_assoc($rsRegi);
   $region_app = $rwRegi['region'];
   
   $wila = $rwApplied['wilayat'];
   $rsWila = mysql_query("SELECT * FROM cm_wilayat WHERE id='$wila'");
   $rwWila = mysql_fetch_assoc($rsWila);
   $wilayat_app = $rwWila['wilayat'];
   
   $qualif = $rwApplied['qualification'];
   if($qualif ==1){
   $qualif_app = 'Diploma';
   }else if($qualif ==2){
   $qualif_app = 'Bachelors';
   }else if($qualif ==3){
								$qualif_app = 'Lesser than secondary school';
								}else if($qualif ==4){
								$qualif_app = 'Secondary school';
								}else if($qualif ==5){
								$qualif_app = 'Higher Diploma';
								}else if($qualif ==6){
								$qualif_app = 'Advanced Diploma';
								}else if($qualif ==7){
								$qualif_app = 'Masters';
								}
								
   $disc = $rwApplied['discipline'];
   $rsDisc = mysql_query("SELECT * FROM cm_discipline WHERE id='$disc'");
   $rwDisc = mysql_fetch_assoc($rsDisc);
   $discipline_app = $rwDisc['discipline'];
   
   $univ = $rwApplied['university'];
   if($univ ==1){
   $univers_app = 'Omani University';
   }else if($univ ==2){
   $univers_app = 'Foreign University';
   }
   
      $jobarray = array("10","11","12","13");
		?>
        <div id="contents">
            <table>
                <tr>
                    <td width="3%">
                        <img src="images/candidate.gif" width="24" height="24" border="0" alt="Candidates" style="margin-top: 3px;" />&nbsp;
                    </td>
                    <td><h2>Candidates: Edit</h2></td>
               </tr>
            </table>

            <p class="note">Edit Candidate</p>

            <form name="editCandidateForm" id="editCandidateForm" action="<?php echo(CATSUtility::getIndexName()); ?>?m=candidates&amp;a=edit" method="post" onSubmit="return checkEditForm(document.editCandidateForm);" autocomplete="off">
                <input type="hidden" name="postback" id="postback" value="postback" />
                <input type="hidden" id="candidateID" name="candidateID" value="<?php $this->_($this->data['candidateID']); ?>" />

                <table class="editTable" width="700">
                    <tr>
                        <td class="tdVertical" valign="top" style="height: 28px;">
                            <label id="isHotLabel" for="isHot">Active:</label>
                        </td>
                         <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"></label>
                        </td>
                        <td class="tdData">
                            <input type="checkbox" id="isActive" name="isActive"<?php if ($this->data['isActive'] == 1): ?> checked<?php endif; ?> />
                            <img title="Unchecking this box indicates the candidate is inactive, and will no longer display on the resume search results." src="images/information.gif" alt="" width="16" height="16" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tdVertical">
                            <label id="industryLabel" for="industry">Industry:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="industryLabel" for="industry"></label>
                        </td>
                        <td class="tdData">
                        <select name="industry" id="industry">
                        <option value="">SELECT</option>
                        <?php $rsIndus = mysql_query("SELECT * FROM cm_industry");
			      while($rwIndus = mysql_fetch_array($rsIndus)){
						$indus_name = utf8_encode($rwIndus['industry']);
						if($industry==$rwIndus['id']){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwIndus['id'];?>" <?php echo $vSelected;?>><?php echo $indus_name;?></option>
						<?php } ?>
                        </select>
                        </td>
                    </tr>
                    
                    <tr>
                        <td class="tdVertical">
                            <label id="functionLabel" for="function">Function:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="functionLabel" for="function"></label>
                        </td>
                        <td class="tdData">
                        <select name="function" id="function">
                        <option value="">SELECT</option>
                        <?php $rsFunc = mysql_query("SELECT * FROM cm_functions");
			      while($rwFunc = mysql_fetch_array($rsFunc)){
						$func_name = utf8_encode($rwFunc['function']);
						if($func==$rwFunc['id']){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwFunc['id'];?>" <?php echo $vSelected;?>><?php echo $func_name;?></option>
						<?php } ?>
                        </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName">First Name:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['first_name'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="firstName" name="firstName" value="<?php $this->_($this->data['firstName']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="middleNameLabel" for="middleName">Middle Name:</label>
                        </td>
                         <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['middle_name'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="middleName" name="middleName" value="<?php $this->_($this->data['middleName']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Last Name:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['last_name'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="lastName" name="lastName" value="<?php $this->_($this->data['lastName']); ?>" style="width: 150px;" />
                        </td>
                    </tr>
					
					  <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Gender:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $gender_app;?></label>
                        </td>
                        <td class="tdData">
						<select name="gender" id="gender">
						<option value="">SELECT</option>
						<option value="1" <?php if($gender==1) echo "selected";?>>Male</option>
						<option value="2" <?php if($gender==2) echo "selected";?>>Female</option>
						</select>
                        </td>
                    </tr>
					
					  <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">DOB:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['dob'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="dob" name="dob" value="<?php $this->_($this->data['dob']); ?>" style="width: 150px;" />
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Nationality:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"></label>
                        </td>
                        <td class="tdData">
                        <select name="nationality" id="nationality">
                        <option value="">SELECT</option>
                        <?php $rsNat = mysql_query("SELECT * FROM cm_nationality");
						while($rwNat = mysql_fetch_array($rsNat)){
						$nat_name = utf8_encode($rwNat['nat_name']);
						if($nationality==$rwNat['nat_code']){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwNat['nat_code'];?>" <?php echo $vSelected;?>><?php echo $nat_name;?></option>
						<?php } ?>
                        </select>
                        </td>
                    </tr>
                    
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">National ID:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['national_id'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="national_id" name="national_id" value="<?php $this->_($this->data['nationalID']); ?>" style="width: 150px;" />
                        </td>
                    </tr>
                    
                    <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Region:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $region_app;?></label>
                        </td>
                        <td class="tdData">
						<select name="region" id="region">
						<option value="">SELECT</option>
						<?php $rsReg = mysql_query("SELECT * FROM cm_region");
						while($rwReg = mysql_fetch_array($rsReg)){
						$reg = utf8_encode($rwReg['region']);
						if($rwReg['id']==$region){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwReg['id'];?>" <?php echo $vSelected;?>><?php echo $reg;?></option>
						<?php } ?>
						</select>
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Wilayat:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $wilayat_app;?></label>
                        </td>
                        <td class="tdData">
						<select name="wilayat" id="wilayat">
						<option value="">SELECT</option>
						<?php
						$rsWila = mysql_query("SELECT * FROM cm_wilayat WHERE region_id='$region'");
						while($rwWila = mysql_fetch_array($rsWila))
						{ 
						if($rwWila['id']==$wilayat){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwWila['id'];?>" <?php echo $vSelected;?>><?php echo $rwWila['wilayat'];?></option>
						<?php } ?>
						</select>
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">GSM:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['gsm'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="gsm" name="gsm" value="<?php $this->_($this->data['gsm']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                     <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Alternative GSM1:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['gsm'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="gsm1" name="gsm1" value="<?php $this->_($this->data['gsm1']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                     <tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Alternative GSM2:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['gsm'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="gsm2" name="gsm2" value="<?php $this->_($this->data['gsm2']); ?>" style="width: 150px;" />
                        </td>
                    </tr>
					
                    <tr>
                        <td class="tdVertical">
                            <label id="email1Label" for="email1">E-Mail:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['email1'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="email1" name="email1" value="<?php $this->_($this->data['email1']); ?>" style="width: 150px;" />
                        </td>
                    </tr>
					
		<tr>
                        <td class="tdVertical">
                            <label id="email1Label" for="email1">Alternative E-Mail1:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['email1'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="email2" name="email2" value="<?php $this->_($this->data['email2']); ?>" style="width: 150px;" />
                        </td>
                    </tr>			

<tr>
                        <td class="tdVertical">
                            <label id="email1Label" for="email1">Alternative E-Mail2:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['email1'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="email3" name="email3" value="<?php $this->_($this->data['email3']); ?>" style="width: 150px;" />
                        </td>
                    </tr>			
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Qualification:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $qualif_app;?></label>
                        </td>
                        <td class="tdData">
						<!--<select name="qualification" id="qualification">
						<option value="">SELECT</option>
						<option value="3" <?php if($quali==3) { echo "selected"; }?>>Lesser than secondary school</option>
						<option value="4" <?php if($quali==4) { echo "selected"; }?>>Secondary school</option>
						<option value="1" <?php if($quali==1) { echo "selected"; }?>>Diploma</option>
						<option value="5" <?php if($quali==5) { echo "selected"; }?>>Higher Diploma</option>
						<option value="6" <?php if($quali==6) { echo "selected"; }?>>Advanced Diploma</option>
						<option value="2" <?php if($quali==2) { echo "selected"; }?>>Bachelors</option>
						<option value="7" <?php if($quali==7) { echo "selected"; }?>>Masters</option>
						</select>-->
						
						<select name="qualification" id="qualification">
						<option value="">SELECT</option>
						<?php $qry = mysql_query("SELECT * FROM cm_qualification");
						while($res = mysql_fetch_array($qry)){
						$qualific = utf8_encode($res['quali']);
						$qua_id = $res['id'];
						if($quali == $qua_id){
						$vSelected = "selected";
						}
						else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $qua_id;?>" <?php echo $vSelected;?>><?php echo $qualific;?></option>
						<?php } ?>
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Discipline:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $discipline_app;?></label>
                        </td>
                        <td class="tdData">
                        
						<select name="discipline" id="discipline">
						<option value="">SELECT</option>
						<?php 
						$rsDisc = mysql_query("SELECT * FROM cm_discipline WHERE joborder_id=''");
						while($rwDisc = mysql_fetch_array($rsDisc)){
						if($rwDisc['id']==$discipline){
						$vSelected = "selected";
						}else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $rwDisc['id'];?>" <?php echo $vSelected;?>><?php echo $rwDisc['discipline'];?></option>
						<?php } ?>
						</select>
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Year of Passing:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['year'];?></label>
                        </td>
                        <td class="tdData">
                         <select STYLE="font-family: Century Gothic; font-size: 13px;" name="year" id="year"><option value="">SELECT</option>
						   <?php
                       for($i=1954;$i<=2014;$i++)
                       {
                       if($year==$i){
                       $vSelected = "selected";
                       }else{
                       $vSelected = "";
                       }
                       echo "<option value = ".$i." $vSelected>".$i."</option>";
                       }
                       
                       
                       ?>

						</select>
						
                        </td>
                    </tr>
					
					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">University:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $univers_app;?></label>
                        </td>
                        <td class="tdData">
						<select name="university" id="university">
						<option value="">SELECT</option>
						<option value="1" <?php if($university==1){ echo "selected";}?>>Omani University</option>
						<option value="2" <?php if($university==2){ echo "selected";}?>>Foreign University</option>
						</select>
						<input type="hidden" name="hid_univ" id="hid_univ" value="<?php echo $university;?>">
                        </td>
                    </tr>

					<tr class="inst1">
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">Institution:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['institute'];?></label>
                        </td>
                        <td class="tdData">
                        <?php //if(in_array($institute, $univer)){?>
						<select name="institute" id="institute">
						<option value="">SELECT</option>
						<?php $qry = mysql_query("SELECT * FROM university");
						while($res = mysql_fetch_array($qry)){
						$univ = utf8_encode($res['university']);
						if($univ == $institute){
						$vSelected = "selected";
						}
						else{
						$vSelected = "";
						}
						?>
						<option value="<?php echo $univ;?>" <?php echo $vSelected;?>><?php echo $res['university'];?></option>
						<?php } ?>
						<option value="others">Others</option>
						</select>
						<div class="o_inst" style="display:none;"><input type="text" name="o_inst" id="o_inst" value="<?php echo $_POST['o_inst'];?>"></div>
						<?php //} else if($university!=2) { ?>
						<!--<input type="text" name="institute" id="institute" value="<?php echo $institute;?>" />-->
						<?php// } ?>
                        </td>
                    </tr>

			<tr class="inst2">
<td class="tdVertical">
Institution:
</td>
<td class="tdData"><?php if($university==2) { echo $rwApplied['institute']; } ?></td>
<td class="tdData">
<input type="text" name="institute1" id="institute1" value="<?php if($university==2) { echo $institute; }?>" class="inputbox" style="width: 150px"/>
</td>
</tr>	

					<tr>
                        <td class="tdVertical">
                            <label id="lastNameLabel" for="lastName">GPA:</label>
                        </td>
                        <td class="tdVertical">
                            <label id="firstNameLabel" for="firstName"><?php echo $rwApplied['gpa'];?></label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="gpa" name="gpa" value="<?php $this->_($this->data['gpa']); ?>" style="width: 50px;" />
                            <label id="lastNameLabel" for="lastName">Scale:</label>
                            <input type="text" class="inputbox" id="scale" name="scale" value="<?php $this->_($this->data['scale']); ?>" style="width: 50px;" />
                        </td>
                    </tr>
				
                   <!-- <tr>
                        <td class="tdVertical">
                            <label id="email2Label" for="email2">2nd E-Mail:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="email2" name="email2" value="<?php $this->_($this->data['email2']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="phoneHomeLabel" for="phoneHome">Home Phone:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="phoneHome" name="phoneHome" value="<?php $this->_($this->data['phoneHome']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="phoneCellLabel" for="phoneCell">Cell Phone:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="phoneCell" name="phoneCell" value="<?php $this->_($this->data['phoneCell']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="phoneWorkLabel" for="phoneWork">Work Phone:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="phoneWork" name="phoneWork" value="<?php $this->_($this->data['phoneWork']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="webSiteLabel" for="webSite">Web Site:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="webSite" name="webSite" value="<?php $this->_($this->data['webSite']); ?>" style="width: 150px" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="addressLabel" for="address1">Address:</label>
                        </td>
                        <td class="tdData">
                            <textarea class="inputbox" id="address" name="address" style="width: 150px;"><?php $this->_($this->data['address']); ?></textarea>
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="cityLabel" for="city">City:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="city" name="city" value="<?php $this->_($this->data['city']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="stateLabel" for="state">State:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="state" name="state" value="<?php $this->_($this->data['state']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="zipLabel" for="zip">Postal Code:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="zip" name="zip" value="<?php $this->_($this->data['zip']); ?>" style="width: 150px;" />
                            <input type="button" class="button" onClick="CityState_populate('zip', 'ajaxIndicator');" value="Lookup" />
                            <img src="images/indicator2.gif" alt="AJAX" id="ajaxIndicator" style="vertical-align: middle; visibility: hidden; margin-left: 5px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="canRelocateLabel" for="canRelocate">Best Time To Call:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="bestTimeToCall" name="bestTimeToCall" value="<?php $this->_($this->data['bestTimeToCall']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical" valign="top" style="height: 28px;">
                            <label id="isHotLabel" for="isHot">Hot Candidate:</label>
                        </td>
                        <td class="tdData" >
                            <input type="checkbox" id="isHot" name="isHot"<?php if ($this->data['isHot'] == 1): ?> checked<?php endif; ?> />

                        </td>
                    </tr>
                            
                    <tr>
                        <td class="tdVertical">
                            <label id="sourceLabel" for="source">Source:</label>
                        </td>
                        <td class="tdData">
                            <select id="sourceSelect" name="source" class="inputbox" style="width: 150px;" onChange="if (this.value == 'edit') { listEditor('Sources', 'sourceSelect', 'sourceCSV', false, ''); this.value = '(none)'; } if (this.value == 'nullline') { this.value = '(none)'; }">
                                <option value="edit">(Edit Sources)</option>
                                <option value="nullline">-------------------------------</option>
                                <?php if ($this->sourceInRS == false): ?>
                                    <?php if ($this->data['source'] != '(none)'): ?>
                                        <option value="(none)">(None)</option>
                                    <?php endif; ?>
                                    <option value="<?php $this->_($this->data['source']); ?>" selected="selected"><?php $this->_($this->data['source']); ?></option>
                                <?php else: ?>
                                    <option value="(none)">(None)</option>
                                <?php endif; ?>
                                <?php foreach ($this->sourcesRS AS $index => $source): ?>
                                    <option value="<?php $this->_($source['name']); ?>" <?php if ($source['name'] == $this->data['source']): ?>selected<?php endif; ?>><?php $this->_($source['name']); ?></option>
                                <?php endforeach; ?>
                            </select>

                            <input type="hidden" id="sourceCSV" name="sourceCSV" value="<?php $this->_($this->sourcesString); ?>" />
                        </td>
                    </tr>-->

			
                    <tr>
                        <td class="tdVertical">
                            <label id="ownerLabel" for="owner">Interviewer:</label>
                        </td>
                         <td class="tdVertical">
                            <label id="ownerLabel" for="owner"></label>
                        </td>
                        <td class="tdData">
                         <select id="owner" name="owner" class="inputbox" style="width: 150px;" <?php if (!$this->emailTemplateDisabled): ?>onchange="document.getElementById('divOwnershipChange').style.display=''; <?php if ($this->canEmail): ?>document.getElementById('checkboxOwnershipChange').checked=true;<?php endif; ?>"<?php endif; ?>>
                                <option value="-1">None</option>

                                <?php foreach ($this->usersRS as $rowNumber => $usersData): ?>
                                    <?php if ($this->data['owner'] == $usersData['userID']): ?>
                                        <option selected="selected" value="<?php $this->_($usersData['userID']) ?>"><?php $this->_($usersData['lastName']) ?>, <?php $this->_($usersData['firstName']) ?></option>
                                    <?php else: ?>
                                        <option value="<?php $this->_($usersData['userID']) ?>"><?php $this->_($usersData['lastName']) ?>, <?php $this->_($usersData['firstName']) ?></option>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            </select>&nbsp;*
                            <div style="display:none;" id="divOwnershipChange">
                                <input type="checkbox" name="ownershipChange" id="checkboxOwnershipChange" <?php if (!$this->canEmail): ?>disabled<?php endif; ?>> E-Mail new owner of change
                            </div>
                        </td>
                    </tr>

                     <!--<tr>
                        <td class="tdVertical">
                            <label id="sourceLabel" for="image">Picture:</label>
                        </td>
                        <td class="tdData">
                            <input type="button" class="button" id="addImage" name="addImage" value="Edit Profile Picture" style="width:150px;" onclick="showPopWin('<?php echo(CATSUtility::getIndexName()); ?>?m=candidates&amp;a=addEditImage&amp;candidateID=<?php echo($this->candidateID); ?>', 400, 370, null); return false;" />&nbsp;
                        </td>
                    </tr>-->
                </table>
               
                <?php if($this->EEOSettingsRS['enabled'] == 1): ?>
                    <?php if(!$this->EEOSettingsRS['canSeeEEOInfo']): ?>
                        <table class="editTable" width="700">
                            <tr>
                                <td>
                                    Editing EEO data is disabled.
                                </td>
                            </tr>
                        </tr>
                        <table class="editTable" width="700" style="display:none;">
                    <?php else: ?>
                        <table class="editTable" width="700">
                    <?php endif; ?>               

                         <?php if ($this->EEOSettingsRS['genderTracking'] == 1): ?>
                             <tr>
                                <td class="tdVertical">
                                    <label id="canRelocateLabel" for="canRelocate">Gender:</label>
                                </td>
                                <td class="tdData">
                                    <select id="gender" name="gender" class="inputbox" style="width:200px;">
                                        <option value="">----</option>
                                        <option value="m" <?php if (strtolower($this->data['eeoGender']) == 'm') echo('selected'); ?>>Male</option>
                                        <option value="f" <?php if (strtolower($this->data['eeoGender']) == 'f') echo('selected'); ?>>Female</option>
                                    </select>
                                </td>
                             </tr>
                         <?php endif; ?>
                         <?php if ($this->EEOSettingsRS['ethnicTracking'] == 1): ?>
                             <tr>
                                <td class="tdVertical">
                                    <label id="canRelocateLabel" for="canRelocate">Ethnic Background:</label>
                                </td>
                                <td class="tdData">
                                    <select id="race" name="race" class="inputbox" style="width:200px;">
                                        <option value="">----</option>
                                        <option value="1" <?php if ($this->data['eeoEthnicTypeID'] == 1) echo('selected'); ?>>American Indian</option>
                                        <option value="2" <?php if ($this->data['eeoEthnicTypeID'] == 2) echo('selected'); ?>>Asian or Pacific Islander</option>
                                        <option value="3" <?php if ($this->data['eeoEthnicTypeID'] == 3) echo('selected'); ?>>Hispanic or Latino</option>
                                        <option value="4" <?php if ($this->data['eeoEthnicTypeID'] == 4) echo('selected'); ?>>Non-Hispanic Black</option>
                                        <option value="5" <?php if ($this->data['eeoEthnicTypeID'] == 5) echo('selected'); ?>>Non-Hispanic White</option>
                                    </select>
                                </td>
                             </tr>
                         <?php endif; ?>
                         <?php if ($this->EEOSettingsRS['veteranTracking'] == 1): ?>
                             <tr>
                                <td class="tdVertical">
                                    <label id="canRelocateLabel" for="canRelocate">Vetran Status:</label>
                                </td>
                                <td class="tdData">
                                    <select id="veteran" name="veteran" class="inputbox" style="width:200px;">
                                        <option value="">----</option>
                                        <option value="1" <?php if ($this->data['eeoVeteranTypeID'] == 1) echo('selected'); ?>>No</option>
                                        <option value="2" <?php if ($this->data['eeoVeteranTypeID'] == 2) echo('selected'); ?>>Eligible Veteran</option>
                                        <option value="3" <?php if ($this->data['eeoVeteranTypeID'] == 3) echo('selected'); ?>>Disabled Veteran</option>
                                        <option value="4" <?php if ($this->data['eeoVeteranTypeID'] == 4) echo('selected'); ?>>Eligible and Disabled</option>
                                    </select>
                                </td>
                             </tr>
                         <?php endif; ?>
                         <?php if ($this->EEOSettingsRS['disabilityTracking'] == 1): ?>
                             <tr>
                                <td class="tdVertical">
                                    <label id="canRelocateLabel" for="canRelocate">Disability Status:</label>
                                </td>
                                <td class="tdData">
                                    <select id="disability" name="disability" class="inputbox" style="width:200px;">
                                        <option value="">----</option>
                                        <option value="No" <?php if ($this->data['eeoDisabilityStatus'] == 'No') echo('selected'); ?>>No</option>
                                        <option value="Yes" <?php if ($this->data['eeoDisabilityStatus'] == 'Yes') echo('selected'); ?>>Yes</option>
                                    </select>
                                </td>
                             </tr>
                         <?php endif; ?>
                    </table>
                <?php endif; ?>

                <table class="editTable" width="700">
                <tr><td colspan="2" style="font-weight:bold;height:30px;">INTERVIEW RATING SHEET</td></tr>
                    
                    <?php //echo "<pre>";print_r($this->extraFieldRS);
                    for ($i = 0; $i < count($this->extraFieldRS); $i++): 
                    if($this->extraFieldRS[$i]['fieldName']=='EDUCATION / DISCIPLINE'){
                    ?>
                    <tr><td colspan="2"><b>REASON FOR REJECT</b></td></tr>
                    <?php 
                    }
                    ?>
                        <tr>
                            <td class="tdVertical" id="extraFieldTd<?php echo($i); ?>">
                                <label id="extraFieldLbl<?php echo($i); ?>">
                                    <?php $this->_($this->extraFieldRS[$i]['fieldName']); ?>:
                                </label>
                            </td>
                            <td class="tdData" id="extraFieldData<?php echo($i); ?>">
                                <?php echo($this->extraFieldRS[$i]['editHTML']); ?>
                            </td>
                        </tr>
                    <?php endfor; ?>

                   <!-- <tr>
                        <td class="tdVertical">
                            <label id="canRelocateLabel" for="canRelocate">Can Relocate:</label>
                        </td>
                        <td class="tdData">
                            <input type="checkbox" id="canRelocate" name="canRelocate"<?php if ($this->data['canRelocate'] == 1): ?> checked<?php endif; ?> />
                        </td>
                    </tr>


                    <tr>
                        <td class="tdVertical">
                            <label id="dateAvailableLabel" for="dateAvailable">Date Available:</label>
                        </td>
                        <td class="tdData">
                            <?php if (!empty($this->data['dateAvailable'])): ?>
                                <script type="text/javascript">DateInput('dateAvailable', false, 'MM-DD-YY', '<?php echo($this->data['dateAvailableMDY']); ?>', -1);</script>
                            <?php else: ?>
                                <script type="text/javascript">DateInput('dateAvailable', false, 'MM-DD-YY', '', -1);</script>
                            <?php endif; ?>
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="currentEmployerLabel" for="currentEmployer">Current Employer:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="currentEmployer" name="currentEmployer" value="<?php $this->_($this->data['currentEmployer']); ?>" style="width: 150px;" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="currentPayLabel" for="currentEmployer">Current Pay:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" name="currentPay" id="currentPay" value="<?php $this->_($this->data['currentPay']); ?>" class="inputbox" style="width: 150px" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="desiredPayLabel" for="currentEmployer">Desired Pay:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" name="desiredPay" id="desiredPay" value="<?php $this->_($this->data['desiredPay']); ?>" class="inputbox" style="width: 150px" />
                        </td>
                    </tr>

                    <tr>
                        <td class="tdVertical">
                            <label id="keySkillsLabel" for="keySkills">Key Skills:</label>
                        </td>
                        <td class="tdData">
                            <input type="text" class="inputbox" id="keySkills" name="keySkills" value="<?php $this->_($this->data['keySkills']); ?>" style="width: 400px;" />
                        </td>
                    </tr>-->

                    <tr>
                        <td class="tdVertical">
                            <label id="notesLabel" for="notes">Misc. Notes:</label>
                        </td>
                        <td class="tdData">
                            <textarea class="inputbox" id="notes" name="notes" rows="5" style="width: 400px;"><?php $this->_($this->data['notes']); ?></textarea>
                        </td>
                    </tr>
                </table>
                <input type="submit" class="button" name="submit" id="submit" value="Save" />&nbsp;
                <input type="reset"  class="button" name="reset"  id="reset"  value="Reset" onClick="resetFormForeign();" />&nbsp;
                <input type="button" class="button" name="back"   id="back"   value="Back to Details" onClick="javascript:goToURL('<?php echo(CATSUtility::getIndexName()); ?>?m=candidates&amp;a=show&amp;candidateID=<?php echo($this->candidateID); ?>');" />
            </form>

            <script type="text/javascript">
                document.editCandidateForm.firstName.focus();
            </script>
        </div>
    </div>
    <div id="bottomShadow"></div>
<?php TemplateUtility::printFooter(); ?>
<script type="text/javascript">
$(document).ready(function(){

var hid_univ_val = $('#hid_univ').val();
//alert(hid_univ_val);
if(hid_univ_val==1){
$('.inst1').show();
$('.inst2').hide();
}else if(hid_univ_val==2){
$('.inst1').hide();
$('.inst2').show();
}

$("#discipline").change(function() {
var disc_val = $('#discipline').val();
if(disc_val=='0'){
$('.o_disc').show();
}else{
$('.o_disc').hide();
}
});

$("#university").change(function() {
var univ = $('#university').val();
//alert(univ);
if(univ==1){
$('.inst1').show();
$('.inst2').hide();
}else if(univ==2){
$('.inst1').hide();
$('.inst2').show();
}
});

$("#institute").change(function() {
var inst = $('#institute').val();
if(inst=='others'){
$('.o_inst').show();
}else{
$('.o_inst').hide();
}
});

$("#year").change(function() {
var year_val = $('#year').val();
if(year_val=='0'){
$('.o_year').show();
}else{
$('.o_year').hide();
}
});

$("#region").change(function() {
var regi = $('#region').val();
$.ajax({
type: "POST",
url: "../ajax_call.php",
data: "mode=2&regi=" + regi,
success: function(html){
$("#wilayat").html(html);
}
});
});

/*$("#submit").click(function() {
window.close();
});*/

});
</script>
                            