<!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" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>{#$title#}</title>
	<meta name="author" content="骑士CMS" />
	<meta name="copyright" content="74cms.com" />
	<link rel="shortcut icon" href="{#$QISHI.site_dir#}favicon.ico" />
	<link rel="stylesheet" href="{#$QISHI.site_template#}css/user_common.css" />
	<link rel="stylesheet" href="{#$QISHI.site_template#}css/user_hunter.css" />
	<script src="{#$QISHI.site_template#}js/png24fix.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.dropdown.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.dialog.js" type='text/javascript' ></script>
	<script src="{#$QISHI.site_template#}js/jquery.jobs-list.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.resume-list.js"></script>
	<script src="{#$QISHI.site_template#}js/ajaxfileupload.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.jcrop.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.artDialog.js"></script>
	<script>
		$(document).ready(function() {
			$(".h_jobs_item").hover(function(){
				$(this).find('.interview_but_box').show().siblings('.add_time').hide();
			},function(){
				$(this).find('.add_time').show().siblings('.interview_but_box').hide();
			});
			$(".h_jobs_item:last").css({"border-bottom":"0"});
			$(".elite_item:last").css({"border-bottom":"0"});
			// 申请为该职位推荐简历
			hunter_apply_jobs("{#$QISHI.site_dir#}");
			// 头像
			$('.change_avater').bind('click', function() {
				var logo_size = {#$QISHI.hunter_photo_max#}+"kb";
				$.dialog({
			        title: false,
			        content: $("#hunter_logo_crop").html(),
			        lock: true,
			        padding: 0,
			        left: "25%"
			    });
			    $("#hunter_logo_size").html("（请使用高质量图片，仅支持JPG、JPEG、GIF、BMP、PNG格式，图片小于"+logo_size+"）");
			});
			// 推荐简历
			recommend_resume("{#$QISHI.site_dir#}");
		});
	</script>
</head>
<body>
	<!-- 顶部 -->
	{#include file="member_hunter/header.htm"#}
	<!-- 顶部 结束-->
	<!-- 猎头首页 -->
	<div class="container">
		<div class="hunter_index clearfix">
			<div class="hunter_index_left">
				<div class="hunter_info_box">
					<div class="hunter_top_info clearfix">
						<div class="hunter_avater">
							<div class="avater_box">
								{#if $hunter_profile.avatars!=''#}
								<img class="middleFace" src="{#$QISHI.site_dir#}data/hunter/photo_img/{#$hunter_profile.avatars#}" width="148" height="148"/>
								{#else#}
								<img class="middleFace" src="{#$QISHI.site_dir#}data/hunter/photo_img/no_photo.gif" width="148" height="148"/>
								{#/if#}
								<a href="javascript:;" class="change_avater">修改头像</a>
							</div>
						</div>
						<div class="hunter_info">
							<h2>{#$hunter_profile.fullname#}<span>ID: <em>LT{#$hunter_profile.id#}</em></span></h2>
							<div class="info_detail">
								<div class="detail_item">从业年限：<span class="job_year">{#$work_time#}</span> 年</div>
								<div class="detail_item">所在地区：{#$hunter_profile.district_cn#}</div>
								<div class="detail_item">擅长行业：{#$hunter_profile.trade_cn#}</div>
								<div class="detail_item">擅长职能：{#$hunter_profile.category_cn#}</div>
								<div class="detail_item about_number">联系电话：{#$hunter_profile.mobile#}{#if $hunter_profile.mobile_audit==1#}<a href='hunter_info.php?act=binding' class="auth yes">[已认证]</a>{#else#}<a href='hunter_info.php?act=binding' class="auth">[未认证]</a>{#/if#}</div>
								<div class="detail_item about_number">电子邮箱：{#$hunter_profile.email#}{#if $hunter_profile.email_audit=='1'#}<a href='hunter_info.php?act=binding' class="auth yes">[已认证]</a>{#else#}<a href='hunter_info.php?act=binding' class="auth">[未认证]</a>{#/if#}</div>
							</div>
						</div>
						<div class="info_edit link_blue"><a href="hunter_info.php?act=profile">[编辑资料]</a></div>
					</div>
					<div class="hunter_bottom_info clearfix">
						<div class="b_info_type">介绍：</div>
						<div class="b_info_content">{#$hunter_profile.contents#}</div>
					</div>
				</div>
				<div class="hunter_left_bottom">
					<div class="hunter_job_top_nav clearfix">
						<ul>
							<li class="nav_li"><a href="?jobs_type=2" class="{#if $smarty.get.jobs_type=='' || $smarty.get.jobs_type=='2'#}select_nav{#/if#}">赏金职位</a><span>|</span></li>
							<li class="nav_li"><a href="?jobs_type=1" class="{#if $smarty.get.jobs_type=='1'#}select_nav{#/if#}">高级职位</a><span>|</span></li>
							<li class="nav_li"><a href="?jobs_type=0" class="{#if $smarty.get.jobs_type=='0'#}select_nav{#/if#}">普通职位</a></li>
						</ul>
					</div>
					<!-- <div class="change_jobs_list link_blue"><a href="">换一批</a></div> -->
					<div class="hunter_job_list" id="entrust_job">
						{#qishi_jobs_list  set="列表名:jobslist,显示数目:3,填补字符:...,排序:rtime>desc,职位类别:$smarty.get.jobs_type,职位类型:2"#}
						{#if $jobslist#}
						{#foreach from=$jobslist item=list#}
						<div class="h_jobs_item" id="{#$smarty.get.start|default:0#}">
							<div class="jobs_name"><a href="{#$list.jobs_url#}">{#$list.jobs_name#}</a> <span>{#$list.district_cn#}</span></div>
							<div class="year_money">
								年薪：<span>{#$list.wage_min#}-{#$list.wage_max#}万</span>
							</div>
							<p class="job_content">
								所属部门：{#$list.department#}  |  工作经验：{#$list.experience_cn#}  |  所属行业：{#$list.trade_cn#}
							</p>
							<div class="time_apply">
								<div class="add_time">{#$list.refreshtime_cn#}</div>
								
								<div class="interview_but_box">
									{#if $list.entrust_hunter==2#}
									<input type="button" value="申请推荐" class="but85orange app_jobs" id="{#$list.id#}"/>
									{#elseif $list.entrust_hunter==1#}
									<input type="button" value="推荐人才" class="but85orange recommend_resume" id="{#$list.id#}"/>
									{#/if#}
								</div>							
							</div>
						</div>
						{#/foreach#}
						<a href="hunter_jobs.php?act=searchjobs" class="add_more_btn">查看更多职位</a>
						{#else#}
						<div class="h_jobs_item">
						找不到相应的职位
						</div>
						{#/if#}

					</div>
				</div>
			</div>
			<div class="hunter_index_right">
				<div class="account_info_box">
					<div class="account_info">
						<h3>账户信息</h3>
						<div class="account_detail link_blue clearfix">
							<div class="a_d_info">账户积分：<em>{#$hunter_points#}</em> 分 </div>
							<a href="hunter_info.php?act=points_recharge" class="operation">[充值]</a>
						</div>
						<div class="account_detail link_blue clearfix">
							<div class="a_d_info">
								<span class="hunter_level">猎头等级：</span>
								<span title="经验：">
									<span class="hunter_level_icon level{#$hunter_profile.level_meal#}" title="{#$hunter_profile.level#}"></span>
								</span>
							</div>
							<a href="hunter_info.php?act=rules_exp" class="operation">[规则]</a>
						</div>
					</div>
					<div class="auth_info">
						<div class="auth_detail">
							当前状态：{#if $hunter_profile.card_audit==1 && $hunter_profile.belongcompany_audit && $hunter_profile.avatars_audit==1#}<span class="auth_state">认证会员</span>{#else#}<span class="auth_state">认证会员</span>{#/if#}
						</div>
						<div class="auth_detail link_blue">
							<!-- <a href="" class="auth_operation">[提交]</a> -->
							实名认证：{#if $hunter_profile.card_audit==0 #}未提交{#elseif $hunter_profile.card_audit==2#}正在审核{#elseif $hunter_profile.card_audit==1#}审核通过{#elseif $hunter_profile.card_audit==3#}
							审核未通过{#/if#}
						</div>
						<div class="auth_detail link_blue">
							从业认证：{#if $hunter_profile.belongcompany_audit==0 #}未提交{#elseif $hunter_profile.belongcompany_audit==2#}正在审核{#elseif $hunter_profile.belongcompany_audit==1#}审核通过{#elseif $hunter_profile.belongcompany_audit==3#}
							审核未通过{#/if#}
						</div>
						<div class="auth_detail link_blue">
							照片认证：{#if $hunter_profile.avatars_audit==0 #}未提交{#elseif $hunter_profile.avatars_audit==2#}正在审核{#elseif $hunter_profile.avatars_audit==1#}审核通过{#elseif $hunter_profile.avatars_audit==3#}
							审核未通过{#/if#}
						</div>
					</div>
				</div>
				<div class="hunter_right_bottom">
					<h3>精英推荐</h3>
					<div class="elite_list">
						{#if $resume_list#}
						{#foreach from=$resume_list item=li#}
						<div class="elite_item clearfix">
							<div class="e_avater">
								<a href="{#"QS_resumeshow,id:"|cat:$li.id|qishi_url#}">
									{#if $li.photo_img==''#}
									<img src="{#$QISHI.site_dir#}data/photo/thumb/no_photo.gif" alt="" width="50" height="50"/>
									{#else#}
									<img src="{#$QISHI.site_dir#}data/photo/{#$li.photo_img#}" alt="" width="50" height="50"/>
									{#/if#}
								</a>
							</div>
							<div class="e_info">
								<div class="e_number clearfix">
									<a href="{#"QS_resumeshow,id:"|cat:$li.id|qishi_url#}" class="e_number_link">JL{#$li.id#}</a>
									<a href="{#"QS_resumeshow,id:"|cat:$li.id|qishi_url#}" class="check_resume">[查看简历]</a>
								</div>
								<div class="elite_info">学历：{#$li.education_cn#}</div>
								<div class="elite_info">地区：{#$li.district_cn#}</div>
							</div>
						</div>
						{#/foreach#}
						{#else#}
						<div style="padding: 10px;">
							没有相应的简历
						</div>
						{#/if#}
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 猎头首页结束 -->
	<!-- 底部 -->
	<!-- 上传头像弹出框-->
	<div id="hunter_logo_crop" style="display:none">
		<div id="ROOTP">
		    <h2>上传头像</h2>
		    <div class="privew">
		        <div class="uploader">
		            <div class="status"></div>
		                <div class="file-field">
		                    <input class="local-file" type="file" name="upload_file" id="resume_uploader" />
		                    <a href="javascript:;" class="button">上传照片</a>
		                </div>
		                <p id="hunter_logo_size"></p>
		        </div>
		        <div class="source_box">
		            <div class="photo_cols">
		                <div class="photo photo_source jcrop-default"></div>
		            </div>
		            <div class="jrotate_box">
		                <ul class="jrotate">
		                    <li><a href="javascript:;" class="rotateB" title="逆时针">逆时针</a></li>
		                    <li><a href="javascript:;" class="rotateA" title="顺时针">顺时针</a></li>
		                    <li><a href="javascript:;" class="rotateC" title="水平">水平</a></li>
		                    <li><a href="javascript:;" class="rotateD" title="垂直">垂直</a></li>
		                    <li><a href="javascript:;" class="reset" title="复位">复位</a></li>
		                </ul>
		            </div>
		        </div>
		        <div class="result_box">
		            <div class="tips">头像会自动生成四种尺寸，请注意中小头像是否清晰。</div>
		            <div class="photo_cols-left">
		                <div class="photo photo_large"></div>
		                <div class="btn-save"><a href="javascript:;" class="button">保存头像</a></div>
		            </div>
		            <div class="photo_cols-right">
		                <div class="photo photo_big"></div>
		                <div class="photo photo_normal"></div>
		                <div class="photo photo_tiny"></div>
		            </div>
		        </div>
		    </div>
		</div>
		<script type="text/javascript">
		$(function(){
		    var rate = "100:100";
		    var minSize = 100;
		    var _rate = rate.split(":"), _zoom = 1;
		        _rate = _rate[0]/_rate[1],
		        server_img = { url: "", name: "" };
		    var cropBox = ROOTP,
		        sourceBox = $(".source_box", cropBox),
		        resultBox = $(".result_box", cropBox),
		        sourcePhoto = $(".photo",sourceBox),
		        status = $(".uploader .status",cropBox),
		        saveButton = $(".btn-save .button",resultBox),
		        uploader = $(".uploader .file-field .local-file",cropBox), _uploader;
		    var showStatus = function(msg){
		          status.html(msg).hide().fadeIn();
		        },
		        hidetatus = function(msg){
		          status.html(msg).fadeOut();
		        };
		    $(".photo",resultBox).css("height",function(){
		      return $(this).width() / _rate;
		    });
		    function initJcrop(){
		      showStatus("正在加载图片...");
		      sourcePhoto.removeClass("jcrop-default").addClass("jcrop-loading");
		      var image = new Image();
		      image.src = server_img.url;
		      if(image.complete){
		        initCropBox(image);
		      } else {
		        image.onload = function(){
		          initCropBox(image);
		        };
		      }
		      function initCropBox(img){
		        var _Size = { width: sourcePhoto.width(), height: sourcePhoto.height() },
		            _size = { width: img.width, height: img.height },
		            _attr = { width: img.width, height: img.height };
		        if(_size.width < 100 || _size.height < 100){
		          showStatus("图片尺寸太小！");
		          $.dialog.error("图片尺寸太小！");
		          sourcePhoto.addClass("jcrop-default").removeClass("jcrop-loading");
		          return false;
		        }
		        minSize = Math.min( Math.max( Math.floor(100 * (_Size.width > _size.width ? 1 : _Size.width / _size.width)), 100 ), Math.max( Math.floor(100 * (_Size.height > _size.height ? 1 : _Size.height / _size.height)), 100 ) );
		        _zoom = 1;
		        if(_attr.width > _Size.width){
		          _zoom = _Size.width / _size.width;
		          _attr.width = _Size.width;
		          _attr.height = _attr.height * _zoom;
		        }
		        if(_attr.height > _Size.height){
		          _zoom = _Size.height / _size.height;
		          _attr.width = _size.width * _zoom;
		          _attr.height = _Size.height;
		        }
		        var showPreview = function(coords){
		          var source = $("img",sourcePhoto).data("coords", coords),
		              rotate = source.data("rotate") || {},
		              vertical = rotate._vertical,
		              canvas = rotate._canvas;
		          $(".photo",resultBox).each(function(){
		            var rx = $(this).width() / coords.w,
		                ry = $(this).height() / coords.h;
		            $(this).find("img,canvas").css({
		              width: Math.round(rx * (vertical && canvas ? img.height : img.width) * _zoom) + 'px',
		              height: Math.round(ry * (vertical && canvas ? img.width : img.height) * _zoom) + 'px',
		              marginLeft: '-' + Math.round(rx * coords.x) + 'px',
		              marginTop: '-' + Math.round(ry * coords.y) + 'px'
		            });
		          });
		        }
		        hidetatus("图片加载成功");
		        sourcePhoto.removeClass("jcrop-loading");
		        saveButton.show();
		        // $(".jrotate_box",sourceBox).show();
		        $(".photo",cropBox).empty().append($("<img src='"+ server_img.url +"' width='"+ _Size.width +"' height='"+ _Size.height +"' />"));
		        $(sourcePhoto).Jcrop({
		          bgColor: "#fcfcfc",
		          setSelect: [ 0, 0, Math.min(Math.max(200, minSize), img.width, img.height) ],
		          minSize: [ minSize ],
		          onChange: showPreview,
		          onSelect: showPreview,
		          aspectRatio: _rate
		        });
		        $(".photo",cropBox).find('img').css({
		          width: _attr.width,
		          height: _attr.height
		        });
		      }
		    }
		    $(".jrotate_box .rotateA",cropBox).bind("click",function(){
		      $(".photo img",cropBox).Jrotate(1);
		    });
		    $(".jrotate_box .rotateB",cropBox).bind("click",function(){
		      $(".photo img",cropBox).Jrotate(2);
		    });
		    $(".jrotate_box .rotateC",cropBox).bind("click",function(){
		      $(".photo img",cropBox).Jrotate(3);
		    });
		    $(".jrotate_box .rotateD",cropBox).bind("click",function(){
		      $(".photo img",cropBox).Jrotate(4);
		    });
		    $(".jrotate_box .reset",cropBox).bind("click",function(){
		      $(".photo img",cropBox).Jrotate(0);
		    });
		    //
		    uploader.bind("change",function(){
		      var filepath = $(this).val();
		      if(["jpg","jpeg","gif","bmp","png"].indexOf(filepath.toLowerCase().substring(filepath.lastIndexOf(".") + 1)) === -1){
		        showStatus("文件格式不正确，请重新选择文件。");
		      } else {
		        showStatus("正在上传图片...");
		          $.ajaxFileUpload({
		            url: "hunter_info.php?act=hunter_logo_preloading",
		            secureuri: false,
		            fileElementId: "resume_uploader",
		            dataType: "text",
		            success: function(data, status){
		              switch(data){
		                case "-1":showStatus("上传图片失败：上传目录不存在!");return false;break;
		                case "-2":showStatus("上传图片失败：上传目录无法写入!");return false;break;
		                case "-3":showStatus("上传图片失败：你选择的文件无法上传！");return false;break;
		                case "-4":showStatus("上传图片失败：文件大小超过限制");return false;break;
		                case "-5":showStatus("上传图片失败：文件类型错误！");return false;break;
		                case "-6":showStatus("上传图片失败：文件上传出错！");return false;break;
		                default:break;
		              }
		              server_img.url = data;
		              initJcrop();
		            },
		            error: function(data, status, e){
		              showStatus(e);
		            }
		          });
		          $(this).replaceWith(_uploader.clone());
		      }
		    }).live("click",function(){
		      if(jQuery.browser.msie){
		        var timer, self = this;
		        timer = window.setInterval(function(){
		          if(document.activeElement == self){
		            $(self).blur();
		          } else {
		            window.clearInterval(timer);
		          }
		        }, 20);
		      }
		    }).live('change', function(event) {
		      var filepath = $(this).val();
		      if(["jpg","jpeg","gif","bmp","png"].indexOf(filepath.toLowerCase().substring(filepath.lastIndexOf(".") + 1)) === -1){
		        showStatus("文件格式不正确，请重新选择文件。");
		      } else {
		        showStatus("正在上传图片...");
		          $.ajaxFileUpload({
		            url: "hunter_info.php?act=hunter_logo_preloading",
		            secureuri: false,
		            fileElementId: "resume_uploader",
		            dataType: "text",
		            success: function(data, status){
		              switch(data){
		                case "-1":showStatus("上传图片失败：上传目录不存在!");return false;break;
		                case "-2":showStatus("上传图片失败：上传目录无法写入!");return false;break;
		                case "-3":showStatus("上传图片失败：你选择的文件无法上传！");return false;break;
		                case "-4":showStatus("上传图片失败：文件大小超过限制");return false;break;
		                case "-5":showStatus("上传图片失败：文件类型错误！");return false;break;
		                case "-6":showStatus("上传图片失败：文件上传出错！");return false;break;
		                default:break;
		              }
		              server_img.url = data;
		              initJcrop();
		            },
		            error: function(data, status, e){
		              showStatus(e);
		            }
		          });
		          $(this).replaceWith(_uploader.clone());
		      }
		    });
		    _uploader = uploader.clone();
		    //save
		    saveButton.bind("click",function(){
		      var source = $("img",sourcePhoto),
		          coords = source.data("coords"),
		          rotate = source.data("rotate") || { _x:1, _y:1, _rotate: 0 };
		      if(!coords) {
		        showStatus("您没有对任何图片进行剪裁");
		        return false;
		      }
		      var datas = {
		        "url": server_img.url,
		        "x1": parseInt(coords.x / _zoom),
		        "x2": parseInt(coords.x2 / _zoom),
		        "y1": parseInt(coords.y / _zoom),
		        "y2": parseInt(coords.y2 / _zoom),
		        "_x": rotate._x,
		        "_y": rotate._y,
		        "_rotate": rotate._rotate
		      }; 
		      $.ajax({
		        url: "hunter_info.php?act=hunter_logo_save",
		        type: "POST",
		        data: datas,
		        cache: false,
		        dataType: "text",
		        success: function(data){  
		            $("img.middleFace").attr("src", data);
		            $.dialog.focus.close();
		            $.dialog.alert("头像上传成功！");
		        },
		        error: function(data){
		          showStatus("保存失败！");
		        }
		      });
		    });
		});
		</script>
	</div>
	<!-- 上传头像弹出框 End-->
	{#include file="./footer.htm"#}
	<!-- 底部结束 -->
</body>
</html>