/home/mip/public_html_/old-website/employer/line_up.php
<?
session_start();
require_once("func_all.php");
do_html_header("Applicant Line Up");

$position = getdata("select * from positions order by name");
$joborder=getdata("select * from job_order  where principal_id='$myprincipalid' order by job_order_no")
?> 
<tr height=100%><td valign="top"><br>
<form method=post action='<?=$PHP_SELF?>' name='form_source_survey'>
	<table align=center width=98% border=0>
	<tr><td align="center"><b> Job Order </b>
	<select name="jo_id" onChange="form_source_survey.submit()">
	<option value=""> All
	<?selectcode($joborder,$jo_id,"job_order_no","job_order_no");?>
	</select>
	</td>
	</tr>
	</table>
</form>
	<table align=center width=98%>
	<tr><td>
		<table border="0" cellpadding="0" cellspacing="0" width=100%>
		<tr><td><img src="img/topleft-login.gif" border="0"></td>
		<td background="img/toptile-login.gif"><img src="img/toptile-login.gif" border="0"></td>
		<td><img src="img/topright-login.gif" border="0"></td></tr>
		<tr><td background="img/midleft-login.gif"><img src="img/midleft-login.gif" border="0"></td>
		<td width="100%" align="center" bgcolor="#dbdee3">
			<table width="100%" cellpadding='3' cellspacing='3'>
   			<tr>
				<td width=2%>&nbsp;</td>
				<td width=15% align=left><b>Applicant No.</td>
				<td width=29% align=left><b>Applicant Name</td>
				<td width=6% align=center><b>Sex</b></td>
				<td width=15% align=left><b>Position</td>
				<td width=15% align=center><b>Agency Remarks</b></td>		
				<td width="16%"><b>Employer's Remarks</b></td>
				<td>&nbsp;</td>
				</tr>
				<?
				//job order
				if($jo_id) { $sql_jo="AND job_order_no='$jo_id' "; }
				$jo=getdata("select * from job_order where principal_id='$myprincipalid' $sql_jo ");
				$n_jo=count($jo);

				for($j=1;$j<=$n_jo;$j++) {
					$sql="SELECT cv.*, p.sex, p.birthdate, p.position1_yrsofexp, p.position1_mosofexp, j.position_id as pos
					from lineup as cv,
					personal as p, 
					jo_position as j              
					where 
					j.jo_pos_id=cv.jo_pos_id
					and p.applicant_id=cv.applicant_id
					and j.job_order_id='".$jo[$j][job_order_id]."'
					and cv.principal_id='$myprincipalid'
					and (p.status like 'On Pool' or p.status like 'KIV') 
					order by cv.date ";
											 
					$result = getdata($sql);
					$found = count($result);
					echo mysql_error();
					
					if($found){ 
             			print "<tr><td colspan='8' class=box valign=top>".$jo[$j]["job_order_no"]."&nbsp;</td></tr>";		
						for($i=1;$i<=$found;$i++){ 
							$applicant_id = $result[$i]["applicant_id"];
							$educ = getdata("SELECT education FROM education WHERE applicant_id = '$applicant_id' ORDER BY to_date DESC");
							
							print "<tr>";
								print "<td class=box align=right valign=top>$i.&nbsp;</td>";
								print "<td class=box valign=top>";						
								print "<a href=\"report_resume.php?applicant_id=".$applicant_id."&employer=1\" target=\"page$applicant_id\">$applicant_id</a>";
								print "</td>";
								print "<td class=box valign=top>".get_applicantname($result[$i]["applicant_id"])."</td>";    				
								print "<td class=box align=center valign=top>".$result[$i]["sex"]."</td>";
								print "<td  class=box valign=top>".getname($result[$i]['pos'],"positions","position_id")."</td>";						
								print "<td class=box align=left valign=top>";
								print $result[$i]["remarks"];
								print "</td>";
								print "<td class=box align=left valign=top>".$result[$i]['remarks2']."</td>";
								print "<td class=box> ";
								?>
								<A HREF="javascript:popUp('edit_remarks.php?applicant_id=<?=$result[$i]['applicant_id']?>&cvsent_id=<?=$result[$i]['cvsent_id']?>&jo_no=<?=$jo[$j][job_order_no]?>')"> 
								<? if($result[$i]['remarks2']!="")
								echo "Edit Remarks"; 
								else echo "Add Remarks";  ?>
								</a>
								<?
								print  "</td>";
							print "</tr>";
						} // end of for loop
  					} else { 
					} 
				} //j	
			?>
			</table>
		</td>
		<td background="img/midright-login.gif"><img src="img/midright-login.gif" border="0"></td></tr>
		<tr><td><img src="img/botleft-login.gif" border="0"></td>
		<td background="img/bottile-login.gif"><img src="img/bottile-login.gif" border="0"></td>
		<td><img src="img/botright-login.gif" border="0"></td></tr>
		</table>			
	</td></tr>
	</table>
</td></tr>
<?
do_html_footer();
?>