assign('affiliate', $affiliate); $back_act=''; $smarty->assign('categories', get_categories_tree()); // 分类? $smarty->assign('article_categories', article_categories_tree($cat_id)); //文章分类? $smarty->assign('company_news', company_news());//走进金万q? $smarty->assign('jingxiao', jingxiao()); // l销 $smarty->assign('talent', talent()); // 人才 $smarty->assign('lianxi', contact()); // 联系 $smarty->assign('cp_categories', get_categories_tree()); // 产品中心 $smarty->assign('news_categories', article_categories_tree()); //企业动? /*jdy add 0816 d首页qȝ插g*/ $smarty->assign("flash",get_flash_xml()); $smarty->assign('flash_count',count(get_flash_xml())); $smarty->assign('lang', $_LANG); /*职位列表*/ if ($_REQUEST['act'] == 'list'){ $sql = "SELECT * FROM " . $ecs->table('position_management') . " where `is_on`=1 and ((`release_time`+`valid_time`*86400) > UNIX_TIMESTAMP() OR `valid_time`='') ORDER BY refresh_time DESC, id DESC"; $row = $GLOBALS['db']->getAll($sql); //print_r($row);exit; $smarty->assign('time', time()); $smarty->assign('job_list', $row); $smarty->display('positions.dwt'); } /*详细信息*/ if ($_REQUEST['act'] == 'job_info'){ $id=$_REQUEST['id']; //echo $id;exit; $sql = "SELECT * "." FROM " . $ecs->table('position_management')."where id=". $id . " ORDER BY id DESC"; $row = $GLOBALS['db']->getRow($sql); //print_r($row);exit; $row['release_time']=date('Y-m-d',$row['release_time']); //$row['valid_time']=date('Y-m-d',$row['valid_time']); $smarty->assign('job', $row); $smarty->display('job_info.dwt'); } /*甌职位面*/ if ($_REQUEST['act'] == 'job_apply'){ //print_R($_CFG); $id=$_REQUEST['id']; //echo $id;exit; $sql = "SELECT * "." FROM " . $ecs->table('position_management')."where id=". $id . " ORDER BY id DESC"; $row = $GLOBALS['db']->getRow($sql); $smarty->assign('job', $row); $smarty->assign('id', $id); $smarty->display('job_apply.dwt'); } /*处理职位甌*/ if ($_REQUEST['act'] == 'chuli_job'){ set_time_limit(0); /* 查验证码 */ include_once('includes/cls_captcha.php'); $validator = new captcha(); if (!$validator->check_word($_POST['captcha'])) { show_message($_LANG['invalid_captcha'], 'q回上一U?, 'positions.php?act=list', 'error'); } if(!empty($_POST)){ $arr['job']=$_POST['job']; $arr['sex']=$_POST['sex']; $arr['name']=$_POST['name']; $arr['age']=$_POST['age']; $arr['hukou']=$_POST['hukou']; $arr['location']=$_POST['location']; $arr['deucation']=$_POST['deucation']; $arr['graduate']=$_POST['graduate']; $arr['major']=$_POST['major']; $arr['nation']=$_POST['nation']; $arr['zzmm']=$_POST['zzmm']; $arr['height']=$_POST['height']; $arr['weight']=$_POST['weight']; $arr['marriage']=$_POST['marriage']; $arr['health']=$_POST['health']; $arr['work_time']=$_POST['work_time']; $arr['language']=$_POST['language']; $arr['wsk']=$_POST['wsk']; $arr['chinese_level']=$_POST['chinese_level']; $arr['other_languages']=$_POST['other_languages']; $arr['work']=$_POST['work']; $arr['edu']=$_POST['edu']; $arr['ability']=$_POST['ability']; $arr['own']=$_POST['own']; $arr['address']=$_POST['address']; $email = isset($_POST['email']) ? $_POST['email'] : ""; if (empty($email)) { show_message("邮箱地址不能为空", 'q回上一U?, 'positions.php?act=list', 'error'); } if (!preg_match("/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i", $email)){ show_message("邮箱地址格式错误", 'q回上一U?, 'positions.php?act=list', 'error'); } $arr['email']=$email; $iphone = isset($_POST['iphone']) ? $_POST['iphone'] : ""; if (empty($iphone)) { show_message("手机不能为空", 'q回上一U?, 'positions.php?act=list', 'error'); } if (!preg_match("/^1\d{10}$/i", $iphone)) { show_message("联系人手机号码格式错?, 'q回上一U?, 'positions.php?act=list', 'error'); } $arr['iphone']=$iphone; $arr['qq']=$_POST['qq']; $arr['tel']=$_POST['tel']; $arr['msn']=$_POST['msn']; $arr['check_time']=$_POST['check_time']; $arr['apply_time']=time(); $arr['attach_url'] = ""; $arr['attach_name'] = ""; if (!empty($_FILES['upload_file']['tmp_name'])){ $extension = strrchr($_FILES['upload_file']['name'], '.'); $allow_type = array( 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/msword' ); $type = $_FILES['upload_file']['type']; /*if (!in_array($type, $allow_type)){ show_message('历只能上传word格式文g', 'q回上一U?, 'positions.php?act=list', 'error'); }*/ $disable = array( '.exe', '.bat', '.exec', '.vbs', '.reg', '.dll', '.mp4', '.mp3', '.mov', '.avi', '.mpg', '.dat', '.ini', '.msi', ); if (in_array($extension, $disable)) { show_message('附g格式错误', 'q回上一U?, 'positions.php?act=list', 'error'); } $upload_path = '/userfiles/positions/'.date('YmdHi').rand(10, 99).$extension; if (move_upload_file($_FILES['upload_file']['tmp_name'], $_SERVER['DOCUMENT_ROOT'].$upload_path)){ $arr['attach_url'] = $upload_path; $arr['attach_name'] = str_replace($extension, '', $_FILES['upload_file']['name']); }else{ show_message('上传文gp|', 'q回上一U?, 'positions.php?act=list', 'error'); } } $_msg_html=''; $_msg_html .='

|站收到如下人员应聘Q详l内容请d金万q网?/a>查阅。。?/h2>'; $_msg_html .='

应聘职位Q?/b>'.trim($_POST['job']).'

'; $_msg_html .='

姓名Q?/b>'.trim($_POST['name']).'

'; $_msg_html .='

专业Q?/b>'.trim($_POST['major']).'

'; $_msg_html .='

学历Q?/b>'.trim($_POST['deucation']).'

'; $_msg_html .='

电话Q?/b>'.trim($_POST['iphone']).'

'; $sql = 'INSERT INTO '. $ecs->table('job_apply') . ' (`job`, `sex`, `name`, `age`, `hukou`, `location`, `deucation`, `graduate`, `major`, `nation`, `zzmm`, `height`, `weight`, `marriage`, `health`, `work_time`, `language`, `wsk`, `chinese_level`, `other_languages`, `work`, `edu`, `ability`, `own`, `address`, `email`, `iphone`, `qq`, `tel`, `msn`, `check_time`, `apply_time`, `attach_url`, `attach_name`) VALUES' . "('".$arr['job']."','".$arr['sex']."','".$arr['name']."','".$arr['age']."','".$arr['hukou']."','".$arr['location']."','".$arr['deucation']."','".$arr['graduate']."','".$arr['major']."','".$arr['nation']."','".$arr['zzmm']."','".$arr['height']."','".$arr['weight']."','".$arr['marriage']."','".$arr['health']."','".$arr['work_time']."','".$arr['language']."','".$arr['wsk']."','".$arr['chinese_level']."','".$arr['other_languages']."','".$arr['work']."','".$arr['edu']."','".$arr['ability']."','".$arr['own']."','".$arr['address']."','".$arr['email']."','".$arr['iphone']."','".$arr['qq']."','".$arr['tel']."','".$arr['msn']."','".$arr['check_time']."','".$arr['apply_time']."', '".$arr['attach_url']."', '".$arr['attach_name']."')"; $result=$db->query($sql); //$sql = "SELECT * "." FROM " . $ecs->table('shop_config')."where code='job_email' "; //$address = $GLOBALS['db']->getRow($sql); $id = $_REQUEST['id']; $sql = "SELECT * "." FROM " . $ecs->table('position_management')."where id=$id"; $address = $GLOBALS['db']->getRow($sql); if($result){ $emaillist=explode(',',$address['email']); foreach($emaillist as $email){ send_mail('金万q?,$email, '工作甌', $_msg_html, 1) ; } show_message('历已投?, 'q回首页', 'index.php', 'info'); }else{ show_message('历投递失?, 'q回首页', 'index.php', 'info'); } } } function get_flash_xml() { $flashdb = array(); if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml')) { // 兼容v2.7.0及以前版? if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER)) { preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER); } if (!empty($t)) { foreach ($t as $key => $val) { $val[4] = isset($val[4]) ? $val[4] : 0; $flashdb[] = array('src'=>$val[1],'url'=>$val[2],'text'=>$val[3],'sort'=>$val[4]); //print_r($flashdb); } } } return $flashdb; } function email($arr,$address){ error_reporting(E_STRICT);//错误调试模式 date_default_timezone_set('Asia/Chongqing');//时区 //require_once('Public/PHPMailer/class.phpmailer.php');//加蝲一个邮件发送类 //require_once与include_once的区?后者找不到文g时警告错?前者是致命错误 //include_once如果前面已经加蝲׃会再加蝲Q? //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded //include("class.phpmailer.php"); include_once('PHPMailer/class.phpmailer.php'); $mail =new PHPMailer();//实例化一个类得到一个对象,q个对象拥有q个cȝ所有属性和Ҏ $body = '|站收到如下人员应聘Q详l内容请d
金万q网?/a>查阅。。?br/>应聘职位Q?.$arr['job'].'
姓名Q?.$arr['name'].'
专业Q?.$arr['major'].'
学历Q?.$arr['deucation'].'
电话Q?.$arr['iphone'];//获取html内容{字符串Ş式} //$body = eregi_replace("[\]",'',$body); $mail->IsSMTP(); //使用smtp协议发? //$mail->Host = "smtp.126.com"; // SMTP server $mail->SMTPDebug = 2; //调试模式 2开发时? 上线之后? // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.163.com"; //发送邮件的服务?sets the SMTP server $mail->Port = 25; //端口set the SMTP port for the GMAIL server $mail->Username = "13291090332@163.com"; //发送邮件的邮箱地址 SMTP account username $mail->Password = "zhp930617"; // SMTP account password $mail->SetFrom('13291090332@163.com', '朱vq?);//讄接收来源 $mail->AddReplyTo("13291090332@163.com","朱vq?回复");//回复邮箱 $mail->Subject = "您好Q您收到一简历!";//标题 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body);//内容使用html格式 $mail->AddAddress($address, "朱vq?);//有多个邮地址Q用多? //$mail->AddAddress("2356247465@qq.com", "??);//有多个邮地址Q用多 } ?>
Ͽʮֿ