<?php
/*
 * 74cms 个人会员中心
 * ============================================================================
 * 版权所有: 骑士网络，并保留所有权利。
 * 网站地址: http://www.74cms.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
if(!defined('IN_QISHI')) die('Access Denied!');
require_once(dirname(dirname(dirname(__FILE__))).'/include/common.inc.php');
$smarty->cache = false;
require_once(QISHI_ROOT_PATH.'include/mysql.class.php');
require_once(QISHI_ROOT_PATH.'include/fun_personal.php');
require_once(QISHI_ROOT_PATH.'include/fun_user.php');
$db = new mysql($dbhost,$dbuser,$dbpass,$dbname);
$act = !empty($_REQUEST['act']) ? trim($_REQUEST['act']) : 'index';

//查看是否填写了基本信息
$pid = get_pid(intval($_SESSION['uid']));	
$resume_basic = get_resume_info($_SESSION['uid'],$pid);
$resume_jobs = get_resume_jobs($pid);
$user=get_user_info($_SESSION['uid']);	

 if ($_SESSION['uid']=='' || $_SESSION['username']=='')
{
	header("Location: ".url_rewrite('QS_index'));
}
elseif ($_SESSION['utype']!='2')
{
	$link[0]['text'] = "会员中心";
	$link[0]['href'] = url_rewrite('QS_index');
	showmsg('您访问的页面需要 个人会员 登录！系统将跳转到 您所属会员 中心',1,$link);
}


//查看是否填写了基本信息
if(empty($resume_basic) && $act!="step1" && $act!="step1_save" && $act!="step2" && $act!="step2_save" )
{	
	header("Location:personal_resume.php?act=step1");
}
elseif(empty($resume_jobs) && $act!="step2" && $act!="step2_save" && $act!="step1" && $act!="step1_save")
{
	$link[0]['text'] = "填写简历期望信息";
	$link[0]['href'] = "personal_resume.php?act=step2";
	exit(showmsg('您还没有填写简历的期望信息 , 请填写简历的期望信息！',1,$link));
}

if (empty($user))
{
	unset($_SESSION['utype'],$_SESSION['uid'],$_SESSION['username']);
	header("Location: ".url_rewrite('QS_index'));
}
if ($_CFG['login_per_audit_email'] && $user['email_audit']=="0" && $act!='user_email' && $act!='user_mobile')
{
	$link[0]['text'] = "认证邮箱";
	$link[0]['href'] = 'personal_info.php?act=user_email';
	$link[1]['text'] = "网站首页";
	$link[1]['href'] = $_CFG['site_dir'];
	showmsg('您的邮箱未认证，认证后才能进行其他操作！',1,$link,true,6);
	exit();
}
$sms=get_cache('sms_config');
if ($_CFG['login_per_audit_mobile'] && $user['mobile_audit']=="0" && $act!='user_mobile' && $act!='user_email' && $sms['open']=="1")
{
	$link[0]['text'] = "认证手机";
	$link[0]['href'] = 'personal_info.php?act=user_mobile';
	$link[1]['text'] = "网站首页";
	$link[1]['href'] = $_CFG['site_dir'];
	showmsg('您的手机未认证，认证后才能进行其他操作！',1,$link,true,6);
	exit();
} 
// 获取申请提醒未看的数目
$sql1="SELECT COUNT(*) AS num FROM ".table("pms_sys")."  where uid={$_SESSION['uid']} and is_look=1 ";
$count1=$db->get_total($sql1);
$_SESSION['personal_count']=intval($count1);
$smarty->assign('sms',$sms);
 
