<?php

set_time_limit(0);
include("../global.php");

if($_GET[step]!="8"){
	echo '<!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>正在升级中.... - - Powered by PHPYun.</title>

<link href="'.$config[sy_weburl].'/template/member/style/msg.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content" style="background:f5f5f5;">
  <div class="content-title" style="width:100%"><span style="width:100%">正在升级中,已进行'.$_GET[step].'/8</span></div>
  <div style="border:1px solid #ccc; float:left;width:100%;">
    <dl style="width:100%">
       <p style="text-align:center;"><img src="loading.gif"></p><br>
	   <p style="text-align:center;"><font color="red">本次更新时间较长,请不要中途中断,以免升级失败,请耐心等待！</font></p>
    </dl>
</div>
</div>
</body>
</html>';
};
if($_GET[step]==""){

	echo "<script>location.href='$config[sy_weburl]/update/index.php?step=1';</script>";

}

/****************************第一步：新增数据字段************************************/
if($_GET[step]=="1"){
    
	
	$db->query("ALTER TABLE `$db_config[def]down_resume` ADD COLUMN `isdel` int(1) NOT NULL DEFAULT 9 ");
	
	$db->query("ALTER TABLE `$db_config[def]email_msg` ADD COLUMN `del` int(1) NOT NULL DEFAULT 0 ");
	
	// 名企增加更新时间
	$db->query("ALTER TABLE `$db_config[def]hotjob` ADD COLUMN `lastupdate` int(10) NULL DEFAULT 0");
	
	$db->query("ALTER TABLE `$db_config[def]moblie_msg` ADD COLUMN `del` int(1) NOT NULL DEFAULT 0 ");
	
	$db->query("ALTER TABLE `$db_config[def]reserve_refresh` ADD COLUMN `s_time` varchar(10) NOT NULL");
	$db->query("ALTER TABLE `$db_config[def]reserve_refresh` ADD COLUMN `e_time` varchar(10) NOT NULL");
	
	$db->query("ALTER TABLE `$db_config[def]resume` ADD COLUMN `defphoto` int(1) NOT NULL DEFAULT 1 ");
	
	$db->query("ALTER TABLE `$db_config[def]resume_expect` ADD COLUMN `sq_jobid` int(11) NULL ");
	$db->query("ALTER TABLE `$db_config[def]resume_expect` ADD COLUMN `crm_tel` int(1) NOT NULL DEFAULT 1 ");
	$db->query("ALTER TABLE `$db_config[def]resume_expect` ADD COLUMN `crm_wx` int(1) NOT NULL DEFAULT 1 ");
	$db->query("ALTER TABLE `$db_config[def]resume_expect` ADD COLUMN `crm_chat` int(1) NOT NULL DEFAULT 1 ");
	
	$db->query("ALTER TABLE `$db_config[def]_special` ADD COLUMN `wappic` varchar(255) NULL");
	$db->query("ALTER TABLE `$db_config[def]_special` ADD COLUMN `wapback` varchar(255) NULL");
	
	$db->query("ALTER TABLE `$db_config[def]userid_job` ADD COLUMN `resume_state` int(1) NOT NULL DEFAULT 1 ");
	$db->query("ALTER TABLE `$db_config[def]userid_job` ADD COLUMN `invited` int(1) NULL ");
	$db->query("ALTER TABLE `$db_config[def]userid_job` ADD COLUMN `invite_time` int(10) NULL ");
	$db->query("ALTER TABLE `$db_config[def]userid_job` ADD COLUMN `isdel` int(1) NOT NULL DEFAULT 9 ");
	$db->query("ALTER TABLE `$db_config[def]userid_job` ADD COLUMN `remark` text NULL");
	
	$db->query("ALTER TABLE `$db_config[def]userid_msg` ADD COLUMN `x` varchar(100) NULL");
	$db->query("ALTER TABLE `$db_config[def]userid_msg` ADD COLUMN `y` varchar(100) NULL");
	$db->query("ALTER TABLE `$db_config[def]userid_msg` ADD COLUMN `isdel` int(1) NOT NULL DEFAULT 9 ");
	$db->query("ALTER TABLE `$db_config[def]userid_msg` ADD COLUMN `remark` text NULL");
	
	// 简历表增加默认头像字段
    $db->query("ALTER TABLE `$db_config[def]resume_expect` ADD COLUMN `defphoto` int(1) NOT NULL DEFAULT 1 ");
    
   
    
    
    $db->query('INSERT INTO `'.$db_config[def].'version` SET `version`="v6.0.1(20211117)",`ctime`='.time());
	
	$db->query("CREATE TABLE `$db_config[def]resume_city_job_class` (
	    `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	    `provinceid` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
	    `provinceid_num` tinyint(4) NOT NULL DEFAULT 0,
	    `cityid` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    `cityid_num` tinyint(4) NOT NULL DEFAULT 0,
	    `three_cityid` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    `three_cityid_num` tinyint(4) NOT NULL DEFAULT 0,
	    `job1` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
	    `job1_num` tinyint(4) NOT NULL DEFAULT 0,
	    `job1_son` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    `job1_son_num` tinyint(4) NOT NULL DEFAULT 0,
	    `job_post` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    `job_post_num` tinyint(4) NOT NULL DEFAULT 0,
	    `provinceid_job1_num` tinyint(4) NOT NULL DEFAULT 0,
	    `provinceid_job1_son_num` tinyint(4) NOT NULL DEFAULT 0,
	    `provinceid_job_post_num` tinyint(4) NOT NULL DEFAULT 0,
	    `cityid_job1_num` tinyint(4) NOT NULL DEFAULT 0,
	    `cityid_job1_son_num` tinyint(4) NOT NULL DEFAULT 0,
	    `cityid_job_post_num` tinyint(4) NOT NULL DEFAULT 0,
	    `three_cityid_job1_num` tinyint(4) NOT NULL DEFAULT 0,
	    `three_cityid_job1_son_num` tinyint(4) NOT NULL DEFAULT 0,
	    `three_cityid_job_post_num` tinyint(4) NOT NULL DEFAULT 0,
	    `eid` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    `lastupdate` int(11) NOT NULL DEFAULT 0,
	    `uid` int(10) UNSIGNED NOT NULL DEFAULT 0,
	    PRIMARY KEY (`id`),
	    INDEX `provinceid_num_idx`(`provinceid`, `provinceid_num`) USING BTREE,
	    INDEX `cityid_num_idx`(`cityid`, `cityid_num`) USING BTREE,
	    INDEX `three_cityid_num_idx`(`three_cityid`, `three_cityid_num`) USING BTREE,
	    INDEX `job1_num_idx`(`job1`, `job1_num`) USING BTREE,
	    INDEX `job1_son_num_idx`(`job1_son`, `job1_son_num`) USING BTREE,
	    INDEX `job_post_num_idx`(`job_post`, `job_post_num`) USING BTREE,
	    INDEX `provinceid_job1_num_idx`(`provinceid`, `job1`, `provinceid_job1_num`) USING BTREE,
	    INDEX `provinceid_job1_son_num_idx`(`provinceid`, `job1_son`, `provinceid_job1_son_num`) USING BTREE,
	    INDEX `provinceid_job_post_num_idx`(`provinceid`, `job_post`, `provinceid_job_post_num`) USING BTREE,
	    INDEX `cityid_job1_num_idx`(`cityid`, `job1`, `cityid_job1_num`) USING BTREE,
	    INDEX `cityid_job1_son_num_idx`(`cityid`, `job1_son`, `cityid_job1_son_num`) USING BTREE,
	    INDEX `cityid_job_post_num_idx`(`cityid`, `job_post`, `cityid_job_post_num`) USING BTREE,
	    INDEX `three_cityid_job1_num_idx`(`three_cityid`, `job1`, `three_cityid_job1_num`) USING BTREE,
	    INDEX `three_cityid_job1_son_num_idx`(`three_cityid`, `job1_son`, `three_cityid_job1_son_num`) USING BTREE,
	    INDEX `three_cityid_job_post_num_idx`(`provinceid`, `job_post`, `three_cityid_job_post_num`) USING BTREE,
	    INDEX `eid_idx`(`eid`) USING BTREE,
	    INDEX `lastupdate_idx`(`lastupdate`) USING BTREE
	    )ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;");

    $db->query("CREATE TABLE `$db_config[def]admin_jobwhb` (
	  `id` int(11) NOT NULL auto_increment,
	  `name` varchar(50) NOT NULL default '',
	  `pic` varchar(255) NOT NULL,
	  `sort` int(11) NOT NULL ,
	  `isopen` int(1) NOT NULL default '0' ,
	  PRIMARY KEY  USING BTREE (`id`)
	) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC  AUTO_INCREMENT=1;");
	// 增加升级记录表
    $db->query("CREATE TABLE `$db_config[def]version` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `version` varchar(50) NOT NULL DEFAULT '',
        `ctime` int(11) NOT NULL,
        PRIMARY KEY (`id`)
        )ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;");

    $db->query("ALTER TABLE `$db_config[def]admin_jobwhb` ADD COLUMN `type` int(1) NOT NULL DEFAULT 1 ");
    $db->query("ALTER TABLE `$db_config[def]admin_jobwhb` ADD COLUMN `num` int(2) NOT NULL DEFAULT 0 ");
    $db->query("ALTER TABLE `$db_config[def]admin_jobwhb` ADD COLUMN `style` int(2) NOT NULL ");

    $db->query("TRUNCATE TABLE  `$db_config[def]resume_city_job_class`");
	
	echo "<script>location.href='$config[sy_weburl]/update/index.php?step=2';</script>";
}
/****************************第二步：调整默认数据************************************/


if($_GET[step]=="2"){
    
    // 名企增加更新时间 -start
    $query = $db->query("SELECT `uid` From `" . $db_config[def] . "hotjob` ");
    $uarr = array();
    while($row=$db->fetch_array($query))
    {
        $uarr[] = $row['uid'];
    }
    if (!empty($uarr)){
        
        $query = $db->query("SELECT `uid`,`lastupdate` From `" . $db_config[def] . "company` WHERE `uid` IN (".implode(',', $uarr).")");
        while($row=$db->fetch_array($query))
        {
            $db->query("UPDATE `" . $db_config[def] . "hotjob` SET `lastupdate` = '".$row['lastupdate']."' WHERE `uid` = '".$row['uid']."'");
        }
    }
    // 名企增加更新时间 -end
    
    // 后台导航
    $db->query("TRUNCATE TABLE  `$db_config[def]admin_navigation`");
    
    $db->query("INSERT INTO `$db_config[def]admin_navigation` (`id`, `name`, `keyid`, `url`, `menu`, `classname`, `sort`, `display`, `dids`, `level`) VALUES
	(1, '会员', 0, '', 1, '0', 1, 0, 1, 1),
	(2, '内容', 0, '', 1, '0', 2, 0, 1, 1),
	(3, '运营', 0, '', 1, '0', 3, 0, 1, 1),
	(4, '工具', 0, '', 1, '0', 4, 0, 0, 1),
	(5, '系统', 0, '', 1, '0', 5, 0, 1, 1),
	(6, '企业', 1, '', 1, 'nav_company', 1, 0, 1, 2),
	(7, '个人', 1, '', 1, 'nav_user', 2, 0, 1, 2),
	(10, '新闻', 2, '', 0, 'nav_news', 1, 0, 1, 2),
	(11, '测评', 2, '', 0, 'nav_cp', 2, 0, 0, 2),
	(12, '招聘会', 2, '', 0, 'nav_zph', 3, 0, 1, 2),
	(13, '工具箱', 2, '', 0, 'nav_gjx', 4, 0, 0, 2),
	(14, '公告', 2, '', 0, 'nav_gg', 5, 0, 1, 2),
	(17, '个人用户列表', 7, 'index.php?m=user_member', 1, '0', 1, 0, 1, 3),
	(15, '问答', 2, '', 0, 'nav_ask', 6, 0, 1, 2),
	(16, '企业管理', 6, 'index.php?m=admin_company', 2, '0', 1, 0, 1, 3),
	(359, '问答设置', 15, 'index.php?m=admin_question&c=config', 1, '0', 3, 0, 0, 3),
	(31, '咨询留言', 9, 'index.php?m=trainmessage', 1, '0', 7, 0, 1, 3),
	(33, '简历管理', 7, 'index.php?m=admin_resume', 2, '0', 2, 0, 1, 3),
	(34, '个人认证审核', 7, 'index.php?m=usercert', 1, '0', 3, 0, 1, 3),
	(36, '普工简历', 156, 'index.php?m=admin_tiny', 1, '0', 2, 0, 1, 3),
	(37, '求职咨询', 7, 'index.php?m=admin_msg', 1, '0', 6, 0, 1, 3),
	(38, '简历记录管理', 7, 'index.php?m=admin_userlog', 1, '0', 7, 0, 1, 3),
	(39, '个人设置', 7, 'index.php?m=admin_userset', 1, '0', 8, 0, 0, 3),
	(40, '职位管理', 6, 'index.php?m=admin_company_job', 2, '0', 2, 0, 1, 3),
	(41, '名企管理', 6, 'index.php?m=admin_hotjob', 2, '0', 3, 0, 1, 3),
	(42, '兼职管理', 6, 'index.php?m=admin_partjob', 2, '0', 4, 0, 1, 3),
	(44, '产品新闻管理', 6, 'index.php?m=productnews', 1, '0', 6, 0, 1, 3),
	(47, '企业认证审核', 6, 'index.php?m=comcert', 1, '0', 9, 0, 1, 3),
	(48, '店铺招聘', 156, 'index.php?m=admin_once', 1, '0', 1, 0, 1, 3),
	(49, '专题招聘', 343, 'index.php?m=special', 1, '0', 1, 0, 0, 3),
	(50, '职位记录管理', 6, 'index.php?m=admin_comlog', 1, '0', 12, 0, 1, 3),
	(52, '增值套餐服务', 6, 'index.php?m=admin_comrating', 1, '0', 14, 0, 0, 3),
	(53, '企业设置', 6, 'index.php?m=admin_comset', 2, '0', 15, 0, 0, 3),
	(54, '新闻管理', 10, 'index.php?m=admin_news', 2, '0', 1, 0, 1, 3),
	(55, '添加新闻', 10, 'index.php?m=admin_news&c=news', 1, '0', 2, 0, 1, 3),
	(56, '新闻类别', 10, 'index.php?m=admin_news&c=group', 1, '0', 3, 0, 0, 3),
	(57, '工具箱', 13, 'index.php?m=hr', 1, '0', 1, 0, 0, 3),
	(58, '工具箱类别', 13, 'index.php?m=hrclass', 1, '0', 2, 0, 0, 3),
	(59, '公告管理', 14, 'index.php?m=admin_announcement', 2, '0', 1, 0, 1, 3),
	(61, '招聘会列表', 12, 'index.php?m=zhaopinhui', 1, '0', 1, 0, 1, 3),
	(62, '添加招聘会', 12, 'index.php?m=zhaopinhui&c=add', 1, '0', 2, 0, 1, 3),
	(63, '参会企业', 12, 'index.php?m=zhaopinhui&c=com', 1, '0', 3, 0, 1, 3),
	(64, '招聘会场地', 12, 'index.php?m=zph_space', 1, '0', 4, 0, 0, 3),
	(65, '意见反馈', 198, 'index.php?m=admin_message', 1, '0', 1, 0, 0, 3),
	(66, '问答管理', 15, 'index.php?m=admin_question', 1, '0', 1, 0, 1, 3),
	(382, 'OSS设置', 123, 'index.php?m=admin_oss_config', 1, '0', 9, 0, 0, 3),
	(68, '系统消息', 198, 'index.php?m=sysnews', 1, '0', 4, 0, 0, 3),
	(69, '测评试卷列表', 11, 'index.php?m=admin_evaluate', 1, '0', 1, 0, 0, 3),
	(70, '添加测评试卷', 11, 'index.php?m=admin_evaluate&c=examup', 1, '0', 2, 0, 0, 3),
	(71, '测评类别管理', 11, 'index.php?m=admin_evaluate&c=group', 1, '0', 3, 0, 0, 3),
	(72, '测评留言管理', 11, 'index.php?m=admin_evaluate&c=message', 1, '0', 5, 0, 0, 3),
	(73, '类别', 5, '', 0, 'nav_lb', 4, 0, 0, 2),
	(74, '商城', 3, '', 0, 'nav_shop', 0, 0, 0, 2),
	(75, '广告', 3, '', 0, 'nav_guanggao', 0, 0, 1, 2),
	(76, '兑换商品管理', 74, 'index.php?m=reward', 1, '0', 1, 0, 0, 3),
	(77, '兑换商品记录', 74, 'index.php?m=reward_list', 1, '0', 2, 0, 0, 3),
	(82, '商品分类', 74, 'index.php?m=redeem_class', 1, '0', 7, 0, 0, 3),
	(83, '广告管理', 75, 'index.php?m=advertise', 2, '0', 1, 0, 1, 3),
	(84, '添加广告', 75, 'index.php?m=advertise&c=ad_add', 1, '0', 2, 0, 1, 3),
	(86, '广告类别', 75, 'index.php?m=advertise&c=class', 1, '0', 4, 0, 0, 3),
	(87, '个人会员分类', 73, 'index.php?m=userclass', 1, '0', 1, 0, 0, 3),
	(88, '城市管理', 73, 'index.php?m=admin_city', 1, '0', 2, 0, 0, 3),
	(89, '行业类别', 73, 'index.php?m=admin_industry', 1, '0', 3, 0, 0, 3),
	(91, '企业会员分类', 73, 'index.php?m=comclass', 1, '0', 5, 0, 0, 3),
	(92, '职位类别管理', 73, 'index.php?m=admin_job', 1, '0', 4, 0, 0, 3),
	(93, '兼职分类', 73, 'index.php?m=partclass', 1, '0', 6, 0, 0, 3),
	(97, '问答类别', 15, 'index.php?m=question_class', 1, '0', 2, 0, 0, 3),
	(98, '举报原因管理', 73, 'index.php?m=admin_reason', 1, '0', 11, 0, 0, 3),
	(101, '单页面类别', 195, 'index.php?m=desc_class', 1, '0', 14, 0, 0, 3),
	(102, '管理员', 5, '', 0, 'nav_gly', 5, 0, 1, 2),
	(103, '生成', 4, '', 0, 'nav_sc', 0, 0, 0, 2),
	(104, '我的帐号', 102, 'index.php?m=admin_user&c=myuser', 2, '0', 1, 0, 1, 3),
	(105, '管理员列表', 102, 'index.php?m=admin_user', 1, '0', 2, 0, 0, 3),
	(106, '添加管理员', 102, 'index.php?m=admin_user&c=add', 1, '0', 3, 0, 0, 3),
	(107, '添加管理员类型', 102, 'index.php?m=admin_user&c=addgroup', 1, '0', 5, 0, 0, 3),
	(110, '管理员日志', 102, 'index.php?m=admin_log', 1, '0', 6, 0, 0, 3),
	(109, '会员日志', 102, 'index.php?m=admin_memberlog', 1, '0', 7, 0, 0, 3),
	(112, '管理员类型', 102, 'index.php?m=admin_user&c=group', 1, '0', 4, 0, 0, 3),
	(113, '首页生成', 103, 'index.php?m=cache&c=index', 1, '0', 1, 0, 0, 3),
	(114, '新闻首页', 103, 'index.php?m=cache&c=news', 1, '0', 2, 0, 0, 3),
	(115, '新闻类别', 103, 'index.php?m=cache&c=newsclass', 1, '0', 3, 0, 0, 3),
	(116, '新闻详细页', 103, 'index.php?m=cache&c=archive', 1, '0', 4, 0, 0, 3),
	(117, '生成缓存', 103, 'index.php?m=cache&c=cache', 1, '0', 5, 0, 0, 3),
	(118, '单页面生成', 103, 'index.php?m=cache&c=once', 1, '0', 6, 0, 0, 3),
	(119, '一键更新', 103, 'index.php?m=cache&c=all', 1, '0', 7, 0, 0, 3),
	(120, '生成XML', 103, 'index.php?m=admin_xml', 1, '0', 8, 0, 0, 3),
	(121, '设置', 5, '', 0, 'nav_set', 1, 0, 0, 2),
	(122, '微信', 4, '', 1, 'nav_weixin', 0, 0, 0, 2),
	(123, '数据', 4, '', 1, 'nav_data', 0, 0, 0, 2),
	(124, '模板', 5, '', 1, 'nav_tpl', 5, 0, 0, 2),
	(125, '微信绑定', 122, 'index.php?m=wx', 1, '0', 1, 0, 0, 3),
	(126, '微信菜单', 122, 'index.php?m=wx&c=wxnav', 1, '0', 2, 0, 0, 3),
	(128, '登录日志', 122, 'index.php?m=wx&c=wxqrcodelog', 1, '0', 4, 0, 0, 3),
	(129, '用户绑定', 122, 'index.php?m=wx&c=binduser', 1, '0', 5, 0, 0, 3),
	(130, '搜索关键字', 122, 'index.php?m=wx&c=keyword', 1, '0', 6, 0, 0, 3),
	(131, '自动回复', 122, 'index.php?m=wx&c=zdkeyword', 1, '0', 7, 0, 0, 3),
	(132, '数据库管理', 123, 'index.php?m=database', 1, '0', 1, 0, 0, 3),
	(133, '数据采集', 123, 'index.php?m=collection', 1, '0', 2, 0, 0, 3),
	(135, '数据调用', 123, 'index.php?m=datacall', 1, '0', 4, 0, 0, 3),
	(136, '切换模板', 124, 'index.php?m=admin_tpl', 1, '0', 1, 0, 0, 3),
	(137, '企业模板', 124, 'index.php?m=admin_tpl&c=comtpl', 1, '0', 2, 0, 0, 3),
	(138, '简历模板', 124, 'index.php?m=admin_tpl&c=resumetpl', 1, '0', 4, 0, 0, 3),
	(140, '添加文档', 13, 'index.php?m=hr&c=add', 1, '0', 2, 0, 0, 3),
	(142, '网站设置', 121, 'index.php?m=config', 1, '0', 1, 0, 0, 3),
	(143, '模块设置', 121, 'index.php?m=model_config', 1, '0', 2, 0, 0, 1),
	(144, '页面设置', 121, 'index.php?m=web_config', 1, '0', 3, 0, 0, 3),
	(145, '导航设置', 121, 'index.php?m=navigation', 1, '0', 4, 0, 0, 3),
	(146, '邮件服务器设置', 185, 'index.php?m=emailconfig', 1, '0', 1, 0, 0, 3),
	(147, '短信设置', 186, 'index.php?m=msgconfig', 1, '0', 1, 0, 0, 3),
	(148, '支付设置', 121, 'index.php?m=payconfig', 1, '0', 7, 0, 0, 3),
	(149, 'SEO设置', 121, 'index.php?m=seo', 1, '0', 8, 0, 0, 3),
	(151, '积分设置', 121, 'index.php?m=integral', 1, '0', 9, 0, 0, 3),
	(152, '注册设置', 121, 'index.php?m=regset', 1, '0', 10, 0, 0, 3),
	(153, '网站地图', 121, 'index.php?m=navmap', 1, '0', 11, 0, 0, 3),
	(154, '添加公告', 14, 'index.php?m=admin_announcement&c=add', 1, '0', 2, 0, 1, 3),
	(156, '微聘', 1, '', 1, 'nav_once', 6, 0, 1, 2),
	(158, '登录', 4, '', 1, 'nav_login', 4, 0, 0, 2),
	(159, '快捷登录', 158, 'index.php?m=qqconfig', 1, '0', 1, 0, 0, 3),
	(160, '整合论坛', 158, 'index.php?m=admin_uc', 1, '0', 2, 0, 0, 3),
	(161, '财务', 3, '', 0, 'nav_cw', 0, 0, 1, 2),
	(162, '充值订单', 161, 'index.php?m=company_order', 1, '0', 3, 0, 1, 3),
	(163, '消费记录', 161, 'index.php?m=company_pay', 2, '0', 2, 0, 1, 3),
	(164, '后台充值', 161, 'index.php?m=recharge', 1, '0', 5, 0, 1, 3),
	(169, '回收站', 123, 'index.php?m=recycle', 1, '0', 7, 0, 0, 3),
	(170, '分站', 5, '', 1, 'nav_fz', 8, 0, 0, 2),
	(171, '分站设置', 170, 'index.php?m=admin_domain', 1, '0', 1, 0, 0, 3),
	(172, '分站管理', 170, 'index.php?m=admin_domain&c=alllist', 1, '0', 2, 0, 0, 3),
	(173, '添加分站', 170, 'index.php?m=admin_domain&c=AddDomain', 1, '0', 3, 0, 0, 3),
	(174, '计划任务', 121, 'index.php?m=cron', 1, '0', 11, 0, 0, 3),
	(175, '预警设置', 121, 'index.php?m=warning', 1, '0', 12, 0, 0, 3),
	(176, '举报', 3, '', 1, 'nav_jb', 6, 0, 1, 2),
	(177, '营销', 3, '', 1, 'nav_yx', 7, 0, 0, 2),
	(178, '被举报职位', 176, 'index.php?m=report', 1, '0', 1, 0, 1, 3),
	(179, '被举报简历', 176, 'index.php?m=report&ut=2', 1, '0', 2, 0, 1, 3),
	(180, '被举报问答', 176, 'index.php?m=report&type=1', 1, '0', 3, 0, 1, 3),
	(181, '被投诉顾问', 176, 'index.php?m=report&type=2', 1, '0', 5, 0, 1, 3),
	(182, '推广营销', 177, 'index.php?m=email', 1, '0', 1, 0, 0, 3),
	(184, '账号申诉', 401, 'index.php?m=admin_appeal', 1, '0', 6, 0, 1, 3),
	(185, '邮件', 4, '', 1, 'nav_email', 6, 0, 1, 2),
	(186, '短信', 4, '', 1, 'nav_msg', 7, 0, 0, 2),
	(187, '短信模板设置', 186, 'index.php?m=msgconfig&c=tpl', 1, '0', 2, 0, 0, 3),
	(188, '短信发送记录', 186, 'index.php?m=msgconfiglist', 1, '0', 3, 0, 0, 3),
	(189, '邮件模板设置', 185, 'index.php?m=emailconfig&c=tpl', 1, '0', 2, 0, 0, 3),
	(190, '邮件发送记录', 185, 'index.php?m=emailconfiglist', 1, '0', 3, 0, 0, 3),
	(193, '关键字管理', 121, 'index.php?m=admin_keyword', 1, '', 11, 0, 0, 3),
	(194, '友情链接', 121, 'index.php?m=link', 1, '', 12, 0, 0, 3),
	(195, '单页面', 5, '', 1, 'nav_desc', 7, 0, 0, 2),
	(196, '单页面管理', 195, 'index.php?m=description', 1, '0', 0, 0, 0, 3),
	(198, '信息', 5, '', 1, 'nav_xx', 9, 0, 0, 2),
	(200, '添加单页面', 195, 'index.php?m=description&c=add', 1, '0', 3, 0, 0, 3),
	(201, '首页模板主题', 124, 'index.php?m=admin_tpl_index', 1, '0', 6, 0, 0, 3),
	(204, '新闻属性', 10, 'index.php?m=admin_news&c=type', 1, '0', 5, 0, 0, 3),
	(206, '添加商品', 74, 'index.php?m=reward&c=add', 1, '0', 3, 0, 0, 3),
	(343, '专题', 3, '', 1, 'nav_sp', 4, 0, 0, 2),
	(344, '添加专题', 343, 'index.php?m=special&c=add', 1, '0', 2, 0, 0, 3),
	(345, '图片管理', 6, 'index.php?m=admin_company_pic', 1, '', 10, 0, 1, 3),
	(346, '图片管理', 7, 'index.php?m=admin_user_pic', 1, '', 7, 0, 1, 3),
	(349, '简历库', 8, 'index.php?m=lt_talent', 1, '', 9, 0, 1, 3),
	(361, '测评用户记录', 11, 'index.php?m=admin_evaluate&c=record', 1, '', 6, 0, 0, 3),
	(362, '添加广告类别', 75, 'index.php?m=advertise&c=addclass', 1, '', 5, 0, 0, 3),
	(401, '会员', 1, '', 0, 'nav_member', 0, 0, 1, 2),
	(402, '会员列表', 401, 'index.php?m=admin_member', 1, '', 1, 0, 1, 3),
	(403, '登录日志', 401, 'index.php?m=admin_loginlog', 1, '', 4, 0, 1, 3),
	(405, '删除会员', 402, 'index.php?m=admin_member&c=del', 1, '', 0, 0, 1, 4),
	(406, '修改会员', 402, 'index.php?m=admin_member&c=editSave', 1, '', 0, 0, 1, 4),
	(407, '重置密码', 402, 'index.php?m=admin_member&c=reset_pw', 1, '', 0, 0, 1, 4),
	(408, '删除日志', 403, 'index.php?m=admin_loginlog&c=dellog', 1, '', 0, 0, 1, 4),
	(409, '删除', 16, 'index.php?m=admin_company&c=del', 1, '', 0, 0, 1, 4),
	(410, '修改', 16, 'index.php?m=admin_company&c=comeditsave', 1, '', 0, 0, 1, 4),
	(411, '会员等级', 16, 'index.php?m=admin_company&c=rating', 1, '', 0, 0, 1, 4),
	(412, '修改套餐', 16, 'index.php?m=admin_company&c=uprating', 1, '', 0, 0, 1, 4),
	(413, '批量导出', 16, 'index.php?m=admin_company&c=xls', 1, '', 0, 0, 1, 4),
	(414, '批量认证', 16, 'index.php?m=admin_company&c=batchfirm', 1, '', 0, 0, 1, 4),
	(415, '删除', 40, 'index.php?m=admin_company_job&c=del', 1, '', 0, 0, 1, 4),
	(416, '修改', 40, 'index.php?m=admin_company_job&c=show', 1, '', 0, 0, 1, 4),
	(417, '职位置顶', 40, 'index.php?m=admin_company_job&c=xuanshang', 1, '', 0, 0, 1, 4),
	(418, '职位推荐', 40, 'index.php?m=admin_company_job&c=recommend', 1, '', 0, 0, 1, 4),
	(419, '职位紧急', 40, 'index.php?m=admin_company_job&c=urgent', 1, '', 0, 0, 1, 4),
	(420, '批量导出', 40, 'index.php?m=admin_company_job&c=xls', 1, '', 0, 0, 1, 4),
	(421, '修改', 41, 'index.php?m=admin_hotjob&c=save', 1, '', 0, 0, 1, 4),
	(422, '删除', 41, 'index.php?m=admin_hotjob&c=del', 1, '', 0, 0, 1, 4),
	(423, '删除', 42, 'index.php?m=admin_partjob&c=del', 1, '', 0, 0, 1, 4),
	(424, '修改', 42, 'index.php?m=admin_partjob&c=show', 1, '', 0, 0, 1, 4),
	(427, '删除', 44, 'index.php?m=comproduct&c=del', 1, '', 0, 0, 1, 4),
	(428, '删除', 45, 'index.php??m=comnews&c=del&id=313', 1, '', 0, 0, 1, 4),
	(430, '删除', 47, 'index.php?m=comcert&c=del&id=4431', 1, '', 0, 0, 1, 4),
	(431, '删除', 345, 'index.php?m=admin_company_pic&c=del', 1, '', 0, 0, 1, 4),
	(432, '修改', 345, 'index.php?m=admin_company_pic&c=uploadsave', 1, '', 0, 0, 1, 4),
	(433, '删除职位申请', 50, 'index.php?m=admin_comlog&c=deluseridjob', 1, '', 0, 0, 1, 4),
	(434, '删除面试邀请', 50, 'index.php?m=admin_comlog&c=deluseridmsg', 1, '', 0, 0, 1, 4),
	(435, '删除职位浏览', 50, 'index.php?m=admin_comlog&c=dellookjob', 1, '', 0, 0, 1, 4),
	(436, '删除兼职报名', 50, 'index.php?m=admin_comlog&c=delpartapply', 1, '', 0, 0, 1, 4),
	(437, '删除收藏人才', 50, 'index.php?m=admin_comlog&c=deltalentpool', 1, '', 0, 0, 1, 4),
	(438, '套餐设置', 52, 'index.php?m=admin_comrating&c=saveclass', 1, '', 0, 0, 1, 4),
	(439, '增值包设置', 52, 'index.php?m=admin_comrating&c=saves', 1, '', 0, 0, 1, 4),
	(440, '删除', 54, 'index.php?m=admin_news&c=delnews', 1, '', 0, 0, 1, 4),
	(441, '删除', 56, 'index.php?m=admin_news&c=delgroup', 1, '', 0, 0, 1, 4),
	(442, '转移类别', 56, 'index.php?m=admin_news&c=changeSon', 1, '', 0, 0, 1, 4),
	(443, '删除', 69, 'index.php?m=admin_evaluate&c=delevaluate', 1, '', 0, 0, 1, 4),
	(444, '删除', 71, 'index.php?m=admin_evaluate&c=delgroup', 1, '', 0, 0, 1, 4),
	(445, '删除', 72, 'index.php?m=admin_evaluate&c=delmsg', 1, '', 0, 0, 1, 4),
	(446, '删除记录', 361, 'index.php?m=admin_evaluate&c=delevaluatelog', 1, '', 0, 0, 1, 4),
	(447, '删除招聘会', 61, 'index.php?m=zhaopinhui&c=del', 1, '', 0, 0, 1, 4),
	(448, '删除', 63, 'index.php?m=zhaopinhui&c=delcom', 1, '', 0, 0, 1, 4),
	(449, '删除场地', 64, 'index.php?m=zph_space&c=del', 1, '', 0, 0, 1, 4),
	(450, '展位新增', 64, 'index.php?m=zph_space&c=save', 1, '', 0, 0, 1, 4),
	(451, '展位修改', 64, 'index.php?m=zph_space&c=ajax', 1, '', 0, 0, 1, 4),
	(452, '删除', 57, 'index.php?m=hr&c=del', 1, '', 0, 0, 1, 4),
	(453, '编辑', 58, 'index.php?m=hrclass&c=add', 1, '', 0, 0, 1, 4),
	(454, '删除', 58, 'index.php?m=hrclass&c=del', 1, '', 0, 0, 1, 4),
	(455, '删除', 59, 'index.php?m=admin_announcement&c=del', 1, '', 0, 0, 1, 4),
	(456, '修改', 66, 'index.php?m=admin_question&c=save', 1, '', 0, 0, 1, 4),
	(457, '删除', 66, 'index.php?m=admin_question&c=del', 1, '', 0, 0, 1, 4),
	(458, '推荐', 66, 'index.php?m=admin_question&c=recommend', 1, '', 0, 0, 1, 4),
	(459, '修改', 97, 'index.php?m=question_class&c=save', 1, '', 0, 0, 1, 4),
	(460, '删除', 97, 'index.php?m=question_class&c=del', 1, '', 0, 0, 1, 4),
	(465, '修改', 81, 'index.php?m=admin_prepaid&c=upcard', 1, '', 0, 0, 1, 4),
	(466, '删除', 81, 'index.php?m=admin_prepaid&c=del', 1, '', 0, 0, 1, 4),
	(468, '删除', 163, 'index.php?m=company_pay&c=del', 1, '', 0, 0, 1, 4),
	(469, '删除', 162, 'index.php?m=company_order&c=del', 1, '', 0, 0, 1, 4),
	(470, '确认付款', 162, 'index.php?m=company_order&c=setpay', 1, '', 0, 0, 1, 4),
	(471, '修改金额', 162, 'index.php?m=company_order&c=save', 1, '', 0, 0, 1, 4),
	(472, '导出', 162, 'index.php?m=company_order&c=xls', 1, '', 0, 0, 1, 4),
	(473, '删除', 83, 'index.php?m=advertise&c=del', 1, '', 0, 0, 1, 4),
	(474, '删除', 86, 'index.php?m=advertise&c=delclass', 1, '', 0, 0, 1, 4),
	(475, '删除', 76, 'index.php?m=reward&c=del', 1, '', 0, 0, 1, 4),
	(476, '删除', 77, 'index.php?m=reward_list&c=del', 1, '', 0, 0, 1, 4),
	(477, '修改', 82, 'index.php?m=redeem_class&c=ajax', 1, '', 0, 0, 1, 4),
	(478, '删除', 82, 'index.php?m=redeem_class&c=del', 1, '', 0, 0, 1, 4),
	(479, '删除', 49, 'index.php?m=special&c=del', 1, '', 0, 0, 1, 4),
	(480, '删除简历', 179, 'index.php?m=report&c=delresume', 1, '', 0, 0, 1, 4),
	(481, '恢复数据', 169, 'index.php?m=recycle&c=recover', 1, '', 0, 0, 1, 4),
	(482, '清空/删除', 169, 'index.php?m=recycle&c=del', 1, '', 0, 0, 1, 4),
	(483, '清除日志', 128, 'index.php?m=wx&c=clearwx', 1, '', 0, 0, 1, 4),
	(484, '取消绑定', 129, 'index.php?m=wx&c=deluser', 1, '', 0, 0, 1, 4),
	(507, '修改用户名', 25, 'index.php?m=admin_company&c=saveusername', 1, '', 0, 0, 1, 4),
	(526, '修改', 48, 'index.php?m=admin_once&c=save', 1, '', 0, 0, 1, 4),
	(527, '删除', 48, 'index.php?m=admin_once&c=del', 1, '', 0, 0, 1, 4),
	(528, '批量延期', 48, 'index.php?m=admin_once&c=ctime', 1, '', 0, 0, 1, 4),
	(529, '店铺设置', 48, 'index.php?m=admin_once&c=onceset', 1, '', 0, 0, 1, 4),
	(530, '修改', 36, 'index.php?m=admin_tiny&c=save', 1, '', 0, 0, 1, 4),
	(531, '删除', 36, 'index.php?m=admin_tiny&c=del', 1, '', 0, 0, 1, 4),
	(532, '普工设置', 36, 'index.php?m=admin_tiny&c=tinyset', 1, '', 0, 0, 1, 4),
	(549, '解绑删除', 394, 'index.php?m=user_member&c=delwflog', 1, '', 0, 0, 1, 4),
	(560, '修改', 106, 'index.php?m=admin_user&c=save', 1, '', 0, 0, 1, 4),
	(575, '修改', 17, 'index.php?m=user_member&c=editSave', 1, '', 0, 0, 1, 4),
	(576, '删除', 17, 'index.php?m=user_member&c=del', 1, '', 0, 0, 1, 4),
	(577, '日志删除', 17, 'index.php?m=user_member&c=memberlogdel', 1, '', 0, 0, 1, 4),
	(578, '简历刷新', 33, 'index.php?m=admin_resume&c=refresh', 1, '', 0, 0, 1, 4),
	(579, '简历推荐', 33, 'index.php?m=admin_resume&c=rec', 1, '', 0, 0, 1, 4),
	(581, '简历备注', 33, 'index.php?m=admin_resume&c=label', 1, '', 0, 0, 1, 4),
	(582, '简历删除', 33, 'index.php?m=admin_resume&c=delResume', 1, '', 0, 0, 1, 4),
	(583, '简历导出', 33, 'index.php?m=admin_resume&c=xls', 1, '', 0, 0, 1, 4),
	(584, '删除', 34, 'index.php?m=admin_trust&c=del', 1, '', 0, 0, 1, 4),
	(585, '删除', 37, 'index.php?m=admin_msg&c=del', 1, '', 0, 0, 1, 4),
	(586, '删除下载记录', 38, 'index.php?m=admin_userlog&c=deldown', 1, '', 0, 0, 1, 4),
	(587, '删除推送记录', 38, 'index.php?m=admin_userlog&c=deltrust', 1, '', 0, 0, 1, 4),
	(588, '删除浏览记录', 38, 'index.php?m=admin_userlog&c=dellook', 1, '', 0, 0, 1, 4),
	(589, '头像修改', 346, 'index.php?m=admin_user_pic&c=savePhoto', 1, '', 0, 0, 1, 4),
	(590, '头像删除', 346, 'index.php?m=admin_user_pic&c=delPhoto', 1, '', 0, 0, 1, 4),
	(591, '修改', 346, 'index.php?m=admin_user_pic&c=saveShow', 1, '', 0, 0, 1, 4),
	(592, '删除', 346, 'index.php?m=admin_user_pic&c=delShow', 1, '', 0, 0, 1, 4),
	(602, '自我介绍', '73', 'index.php?m=admin_introduce', '1', '0', '14', '0', '1', '3'),
    (806, '会员注销', '401', 'index.php?m=admin_member_logout', 1, '', 5, 0, 0, 1),
	(809, '修改', '104', 'index.php?m=admin_user&c=savePass', '1', '', '0', '0', '1', '4'),
	(821, '面试模板', 6, 'index.php?m=admin_yqmb', 1, '', 7, 0, 0, 1),
	(822, '发布工具', 122, 'index.php?m=wx&c=pubtool', 1, '', 9, 0, 0, 1),
	(830, '分配顾问', 16, 'index.php?m=admin_company&c=checkguwen', 1, '', 0, 0, 0, 4),
	(843, '拨号记录', 6, 'index.php?m=admin_jobtellog', 1, '', 13, 0, 0, 1),
	(861, '删除职位收藏', 38, 'index.php?m=admin_userlog&c=delfavjob', 1, '', 0, 0, 0, 4),
	(862, '海报设置', 177, 'index.php?m=admin_hb_config', 1, '', 9, 0, 0, 3),
    (867, '添加规则', 131, 'index.php?m=wx&c=zdaddkeyword', 1, '', 0, 0, 0, 4),
    (868, '删除规则', 131, 'index.php?m=wx&c=delkeyword', 1, '', 0, 0, 0, 4);");
    // 超级管理员权限
    $group = $db->DB_select_once("admin_user_group","1 order by id asc");
    
    $db->query('UPDATE `' . $db_config[def] . 'admin_user_group` SET `group_power`=\'a:375:{i:0;s:3:"999";i:1;s:1:"1";i:2;s:1:"2";i:3;s:1:"3";i:4;s:1:"4";i:5;s:1:"5";i:6;s:3:"401";i:7;s:1:"6";i:8;s:1:"7";i:9;s:1:"8";i:10;s:3:"156";i:11;s:3:"393";i:12;s:2:"10";i:13;s:2:"11";i:14;s:2:"12";i:15;s:2:"13";i:16;s:2:"14";i:17;s:2:"15";i:18;s:3:"853";i:19;s:2:"74";i:20;s:2:"75";i:21;s:3:"161";i:22;s:3:"166";i:23;s:3:"343";i:24;s:3:"176";i:25;s:3:"177";i:26;s:3:"103";i:27;s:3:"122";i:28;s:3:"123";i:29;s:3:"158";i:30;s:3:"185";i:31;s:3:"186";i:32;s:3:"844";i:33;s:3:"363";i:34;s:3:"121";i:35;s:2:"73";i:36;s:3:"102";i:37;s:3:"124";i:38;s:3:"195";i:39;s:3:"170";i:40;s:3:"198";i:41;s:3:"402";i:42;s:3:"405";i:43;s:3:"406";i:44;s:3:"407";i:45;s:3:"601";i:46;s:3:"596";i:47;s:3:"403";i:48;s:3:"408";i:49;s:3:"806";i:50;s:3:"184";i:51;s:2:"16";i:52;s:3:"409";i:53;s:3:"410";i:54;s:3:"411";i:55;s:3:"412";i:56;s:3:"413";i:57;s:3:"414";i:58;s:3:"830";i:59;s:2:"40";i:60;s:3:"415";i:61;s:3:"416";i:62;s:3:"417";i:63;s:3:"418";i:64;s:3:"419";i:65;s:3:"420";i:66;s:2:"41";i:67;s:3:"421";i:68;s:3:"422";i:69;s:2:"42";i:70;s:3:"423";i:71;s:3:"424";i:72;s:2:"43";i:73;s:3:"425";i:74;s:3:"426";i:75;s:2:"44";i:76;s:3:"427";i:77;s:3:"821";i:78;s:2:"46";i:79;s:3:"429";i:80;s:2:"47";i:81;s:3:"430";i:82;s:3:"345";i:83;s:3:"431";i:84;s:3:"432";i:85;s:2:"50";i:86;s:3:"433";i:87;s:3:"434";i:88;s:3:"435";i:89;s:3:"436";i:90;s:3:"437";i:91;s:3:"843";i:92;s:2:"52";i:93;s:3:"438";i:94;s:3:"439";i:95;s:2:"53";i:96;s:2:"17";i:97;s:3:"575";i:98;s:3:"576";i:99;s:3:"577";i:100;s:2:"33";i:101;s:3:"578";i:102;s:3:"579";i:103;s:3:"580";i:104;s:3:"581";i:105;s:3:"582";i:106;s:3:"583";i:107;s:2:"34";i:108;s:3:"584";i:109;s:2:"35";i:110;s:2:"37";i:111;s:3:"585";i:112;s:2:"38";i:113;s:3:"586";i:114;s:3:"587";i:115;s:3:"588";i:116;s:3:"346";i:117;s:3:"589";i:118;s:3:"590";i:119;s:3:"591";i:120;s:3:"592";i:121;s:2:"39";i:122;s:2:"18";i:123;s:3:"487";i:124;s:3:"488";i:125;s:3:"489";i:126;s:3:"490";i:127;s:3:"491";i:128;s:2:"19";i:129;s:3:"492";i:130;s:3:"493";i:131;s:2:"20";i:132;s:3:"494";i:133;s:3:"495";i:134;s:2:"21";i:135;s:3:"496";i:136;s:2:"22";i:137;s:3:"497";i:138;s:2:"23";i:139;s:3:"498";i:140;s:3:"499";i:141;s:3:"500";i:142;s:3:"501";i:143;s:3:"502";i:144;s:3:"347";i:145;s:3:"503";i:146;s:3:"504";i:147;s:2:"24";i:148;s:3:"349";i:149;s:3:"505";i:150;s:2:"48";i:151;s:3:"526";i:152;s:3:"527";i:153;s:3:"528";i:154;s:3:"529";i:155;s:2:"36";i:156;s:3:"530";i:157;s:3:"531";i:158;s:3:"532";i:159;s:3:"394";i:160;s:3:"543";i:161;s:3:"544";i:162;s:3:"545";i:163;s:3:"546";i:164;s:3:"547";i:165;s:3:"548";i:166;s:3:"549";i:167;s:3:"398";i:168;s:3:"550";i:169;s:3:"551";i:170;s:3:"399";i:171;s:3:"552";i:172;s:3:"400";i:173;s:3:"553";i:174;s:3:"554";i:175;s:3:"555";i:176;s:3:"397";i:177;s:2:"54";i:178;s:3:"440";i:179;s:2:"55";i:180;s:2:"56";i:181;s:3:"441";i:182;s:3:"442";i:183;s:3:"204";i:184;s:2:"69";i:185;s:3:"443";i:186;s:2:"70";i:187;s:2:"71";i:188;s:3:"444";i:189;s:2:"72";i:190;s:3:"445";i:191;s:3:"361";i:192;s:3:"446";i:193;s:2:"61";i:194;s:3:"447";i:195;s:2:"62";i:196;s:2:"63";i:197;s:3:"448";i:198;s:2:"64";i:199;s:3:"449";i:200;s:3:"450";i:201;s:3:"451";i:202;s:2:"57";i:203;s:3:"452";i:204;s:2:"58";i:205;s:3:"453";i:206;s:3:"454";i:207;s:3:"140";i:208;s:2:"59";i:209;s:3:"455";i:210;s:3:"154";i:211;s:2:"66";i:212;s:3:"456";i:213;s:3:"457";i:214;s:3:"458";i:215;s:2:"97";i:216;s:3:"459";i:217;s:3:"460";i:218;s:3:"359";i:219;s:3:"854";i:220;s:3:"855";i:221;s:2:"76";i:222;s:3:"475";i:223;s:2:"77";i:224;s:3:"476";i:225;s:3:"206";i:226;s:2:"82";i:227;s:3:"477";i:228;s:3:"478";i:229;s:2:"83";i:230;s:3:"473";i:231;s:2:"84";i:232;s:2:"85";i:233;s:2:"86";i:234;s:3:"474";i:235;s:3:"362";i:236;s:3:"165";i:237;s:3:"467";i:238;s:3:"163";i:239;s:3:"468";i:240;s:3:"162";i:241;s:3:"469";i:242;s:3:"470";i:243;s:3:"471";i:244;s:3:"472";i:245;s:3:"167";i:246;s:3:"164";i:247;s:3:"205";i:248;s:3:"208";i:249;s:3:"209";i:250;s:3:"210";i:251;s:3:"211";i:252;s:2:"79";i:253;s:3:"461";i:254;s:2:"78";i:255;s:3:"462";i:256;s:3:"463";i:257;s:2:"80";i:258;s:2:"81";i:259;s:3:"464";i:260;s:3:"465";i:261;s:3:"466";i:262;s:2:"49";i:263;s:3:"479";i:264;s:3:"344";i:265;s:3:"178";i:266;s:3:"179";i:267;s:3:"480";i:268;s:3:"180";i:269;s:3:"181";i:270;s:3:"182";i:271;s:3:"594";i:272;s:3:"862";i:273;s:3:"113";i:274;s:3:"114";i:275;s:3:"115";i:276;s:3:"116";i:277;s:3:"117";i:278;s:3:"118";i:279;s:3:"119";i:280;s:3:"120";i:281;s:3:"404";i:282;s:3:"125";i:283;s:3:"126";i:284;s:3:"127";i:285;s:3:"128";i:286;s:3:"483";i:287;s:3:"199";i:288;s:3:"129";i:289;s:3:"484";i:290;s:3:"130";i:291;s:3:"131";i:292;s:3:"867";i:293;s:3:"868";i:294;s:3:"197";i:295;s:3:"828";i:296;s:3:"822";i:297;s:3:"132";i:298;s:3:"133";i:299;s:3:"134";i:300;s:3:"135";i:301;s:3:"168";i:302;s:3:"169";i:303;s:3:"481";i:304;s:3:"482";i:305;s:3:"382";i:306;s:3:"863";i:307;s:3:"159";i:308;s:3:"160";i:309;s:3:"376";i:310;s:3:"377";i:311;s:3:"146";i:312;s:3:"189";i:313;s:3:"190";i:314;s:3:"147";i:315;s:3:"187";i:316;s:3:"188";i:317;s:3:"845";i:318;s:3:"846";i:319;s:3:"365";i:320;s:3:"386";i:321;s:3:"598";i:322;s:3:"599";i:323;s:3:"597";i:324;s:3:"142";i:325;s:3:"143";i:326;s:3:"144";i:327;s:3:"145";i:328;s:3:"148";i:329;s:3:"149";i:330;s:3:"151";i:331;s:3:"152";i:332;s:3:"153";i:333;s:3:"174";i:334;s:3:"193";i:335;s:3:"175";i:336;s:3:"194";i:337;s:2:"87";i:338;s:2:"88";i:339;s:2:"89";i:340;s:2:"92";i:341;s:2:"91";i:342;s:2:"93";i:343;s:2:"94";i:344;s:2:"95";i:345;s:2:"96";i:346;s:2:"98";i:347;s:3:"602";i:348;s:3:"104";i:349;s:3:"809";i:350;s:3:"105";i:351;s:3:"106";i:352;s:3:"560";i:353;s:3:"112";i:354;s:3:"107";i:355;s:3:"110";i:356;s:3:"109";i:357;s:3:"827";i:358;s:3:"136";i:359;s:3:"137";i:360;s:3:"138";i:361;s:3:"201";i:362;s:3:"202";i:363;s:3:"196";i:364;s:3:"200";i:365;s:3:"101";i:366;s:3:"171";i:367;s:3:"172";i:368;s:3:"173";i:369;s:3:"354";i:370;s:3:"111";i:371;s:3:"203";i:372;s:2:"65";i:373;s:2:"68";i:374;s:3:"814";}\' WHERE `id`='.$group['id'].'');

    $num = 0;

    $SQL = "SELECT count(*) as num From `" . $db_config[def] . "admin_jobwhb` WHERE `name` LIKE '%企业海报%'";

    $query = $db->query($SQL);

    while($row=$db->fetch_array($query))
    {
        $num = $row['num'];
    }

    if($num<1){
        // 企业海报
        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-1', './data/upload/whb/20210926/16388453507.png', 1, 2, 1, 1, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-2', './data/upload/whb/20210926/16368110265.png', 2, 2, 1, 2, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-3', './data/upload/whb/20210926/16424211377.png', 3, 2, 1, 3, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-4', './data/upload/whb/20210926/16373060517.png', 4, 2, 1, 4, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-5', './data/upload/whb/20210926/16410383023.png', 5, 2, 1, 5, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报1-6', './data/upload/whb/20210926/16373401231.png', 6, 2, 1, 6, 1);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-1', './data/upload/whb/20210926/16334727258.png', 1, 2, 1, 1, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-2', './data/upload/whb/20210926/16367046832.png', 2, 2, 1, 2, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-3', './data/upload/whb/20210926/16416887173.png', 3, 2, 1, 3, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-4', './data/upload/whb/20210926/16339360285.png', 4, 2, 1, 4, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-5', './data/upload/whb/20210926/16355139341.png', 5, 2, 1, 5, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报2-6', './data/upload/whb/20210926/16424128315.png', 6, 2, 1, 6, 2);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-1', './data/upload/whb/20210926/16395304774.png', 1, 2, 1, 1, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-2', './data/upload/whb/20210926/16359228791.png', 2, 2, 1, 2, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-3', './data/upload/whb/20210926/16404323056.png', 3, 2, 1, 3, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-4', './data/upload/whb/20210926/16411349471.png', 4, 2, 1, 4, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-5', './data/upload/whb/20210926/16330948051.png', 5, 2, 1, 5, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报3-6', './data/upload/whb/20210926/16418479077.png', 6, 2, 1, 6, 3);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-1', './data/upload/whb/20210926/16346951861.png', 1, 2, 1, 1, 4);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-2', './data/upload/whb/20210926/16349378085.png', 2, 2, 1, 2, 4);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-3', './data/upload/whb/20210926/16409274247.png', 3, 2, 1, 3, 4);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-4', './data/upload/whb/20210926/16407217399.png', 4, 2, 1, 4, 4);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-5', './data/upload/whb/20210926/16385047826.png', 5, 2, 1, 5, 4);");

        $db->query("INSERT INTO `$db_config[def]admin_jobwhb` (`id`, `name`, `pic`, `sort`,`type`, `isopen`,`num`,`style`) VALUES (NULL, '企业海报4-6', './data/upload/whb/20210926/16405375047.png', 6, 2, 1, 6, 4);");
    }
	
    
    

    // wap首页导航
    $db->query("INSERT INTO `$db_config[def]navigation` (`id`, `nid`, `name`, `url`, `sort`, `display`, `eject`, `type`, `furl`, `color`, `model`, `bold`, `desc`, `news`, `config`, `pic`)VALUES (NULL, 26, '店铺招聘', 'once', 10, 1, 0, 1, '', '', '', 0, NULL, NULL, '', './data/upload/nav/20210913/16339010778.png');");
    $db->query("INSERT INTO `$db_config[def]navigation` (`id`, `nid`, `name`, `url`, `sort`, `display`, `eject`, `type`, `furl`, `color`, `model`, `bold`, `desc`, `news`, `config`, `pic`)VALUES (NULL, 26, '普工简历', 'tiny', 11, 1, 0, 1, '', '', '', 0, NULL, NULL, '', './data/upload/nav/20210913/16350046154.png');");
    $db->query("INSERT INTO `$db_config[def]navigation` (`id`, `nid`, `name`, `url`, `sort`, `display`, `eject`, `type`, `furl`, `color`, `model`, `bold`, `desc`, `news`, `config`, `pic`)VALUES (NULL, 26, '附近职位', 'map', 15, 1, 0, 1, '', '', '', 0, NULL, NULL, '', './data/upload/nav/20210913/16395944961.png');");
    
    
    // 个人头像
    $db->query("UPDATE `" . $db_config[def] . "admin_config` SET `config` = 'data/logo/20210922/16323021198584.png' WHERE `name` = 'sy_member_icon'");
    $db->query("UPDATE `" . $db_config[def] . "admin_config` SET `config` = 'data/logo/20210922/16323021192988.png' WHERE `name` = 'sy_member_iconv'");
    
    // 简历审核模板
    $add = $db->query("INSERT INTO `$db_config[def]userclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, 0, '简历审核模板', 'user_audit', 0);");
    $nid = $db->insert_id();
    
    $db->query("INSERT INTO `$db_config[def]userclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '简历完整度太低，请继续完善简历', '', 0);");
    $db->query("INSERT INTO `$db_config[def]userclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '为保证简历真实性，姓名请填写真实姓名', '', 0);");
    
    // 职位审核模板
    $add = $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, 0, '职位审核模板', 'job_audit', 0);");
    $nid = $db->insert_id();
    
    $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '职位信息中有985、211、全日制等，此类招聘条件为不合理招聘条件，如有疑问请联系客服，谢谢配合', '', 0);");
    $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '请规范填写招聘内容，不得违反法律和社会公德，请及时修改，谢谢配合', '', 0);");
    
    // 热门问题
    $add = $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, 0, '热门问题', '热门问题', 0);");
    $nid = $db->insert_id();
    
    $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '公司怎么样？靠谱吗？', '', 0);");
    $db->query("INSERT INTO `$db_config[def]comclass` (`id`, `keyid`, `name`, `variable`, `sort`)VALUES (NULL, ".$nid.", '公司福利待遇怎么样？', '', 0);");
    
    if(!$config['sy_member_icon_arr']){
        
        $db->query('INSERT INTO `'.$db_config[def].'admin_config` SET `name`="sy_member_icon_arr",`config`=\'a:5:{i:0;s:37:"data/logo/20210922/16323021198584.png";i:1;s:37:"data/logo/20210922/16323021192178.png";i:2;s:37:"data/logo/20210922/16323021192007.png";i:3;s:37:"data/logo/20210922/16323021191018.png";i:4;s:37:"data/logo/20210922/16323068259312.png";}\'');
        
        $config['sy_member_icon_arr'] = array("0"=>"data/logo/20210922/16323021198584.png","1"=>"data/logo/20210922/16323021192178.png","2"=>"data/logo/20210922/16323021192007.png","3"=>"data/logo/20210922/16323021191018.png","4"=>"data/logo/20210922/16323068259312.png");
    }
    if(!$config['sy_member_iconv_arr']){
        
        $db->query('INSERT INTO `'.$db_config[def].'admin_config` SET `name`="sy_member_iconv_arr",`config`=\'a:5:{i:0;s:37:"data/logo/20210922/16323021192988.png";i:1;s:37:"data/logo/20210922/16323021193091.png";i:2;s:37:"data/logo/20210922/16323021197184.png";i:3;s:37:"data/logo/20210922/16323021198868.png";i:4;s:37:"data/logo/20210922/16323068256222.png";}\'');
        
        $config['sy_member_iconv_arr'] = array("0"=>"data/logo/20210922/16323021192988.png","1"=>"data/logo/20210922/16323021193091.png","2"=>"data/logo/20210922/16323021197184.png","3"=>"data/logo/20210922/16323021198868.png","4"=>"data/logo/20210922/16323068256222.png");
    }
    
    if(!$config['sy_shresume_applyjob']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_shresume_applyjob',`config`=0");
        
        $config['sy_shresume_applyjob'] = 0;
    }
    
    if(!$config['sy_login_type']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_login_type',`config`=1");
        
        $config['sy_login_type'] = 1;
    }
    
    if(!$config['sy_advice_mobilecode']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_advice_mobilecode',`config`=0");
        
        $config['sy_advice_mobilecode'] = 0;
    }
    
    if(!$config['sy_job_lookfx']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_job_lookfx',`config`=0");
        
        $config['sy_job_lookfx'] = 0;
    }
    if(!$config['sy_concheck_open']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_concheck_open',`config`=2");
        
        $config['sy_concheck_open'] = 0;
    }
    if(!$config['tg_back']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='tg_back',`config`=2");
        
        $config['tg_back'] = 0;
    }
    if(!$config['hotcom_top']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='hotcom_top',`config`=0");
        
        $config['hotcom_top'] = 0;
    }
    if(!$config['sy_msg_resumestate']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_msg_resumestate',`config`=1");
        
        $config['sy_msg_resumestate'] = 1;
    }
    if(!$config['sy_rname_num']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_rname_num',`config`=10");
        
        $config['sy_rname_num'] = 10;
    }
    if(!$config['sy_msg_lock']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_msg_lock',`config`=2");
        
        $config['sy_msg_lock'] = 1;
    }
    if(!$config['sy_datacycle']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_datacycle',`config`=0");
        
        $config['sy_datacycle'] = 0;
    }
    if(!$config['sy_resumeout_day_num']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_resumeout_day_num',`config`=0");
        
        $config['sy_resumeout_day_num'] = 0;
    }
    if(!$config['sy_resumeout_interval']){
        
        $db->query("INSERT INTO `$db_config[def]admin_config` SET `name`='sy_resumeout_interval',`config`=0");
        
        $config['sy_resumeout_interval'] = 0;
    }
    echo "<script>location.href='$config[sy_weburl]/update/index.php?step=3';</script>";
}
/****************************第三步：处理新闻开始时间************************************/
if ($_GET['step'] == 3){
    
    $query = $db->query("SELECT count(*) as num FROM `$db_config[def]news_base` ");
    while($row=$db->fetch_array($query))
    {
        $count = $row['num'];
    }
    $size = 1000;
    $num = ceil($count/$size);
    
    if(!$_GET['num']){
        $i = 0;
        
    }else{
        $i=$_GET['num'];
    }
    $SQL = "SELECT `id`,`datetime`,`starttime` From `" . $db_config[def] . "news_base` LIMIT ".$size * $i.", ".$size;
    
    $query = $db->query($SQL);
    
    while($row=$db->fetch_array($query))
    {
        if (empty($row['starttime'])){
            $db->query("UPDATE `" . $db_config[def] . "news_base` SET `starttime` = '".$row['datetime']."' WHERE `id` = '".$row['id']."'");
        }
    }
    if(($i+1)>=$num){
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=4';</script>";
    }else{
        $getnum = $i+1;
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=3&num=".$getnum."';</script>";
    }
    
}
/****************************第四步：处理公告开始时间************************************/
if ($_GET['step'] == 4){
    $query = $db->query("SELECT count(*) as num FROM `$db_config[def]admin_announcement` ");
    while($row=$db->fetch_array($query))
    {
        $count = $row['num'];
    }
    
    $size = 1000;
    $num = ceil($count/$size);
    
    if(!$_GET['num']){
        $i = 0;
        
    }else{
        $i=$_GET['num'];
    }
    $SQL = "SELECT `id`,`datetime`,`startime` From `" . $db_config[def] . "admin_announcement` LIMIT ".$size * $i.", ".$size;
    
    $query = $db->query($SQL);
    
    while($row=$db->fetch_array($query))
    {
        
        if (empty($row['startime'])){
            $db->query("UPDATE `" . $db_config[def] . "admin_announcement` SET `startime` = '".$row['datetime']."' WHERE `id` = '".$row['id']."'");
        }
    }
    if(($i+1)>=$num){
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=5';</script>";
    }else{
        $getnum = $i+1;
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=4&num=".$getnum."';</script>";
    }
}
/****************************第五步：处理简历城市************************************/
if ($_GET[step] == "5") {
    $query = $db->query("SELECT count(*) as num FROM `$db_config[def]resume_expect` ");

    $row = $db->fetch_array($query);
    $count = $row['num'];

    $size = 1000;
    $num = ceil($count / $size);

    if (!$_GET['num']) {
        $i = 0;

    } else {
        $i = $_GET['num'];
    }
    $SQL = "SELECT `id`,`name`,`lastupdate` FROM `" . $db_config[def] . "resume_expect` LIMIT " . $size * $i . ", " . $size;

    $query = $db->query($SQL);
    $expectList = array();
    while ($expect = $db->fetch_array($query)) {
        $expectList[] = $expect;
		$eidArr[] = $expect['id'];
    }

    $eids = implode(',', $eidArr);

    $SQL = "SELECT * FROM `{$db_config['def']}resume_cityclass` WHERE eid in ({$eids}) ORDER BY eid";
    $cityclass_query = $db->query($SQL);
    $cityclassList = array();
    while ($cityclass = $db->fetch_array($cityclass_query)) {
        $cityclassList[$cityclass['eid']][] = $cityclass;
    }

    $SQL = "SELECT * FROM `{$db_config['def']}resume_jobclass` WHERE eid in ({$eids}) ORDER BY eid";
    $jobclass_query = $db->query($SQL);
    $jobclassList = array();
    while ($jobclass = $db->fetch_array($jobclass_query)) {
        $jobclassList[$jobclass['eid']][] = $jobclass;
    }

    $checkExist = !empty($_GET['exist']) ? true : false;

    $insertSql = '';
    $insertData = array();
    foreach ($expectList as $expect) {
        $cjColNum = $jobColNum = $cityColNum = [];
        if (!empty($cityclassList[$expect['id']])) {
            foreach ($cityclassList[$expect['id']] as $cityclass) {
                if (!empty($jobclassList[$expect['id']])) {
                    foreach ($jobclassList[$expect['id']] as $jobclass) {
                        $provinceid = $cityclass['provinceid'];
                        $cityid = $cityclass['cityid'];
                        $three_cityid = $cityclass['three_cityid'];
                        $city_key = $provinceid . '_' . $cityid;
                        $three_city_key = $provinceid . '_' . $cityid . '_' . $three_cityid;
                        $cityColNum[$provinceid] = $cityColNum[$provinceid] ? $cityColNum[$provinceid] + 1 : 1;
                        $cityColNum[$city_key] = $cityColNum[$city_key] ? $cityColNum[$city_key] + 1 : 1;
                        $cityColNum[$three_city_key] = $cityColNum[$three_city_key] ? $cityColNum[$three_city_key] + 1 : 1;

                        $job1 = $jobclass['job1'];
                        $job1_son = $jobclass['job1_son'];
                        $job_post = $jobclass['job_post'];
                        $job1_son_key = $job1 . '_' . $job1_son;
                        $job_post_key = $job1 . '_' . $job1_son . '_' . $job_post;
                        $jobColNum[$job1] = isset($jobColNum[$job1]) ? $jobColNum[$job1] + 1 : 1;
                        $jobColNum[$job1_son_key] = isset($jobColNum[$job1_son_key]) ? $jobColNum[$job1_son_key] + 1 : 1;
                        $jobColNum[$job_post_key] = isset($jobColNum[$job_post_key]) ? $jobColNum[$job_post_key] + 1 : 1;

                        $cj_key1 = '1' . $provinceid . '_' . $job1;
                        $cj_key2 = '1' . $provinceid . '_' . $job1 . '_' . $job1_son;
                        $cj_key3 = '1' . $provinceid . '_' . $job1 . '_' . $job1_son . '_' . $job_post;
                        $cjColNum[$cj_key1] = isset($cjColNum[$cj_key1]) ? $cjColNum[$cj_key1] + 1 : 1;
                        $cjColNum[$cj_key2] = isset($cjColNum[$cj_key2]) ? $cjColNum[$cj_key2] + 1 : 1;
                        $cjColNum[$cj_key3] = isset($cjColNum[$cj_key3]) ? $cjColNum[$cj_key3] + 1 : 1;

                        $cj_key4 = '2' . $cityid . '_' . $job1;
                        $cj_key5 = '2' . $cityid . '_' . $job1 . '_' . $job1_son;
                        $cj_key6 = '2' . $cityid . '_' . $job1 . '_' . $job1_son . '_' . $job_post;
                        $cjColNum[$cj_key4] = isset($cjColNum[$cj_key4]) ? $cjColNum[$cj_key4] + 1 : 1;
                        $cjColNum[$cj_key5] = isset($cjColNum[$cj_key5]) ? $cjColNum[$cj_key5] + 1 : 1;
                        $cjColNum[$cj_key6] = isset($cjColNum[$cj_key6]) ? $cjColNum[$cj_key6] + 1 : 1;

                        $cj_key7 = '3' . $three_cityid . '_' . $job1;
                        $cj_key8 = '3' . $three_cityid . '_' . $job1 . '_' . $job1_son;
                        $cj_key9 = '3' . $three_cityid . '_' . $job1 . '_' . $job1_son . '_' . $job_post;
                        $cjColNum[$cj_key7] = isset($cjColNum[$cj_key7]) ? $cjColNum[$cj_key7] + 1 : 1;
                        $cjColNum[$cj_key8] = isset($cjColNum[$cj_key8]) ? $cjColNum[$cj_key8] + 1 : 1;
                        $cjColNum[$cj_key9] = isset($cjColNum[$cj_key9]) ? $cjColNum[$cj_key9] + 1 : 1;

                        $where = "provinceid = {$cityclass['provinceid']} and cityid = {$cityclass['cityid']} and three_cityid = {$cityclass['three_cityid']} and job1 = {$jobclass['job1']} and job1_son = {$jobclass['job1_son']} and job_post = {$jobclass['job_post']} and eid = {$expect['id']}";
                        if ($checkExist) {
                            $city_job_class_query = $db->query("SELECT count(*) as num FROM `{$db_config['def']}resume_city_job_class` WHERE {$where}");
                            while ($city_job_class_rows = $db->fetch_array($city_job_class_query)) {
                                $city_job_class_num = $city_job_class_rows['num'];
                            }
                            if ($city_job_class_num) {
                                continue;
                            }
                        }

                        $isql = "(0, {$cityclass['provinceid']}, {$cityColNum[$provinceid]}, {$cityclass['cityid']}, {$cityColNum[$city_key]}, {$cityclass['three_cityid']}, {$cityColNum[$three_city_key]}, {$jobclass['job1']}, {$jobColNum[$job1]}, {$jobclass['job1_son']}, {$jobColNum[$job1_son_key]}, {$jobclass['job_post']}, {$jobColNum[$job_post_key]},{$cjColNum[$cj_key1]},{$cjColNum[$cj_key2]},{$cjColNum[$cj_key3]},{$cjColNum[$cj_key4]},{$cjColNum[$cj_key5]},{$cjColNum[$cj_key6]},{$cjColNum[$cj_key7]},{$cjColNum[$cj_key8]},{$cjColNum[$cj_key9]}, {$expect['id']}, {$expect['lastupdate']}, {$cityclass['uid']})";
                        if ($insertSql) {
                            $insertKey = md5($where);
                            if (!isset($insertData[$insertKey])) { // 去重
                                $insertData[$insertKey] = 1;
                                $insertSql .= ",{$isql}";
                            }
                        } else {
                            $insertData[] = $isql;
                            $insertSql .= "INSERT INTO `{$db_config['def']}resume_city_job_class` VALUE {$isql}";
                        }
                    }
                } else {
                    $provinceid = $cityclass['provinceid'];
                    $cityid = $cityclass['cityid'];
                    $three_cityid = $cityclass['three_cityid'];
                    $city_key = $provinceid . '_' . $cityid;
                    $three_city_key = $provinceid . '_' . $cityid . '_' . $three_cityid;
                    $cityColNum[$provinceid] = isset($cityColNum[$provinceid]) ? $cityColNum[$provinceid] + 1 : 1;
                    $cityColNum[$city_key] = isset($cityColNum[$city_key]) ? $cityColNum[$city_key] + 1 : 1;
                    $cityColNum[$three_city_key] = isset($cityColNum[$three_city_key]) ? $cityColNum[$three_city_key] + 1 : 1;

                    $where = "provinceid = {$cityclass['provinceid']} and cityid = {$cityclass['cityid']} and three_cityid = {$cityclass['three_cityid']} and job1 = 0 and job1_son = 0 and job_post = 0 and eid = {$expect['id']}";
                    if ($checkExist) {
                        $city_job_class_query = $db->query("SELECT count(*) as num FROM `{$db_config['def']}resume_city_job_class` WHERE {$where}");
                        $city_job_class_rows = $db->fetch_array($city_job_class_query);
                        $city_job_class_num = $city_job_class_rows['num'];
                        if ($city_job_class_num) {
                            continue;
                        }
                    }

                    $isql = "(0, {$cityclass['provinceid']}, {$cityColNum[$provinceid]}, {$cityclass['cityid']}, {$cityColNum[$city_key]}, {$cityclass['three_cityid']}, {$cityColNum[$three_city_key]}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {$expect['id']}, {$expect['lastupdate']}, {$cityclass['uid']})";
                    if ($insertSql) {
                        $insertKey = md5($where);
                        if (!isset($insertData[$insertKey])) { // 去重
                            $insertData[$insertKey] = 1;
                            $insertSql .= ",{$isql}";
                        }
                    } else {
                        $insertData[] = $isql;
                        $insertSql .= "INSERT INTO `{$db_config['def']}resume_city_job_class` VALUE {$isql}";
                    }
                }
            }
        } elseif (!empty($jobclassList[$expect['id']])) {
            foreach ($jobclassList[$expect['id']] as $jobclass) {
                $job1 = $jobclass['job1'];
                $job1_son = $jobclass['job1_son'];
                $job_post = $jobclass['job_post'];
                $job1_son_key = $job1 . '_' . $job1_son;
                $job_post_key = $job1 . '_' . $job1_son . '_' . $job_post;
                $jobColNum[$job1] = isset($jobColNum[$job1]) ? $jobColNum[$job1] + 1 : 1;
                $jobColNum[$job1_son_key] = isset($jobColNum[$job1_son_key]) ? $jobColNum[$job1_son_key] + 1 : 1;
                $jobColNum[$job_post_key] = isset($jobColNum[$job_post_key]) ? $jobColNum[$job_post_key] + 1 : 1;

                $where = "provinceid = 0 and cityid = 0 and three_cityid = 0 and job1 = {$jobclass['job1']} and job1_son = {$jobclass['job1_son']} and job_post = {$jobclass['job_post']} and eid = {$expect['id']}";
                if ($checkExist) {
                    $city_job_class_query = $db->query("SELECT count(*) as num FROM `{$db_config['def']}resume_city_job_class` WHERE {$where}");
                    $city_job_class_rows = $db->fetch_array($city_job_class_query);
                    $city_job_class_num = $city_job_class_rows['num'];
                    if ($city_job_class_num) {
                        continue;
                    }
                }

                $isql = "(0, 0, 0, 0, 0, 0, 0, {$jobclass['job1']}, {$jobColNum[$job1]}, {$jobclass['job1_son']}, {$jobColNum[$job1_son_key]}, {$jobclass['job_post']}, {$jobColNum[$job_post_key]}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {$expect['id']}, {$expect['lastupdate']}, {$jobclass['uid']})";
                if ($insertSql) {
                    $insertKey = md5($where);
                    if (!isset($insertData[$insertKey])) { // 去重
                        $insertData[$insertKey] = 1;
                        $insertSql .= ",{$isql}";
                    }
                } else {
                    $insertData[] = $isql;
                    $insertSql .= "INSERT INTO `{$db_config['def']}resume_city_job_class` VALUE {$isql}";
                }
            }
        }
    }
    if ($insertSql) {
        $db->query($insertSql);
    }

    if (($i + 1) >= $num) {
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=6';</script>";
    } else {
        $getnum = $i + 1;
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=5&num=" . $getnum . "';</script>";
    }
}
/****************************第六步：处理简历随机头像************************************/
if ($_GET[step] == "6") {
    $query  =   $db->query("SELECT count(*) as num FROM `$db_config[def]resume` WHERE `defphoto` = 2 AND `photo` <> ''");
    
    $row    =   $db->fetch_array($query);
    $count  =   $row['num'];
    
    $size   =   1000;
    $num    =   ceil($count / $size);
    
    for($i=0;$i<$num;$i++){
        
        $SQL = "Select `uid` From `" . $db_config[def] . "resume` where `photo` <> '' AND `defphoto` = 2 ORDER BY uid ASC limit ".$size;
        $query = $db->query($SQL);
        
        while($row=$db->fetch_array($query))
        {
            $db->query("UPDATE `" . $db_config[def] . "resume_expect` SET defphoto=2 WHERE `uid`='".$row['uid']."'");
        }
    }
    
    
    if (($i + 1) >= $num) {
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=7';</script>";
    } else {
        $getnum = $i + 1;
        echo "<script>location.href='$config[sy_weburl]/update/index.php?step=6&num=" . $getnum . "';</script>";
    }
}
/****************************第七步：清空缓存************************************/
if($_GET[step]=="7"){
    $delfiles="data/templates_c";
    $dh=@opendir($delfiles);
    while($file=@readdir($dh)){
        if($file!="."&&$file!=".."){
            $fullpath=$delfiles."/".$file;
            @unlink($fullpath);
        }
    }
    @closedir($dh);
    echo "<script>location.href='$config[sy_weburl]/update/index.php?step=8';</script>";
}
/****************************第八步：升级完成************************************/
if($_GET[step]=="8"){
	echo "数据库升级成功！请删除/update/ 目录 根据以下提示继续操作！";
	echo "<pre>";
	echo "1：进入后台 工具-生成-<font color='red'>生成缓存(数据库缓存)</font>";
	echo "<pre>";
	echo "2：进入后台 清除缓存";
	echo "<pre>";
	echo "3：其他各项配置按需修改";
	echo "<pre>";
}

?>