<?php
	include_once("check_login.php");
	include_once("include/config.php");
	$job_id = trim($_GET["job_id"]);
	if(!check_is_numb($job_id) || $job_id < 1)
		show_err("职位信息参数出错，请返回重新操作");
	$filter_arr[0] = array("0",$job_id,false);
	if(!$hm_arr = get_job($filter_arr))
		show_err("系统中没有你要查看的职位信息");
	$page = trim($_GET["page"]);
	$page = $page ? $page : 1;
	$max_per_page = 10;
	$filter_arr[0] = array("1",$job_id,false);
	if(!$hm_arr_d = get_job_d($filter_arr))
		show_err("系统中暂无该职位的应聘信息","set_job_list.php");
?>
<!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>应聘职位列表</title>
<script language = "javascript" src="include/jquery.min.js" type="text/javascript"></script>
<script language="javascript">
$(function(){
	$(".set_main_list li").bind({
		mouseover:function(){
			$("." + $(this).attr("class")).css("background-color","#DDD");
		},
		mouseout:function(){
			$("." + $(this).attr("class")).css("background-color","");
		}
	});
});
</script>
<style type="text/css">
.set_main_list{width:906px; overflow:hidden; margin:0px auto; border-left:#CCC 1px solid;}
 ul{list-style:none; margin:0px; padding:0px;}
.set_main_list li{list-style:none; height:30px; line-height:30px; overflow:hidden; float:left; border-right:#CCC 1px solid; border-bottom:#CCC 1px solid;}
.set_main_title{width:906px; overflow:hidden; margin:0px auto; margin-top:20px; border-left:#CCC 1px solid; border-top:#CCC 1px solid; background-color:#DDD;}
.set_main_title li{list-style:none; height:30px; line-height:30px; float:left; padding:0px; text-align:center; border-right:#CCC 1px solid; border-bottom:#CCC 1px solid;}
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<div class="head_menu"><span class="head_menu_on"><a href="set_job_list.php">职位列表</a></span><a href="set_job_new.php">添加招聘</a><a href="set_job_good.php">福利待遇</a></div>
<div class="set_main_out">
	<div style="width:906px; text-align:center; font-weight:bold; font-size:16px; color:#666; margin:0px auto; margin-top:20px;">以下是应聘：<?php echo stripslashes($hm_arr[0][1]); ?>的信息</div>
    <div class="set_main_title">
      <ul>
      	<li style="width:50px;">ID</li>
      	<li style="width:150px;">姓名</li>
        <li style="width:200px;">住址</li>
        <li style="width:150px;">学历</li>
        <li style="width:250px;">联系方式</li>
        <li style="width:100px;">操作</li>
      </ul>
    </div>
    <div class="set_main_list">
      <ul>
      <?php
			//计算总页数
			$all_page = ceil(count($hm_arr_d)/$max_per_page);
			if($page > $all_page)
				$page = $all_page;
			$start = $page ? (($page - 1) * $max_per_page) : 0;
			$filter_arr[] = array("2","$start,$max_per_page",false);
			$hm_arr_d = get_job_d($filter_arr);
			foreach($hm_arr_d as $key => $val){
				echo "<li class=\"li_$val[0]\" style=\"width:50px; text-align:center;\">$val[0]</li>\n";
				echo "<li class=\"li_$val[0]\" style=\"width:150px; text-align:center;\">" . stripslashes($val[2]) . "</li>\n";
				echo "<li class=\"li_$val[0]\" style=\"width:200px; text-align:center;\">" . stripslashes($val[5]) . "</li>\n";
				echo "<li class=\"li_$val[0]\" style=\"width:150px; text-align:center;\">" . get_user_xl($val[3]) . "</li>\n";
				echo "<li class=\"li_$val[0]\" style=\"width:250px; text-align:center;\">" . stripslashes($val[6]) . "</li>\n";
				echo "<li class=\"li_$val[0]\" style=\"width:100px; text-align:center;\"><span class=\"do_style\" style=\"width:50px;\" onclick=\"location.href='set_job_d.php?job_d_id=$val[0]'\">详情</span><span class=\"do_style\" style=\"width:50px;\" onclick=\"if(confirm('确定要删除该招聘信息吗？')) location.href='DEL.php?type=job_d&id=$val[0]'; else return;\">删除</span></li>";
			}
	  ?>
      </ul>
    </div>
<div id="page" style="width:906px;">
<?php
	for($i = 1;$i <= $all_page;$i++)
		echo $i - $page == 0 ? "<a class=\"now_page\">$i</a>" : "<a class=\"page_span\" href=\"set_job_list_d.php?job_id=$job_id&page=$i\">$i</a>";
?>
</div>
</div>
</body>
</html>