/* * トップ */ //error_reporting (E_ALL); require_once("common.php"); // クラスの生成 $ap = new Application(); $act = $_REQUEST["act"]; $data["top"] = TOP; $data["top_url"] = TOP_URL; $data["gmap_key"] = GMAP_KEY; // 設定情報 if (!$_SESSION["SETUP"]) { $setup = get_setup(); if ($setup) { $_SESSION["SETUP"] = $setup; } } else { //$setup = $_SESSION["SETUP"]; $setup = get_setup(); if ($setup) { $_SESSION["SETUP"] = $setup; } } $_SESSION["SETUP"] = $setup; $data["setup"] = $setup; //Added SNS Register if ($ap->act == "fbregister") { try { $facebook = new Facebook($SNSConfig['facebook']); $params = array( 'display' => 'popup', 'redirect_uri' => TOP_URL . "?act=cb_fbregister", 'scope' => 'public_profile, email', 'default_graph_version' => 'v2.3', ); header("Location:" . $facebook->getLoginUrl($params)); } catch(\Exception $e) { header("Location:" . TOP_URL . 'register.html'); } exit; } if ($ap->act == "cb_fbregister") { $code = empty($_REQUEST["code"]) ? "" : $_REQUEST["code"]; if (is_array($code) && count($code) == 0) { //Session::put('message', trans('message.register.error_facebook_communication')); header("Location:" . TOP_URL . 'register.html'); exit; } else if(!is_array($code) && strlen($code) == 0) { //Session::put('message', trans('message.register.error_facebook_communication')); header("Location:" . TOP_URL . 'register.html'); exit; } $facebook = new Facebook($SNSConfig['facebook']); $url = "https://graph.facebook.com/v2.3/oauth/access_token?" . "client_id={$SNSConfig['facebook']['appId']}&" . "client_secret={$SNSConfig['facebook']['secret']}&" . "redirect_uri=" . TOP_URL . "?act=cb_fbregister&" . "code={$code}"; try { $res = @file_get_contents($url); $res = json_decode($res, true); } catch(\Exception $e) { header("Location:" . TOP_URL . 'register.html'); exit; } if (empty($res['access_token'])) { header("Location:" . TOP_URL . 'register.html'); exit; } $facebook->setAccessToken($res['access_token']); $uid = $facebook->getUser(); if ($uid == 0) { //Session::put('message', trans('message.register.error_facebook_problem')); header("Location:" . TOP_URL . 'register.html'); exit; } $loginInfo = $facebook->api('/me?locale=ja_JP&fields=name,email,first_name,last_name'); if (empty($loginInfo['email'])) { //Session::put('message', trans('message.register.error_facebook_email_empty')); header("Location:" . TOP_URL . 'register.html'); exit; } $facebookInfo = array( 'name' => '', 'kana' => '', 'email' => '', 'email_confirm' => '', // fb識別子 'fb_info' => '', ); if(!empty($loginInfo['name'])) { $facebookInfo['name'] = $loginInfo['name']; } else { $facebookInfo['name'] = (empty($loginInfo['last_name']) ? '' : $loginInfo['last_name']) . '' . (empty($loginInfo['first_name']) ? '' : $loginInfo['first_name']); } if ($facebookInfo['name']) { $facebookInfo['name'] = preg_replace("/( | )/", "", $facebookInfo['name'] ); } if(isset($loginInfo['email'])) { $facebookInfo['email'] = $loginInfo['email']; $facebookInfo['email_confirm'] = $loginInfo['email']; } // fb識別子 $facebookInfo['fb_info'] = $uid; // 値セット $shokusyu = get_info(INFO_SHOKUSYU); $koyou = get_info(INFO_KOYOU); //$ap->view("register.html", array('form' => $facebookInfo)); $ap->view("register.html", array('form' => $facebookInfo , 'preficture_list' => $preficture_list , 'shokusyu' => $shokusyu , 'koyou' => $koyou , 'setup' => $setup)); exit; } // Pref -> City if ($ap->act == "get_city") { $id = $_REQUEST["id"]; if ($id) { if ($_REQUEST["use"]) { $sql = "SELECT city_cd,city FROM address WHERE substring(city_cd, 1, 2)={$id} and city is not null and city<>'' and count>0"; } else { $sql = "SELECT city_cd,city FROM address WHERE substring(city_cd, 1, 2)={$id} and city is not null and city<>''"; } $ret = $ap->inst->search_sql($sql); $list = $ret["data"]; } echo "{"; if ($list) { foreach ($list as $val) { echo "'" . $val["city_cd"] . "':'" . $val["city"] . "',"; } } //echo "'':''}"; echo "}"; exit; } // 都道府県から市区町村リスト取得(該当求人件数取得) if ($ap->act == "get_city2") { $id = $_REQUEST["id"]; if ($id) { if ($_REQUEST["use"]) { $sql = "SELECT city_cd,city FROM address WHERE substring(city_cd, 1, 2)={$id} and city is not null and city<>'' and count>0"; } else { //$sql = "SELECT city_cd,city FROM address WHERE substring(city_cd, 1, 2)={$id} and city is not null and city<>''"; $sql = "SELECT city_cd,city FROM address WHERE pref_cd={$id} and city is not null and city<>''"; } $ret = $ap->inst->search_sql($sql); $list = $ret["data"]; } echo "{"; if ($list) { foreach ($list as $val) { //echo "'" . $val["city_cd"] . "':'" . $val["city"] . "',"; $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $id, "cond" => "="); //都道府県 $db->search[] = array("field" => "kinmu_city", "value" => $val["city_cd"], "cond" => "="); //都道府県 $count = $db->getCount(); echo "'" . $val["city_cd"] . "':['" . $val["city"] . "','" . $count . "'],"; } } //echo "'':''}"; echo "}"; exit; } // 市区町村コードから市区町村名取得 if ($ap->act == "get_city_name") { $id = $_REQUEST["id"]; $sql = "select * from address where `city_cd`={$id}"; $ret = $ap->inst->search_sql($sql); $list = $ret["data"]; if ($list) { foreach ($list as $val) { echo $val["city"]; } } echo ""; exit; } if ($act == "ajax_eki") { $ensen = $_REQUEST["id"]; if ($ensen) { $sql = "select * from ekis where use_flag=1 AND ensen_cd='{$ensen}' order by eki_cd"; $inst = DBConnection::getConnection($DB_URI); //求人に登録されている駅のみ取得 20121112 sakai//////////////////////////// $eki_array = ""; $sql2 = "select eki1 from `kyujin` where ensen1=".$ensen.""; $ret2 = $inst->search_sql($sql2); if ($ret2["count"]) { $list2 = array(); foreach ($ret2["data"] as $val) { $list2[] = $val["eki1"]; } $eki_array = implode(",",$list2); // $list2="eki1" に当てはまる"eki_cd" } $eki_array2 = ""; $sql3 = "select eki2 from `kyujin` where ensen2=".$ensen.""; $ret3 = $inst->search_sql($sql3); if ($ret3["count"]) { $list3 = array(); foreach ($ret3["data"] as $val) { $list3[] = $val["eki2"]; } $eki_array2 = implode(",",$list3); // $list3="eki2" に当てはまる"eki_cd" } if (($eki_array) && ($eki_array2)) { $list4 = $eki_array.",".$eki_array2; } else if (($eki_array) && !($eki_array2)) { $list4 = $eki_array; } else if (!($eki_array) && ($eki_array2)) { $list4 = $eki_array2; } $eki_array3 = " and `eki_cd` IN(".$list4.")"; $sql = "select * from ekis where ( use_flag=1 AND ensen_cd='{$ensen}'{$eki_array3} ) order by eki_cd"; //求人に登録されている駅のみ取得 20121112 sakai//////////////////////////// $ret = $inst->search_sql($sql); if ($ret["count"]) { $list = $ret["data"]; $i = 0; foreach ($list as $val) { if ($i++) echo ","; echo $val["eki_cd"] . ":" . $val["name"]; } exit; } } echo ""; exit; } // 141215 新・沿線、駅検索ロジック用(駅一覧をチェックボックスで表示) if ($act == "ajax_eki2") { $ensen = $_REQUEST["id"]; $check_eki = $_REQUEST["check"]; //チェックされている駅リスト if ($ensen) { $sql = "select * from ekis where use_flag=1 AND ensen_cd='{$ensen}' order by eki_cd"; $inst = DBConnection::getConnection($DB_URI); //求人に登録されている駅のみ取得 20121112 sakai//////////////////////////// $eki_array = ""; $sql2 = "select eki1 from `kyujin` where ensen1=".$ensen.""; $ret2 = $inst->search_sql($sql2); if ($ret2["count"]) { $list2 = array(); foreach ($ret2["data"] as $val) { $list2[] = $val["eki1"]; } $eki_array = implode(",",$list2); // $list2="eki1" に当てはまる"eki_cd" } $eki_array2 = ""; $sql3 = "select eki2 from `kyujin` where ensen2=".$ensen.""; $ret3 = $inst->search_sql($sql3); if ($ret3["count"]) { $list3 = array(); foreach ($ret3["data"] as $val) { $list3[] = $val["eki2"]; } $eki_array2 = implode(",",$list3); // $list3="eki2" に当てはまる"eki_cd" } if (($eki_array) && ($eki_array2)) { $list4 = $eki_array.",".$eki_array2; } else if (($eki_array) && !($eki_array2)) { $list4 = $eki_array; } else if (!($eki_array) && ($eki_array2)) { $list4 = $eki_array2; } $eki_array3 = " and `eki_cd` IN(".$list4.")"; $sql = "select * from ekis where ( use_flag=1 AND ensen_cd='{$ensen}'{$eki_array3} ) order by eki_cd"; //求人に登録されている駅のみ取得 20121112 sakai//////////////////////////// $ret = $inst->search_sql($sql); if ($ret["count"]) { $list = $ret["data"]; $i = 0; if($check_eki) { foreach ($list as $val1) { foreach ($check_eki as $val2) { if ($val1["eki_cd"] == $val2) { $check_flg = 1; break; } } if ($check_flg) { echo "
  • "; } else { echo "
  • "; } $check_flg = ""; } } else { foreach ($list as $val1) { echo "
  • "; } } exit; } } echo "沿線を選択して下さい"; exit; } //------------------------------------- //給与表示 if ($act == "ajax_kyuyo") { $kyuyo = $_REQUEST["id"]; $item = get_info_item($kyuyo); $val = array(); $val[] = $item["kyuyo1"] . ":" . yen_format($item["kyuyo1"]); $val[] = $item["kyuyo2"] . ":" . yen_format($item["kyuyo2"]); $val[] = $item["kyuyo3"] . ":" . yen_format($item["kyuyo3"]); $val[] = $item["kyuyo4"] . ":" . yen_format($item["kyuyo4"]); $val[] = $item["kyuyo5"] . ":" . yen_format($item["kyuyo5"]); $val[] = $item["kyuyo6"] . ":" . yen_format($item["kyuyo6"]); echo join(";", $val); exit; } //------------------------------------ // 駅データJPテスト if ($ap->act == "ekidata") { $pref = $_REQUEST["pref"]; header("Content-Type: text/html; charset=UTF-8"); $ekidata = new MyEkiDataJP(); //$ekidata = new MyEkiDataJP(array('cache_file_path' => '.')); $lines = $ekidata->getLinesByPrefId($pref); foreach ( $lines->line as $line ) { echo "◆{$line->line_name} ({$line->line_cd})
    "; $stations = $ekidata->getStationsByPrefIdAndLineId($pref, (string)$line->line_cd); foreach ( $stations as $s ) { echo " {$s->station->station_name} ({$s->station->station_cd})
    "; } } exit; } //------------------------------------ // 路線選択リスト作成(新) if ($act == "ajax_rosen") { $pref = $_REQUEST["pref"]; if ($pref > 47 || $pref == "") { echo ""; exit; } $ekidata = new MyEkiDataJP(); $lines = $ekidata->getLinesByPrefId($pref); $i = 0; foreach ( $lines->line as $line ){ if ($i++) echo ","; echo "{$line->line_cd}:{$line->line_name}"; } exit; } //------------------------------------ // 駅選択リスト作成(新)求人作成時用 if ($act == "ajax_eki_make") { $pref = $_REQUEST["pref"]; $ensen = $_REQUEST["ensen"]; if ($pref > 47 || $pref == "") { echo ""; exit; } if ($ensen == "") { echo ""; exit; } $ekidata = new MyEkiDataJP(); $stations = $ekidata->getStationsByPrefIdAndLineId($pref, $ensen); $i = 0; foreach ( $stations as $s ){ if ($i++) echo ","; echo "{$s->station->station_cd}:{$s->station->station_name}"; } exit; } //------------------------------------ // 路線選択リスト作成(新)求人検索用 if ($act == "ajax_rosen_search") { $pref = $_REQUEST["pref"]; $ensen = $_REQUEST["ensen"]; //選択された項目を得る if ($pref > 47 || $pref == "") { echo ""; exit; } $ekidata = new MyEkiDataJP(); $lines = $ekidata->getLinesByPrefId($pref); $i = 0; foreach ( $lines->line as $line ){ //駅の求人数計測 $sql = "select count(*) from kyujin where status=2 and del_flag=0 and kyujin_start<=date(now()) and kyujin_end>=date(now()) and kinmu = ".$pref." and (ensen1 = {$line->line_cd} or ensen2 = {$line->line_cd} )"; $inst = DBConnection::getConnection($DB_URI); $ret = $inst->search_sql($sql); // $flg = 0; if ($i++) echo ","; if (is_array($ensen)) { foreach($ensen as $val) { if ($val == $line->line_cd) { $flg = 1; } } if ($flg) { echo "{$line->line_cd}:{$line->line_name}:".$ret["data"][0]["count(*)"].":sel"; } else { echo "{$line->line_cd}:{$line->line_name}:".$ret["data"][0]["count(*)"]; } } else { if ($ensen == $line->line_cd) { echo "{$line->line_cd}:{$line->line_name}:".$ret["data"][0]["count(*)"].":sel"; } else { echo "{$line->line_cd}:{$line->line_name}:".$ret["data"][0]["count(*)"]; } } } exit; } //------------------------------------ // 駅選択リスト作成(新)求人検索用 if ($act == "ajax_eki_search") { $pref = $_REQUEST["pref"]; $ensen = $_REQUEST["ensen"]; $eki = $_REQUEST["eki"]; if ($pref > 47 || $pref == "") { echo ""; exit; } if ($ensen == "") { echo ""; exit; } header("Content-Type: text/html; charset=UTF-8"); $ekidata = new MyEkiDataJP(); $stations = $ekidata->getStationsByPrefIdAndLineId($pref, $ensen); $i = 0; foreach ( $stations as $s ){ //駅の求人数計測 $sql = "select count(*) from kyujin where status=2 and del_flag=0 and kyujin_start<=date(now()) and kyujin_end>=date(now()) and (eki1 = {$s->station->station_cd} or eki2 = {$s->station->station_cd} )"; $inst = DBConnection::getConnection($DB_URI); $ret = $inst->search_sql($sql); $flg = 0; if ($i++) echo ","; if (is_array($eki)) { foreach($eki as $val) { if ($val == $s->station->station_cd) { $flg = 1; } } if ($flg) { echo "{$s->station->station_cd}:{$s->station->station_name}:".$ret["data"][0]["count(*)"].":sel"; } else { echo "{$s->station->station_cd}:{$s->station->station_name}:".$ret["data"][0]["count(*)"]; } } else { if ($eki == $s->station->station_cd) { echo "{$s->station->station_cd}:{$s->station->station_name}:".$ret["data"][0]["count(*)"].":sel"; } else { echo "{$s->station->station_cd}:{$s->station->station_name}:".$ret["data"][0]["count(*)"]; } } } exit; } //------------------------------------- // 最新求人日付 $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now())"); $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->page = 0; $db->limit = 1; $list = $db->getList(); if ($list) { $data["new_info"] = date_format2($list[0]["kyujin_start"]); } /* define("INFO_SETUP", 1); // 設定 define("INFO_AREA", 2); // 勤務地 1 define("INFO_KYUYO", 3); // 給与 2 define("INFO_KOYOU", 4); // 雇用形態 3 define("INFO_GYOSHU", 5); // 業種 4 define("INFO_SHOKUSYU", 6); // 職種 5 define("INFO_SKILL", 7); // スキル 6 define("INFO_SHIKAKU", 8); // 保有資格 7 define("INFO_RIREKI", 9); // 履歴書用職種 8 define("INFO_ENSEN", 10); // 沿線 9 define("INFO_EKI", 11); // 駅名 10 define("INFO_MAIL", 12); // メールテンプレート 11 define("INFO_UNEI", 13); // 運営会社情報 13 define("INFO_HELP", 14); // ヘルプカテゴリ 14 define("INFO_KAKIN", 15); // 課金 15 define("INFO_GYOMU", 16); // 業務 16 define("INFO_SKILLRANK", 17); // スキル状態 */ // -------------------------------- // 写真表示 if ($act == "get_image") { $id = htmlspecialchars($_REQUEST["id"]); $file = htmlspecialchars($_REQUEST["file"]); $size = htmlspecialchars($_REQUEST["size"]); // sizeで指定した矩形の切り取り $tx = htmlspecialchars($_REQUEST["x"]); // x,yで指定した矩形の切り取り $ty = htmlspecialchars($_REQUEST["y"]); // x,yで指定した矩形の切り取り $pv = htmlspecialchars($_REQUEST["pv"]); if ($id || $file) { if ($tx || $ty) { $sx = 0; $sy = 0; if ($tx) { $sx = $tx; } if ($ty) { $sy = $ty; } } else if ($size) { $sx = $size; $sy = $size; } else { $sx = 0; $sy = 0; } get_image($id, $file, $sx, $sy, $pv); } exit; } // ------------------------------------ // 応募フォーム メール重複処理用 if ($_SESSION["entry_email_jyuhuku"]) { if ( $act != "detail-form" ) { unset($_SESSION["entry_email_jyuhuku"]); } } // -------------------------------- // 各ページの処理 //$html = &htmltemplate::getInstance(); // -------------------------------- // ピックアップ情報の取得 $db = new Pickup(); $db->search[] = array("field" => "status", "value" => "1", "cond" => "="); $db->search[] = array("expression" => "start_date <= now()"); $db->search[] = array("expression" => "end_date >= now()"); $list = $db->getList(); if ($list) { shuffle($list); // ランダムに並べる // 5件以上なら5件選択 if (count($list) > 5) { $list = array_slice($list, 0, 5); } foreach ($list as $key => $val) { $company = Company::getData($val["company_id"]); $list[$key]["company_name"] = $company["company_name"]; $list[$key]["url"] = TOP_URL . "s/&company_id=" . $val["company_id"]; unset($cond); $cond["city_cd"] = $company["city"]; $cityname = Address::findData($cond); $list[$key]["address"] = $preficture_list[$company['pref']] . $cityname[0]['city']; } $list[count($list)-1]["last"] = "1"; // 最終データ $data["pickup"] = $list; } // 新着の求人 -------------------------------- $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開期間内 $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->limit = 4; $fields = array("0" => "kyujin_id" , "1" => "company_id" , "2" => "title" , "3" => "syokusyu" , "4" => "koyou" , "5" => "category01" , "6" => "pr1" , "7" => "kinmu" , "8" => "main_image" , "10" => "kyuyo" , "11" => "kyuyo_min" , "12" => "kyuyo_max" , "14" => "admin_pickup" , "15" => "kyujin_start" ); $new_list_tmp = $db->getList($fields); if ($new_list_tmp) { foreach ($new_list_tmp as $key => $val) { $new_list_tmp[$key] = disp_kyujin($val); } $data["new_list"] = $new_list_tmp; } // 都道府県 foreach($preficture_list as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $key, "cond" => "="); //都道府県 $count = $db->getCount(); $data["pref_list"][$key]["name"] = $val; $data["pref_list"][$key]["count"] = $count; } // 職種 $data["syokusyu"] = get_info(INFO_SHOKUSYU); // -------------------------------- // 最近見た求人の取得 unset($list); if($_SESSION["LOGIN"]["kyushoku_id"]){ $where = " and kyushoku_id=".$_SESSION["LOGIN"]["kyushoku_id"]; }else{ $where = ""; } //$sql = "select kyujin_rireki.kyujin_id from kyujin_rireki, kyujin where kyujin_rireki.kyujin_id=kyujin.kyujin_id and kyujin_start<=date(now()) and kyujin_end>=date(now()) and status=2 order by kyujin_rireki.reg_date desc limit 0,20"; // 171128 負荷軽減 $sql = "select distinct kyujin_id from kyujin_rireki where view_flg = 1 order by reg_date desc limit 0,10"; $inst = DBConnection::getConnection($DB_URI); $ret = $inst->search_sql($sql); if ($ret["count"]) { $list = $ret["data"]; } if ($list) { $kyujin_id = array(); $num = 0; $idx = get_info_idx(INFO_SHOKUSYU); $idx2 = get_info_idx(INFO_KOYOU); foreach ($list as $val) { if (!$kyujin_id[$val['kyujin_id']]) { unset($item); $item = Kyujin::getData($val['kyujin_id'], array("kyujin_id", "company_id", "title", "pr1", "pr2", "main_image", "kyujin_start", "syokusyu", "kinmu", "koyou")); $company_name = Company::getData($item['company_id'], array("company_name")); $item["company_name"] = $company_name["company_name"]; if(strtotime("now -14 day") < strtotime($item["kyujin_start"])){ $item["new"] = 1; } $item["kinmu"] = $preficture_list[$item["kinmu"]]; $item["syokusyu"] = $idx[$item["syokusyu"]]; $item["koyou"] = $idx2[$item["koyou"]]; $data["check"][] = $item; $kyujin_id[$val['kyujin_id']] = "1"; if (++$num >= 10) break; } } } // -------------------------------- // 掲載中求人数取得 $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開期間内 $data["activ_kyujin_count"] = $db->getCount(); // 新着求人件数取得 $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開期間内 $db->search[] = array("expression" => "kyujin_start >= date(date_sub(now(), interval 14 day))"); // 2週間以内 $data["new_kyujin_count"] = $db->getCount(); // -------------------------------- // コンテンツページ if ($act == "page") { $id = $_REQUEST["id"]; if ($id) { $item = Page::getData($id); if ($item) { $item["contents"] = html_entity_decode($item["contents"]); $data["item"] = $item; } } if (!$data["item"]) { $data["no_item"] = 1; } $ap->view("page.html", $data); exit; } // ログイン if ($act == "login") { if ($_REQUEST["email"] && $_REQUEST["passwd"]) { $email = htmlspecialchars($_REQUEST["email"]); $passwd = htmlspecialchars($_REQUEST["passwd"]); $cond["email"] = $email; $cond["passwd"] = Encode($passwd); $cond["del_flag"] = "0"; $ret = Kyushoku::findData($cond); if (count($ret) == 1) { $user = $ret[0]; $_SESSION["LOGIN"] = $user; // if ($_REQUEST["auto_login"]) { setLoginCookie("X", $user["kyushoku_id"], LOGIN_COOKIE1); } // if (isset($_SESSION['NEXT_URL'])) { $url = $_SESSION['NEXT_URL']; unset($_SESSION['NEXT_URL']); header("location: " . $url); } else { // MyPageへ header("location: ./myuser/"); } exit; } $data["message"] = "ログインできません。IDとパスワードを確認してください。"; $data["email"] = $email; $data["passwd"] = $passwd; } else { $data["message"] = $_SESSION['LOGIN_MESSAGE']; } unset($_SESSION['LOGIN_MESSAGE']); $ap->view("login.html", $data); exit; } if ($act == "logout") { // ログアウト unset($_SESSION["LOGIN"]); } // -------------------------------- // ログイン成功後の処理の継続の場合 if ($act == 'logined') { $_REQUEST = $_SESSION['REQUEST']; unset($_SESSION['REQUEST']); $act = htmlspecialchars($_REQUEST['act']); } //----------------------------------- if (isset($_SESSION["LOGIN"])) { $data["login"] = 1; } else { $ret = isLogin(LOGIN_COOKIE1); if ($ret) { $id = $ret["user_id"]; $user = Kyushoku::getData($id); if ($user) { $_SESSION["LOGIN"] = $user; if (isset($_SESSION['NEXT_URL'])) { $url = $_SESSION['NEXT_URL']; unset($_SESSION['NEXT_URL']); header("location: " . $url); exit; } $data["login"] = 1; } else { $data['logout'] = 1; } } else { $data['logout'] = 1; } } // 企業の自動ログインチェック if (!$_SESSION["COMPANY_LOGIN"]) { if (($ret = isLogin(LOGIN_COOKIE2))) { $id = $ret["user_id"]; $user = Company::getData($id); if ($user) { $_SESSION["COMPANY_LOGIN"] = $user; if (isset($_SESSION['NEXT_URL'])) { $url = $_SESSION['NEXT_URL']; unset($_SESSION['NEXT_URL']); header("location: " . $url); exit; } } } } else { $data["company_login"] = "1"; } // 検討中に保存 if ($act == "bookmark") { login_check("ログインしてください"); // 削除 if ($_REQUEST["del"]) { foreach ($_REQUEST["del"] as $val) { unset($cond); $cond["seq"] = $val; $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Bookmark::findData($cond); if ($ret) { Bookmark::deleteData($val); } } } // 追加 if ($_REQUEST["id"]) { $ok = true; $id = $_REQUEST["id"]; // 検討中に登録済み unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["kyujin_id"] = $id; $ret = Bookmark::findData($cond); if ($ret) { $data["error"] = "この求人はすでに検討中に登録済みです。"; $ok = false; } // 応募済み unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["kyujin_id"] = $id; $ret = Oubo::findData($cond); if ($ret) { $data["error"] = "この求人にはすでに応募しています。"; $ok = false; } if ($ok) { unset($item); $item["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $item["kyujin_id"] = $id; Bookmark::addData($item); // 追加 } } unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Bookmark::findData($cond); if ($ret) { $list = array(); foreach ($ret as $key => $val) { $item = Kyujin::getData($val["kyujin_id"]); if ($item) { $item["seq"] = $val["seq"]; // 内容200字まで // 企業情報 // 新着 // 更新日 $item["reg_date"] = date_format2($item["reg_date"]); $list[] = disp_kyujin($item); } } $data["total"] = count($list); $data["list"] = $list; } $ap->view("bookmark.html", $data); exit; } if ($act == "company") { $ap->view("company.html", $data); exit; } //-------------------------------------------- // お問合せ $contact_check = array( // フォーム項目名 文字種 最大文字数 必須 表示名称 array("company_name", "*", "", false, "会社名"), array("name", "*", "", true, "お名前"), array("email", "MAIL", "", true, "メールアドレス"), array('tel', "TEL", "", false, "電話番号"), array('kind', "*", "", true, "お問合せ内容"), array('comment', "*", "", true, "詳細"), array("mode", "*", "", true, "モード"), ); if ($act == "contact") { $form = FormCheck::get_form($contact_check, $_REQUEST); if ($form) { $msg = FormCheck::check($form, $contact_check); $data["form"] = $form; // if ($msg) { foreach ($msg as $key => $v) { $data["error"][$key] = $v; $data["message"][] = $v; } } else { $_SESSION["contact"] = $form; $data["form"]["kind"] = $contact_list[$form["kind"]]; $ap->view("contact-confirm.html", $data); exit; } } if ($_SESSION["contact"]) { $data["form"] = $_SESSION["contact"]; } // お問い合わせ種別設定用 if ($_REQUEST["k"]) { $data["form"]["kind"] = $_REQUEST["k"]; } $data["contact_list"] = $contact_list; $ap->view("contact.html", $data); exit; } if ($act == "contact-confirm") { if ($_REQUEST["mode"]) { if ($_SESSION["contact"]) { $form = $_SESSION["contact"]; unset($_SESSION["contact"]); unset($item); $item["company_name"] = $form["company_name"]; $item["name"] = $form["name"]; $item["email"] = $form["email"]; $item["tel"] = $form["tel"]; $item["kind"] = $form["kind"]; $item["comment"] = $form["comment"]; Contact::addData($item); // メール送信 $form["kind"] = $contact_list[$form["kind"]]; $info = array("form" => $form, "setup" => $setup); // メール送信(確認) template_mail($form["email"], "inquire_user_subject", "inquire_user_body", $info, ""); // メール送信(管理者) $mail = get_setup(INFO_MAIL); template_mail($mail["admin_mail_replay"], "inquire_admin_subject", "inquire_admin_body", $info, ""); // $data["complete"] = "1"; $data["form"] = $form; $ap->view("contact-thankyou.html", $data); exit; } else { header("location: ./"); exit; } } $data["form"] = $_SESSION["contact"]; $data["form"]["kind"] = $contact_list[$data["form"]["kind"]]; $ap->view("contact-confirm.html", $data); exit; } //-------------------------------------------- // 電話応募 $entry_tel_check = array( // フォーム項目名 文字種 最大文字数 必須 表示名称 array("name", "*", "", true, "氏名"), array("name_kana", "*", "", true, "氏名フリガナ"), array('tel', "TEL", "", false, "電話番号"), array('mobile', "TEL", "", false, "携帯電話番号"), array("email", "MAIL", "", false, "メールアドレス"), array("mode", "*", "", true, "モード"), ); if ($act == "entry_tel") { $id = $_REQUEST["id"]; if (!$id) { // 求人が選択されていない header("location: ./"); exit; } // $item = Kyujin::getData($id); //求人データ取得 // 期限切れ、終了チェック if ( ($item["status"] == 2) && ( (strtotime(date('Y-m-d')) >= strtotime($item["kyujin_start"]) ) && (strtotime(date('Y-m-d')) <= strtotime($item["kyujin_end"]) ) ) ) { //ok } else { header("location: ./"); exit; } // $data["item"] = disp_kyujin($item); // ログインユーザーの応募済みチェック if ($_SESSION["LOGIN"]) { unset($cond); $cond['kyujin_id'] = $id; $cond['kyushoku_id'] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = EntryTel::findData($cond); if ($ret) { $data["oubo_message"] = "この求人には、".date('Y年n月j日 G時i分', strtotime($ret[0]["reg_date"]))."に表示済みです。
    電話番号を再度表示する場合は、入力内容を確認の上「電話番号を表示する」ボタンをクリックして下さい。"; $data["completed"] = 1; //既にエントリー済み } } // $form = FormCheck::get_form($entry_tel_check, $_REQUEST); if ($form) { $msg = FormCheck::check($form, $entry_tel_check); $data["form"] = $form; if ($form["tel"] || $form["mobile"]) { // } else { $msg["tel"] = "電話番号が記入されていません"; } // if ($msg) { foreach ($msg as $key => $v) { $data["error"][$key] = $v; $data["message"][] = $v; } /* } else { //確認ページへ $_SESSION["entry_tel"] = $form; $ap->view("entry_tel_confirm.html", $data); exit; } */ } else { //ログインユーザー以外の応募済みチェック if (!$_SESSION["LOGIN"]) { unset($cond); $cond['kyujin_id'] = $id; $cond['name'] = $form["name"]; $cond['name_kana'] = $form["name_kana"]; $ret = EntryTel::findData($cond); if ($ret) { foreach($ret as $val) { if ( ( $val["tel"] && ( $val["tel"] == $form["tel"] ) ) || ( $val["mobile"] && ( $val["mobile"] == $form["mobile"] ) ) ) { $data["oubo_message"] = "この求人には、".date('Y年n月j日 G時i分', strtotime($val["reg_date"]))."に表示済みです。"; break; } } $data["completed"] = 1; //既にエントリー済み } } else if ($data["completed"] == 1) { //ログインユーザーの応募済みメッセージ設定 $data["oubo_message"] = str_replace('
    電話番号を再度表示する場合は、入力内容を確認の上「電話番号を表示する」ボタンをクリックして下さい。', '', $data["oubo_message"]); } // if ($data["completed"] != 1) { // 登録 unset($item); $item['kyujin_id'] = $id; $item['kyushoku_id'] = (isset($_SESSION["LOGIN"]["kyushoku_id"])) ? $_SESSION["LOGIN"]["kyushoku_id"] : 0; $item['name'] = $form["name"]; $item['name_kana'] = $form["name_kana"]; $item['email'] = $form["email"]; $item['tel'] = $form["tel"]; $item['mobile'] = $form["mobile"]; EntryTel::addData($item); // 電話応募メール(求職者向け) $info = array("setup" => $setup, "form" => $form, "kyujin" => $data["item"]); if ($form["email"]) { template_mail($form["email"], "tel_entry_user_subject", "tel_entry_user_body", $info, "admin_mail_noreplay"); } // 電話応募メール(会社向け) $company = Company::getData($data["item"]["company_id"]); $info = array("setup" => $setup, "form" => $form, "kyujin" => $data["item"], "company" => $company); template_mail($company["email"], "tel_entry_company_subject", "tel_entry_company_body", $info, "admin_mail_noreplay"); // } //unset($_SESSION["form"]); //$_SESSION["form"] = "entry_tel"; $ap->view("entry_tel_thankyou.html", $data); exit; } } else if ($_SESSION["LOGIN"]["kyushoku_id"]) { unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Rirekisyo::findData($cond); if ($ret) { $form = $ret[0]; $form["name_kana"] = $form["kana"]; if ($form["email"]) { $form["email2"] = $form["email"]; } $data["form"] = $form; } else { $form = $_SESSION["LOGIN"]; $form["name_kana"] = $form["kana"]; $form["email2"] = $form["email"]; $data["form"] = $form; } } $ap->view("entry_tel.html", $data); exit; } if ($act == "entry_tel_thankyou") { header("location: ./"); exit; } //-------------------------------------------- // 応募 $oubo1_check = array( // フォーム項目名 文字種 最大文字数 必須 表示名称 array("name", "*", "", true, "氏名"), array("kana", "*", "", true, "フリガナ"), array("email", "MAIL", "", true, "メールアドレス"), array("email2", "MAIL", "", false, "メールアドレス確認"), array('birthday_year', "*", "", true, "生年月日"), array('birthday_month', "*", "", true, "生年月日"), array('birthday_day', "*", "", true, "生年月日"), array('sex', "*", "", true, "性別"), array('zip1', "*", "", false, "郵便番号"), array('zip2', "*", "", false, "郵便番号"), array('pref', "*", "", true, "都道府県"), array('address1', "*", "", true, "住所1"), array('address2', "*", "", true, "住所2"), array('tel', "TEL", "", false, "自宅電話"), array('mobile', "TEL", "", false, "携帯電話"), array('school', "*", "", false, "最終学歴"), array('gakubu', "*", "", false, "学部"), array('school_year', "*", "", false, "学歴年"), array('school_status', "*", "", false, "学歴状況"), array('passwd', "AN", "", false, "パスワード"), array('passwd2', "AN", "", false, "パスワード確認"), array("mode", "*", "", true, "モード"), ); if ($act == "detail-form") { $id = $_REQUEST["id"]; if (!$id) { // 求人が選択されていない header("location: ./"); exit; } // $item = Kyujin::getData($id); //求人データ取得 // 期限切れ、終了チェック if ( ($item["status"] == 2) && ( (strtotime(date('Y-m-d')) >= strtotime($item["kyujin_start"]) ) && (strtotime(date('Y-m-d')) <= strtotime($item["kyujin_end"]) ) ) ) { //ok } else { header("location: ./"); exit; } // $data["item"] = disp_kyujin($item); // 応募済みチェック unset($cond); $cond['kyujin_id'] = $id; $cond['kyushoku_id'] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Oubo::findData($cond); if ($ret) { $data["oubo_error"] = "この求人には、応募済みです。"; $ap->view("detail-form.html", $data); exit; } // $form = FormCheck::get_form($oubo1_check, $_REQUEST); if ($form) { $msg = FormCheck::check($form, $oubo1_check); if (!$_SESSION["LOGIN"]) { // ログインしていないで応募 if (!$form["passwd"]) { $msg["passwd"] = "パスワードが入力されていません。"; } if (!$form["passwd2"]) { $msg["passwd2"] = "パスワード確認が入力されていません。"; } if ($form["passwd"] && $form["passwd2"]) { if ($form["passwd"] != $form["passwd2"]) { $msg["passwd"] = "パスワードが一致していません。"; } } } $data["form"] = $form; // メールアドレス重複 // if ($form["email"] && $form["email2"]) { // if ($form["email"] != $form["email2"]) { // $msg["email"] = "メールアドレスが一致していません"; // } else if (!$_SESSION["LOGIN"]["kyushoku_id"]) { // 新規の場合は登録済みチェックをする // unset($cond); // $cond["email"] = $form["email"]; // $ret = Kyushoku::findData($cond); // if ($ret) { // $msg["email"] = "このメールアドレスは登録済みです"; // // 150527 メール登録済みの場合、ログイン導線を表示、そこからのログインにてフォーム情報を保持したまま戻る // $data["entry_email_jyuhuku"] = "1"; // $_SESSION["entry_email_jyuhuku"] = $form; // $_SESSION["entry_email_jyuhuku"]["kyujin_id"] = $id; // } // } else { // unset($cond); // $cond["email"] = $form["email"]; // $ret = Kyushoku::findData($cond); // if ($ret) { // foreach ($ret as $val) { // if ($val["kyushoku_id"] != $_SESSION["LOGIN"]["kyushoku_id"]) { // $msg["email"] = "このメールアドレスは登録済みです"; // // 150527 メール登録済みの場合、ログイン導線を表示、そこからのログインにてフォーム情報を保持したまま戻る // $data["entry_email_jyuhuku"] = "1"; // $_SESSION["entry_email_jyuhuku"] = $form; // $_SESSION["entry_email_jyuhuku"]["kyujin_id"] = $id; // break; // } // } // } // } // } if ($form["email"]) { if (!$_SESSION["LOGIN"]["kyushoku_id"]) { // 新規の場合は登録済みチェックをする unset($cond); $cond["email"] = $form["email"]; $ret = Kyushoku::findData($cond); if ($ret) { $msg["email"] = "このメールアドレスは登録済みです"; // 150527 メール登録済みの場合、ログイン導線を表示、そこからのログインにてフォーム情報を保持したまま戻る $data["entry_email_jyuhuku"] = "1"; $_SESSION["entry_email_jyuhuku"] = $form; $_SESSION["entry_email_jyuhuku"]["kyujin_id"] = $id; } } else { unset($cond); $cond["email"] = $form["email"]; $ret = Kyushoku::findData($cond); if ($ret) { foreach ($ret as $val) { if ($val["kyushoku_id"] != $_SESSION["LOGIN"]["kyushoku_id"]) { $msg["email"] = "このメールアドレスは登録済みです"; // 150527 メール登録済みの場合、ログイン導線を表示、そこからのログインにてフォーム情報を保持したまま戻る $data["entry_email_jyuhuku"] = "1"; $_SESSION["entry_email_jyuhuku"] = $form; $_SESSION["entry_email_jyuhuku"]["kyujin_id"] = $id; break; } } } } } if ($form["tel"] || $form["mobile"]) { // } else { $msg["tel"] = "電話番号が記入されていません"; } // 郵便番号 if ($form["zip1"] && $form["zip2"]) { // } else { $msg["zip"] = "郵便番号が記入されていません"; } // $m = set_error_msg($msg["pref"], $msg["address1"], $msg["address2"]); if ($m) { unset($msg["pref"]); unset($msg["address1"]); unset($msg["address2"]); $msg["address"] = $m; } $m = set_error_msg($msg["birthday_year"], $msg["birthday_month"], $msg["birthday_day"]); if ($m) { unset($msg["birthday_year"]); unset($msg["birthday_month"]); unset($msg["birthday_day"]); $msg["birthday"] = $m; } // 資格 $shikaku = $_REQUEST["shikaku"]; /* $shikaku = array(); $shikaku_sel = array(); if ($_REQUEST["shikaku"]) { foreach ($_REQUEST["shikaku"] as $val) { $shikaku[$val] = $val; } } */ $form["shikaku"] = $shikaku; // スキル $skill = array(); if ($_REQUEST["skill"]) { foreach ($_REQUEST["skill"] as $key => $val) { $skill[$key] = $val; } } $form["skill"] = $skill; // if ($msg) { foreach ($msg as $key => $v) { $data["error"][$key] = $v; $data["message"][] = $v; } } else { $_SESSION["detail1"] = $form; $act = "detail-form-2"; } // $data["skill"] = get_info(INFO_SKILL); $data["skillrank"] = get_info(INFO_SKILLRANK); foreach ($data["skill"] as $key => $val) { foreach ($data["skillrank"] as $val2) { if ($skill[$val["info_id"]] == $val2["info_id"]) { $val2["sel"] = "checked"; } $data["skill"][$key]["skillrank"][] = $val2; } } $data["shikaku"] = get_info_select(INFO_SHIKAKU, $shikaku, "checked"); } else if ($_SESSION["detail1"]) { // 戻ってきた場合 $form = $_SESSION["detail1"]; if ($form["email"]) { $form["email2"] = $form["email"]; } $data["form"] = $form; // $skill = $form["skill"]; $shikaku = $form["shikaku"]; } else if ($_SESSION["LOGIN"]["kyushoku_id"]) { // 150527 入力したメールが登録済みの場合、ログイン導線を表示、そこからのログインにてフォーム情報を保持したまま戻る if ($_SESSION["entry_email_jyuhuku"]) { unset($_SESSION["entry_email_jyuhuku"]); } // ログインしていれば、現在の登録データを取り出す unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Rirekisyo::findData($cond); if ($ret) { $form = $ret[0]; if ($form["email"]) { $form["email2"] = $form["email"]; } $data["form"] = $form; // 職歴初期化 for ($i = 0; $i < 10; $i++) { unset($item); if ($i > 0) { $item["body"] = "none"; $item["tab"] = "block"; } $item["id"] = $i + 1; $item['from_year'] = year_select(date('Y'), 1930); $item['to_year'] = year_select(date('Y'), 1930); $data["syoku"][$i] = $item; } // /* unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["oubo_id"] = "0"; $ret = Syokureki::findData($cond); */ $ret = getSyokureki($_SESSION["LOGIN"]["kyushoku_id"], "0"); if ($ret) { $i = 0; foreach ($ret as $val) { unset($item); if ($i > 0) { $item["body"] = "block"; $item["tab"] = "none"; } $item["id"] = $i + 1; $item['company'] = $val["company_name"]; $item['from_year'] = year_select(date('Y'), 1930, substr($val["priod_start"], 0, 4)); $item['from_month' . intval(substr($val["priod_start"], 5, 2))] = "selected"; $item['to_year'] = year_select(date('Y'), 1930, substr($val["priod_end"], 0, 4)); $item['to_month' . intval(substr($val["priod_end"], 5, 2))] = "selected"; $item['syokusyu' . $val["syokusyu"]] = "selected"; $item['koyou' . $val["koyou"]] = "selected"; $item['shokumu'] = $val["kinmu"]; $data["syoku"][$i++] = $item; } } // スキル unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["oubo_id"] = "0"; $ret = Skill::findData($cond); $skill = array(); if ($ret) { foreach ($ret as $val) { $skill[$val["skill_id"]] = $val["status"]; } } // 資格 $ret = Shikaku::findData($cond); $shikaku = array(); if ($ret) { foreach ($ret as $val) { $shikaku[] = $val["shikaku_id"]; } } } else { $form = $_SESSION["LOGIN"]; $form["email2"] = $form["email"]; $data["form"] = $form; } } // if ($form["sex"]) { $data["sex". $form["sex"]] = "checked"; } if ($form["birthday"]) { $y = substr($form["birthday"], 0, 4); $m = intval(substr($form["birthday"], 5, 2)); $d = intval(substr($form["birthday"], 8, 2)); // $data["birthday_year" . $y] = "selected"; $data["birthday_year"] = year_select(date('Y')-16, 1930, $y); $data["birthday_month" . $m] = "selected"; $data["birthday_day" . $d] = "selected"; } else if ($form["birthday_year"]) { $data["birthday_year"] = year_select(date('Y')-16, 1930, $form["birthday_year"]); $data["birthday_month" . $form["birthday_month"]] = "selected"; $data["birthday_day" . $form["birthday_day"]] = "selected"; } else { $data["birthday_year"] = year_select(date('Y')-16, 1930); } if ($form["pref"]) { $data["pref" . $form["pref"]] = "selected"; } //add hana +5 111101 $data["school_year"] = year_select(date('Y')+5, 1950, $form["school_year"]); if ($form["school_status"]) { $data["school_status" . $form["school_status"]] = "selected"; } // $data["skill"] = get_info(INFO_SKILL); $data["skillrank"] = get_info(INFO_SKILLRANK); foreach ($data["skill"] as $key => $val) { foreach ($data["skillrank"] as $val2) { if ($skill[$val["info_id"]] == $val2["info_id"]) { $val2["sel"] = "checked"; } $data["skill"][$key]["skillrank"][] = $val2; } } $data["shikaku"] = get_info_select(INFO_SHIKAKU, $shikaku, "checked"); /* if ($data["shikaku"]) { foreach ($data["shikaku"] as $key => $val) { if ($shikaku[$val["info_id"]]) { $data["shikaku"][$key]["sel"] = "checked"; } } } */ if ($act == "detail-form") { $ap->view("detail-form.html", $data); exit; } } if ($act == "detail-form-2") { $id = $_REQUEST["id"]; if (!$id) { // 求人が選択されていない header("location: ./"); exit; } $item = Kyujin::getData($id); $data["item"] = disp_kyujin($item); $pr = htmlspecialchars($_REQUEST["pr"]); // if ($_REQUEST["mode"] == "form2") { // 職歴保存 for ($i = 1; $i <= 10; $i++) { $company = htmlspecialchars($_REQUEST['syoku' . $i . '_company']); $from_year = $_REQUEST['syoku' . $i . '_from_year']; $from_month = $_REQUEST['syoku' . $i . '_from_month']; $to_year = $_REQUEST['syoku' . $i . '_to_year']; $to_month = $_REQUEST['syoku' . $i . '_to_month']; $syokusyu = $_REQUEST['syoku' . $i . '_syokusyu']; $koyou = $_REQUEST['syoku' . $i . '_koyou']; $shokumu = htmlspecialchars($_REQUEST['syoku' . $i . '_shokumu']); // 文字数カウント用 改行コード変換 $tmp_count = str_replace("\r\n", "\n", $_REQUEST['syoku' . $i . '_shokumu']); // if ( mb_strlen( $tmp_count, "UTF-8" ) > 2000 ) { $msg['syoku' . $i . '_shokumu'] = "職歴" . $i . "の職務内容が2000文字を超えています。"; } // if ($company || $from_year || $from_month || $to_year || $to_month || $syokusyu || $koyou || $shokumu) { if ($company && $from_year && $from_month && $to_year && $to_month && $syokusyu && $koyou && $shokumu) { // } else { $msg["shoku" . $i] = "職歴は全ての項目を入力してください"; } } unset($item); $item["company"] = $company; $item["from_year"] = $from_year; $item["from_month"] = $from_month; $item["to_year"] = $to_year; $item["to_month"] = $to_month; $item["syokusyu"] = $syokusyu; $item["koyou"] = $koyou; $item["shokumu"] = $shokumu; $syoku[] = $item; } if ($msg) { foreach ($msg as $key => $v) { $data["error"][$key] = $v; } $_SESSION["detail2"]["syoku"] = $syoku; $_SESSION["detail2"]["pr"] = $pr; } else { $_SESSION["detail2"]["syoku"] = $syoku; $_SESSION["detail2"]["pr"] = $pr; $act = "detail-form-confirm"; } } if ($act == "detail-form-2") { // 職歴初期化 for ($i = 0; $i < 10; $i++) { unset($item); if ($i > 0) { $item["body"] = "none"; $item["tab"] = "block"; } $item["id"] = $i + 1; $item['from_year'] = year_select(date('Y'), 1930); $item['to_year'] = year_select(date('Y'), 1930); $item['syokureki'] = get_info_select(INFO_RIREKI); $item['koyou'] = get_info_select(INFO_RIREKIKOYOU); $data["syoku"][$i] = $item; } // if ($_SESSION["detail2"]) { $syoku = $_SESSION["detail2"]["syoku"]; if ($syoku) { $i = 0; foreach ($syoku as $val) { if ($val["company"]) { unset($item); if ($i > 0) { $item["body"] = "block"; $item["tab"] = "none"; } $item["id"] = $i + 1; $item['company'] = $val["company"]; $item['from_year'] = year_select(date('Y'), 1930, $val["from_year"]); $item['from_month' . intval($val["from_month"])] = "selected"; $item['to_year'] = year_select(date('Y'), 1930, $val["to_year"]); $item['to_month' . intval($val["to_month"])] = "selected"; $item['syokureki'] = get_info_select(INFO_RIREKI, $val["syokusyu"]); $item['koyou'] = get_info_select(INFO_RIREKIKOYOU, $val["koyou"]); $item['shokumu'] = $val["shokumu"]; $data["syoku"][$i++] = $item; } } } $data["form"]["pr"] = $_SESSION["detail2"]["pr"]; } else if ($_SESSION["LOGIN"]["kyushoku_id"]) { /* unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["oubo_id"] = "0"; $ret = Syokureki::findData($cond); */ $ret = getSyokureki($_SESSION["LOGIN"]["kyushoku_id"], "0"); if ($ret) { $i = 0; foreach ($ret as $val) { unset($item); if ($i > 0) { $item["body"] = "block"; $item["tab"] = "none"; } $item["id"] = $i + 1; $item['company'] = $val["company_name"]; $item['from_year'] = year_select(date('Y'), 1930, substr($val["priod_start"], 0, 4)); $item['from_month' . intval(substr($val["priod_start"], 5, 2))] = "selected"; $item['to_year'] = year_select(date('Y'), 1930, substr($val["priod_end"], 0, 4)); $item['to_month' . intval(substr($val["priod_end"], 5, 2))] = "selected"; $item['syokureki'] = get_info_select(INFO_RIREKI, $val["syokusyu"]); $item['koyou'] = get_info_select(INFO_RIREKIKOYOU, $val["koyou"]); $item['shokumu'] = $val["kinmu"]; $data["syoku"][$i++] = $item; } } // $user = Kyushoku::getData($_SESSION["LOGIN"]["kyushoku_id"]); unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = Rirekisyo::findData($cond); if ($ret) { $data["form"]["pr"] = $ret[0]["pr"]; } } else { $form = $_SESSION["LOGIN"]; $form["passwd2"] = $form["passwd"]; $data["form"] = $form; } $ap->view("detail-form-2.html", $data); exit; } } if ($act == "detail-form-confirm") { $id = $_REQUEST["id"]; if (!$id) { // 求人が選択されていない header("location: ./"); exit; } $kyujin = Kyujin::getData($id); $data["item"] = disp_kyujin($kyujin); // if ((!$_SESSION["detail1"]) || (!$_SESSION["detail2"])) { header("location: ./"); exit; } // if ($_REQUEST["mode"] == "form3") { // 保存 $form = $_SESSION["detail1"]; $syoku = $_SESSION["detail2"]["syoku"]; $pr = $_SESSION["detail2"]["pr"]; // 利用者登録がまだなら、利用者登録を先に行う if (!$_SESSION["LOGIN"]["kyushoku_id"]) { unset($item); $item['name'] = $form["name"]; $item['kana'] = $form["kana"]; $item['email'] = $form["email"]; $item['passwd'] = Encode($form["passwd"]); $item['pr'] = $pr; $kyushoku_id = Kyushoku::addData($item); // 登録完了メール $info = array("setup" => $setup, "form" => $form); template_mail($form["email"], "regist_subject", "regist_body", $info, "admin_mail_noreplay"); // 150527 利用者登録がまだの方が応募した後は、強制ログインさせる unset($cond); $cond["email"] = $item["email"]; $cond["passwd"] = $item["passwd"]; $cond["del_flag"] = "0"; $ret = Kyushoku::findData($cond); if (count($ret) == 1) { $_SESSION["LOGIN"] = $ret[0]; } $data["login"] = 1; //ログインフラグ // // 履歴書保存 unset($item); $item['kyushoku_id'] = $kyushoku_id; $item['name'] = $form["name"]; $item['kana'] = $form["kana"]; $item['sex'] = $form["sex"]; $item['birthday'] = $form["birthday_year"] ."-". $form["birthday_month"] ."-". $form["birthday_day"]; $item['zip1'] = $form["zip1"]; $item['zip2'] = $form["zip2"]; $item['pref'] = $form["pref"]; $item['address1'] = $form["address1"]; $item['address2'] = $form["address2"]; $item['tel'] = $form["tel"]; $item['mobile'] = $form["mobile"]; $item['email'] = $form["email"]; $item['school'] = $form["school"]; // 2012/01/18 酒井追加 ここから $item['gakubu'] = $form["gakubu"]; // 2012/01/18 酒井追加 ここまで $item['school_year'] = $form["school_year"]; $item['school_status'] = $form["school_status"]; $item['pr'] = $pr; $rirekisyo_id = Rirekisyo::addData($item); } else { $kyushoku_id = $_SESSION["LOGIN"]["kyushoku_id"]; // 履歴書保存 unset($item); $item['kyushoku_id'] = $kyushoku_id; $item['name'] = $form["name"]; $item['kana'] = $form["kana"]; $item['sex'] = $form["sex"]; $item['birthday'] = $form["birthday_year"] ."-". $form["birthday_month"] ."-". $form["birthday_day"]; $item['zip1'] = $form["zip1"]; $item['zip2'] = $form["zip2"]; $item['pref'] = $form["pref"]; $item['address1'] = $form["address1"]; $item['address2'] = $form["address2"]; $item['tel'] = $form["tel"]; $item['mobile'] = $form["mobile"]; $item['email'] = $form["email"]; $item['school'] = $form["school"]; $item['gakubu'] = $form["gakubu"]; $item['school_year'] = $form["school_year"]; $item['school_status'] = $form["school_status"]; // $item['pr'] = $pr; // unset($cond); $cond['kyushoku_id'] = $kyushoku_id; $ret = Rirekisyo::findData($cond); if ($ret) { $rirekisyo_id = $ret[0]["rirekisyo_id"]; Rirekisyo::updateData($rirekisyo_id, $item); } else { $rirekisyo_id = Rirekisyo::addData($item); } // スキル、資格、職歴削除 unset($cond); $cond['kyushoku_id'] = $kyushoku_id; $cond["oubo_id"] = "0"; $ret = Skill::findData($cond); if ($ret) { foreach ($ret as $val) { Skill::deleteData($val["seq"]); } } $ret = Shikaku::findData($cond); if ($ret) { foreach ($ret as $val) { Shikaku::deleteData($val["seq"]); } } //$ret = Syokureki::findData($cond); $ret = getSyokureki($kyushoku_id, "0"); if ($ret) { foreach ($ret as $val) { Syokureki::deleteData($val["seq"]); } } } unset($item); $item['kyujin_id'] = $id; $item['kyushoku_id'] = $kyushoku_id; // $item['koyou'] = $form["koyou"]; $item['name'] = $form["name"]; $item['sex'] = $form["sex"]; $item['birthday'] = $form["birthday_year"] ."-". $form["birthday_month"] ."-". $form["birthday_day"]; //Ouboには郵便番号は無い //$item['zip1'] = $form["zip1"]; //$item['zip2'] = $form["zip2"]; $item['pref'] = $form["pref"]; $item['address1'] = $form["address1"]; $item['address2'] = $form["address2"]; $item['tel'] = $form["tel"]; $item['email'] = $form["email"]; $item['school'] = $form["school"]; $item['school_year'] = $form["school_year"]; $item['school_status'] = $form["school_status"]; $item['passwd'] = $form["passwd"]; $item['pr'] = $pr; $item['last_message'] = "0"; // 返事待ち $oubo_id = Oubo::addData($item); if ($oubo_id) { // スキル $skill = $form["skill"]; if ($skill) { foreach ($skill as $key => $val) { unset($item); $item["kyushoku_id"] = $kyushoku_id; $item["oubo_id"] = $oubo_id; $item["skill_id"] = $key; $item["status"] = $val; Skill::addData($item); // if (!$_SESSION["LOGIN"]["kyushoku_id"]) { // 履歴書用 $item["oubo_id"] = "0"; Skill::addData($item); // } } } // 資格 $shikaku = $form["shikaku"]; if ($shikaku) { foreach ($shikaku as $val) { unset($item); $item["kyushoku_id"] = $kyushoku_id; $item["oubo_id"] = $oubo_id; $item["shikaku_id"] = $val; Shikaku::addData($item); // if (!$_SESSION["LOGIN"]["kyushoku_id"]) { // 履歴書用 $item["oubo_id"] = "0"; Shikaku::addData($item); // } } } // 職歴 if ($syoku) { $i = 1; foreach ($syoku as $val) { if ($val['company']) { unset($item); $item["kyushoku_id"] = $kyushoku_id; $item["oubo_id"] = $oubo_id; $item["company_name"] = $val['company']; $item["priod_start"] = $val['from_year'] . "-" . $val['from_month'] . "-01"; $item["priod_end"] = $val['to_year'] . "-" . $val['to_month'] . "-01"; $item["syokusyu"] = $val['syokusyu']; $item["koyou"] = $val['koyou']; $item["kinmu"] = $val['shokumu']; $item["ord"] = $i++; Syokureki::addData($item); // if (!$_SESSION["LOGIN"]["kyushoku_id"]) { // 履歴書用 $item["oubo_id"] = "0"; Syokureki::addData($item); // } } } } // 応募数カウント $sql = "update kyujin set oubo_count=oubo_count+1 where kyujin_id=" . $id; $inst = DBConnection::getConnection($DB_URI); $ret = $inst->db_exec($sql); // 応募課金情報保存 kakin(KAKIN_OUBO, $kyujin["company_id"], $oubo_id, $_SESSION["LOGIN"]["kyushoku_id"]); // 応募メール(求職者向け) $info = array("setup" => $setup, "form" => $form, "kyujin" => disp_kyujin($kyujin)); if ($form["email"]) { template_mail($form["email"], "oubo_user_subject", "oubo_user_body", $info, "admin_mail_noreplay"); } $user = Kyushoku::getData($kyushoku_id); if ($user["mobile_mail"]) { template_mail($user["mobile_mail"], "oubo_user_subject", "oubo_user_body", $info, "admin_mail_noreplay"); } // 応募メール(会社向け) $company = Company::getData($kyujin["company_id"]); $info = array("setup" => $setup, "form" => $form, "kyujin" => disp_kyujin($kyujin), "company" => $company); template_mail($company["email"], "oubo_company_subject", "oubo_company_body", $info, "admin_mail_noreplay"); // $data["complete"] = "1"; // 終了 // ブックマーク済みチェック if ($_SESSION["LOGIN"]["kyushoku_id"]) { unset($cond); $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $cond["kyujin_id"] = $id; $ret = Bookmark::findData($cond); if ($ret) { foreach ($ret as $val) { Bookmark::deleteData($val["seq"]); } } } } } // $form = $_SESSION["detail1"]; $data["form"] = disp_oubo($form); // $idx = get_info_idx(INFO_SKILL); $skill_rank = get_info_idx(INFO_SKILLRANK); foreach ($form["skill"] as $key => $val) { // $data["skill"][] = $idx[$key] . "($val)"; $data["skill"][] = $idx[$key] . " " . $skill_rank[$val]; } $idx = get_info_idx(INFO_SHIKAKU); if (is_array($form["shikaku"])) { foreach ($form["shikaku"] as $key => $val) { $data["shikaku"][] = $idx[$val]; } } // $syokusyu_idx = get_info_idx(INFO_RIREKI); $koyou_idx = get_info_idx(INFO_RIREKIKOYOU); $num = 0; foreach ($_SESSION["detail2"]["syoku"] as $val) { if ($val['company']) { $val["num"] = $num + 1; $val["syokusyu"] = $syokusyu_idx[$val["syokusyu"]]; $val["koyou"] = $koyou_idx[$val["koyou"]]; $data["syoku"][] = $val; } $num++; } if ($_SESSION["detail2"]["pr"]) { $data["pr"] = $_SESSION["detail2"]["pr"]; } // 完了の場合はセッション情報削除 if ($data["complete"]) { unset($_SESSION["detail1"]); unset($_SESSION["detail2"]); } // $ap->view("detail-form-confirm.html", $data); exit; } //-------------------------------------------- // 求人詳細画面 if ($act == "detail") { unset($_SESSION["detail1"]); $id = $_REQUEST["id"]; if ($id) { $item = Kyujin::getData($id); if (!$item || $item["del_flag"]) { // 削除済 $data["delete"] = "1"; $ap->view("detail.html", $data); exit; } if ($item["status"] == "2") { $data["valid"] = "1"; } $data["item"] = disp_kyujin($item, true); if ($data["item"]["movietag"]) $data["item"]["movietag"] = html_entity_decode($data["item"]["movietag"]); // 閲覧数カウント $sql = "update kyujin set view_count=view_count+1 where kyujin_id=".$id; $inst = DBConnection::getConnection($DB_URI); $ret = $inst->db_exec($sql); // 履歴保存 $flag = 1; if ($_SESSION["LOGIN"]["kyushoku_id"]) { /* unset($cond); $cond["kyujin_id"] = $id; $cond["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; $ret = KyujinRireki::findData($cond); */ $db = new KyujinRireki(); $db->search[] = array("field" => "kyujin_id", "value" => $id, "cond" => "="); $db->search[] = array("field" => "kyushoku_id", "value" => $_SESSION["LOGIN"]["kyushoku_id"], "cond" => "="); $db->search[] = array("expression" => "reg_date >= date_sub(now(), interval 1 DAY)"); //1日以内 $db->order[] = array("field" => "reg_date", "desc" => "1"); $ret = $db->getList(); if ($ret) { // (1日以内に)すでに閲覧してる場合は、閲覧日を最新に。1日以上経過している場合は新たに履歴に追加 $upd["reg_date"] = "now()"; KyujinRireki::updateData($ret[0]["seq"], $upd); $flag = 0; } } // if ($flag) { // unset($item); // $item["kyujin_id"] = $id; // $item["company_id"] = $data["item"]["company_id"]; // if ($_SESSION["LOGIN"]["kyushoku_id"]) { // $item["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; // } // KyujinRireki::addData($item); // } // 171128 最近見た求人取得の負荷軽減のため、求人履歴に表示フラグ付与 if ($flag) { unset($item2); $item2["kyujin_id"] = $id; $item2["company_id"] = $data["item"]["company_id"]; if ($_SESSION["LOGIN"]["kyushoku_id"]) { $item2["kyushoku_id"] = $_SESSION["LOGIN"]["kyushoku_id"]; } $now = date("Y-m-d H:i:s"); if ( ($item["status"] == 2) && ( (strtotime($item["kyujin_start"]) <= strtotime($now)) && (strtotime($item["kyujin_end"]) >= strtotime($now)) ) ) { $item2["view_flg"] = 1; } KyujinRireki::addData($item2); } // $ap->view("detail.html", $data); exit; } } if ($act == "detail-map") { $id = $_REQUEST["id"]; if ($id) { $item = Kyujin::getData($id); // 150804 地図表示を勤務地に変更 /* if (!$item['mensetsu_address']) { $item['mensetsu_address'] = $item['kinmu_address']; } */ if ($item["status"] == "2") { $data["valid"] = "1"; } $data["item"] = disp_kyujin($item); // // 150804 地図表示を勤務地に変更 $map_tmp_02 = $data["item"]["kinmu"] . $data["item"]["kinmu_city"] . $data["item"]["kinmu_address"]; // $data["gmap_key"] = GMAP_KEY; //141205 緯度経度による地図表示方法変更 //if ($item['map']) { if (substr($item['map'], 0, 1) != "," && $item['map']) { $map_tmp = explode(",", $item['map']); //150222 if ($map_tmp[0] && $map_tmp[1]) { $data['map_lat'] = $map_tmp[0]; $data['map_lon'] = $map_tmp[1]; } else { // 150804 地図表示を勤務地に変更 //$map_str_key = explode(" ",$item['mensetsu_address']); $map_str_key = explode(" ",$map_tmp_02); // if(strlen($map_str_key[1]) > 0){ //$map_str_key[1] = "(".$map_str_key[1].")"; $map_str_key[1] = ""; } // $data['map_str'] = $map_str_key[0].$map_str_key[1]; //関数の追加 $latlng = GetGeocode($map_str_key[0].$map_str_key[1]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } } } else { // 全角スペースを半角スペースに変換 $str = mb_convert_kana($map_tmp_02,"s","UTF-8"); // $map_str_key = explode(" ",$str); //150908 空欄の配列は削除 foreach($map_str_key as $key => $val) { if (!$val) { unset($map_str_key[$key]); } } // //150908 住所データ結合 /* foreach($map_str_key as $key => $val) { $map_str_key_tmp[0] .= $val; } */ $map_str_key_tmp[0] = implode("%20", $map_str_key); // $data['map_str'] = $map_str_key[0].$map_str_key[1]; //関数の追加 //$latlng = GetGeocode($map_str_key[0].$map_str_key[1]); $latlng = GetGeocode($map_str_key_tmp[0]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } } /* if ($item['mensetsu_lat'] && $item['mensetsu_lon']) { $data['map_lat'] = $item['mensetsu_lat']; $data['map_lon'] = $item['mensetsu_lon']; } else { $map_str_key = explode(" ",$item['mensetsu_address']); if(strlen($map_str_key[1]) > 0){ //$map_str_key[1] = "(".$map_str_key[1].")"; $map_str_key[1] = ""; } // $data['map_str'] = $map_str_key[0].$map_str_key[1]; //関数の追加 $latlng = GetGeocode ($map_str_key[0].$map_str_key[1]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } } */ $ap->view("detail-map.html", $data); exit; } if ($_REQUEST["preview"]) { // 作成中のプレビュー $data["preview"] = "1"; $item = $_SESSION["make-confirm"]; if (!$item['mensetsu_address']) { $item['mensetsu_address'] = $item['kinmu_address']; } $data["item"] = disp_kyujin($item); $data["gmap_key"] = GMAP_KEY; $ap->view("detail-map.html", $data); exit; } } if ($act == "detail-map2") { $id = $_REQUEST["id"]; if ($id) { $item = Kyujin::getData($id); // 面接地が勤務地と同じだった場合 if ( $item["mensetsu"] == 1 ) { if ($item['map']) { $map_code = $item['map']; } } if (!$item['mensetsu_address']) { $item['mensetsu_address'] = $item['kinmu_address']; } if ($item["status"] == "2") { $data["valid"] = "1"; } $data["item"] = disp_kyujin($item); // $data["gmap_key"] = GMAP_KEY; //141205 緯度経度による地図表示方法変更 //if ($map_code) { if (substr($map_code, 0, 1) != "," && $map_code) { $map_tmp = explode(",", $map_code); if ($map_tmp[0] && $map_tmp[1]) { $data['map_lat'] = $map_tmp[0]; $data['map_lon'] = $map_tmp[1]; } else { $map_str_key = explode(" ",$item['mensetsu_address']); if(strlen($map_str_key[1]) > 0){ $map_str_key[1] = ""; } $latlng = GetGeocode($map_str_key[0].$map_str_key[1]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } } } else { // 全角スペースを半角スペースに変換 $str = mb_convert_kana($item['mensetsu_address'],"s","UTF-8"); // //$map_str_key = explode(" ",$item['mensetsu_address']); $map_str_key = explode(" ",$str); //150908 空欄の配列は削除 foreach($map_str_key as $key => $val) { if (!$val) { unset($map_str_key[$key]); } } // $map_str_key_tmp[0] = implode("%20", $map_str_key); /* if(strlen($map_str_key[1]) > 0){ $map_str_key[1] = ""; } */ //$latlng = GetGeocode($map_str_key[0].$map_str_key[1]); $latlng = GetGeocode($map_str_key_tmp[0]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } } /* $map_str_key = explode(" ",$item['mensetsu_address']); if(strlen($map_str_key[1]) > 0){ //$map_str_key[1] = "(".$map_str_key[1].")"; $map_str_key[1] = ""; } // $data['map_str'] = $map_str_key[0].$map_str_key[1]; //関数の追加 $latlng = GetGeocode($map_str_key[0].$map_str_key[1]); if ($latlng) { $data['map_url'] = $latlng[0]; $data['map_lat'] = $latlng[1]; $data['map_lon'] = $latlng[2]; } */ $ap->view("detail-map2.html", $data); exit; } if ($_REQUEST["preview"]) { // 作成中のプレビュー $data["preview"] = "1"; $item = $_SESSION["make-confirm"]; if (!$item['mensetsu_address']) { $item['mensetsu_address'] = $item['kinmu_address']; } $data["item"] = disp_kyujin($item); $data["gmap_key"] = GMAP_KEY; $ap->view("detail-map.html", $data); exit; } } //-------------------------------------------- // 新規登録 $regist_check = array( // フォーム項目名 文字種 最大文字数 必須 表示名称 array("name", "*", "", true, "氏名"), array("kana", "*", "", true, "フリガナ"), array("email", "MAIL", "", true, "メールアドレス"), array("email2", "MAIL", "", false, "メールアドレス確認"), array("passwd", "AN", "", true, "パスワード"), array("passwd2", "AN", "", true, "パスワード確認"), // SNS識別子 array("fb_info", "*", "", false, "fb_info"), array("mode", "*", "", true, "モード"), ); if ($act == "register") { $form = FormCheck::get_form($regist_check, $_REQUEST); if ($form && $_SESSION["form"]) { $msg = FormCheck::check($form, $regist_check); // メールアドレス重複 // if ($form["email"] && $form["email2"]) { // if ($form["email"] != $form["email2"]) { // $msg["email"] = "メールアドレスが一致していません"; // } else { // unset($cond); // $cond["email"] = $form["email"]; // $ret = Kyushoku::findData($cond); // if ($ret) { // $msg["email"] = "このメールアドレスは登録済みのためご利用いただけません"; // } // } // } if ($form["email"]) { unset($cond); $cond["email"] = $form["email"]; $ret = Kyushoku::findData($cond); if ($ret) { $msg["email"] = "このメールアドレスは登録済みのためご利用いただけません"; } } if ($msg["passwd"]) { } else if ($form["passwd"] && $form["passwd2"]) { if ($form["passwd"] != $form["passwd2"]) { $msg["passwd"] = "パスワードが一致していません"; } else { if ((strlen($form["passwd"]) < 6)||(strlen($form["passwd"]) > 20)) { $msg["passwd"] = "半角英数字(0~9、A~Z)、6~20文字で入力してください。"; } } } $data["form"] = $form; if ($msg) { foreach ($msg as $key => $v) { $data["error"][$key] = $v; $data["message"][] = $v; } } else { unset($_SESSION["form"]); // 登録処理 unset($item); $item["name"] = $form["name"]; $item["kana"] = $form["kana"]; $item["email"] = $form["email"]; $item["passwd"] = Encode($form["passwd"]); // SNS識別子 $item["fb_info"] = $form["fb_info"]; //agent // if (!empty($_COOKIE[banner_landing_id])) { // $banner = Banner_landing::getData($_COOKIE[banner_landing_id]); // $item["agent_id"] = $banner[agent_id]; // } $id = Kyushoku::addData($item); if ($id) { // 登録メール送信 $info = array("setup" => $setup, "form" => $form); template_mail($form["email"], "regist_subject", "regist_body", $info, "admin_mail_noreplay"); // //agent // if (!empty($_COOKIE[banner_landing_id])) { // unset($item); // $item[agent_id] = $banner[agent_id]; // $item[banner_type] = $banner[banner_type]; // $item[id] = $id; // $item[banner_landing_id] = $_COOKIE[banner_landing_id]; // banner_conversion::addData($item); // } $ap->view("register-thankyou.html", $data); exit; } } } $_SESSION["form"] = "register"; $ap->view("register.html", $data); exit; } if ($act == "register-thankyou") { header("location: ./"); exit; } //-------------------------------------------- // スカウト if ($act == "scout") { $ap->view("scout.html", $data); exit; } /* //-------------------------------------------- // 新着求人一覧 if ($act == "new") { $page = $_REQUEST["page"]; if (!$page) { $page = 0; } // $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("expression" => "kyujin_start >= date(date_sub(now(), interval 14 day))"); // 2週間以内 $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->page = $page; $db->limit = 20; $count = $db->getCount(); $pages = intval(($count + $db->limit - 1) / $db->limit); if ($pages > 1) { $data["pager"] = page_index2($page, $pages); } $list = $db->getList(); if ($list) { $data["total"] = $count; // 総件数 $data["list_start"] = $page * 20 + 1; $data["list_end"] = $page * 20 + count($list); foreach ($list as $key => $val) { // 内容200字まで // 企業情報 // 新着 // 更新日 $val["reg_date"] = date_format2($val["reg_date"]); $list[$key] = disp_kyujin($val); } $data["list"] = $list; } $ap->view("new.html", $data); exit; } */ //-------------------------------------------- // 検索/RSS出力 if (($act == "search")||($act == "get_rss") || ($act == "new") || ($act == "search2")) { ini_set("max_execution_time", 0); $page = $_REQUEST["page"]; // 検索条件を引き継いで来た場合 if ($_REQUEST["condition"]) { $data["condition"] = $_REQUEST["condition"]; } // 新着ページの場合 if ($act == "new") { $data["new"] = 1; } // if (!$page) { $page = "0"; } if ($act == "get_rss") { $no = $_REQUEST["no"]; $val = Search::getData($no); //$keyword = $val["keyword"]; $keyword = explode(" ", $val['keyword']); $area = explode(",", $val['area']); $city = explode(",", $val['city']); $syokusyu = explode(",", $val['syokusyu']); //$gyomu = explode(",", $val['gyomu']); //141209 $category01 = explode(",", $val['category01']); $category02 = explode(",", $val['category02']); $category03 = explode(",", $val['category03']); $category04 = explode(",", $val['category04']); $category05 = explode(",", $val['category05']); $category06 = explode(",", $val['category06']); $category07 = explode(",", $val['category07']); $category08 = explode(",", $val['category08']); $category09 = explode(",", $val['category09']); $category10 = explode(",", $val['category10']); // if ($val['ensen']) { $ensen = $val['ensen']; } if ($val['eki']) { $eki = explode(",", $val['eki']); } //$eki = $val['eki']; $koyou = explode(",", $val['koyou']); list($kyuyo, $kyuyo_type) = explode(",", $val['kyuyo']); $new = $val['new_flag']; $beginer = $val['beginer']; //$gyomu = sel_normalize($gyomu); //141209 $category01 = sel_normalize($category01); $category02 = sel_normalize($category02); $category03 = sel_normalize($category03); $category04 = sel_normalize($category04); $category05 = sel_normalize($category05); $category06 = sel_normalize($category06); $category07 = sel_normalize($category07); $category08 = sel_normalize($category08); $category09 = sel_normalize($category09); $category10 = sel_normalize($category10); // $area = sel_normalize($area); $city = sel_normalize($city); $syokusyu = sel_normalize($syokusyu); $koyou = sel_normalize($koyou); } else { // //$gyomu = sel_normalize($_REQUEST["gyomu"]); // $category01 = sel_normalize($_REQUEST["category01"]); $category02 = sel_normalize($_REQUEST["category02"]); $category03 = sel_normalize($_REQUEST["category03"]); $category04 = sel_normalize($_REQUEST["category04"]); $category05 = sel_normalize($_REQUEST["category05"]); $category06 = sel_normalize($_REQUEST["category06"]); $category07 = sel_normalize($_REQUEST["category07"]); $category08 = sel_normalize($_REQUEST["category08"]); $category09 = sel_normalize($_REQUEST["category09"]); $category10 = sel_normalize($_REQUEST["category10"]); // $area = sel_normalize($_REQUEST['area']); $city = sel_normalize($_REQUEST['city']); $syokusyu = sel_normalize($_REQUEST['syokusyu']); $koyou = sel_normalize($_REQUEST['koyou']); // //$keyword = $_REQUEST["keyword"]; if (strpos($_REQUEST["keyword"], " ") === FALSE) { $keyword = htmlspecialchars($_REQUEST["keyword"]); } else { $keyword = explode(" ", htmlspecialchars($_REQUEST["keyword"])); } // $kyuyo_type = $_REQUEST["kyuyo_type"]; $kyuyo = $_REQUEST["kyuyo"]; $ensen = $_REQUEST["ensen"]; $eki = sel_normalize($_REQUEST['eki']); //$eki = $_REQUEST["eki"]; // 新着の場合 if ($act == "new") { $new = 1; } else { $new = $_REQUEST['new']; } // 180131 並び順 if ($_REQUEST["ord"]) { $ord = $_REQUEST["ord"]; } else { $ord = 1; } $beginer = $_REQUEST['beginer']; $company_id = $_REQUEST['company_id']; if ($_REQUEST["pref"]) { // 地図から $area = array($_REQUEST["pref"]); } // 都道府県、市区町村、職種 のみの検索時は検索URLを変更してリダイレクト if(empty($_REQUEST['no_change_url'])){ $changed_url = true; $search_list = array(); // [例] array('area2', 'city10', shokusyu7) foreach ($_REQUEST as $key => $vals){ //if(in_array($key, array('act', 'page', 'mode', 'seq', 'PHPSESSID'))) continue; if(in_array($key, array('act', 'page', 'mode', 'seq', 'PHPSESSID', 'officerecruit_user', 'officerecruit_comp'))) continue; if(in_array($key, array('area', 'city', 'syokusyu', 'pref'))){ if( is_array($vals) && $vals ){ if(count($vals) > 1){ //条件が複数の場合 $changed_url = false; }elseif($vals[0]){ // 条件が1つの場合 $search_list[] = $key . $vals[0]; } }elseif($vals){ // 条件が1つの場合 $search_list[] = $key . $vals; } }elseif($vals){ // 特定の検索条件以外が含まれている場合はリダイレクトしない foreach ((array) $vals as $val){ if($val){ $changed_url = false; break; } } } if(!$changed_url) break; } if( $changed_url && $search_list ){ if(!empty($_REQUEST['page'])) $search_list[] = 'p'. $_REQUEST['page']; $redirect_url = (empty($_SERVER["HTTPS"]) ? 'http://' : 'https://') ."{$_SERVER["SERVER_NAME"]}/s/". implode('/', $search_list); header("Location: {$redirect_url}"); exit; } } } // if ($_REQUEST["w"]) { $data["wc"] = "block"; // 詳細検索条件を開く $data["wo"] = "none"; // 詳細検索条件を開く /* } else { $data["wc"] = "none"; // 詳細検索条件を開く $data["wo"] = "block"; // 詳細検索条件を開く } */ // 検索実行 // $search = ""; // 検索条件表示 $search = array(); // php7系対応 $search2 = ""; // 検索条件表示2(メタ・title用) $search3 = ""; // 検索条件表示3(メタ・keyword,description用) $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("field" => "company_id", "value" => "1", "cond" => ">="); // スタートワーク用 企業ID未指定を除外 // $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 if ($company_id) { $db->search[] = array("field" => "company_id", "value" => $company_id, "cond" => "="); // 会社 $data["company_id"] = $company_id; $tmp = Company::getData($company_id); $search[] = "【企業】 " . $tmp["company_name"] ." の求人一覧"; $search2 .= $tmp["company_name"]; $search3 .= $tmp["company_name"]; $data["search_company"] = $tmp["company_name"]; } /* if ($gyomu) { // $db->search[] = array("field" => "gyomu", "value" => $gyomu, "cond" => "in"); $c_gyomu[] = array("field" => "name", "value" => "gyomu", "cond" => "="); $c_gyomu[] = array("field" => "value", "value" => $gyomu, "cond" => "in"); $db->search[] = array("field" => "kyujin_id", "cond" => "in", "select" => array("table" => "kyujin_profile", "where" => $c_gyomu, "fields" => array("distinct kyujin_id"))); $tmp = array(); $idx = get_info_idx(INFO_GYOMU); foreach ($gyomu as $val) { $tmp[] = $idx[$val]; } if ($search) { $search[] = "  "; } $search[] = join("・", $tmp); } */ if ($area) { if (is_array($area)) { foreach($area as $val) { $c_area[] = array("field" => "kinmu", "value" => $val, "cond" => "=", "relation" => "or"); } $db->search[] = array("nest" => $c_area); } else { $db->search[] = array("field" => "kinmu", "value" => $area, "cond" => "="); } $tmp = array(); // $idx = get_info_idx(INFO_AREA); foreach ($area as $val) { $tmp[] = $preficture_list[$val]; } if ($city) { $search[] = "【都道府県】 " . join("・", $tmp); $search2 .= join("・", $tmp); $data["search_area"] = join(" ", $tmp); } else { $search[] = "【都道府県】 " . join("・", $tmp) ." "; $search2 .= join("・", $tmp) ."の"; $data["search_area"] = join(" ", $tmp); } $search3 .= "、" . join("・", $tmp); $seo_pref = $tmp; $data["area"] = $area; } if ($city) { $db->search[] = array("field" => "kinmu_city", "value" => $city, "cond" => "in"); $tmp = array(); // $idx = get_info_idx(INFO_AREA); foreach ($city as $val) { $tmp[] = get_city_name($val); } if ($area) { $search[] = "【市区町村】 " . join("・", $tmp); $data["search_city"] = join(" ", $tmp); } else { $search[] = "【市区町村】 " . join("・", $tmp); $data["search_city"] = join(" ", $tmp); } $search2 .= join("・", $tmp) ."の"; $search3 .= "、" . join("・", $tmp); $data["city"] = join(",", $city); } if ($syokusyu) { $db->search[] = array("field" => "syokusyu", "value" => $syokusyu, "cond" => "in"); $tmp = array(); $idx = get_info_idx(INFO_SHOKUSYU); foreach ($syokusyu as $val) { $tmp[] = $idx[$val]; } $search[] = "【職種】 " . join("・", $tmp); $data["search_syokusyu"] = join(" ", $tmp); $search2 .= "職種「".join("・", $tmp)."」、"; $search3 .= "、" . join("・", $tmp); } if ($koyou) { $db->search[] = array("field" => "koyou", "value" => $koyou, "cond" => "in"); $tmp = array(); $idx = get_info_idx(INFO_KOYOU); foreach ($koyou as $val) { $tmp[] = $idx[$val]; } $search[] = "【雇用形態】 " . join("・", $tmp); $data["search_koyou"] = join(" ", $tmp); $search2 .= "雇用形態「".join("・", $tmp)."」、"; $search3 .= "、" . join("・", $tmp); } if ($category01) { foreach($category01 as $val) { $c_cate[] = array("field" => "CONCAT(',',category01,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category01,1); $search[] = $category_name; $search2_catetmp[0] = disp_category2($category01,1); $data["search_category01"] = disp_category3($category01,1); } if ($category02) { foreach($category02 as $val) { $c_cate[] = array("field" => "CONCAT(',',category02,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category02,2); $search[] = $category_name; $search2_catetmp[1] = disp_category2($category02,2); $data["search_category02"] = disp_category3($category02,2); } if ($category03) { foreach($category03 as $val) { $c_cate[] = array("field" => "CONCAT(',',category03,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category03,3); $search[] = $category_name; $search2_catetmp[2] = disp_category2($category03,3); $data["search_category03"] = disp_category3($category03,3); } if ($category04) { foreach($category04 as $val) { $c_cate[] = array("field" => "CONCAT(',',category04,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category04,4); $search[] = $category_name; $search2_catetmp[3] = disp_category2($category04,4); $data["search_category04"] = disp_category3($category04,4); } if ($category05) { foreach($category05 as $val) { $c_cate[] = array("field" => "CONCAT(',',category05,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category05,5); $search[] = $category_name; $search2_catetmp[4] = disp_category2($category05,5); $data["search_category05"] = disp_category3($category05,5); } if ($category06) { foreach($category06 as $val) { $c_cate[] = array("field" => "CONCAT(',',category06,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category06,6); $search[] = $category_name; $search2_catetmp[5] = disp_category2($category06,6); $data["search_category06"] = disp_category3($category06,6); } if ($category07) { foreach($category07 as $val) { $c_cate[] = array("field" => "CONCAT(',',category07,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category07,7); $search[] = $category_name; $search2_catetmp[6] = disp_category2($category07,7); $data["search_category07"] = disp_category3($category07,7); } if ($category08) { foreach($category08 as $val) { $c_cate[] = array("field" => "CONCAT(',',category08,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category08,8); $search[] = $category_name; $search2_catetmp[7] = disp_category2($category08,8); $data["search_category08"] = disp_category3($category08,8); } if ($category09) { foreach($category09 as $val) { $c_cate[] = array("field" => "CONCAT(',',category09,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category09,9); $search[] = $category_name; $search2_catetmp[8] = disp_category2($category09,9); $data["search_category09"] = disp_category3($category09,9); } if ($category10) { foreach($category10 as $val) { $c_cate[] = array("field" => "CONCAT(',',category10,',')", "value" => "%,".$val.",%", "cond" => "like", "relation" => "or"); } $db->search[] = array("nest" => $c_cate); $category_name = disp_category($category10,10); $search[] = $category_name; $search2_catetmp[9] = disp_category2($category10,10); $data["search_category10"] = disp_category3($category10,10); } if($category01 || $category02 || $category03 || $category04 || $category05 || $category06 || $category07 || $category08 || $category09 || $category10) { $search2_catetmp2 = join("、", $search2_catetmp); $search2 .= $search2_catetmp2 . "を含む"; $search3 .= "、" . $search2_catetmp2; } if ($kyuyo_type && $kyuyo) { $db->search[] = array("field" => "kyuyo", "value" => $kyuyo_type, "cond" => "="); // $db->search[] = array("field" => "kyuyo_min", "value" => $kyuyo, "cond" => "<="); $db->search[] = array("field" => "kyuyo_max", "value" => $kyuyo, "cond" => ">="); $idx = get_info_idx(INFO_KYUYO); $search[] = "【給与】 " . $idx[$kyuyo_type] . " " . $kyuyo . "円以上"; $search2 .= $idx[$kyuyo_type] . " " . $kyuyo . "円以上の"; $search3 .= "、" . $idx[$kyuyo_type] . " " . $kyuyo . "円以上"; // $db->search[] = array("field" => "", "value" => "", "cond" => ""); $data["kyuyo"] = $kyuyo; } if ($keyword) { if (is_array($keyword)) { $keyword_tmp = $keyword; $data["keyword"] = implode(" ", $keyword); } else { $keyword_tmp[] = $keyword; $data["keyword"] = $keyword; } foreach($keyword_tmp as $val) { $where = array(); $where[] = array("field" => "title", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "pr1", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "pr2", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "kyuyo_info", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "kinmu_time", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "taiguu", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "kyujitsu", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "access_info", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image1_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image2_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image3_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image4_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image5_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image6_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image7_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "image8_text", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "taisyo", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "naiyou", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "message_title", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); $where[] = array("field" => "message", "value" => "%".$val."%", "cond" => "like", "relation" => "or"); //職種 $where1[] = array("field" => "title", "value" => "%".$val."%", "cond" => "like"); $where1[] = array("field" => "kind", "value" => INFO_SHOKUSYU, "cond" => "="); $where[] = array("field" => "syokusyu", "cond" => "in", "select" => array("table" => "info", "where" => $where1, "fields" => array("distinct info_id")), "relation" => "or"); //雇用形態 $where2[] = array("field" => "title", "value" => "%".$val."%", "cond" => "like"); $where2[] = array("field" => "kind", "value" => INFO_KOYOU, "cond" => "="); $where[] = array("field" => "koyou", "cond" => "in", "select" => array("table" => "info", "where" => $where2, "fields" => array("distinct info_id")), "relation" => "or"); //こだわり $where[] = array("cond" => "find_in_set", "opt" => "(SELECT DISTINCT seq FROM category WHERE name LIKE '%".$val."%'), category01", "relation" => "or"); //企業名 $where3[] = array("field" => "company_name", "value" => "%".$val."%", "cond" => "like"); $where[] = array("field" => "company_id", "cond" => "in", "select" => array("table" => "company", "where" => $where3, "fields" => array("distinct company_id")), "relation" => "or"); $db->search[] = array("nest" => $where); } //$data["keyword"] = implode(" ", $keyword); $search[] = "【キーワード】 " . $data["keyword"]; $search2 .= "キーワード「" . $data["keyword"] . "」を含む"; $search3 .= "、" . $data["keyword"]; $data["search_keyword"] = $data["keyword"]; } /* if ($city) { $db->search[] = array("field" => "kinmu_address", "value" => "%".$city."%", "cond" => "like"); $data["city"] = $city; if ($search) { $search[] = "  "; } $search[] = "勤務市区町村:" . $city; } */ /////////////// 20120313 酒井SQL分の修正 /* if ($ensen) { //$cond_ensen[] = array("field" => "ensen1", "value" => $ensen, "cond" => "=", "relation" => "or"); //$cond_ensen[] = array("field" => "ensen2", "value" => $ensen, "cond" => "=", "relation" => "or"); $cond_ensen[] = array("field" => "CONCAT( ensen1, eki1 )", "value" => $ensen.$eki."%", "cond" => "like", "relation" => "or"); $cond_ensen[] = array("field" => "CONCAT( ensen2, eki2 )", "value" => $ensen.$eki."%", "cond" => "like", "relation" => "or"); $db->search[] = array("nest" => $cond_ensen); $search[] = "【沿線】 " . get_ensen($ensen) ."
    "; } */ ////////////// 20120313 酒井 上記ensenに統合 if ($ensen) { $cond_ensen[] = array("field" => "ensen1", "value" => $ensen, "cond" => "=", "relation" => "or"); $cond_ensen[] = array("field" => "ensen2", "value" => $ensen, "cond" => "=", "relation" => "or"); $db->search[] = array("nest" => $cond_ensen); if ($eki) { //$search[] = "【沿線】 " . get_ensen($ensen) ."/"; $search2 .= get_ensen($ensen) ."沿い、"; } else { $search[] = "【沿線】 " . get_ensen($ensen); $search2 .= get_ensen($ensen) ."沿いの"; } $search3 .= "、" . get_ensen($ensen); $seo_ensen = get_ensen($ensen); } // 141215 駅複数選択可 if ($eki) { $eki_tmp = ""; if(is_array($eki)) { foreach($eki as $val) { $cond_eki[] = array("field" => "eki1", "value" => $val, "cond" => "=", "relation" => "or"); $cond_eki[] = array("field" => "eki2", "value" => $val, "cond" => "=", "relation" => "or"); $eki_tmp .= get_eki($ensen,$val) . "駅・"; } } else { $cond_eki[] = array("field" => "eki1", "value" => $eki, "cond" => "=", "relation" => "or"); $cond_eki[] = array("field" => "eki2", "value" => $eki, "cond" => "=", "relation" => "or"); $eki_tmp .= get_eki($ensen,$eki) . "駅・"; } $db->search[] = array("nest" => $cond_eki); $eki_tmp = mb_substr($eki_tmp, 0, -1, "UTF-8"); //$search[] = "【沿線】 " . $eki_tmp; if ($ensen) { $search[] = "【沿線】 " . get_ensen($ensen) ."/".$eki_tmp; } else { $search[] = "【駅】 " . $eki_tmp; } $search2 .= $eki_tmp ."周辺の"; $search3 .= "、" . $eki_tmp; } if ($new) { //$db->search[] = array("field" => "kyujin_start", "value" => "date(date_sub(now(), interval 14 day))", "cond" => ">="); $db->search[] = array("expression" => "kyujin_start >= date(date_sub(now(), interval 14 day))"); $search[] = "【新着】 "; if($beginer) { $search2 .= "新着、"; } else { $search2 .= "新着の"; } $search3 .= "、新着"; $data["new1"] = "checked"; } if ($beginer) { $db->search[] = array("field" => "beginer", "value" => $beginer, "cond" => "="); $search[] = "【初心者歓迎】 "; if($new) { $search2 .= "初心者歓迎の"; } else { $search2 .= "初心者歓迎、"; } $data["beginer1"] = "checked"; } if ($ord) { if ($ord == 1) { //標準:おすすめ順(ピックアップ) $db->order[] = array("field" => "admin_pickup", "desc" => "1"); $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->order[] = array("field" => "reg_date", "desc" => "1"); } else if ($ord == 2) { //新着・更新順 $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->order[] = array("field" => "reg_date", "desc" => "1"); } $data["ord"] = $ord; } else { $db->order[] = array("field" => "ord", "asc" => "1"); $db->order[] = array("field" => "kyujin_start", "desc" => "1"); $db->order[] = array("field" => "reg_date", "desc" => "1"); } // $db->order[] = array("field" => "plan", "desc" => "1"); //プラン(0:スタンダード 1:プレミアム) // $db->order[] = array("field" => "ord", "asc" => "1"); //並び順(数値が小さい順) // $db->order[] = array("field" => "reg_date", "desc" => "1"); $db->page = $page; $db->limit = 20; $count = $db->getCount(); $pages = intval(($count + $db->limit - 1) / $db->limit); $data["pages"] = $pages; $data['page'] = $page + 1; // ページ番号 $show_page = 9; // ページャーの表示ページ数 $show_page_harf = floor($show_page / 2); // ページャーの表示ページ数の半分 if ($pages > 1) { $data["pager"] = page_index2($page, $pages); $remaning_page = $pages - $data['page']; if($page <= $show_page_harf){ // 1~5ページ目 $data["pager"]["list"] = array_splice($data["pager"]["list"], 0, $show_page); }elseif($remaning_page < $show_page_harf){ // 最終ページから9ページ目以内 $data["pager"]["list"] = array_splice($data["pager"]["list"], ($pages - $show_page), $pages); }else{ $st_page = $page - $show_page_harf; $data["pager"]["list"] = array_splice($data["pager"]["list"], $st_page, $show_page); } } // ページャ用パラメーター if(empty($_REQUEST['no_change_url'])){ // 複雑なURL $request = $_REQUEST; unset($request['page']); $query_param = http_build_query($request); $data["query_param"] = preg_replace('|&page=\d+$|', '', $query_param); $data["query_param"] .= '&page='; $data["query_param"] = 'index.php?' . $data["query_param"]; }else{ // 静的URL $data["query_param"] = preg_replace('|/p\d+$|', '', $_SERVER["REQUEST_URI"]); $data["query_param"] .= '/p'; $data["query_param"] = preg_replace('|^/|', '', $data["query_param"]); } $list = $db->getList(); if ($list) { $data["total"] = $count; // 総件数 $data["list_start"] = $page * 20 + 1; $data["list_end"] = $page * 20 + count($list); foreach ($list as $key => $val) { // 内容200字まで // 企業情報 // 新着 // 更新日 $val["reg_date"] = date_format2($val["reg_date"]); $list[$key] = disp_kyujin($val); } $data["list"] = $list; } if ($act == "get_rss") { $rss = array(); foreach ($list as $val) { unset($item); $item["url"] = TOP_URL . "detail.html&id=" . $val["kyujin_id"]; $item["title"] = $val["title"]; $item["creator"] = $val["company"]["company_name"]; $item["category"] = $val["koyou"]; $item["description"] = $val["pr1"]; //$item["date"] = $val["kyujin_start"]; $tm = mktime(0, 0, 0, substr($val["kyujin_start"], 5, 2), substr($val["kyujin_start"], 8, 2), substr($val["kyujin_start"], 0, 4)); $item["date"] = date('Y-m-d\TH:i:s+09:00', $tm); $rss[] = $item; } unset($val); $val["about"] = $setup["site_name"]; $val["title"] = $setup["site_name"]; $val["url"] = TOP_URL; $val["link"] = TOP_URL; $val["description"] = $setup["description"]; $val["creator"] = $setup["site_name"]; $val["rights"] = $setup["site_name"]; $val["date"] = $item["date"] = date('Y-m-d\TH:i:s+09:00', time()); $val["rss"] = $rss; // RSS出力 /* header('content-type: text/xml; charset=utf-8'); $data = htmltemplate::t_buffer("rss.xml", $val); echo mb_convert_encoding($data, 'utf8', SCRIPT_ENCODING); */ print_r($rss); exit; } // if ($search) { $data["search"] = $search; } if ($search2) { $data["search3"] = $search2; $search2 .= "求人情報を全".$count."件表示しています。"; $data["search2"] = $search2; } if ($seo_pref) { $data["seo_pref"] = $seo_pref; } if ($seo_ensen) { $data["seo_ensen"] = $seo_ensen; } // 勤務地 // $data["area"] = get_info_select(INFO_AREA, $area); if ($area) { foreach ($area as $val) { $data["area" . $val] = "selected"; } } // 沿線 if ($ensen) { $data["ensen_sel"] = $ensen; } // 駅 if ($eki) { $data["eki_sel"] = $eki; } // 都道府県 foreach($preficture_list as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $key, "cond" => "="); //都道府県 $count = $db->getCount(); $data["pref_list"][$key]["name"] = $val; $data["pref_list"][$key]["count"] = $count; } // 職種 選択肢取得 $data["syokusyu"] = get_info_select(INFO_SHOKUSYU, $syokusyu ,"checked"); //第3引数にて選択時付与情報付与 "selected" or "checked" foreach($data["syokusyu"] as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "syokusyu", "value" => $val["info_id"], "cond" => "in"); $count = $db->getCount(); $data["syokusyu"][$key]["count"] = $count; } // 雇用形態 選択肢取得 $data["koyou"] = get_info_select(INFO_KOYOU, $koyou ,"checked"); foreach($data["koyou"] as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "koyou", "value" => $val["info_id"], "cond" => "in"); $count = $db->getCount(); $data["koyou"][$key]["count"] = $count; } // 業務 (廃止) //$data["gyomu"] = get_info_select(INFO_GYOMU, $gyomu); // 給与 選択肢取得 $data["kyuyo_type"] = get_info_select(INFO_KYUYO, $kyuyo_type); // 変動カテゴリ $db = new Category(); $db->search[] = array("field" => "level", "value" => 1, "cond" => "="); $db->order[] = array("field" => "ord", "asc" => "1"); $cate_tit = $db->getList(); // カテゴリ名(親)取得(seq => カテゴリid , name => カテゴリ名 , level => カテゴリ階層(1 = 親) , ord => カテゴリ並び順 ) $db = new Category(); $db->search[] = array("field" => "level", "value" => 2, "cond" => "="); $db->order[] = array("field" => "ord", "asc" => "1"); $db->order[] = array("field" => "parents_ord", "asc" => "1"); $cate_tmp = $db->getList(); // カテゴリ項目(子)取得(seq => カテゴリid , name => カテゴリ名 , level => カテゴリ階層(2 = 子) , ord => カテゴリ並び順 , parents_ord => 親の並び順 , parents => 親ID ) //form選択項目セット $cate_tmp_sel["category01"] = $category01; $cate_tmp_sel["category02"] = $category02; $cate_tmp_sel["category03"] = $category03; $cate_tmp_sel["category04"] = $category04; $cate_tmp_sel["category05"] = $category05; $cate_tmp_sel["category06"] = $category06; $cate_tmp_sel["category07"] = $category07; $cate_tmp_sel["category08"] = $category08; $cate_tmp_sel["category09"] = $category09; $cate_tmp_sel["category10"] = $category10; foreach($cate_tit as $val1) { for ($i = 1; $i < 11; $i++){ //カテゴリは最大10個までしか登録できない(運営側) $category_ii = "category" . sprintf("%02d", $i); //カテゴリ名セット if ($val1["ord"] == $i) { //親の並び順が$iだったら foreach($cate_tmp as $val2) { if ($val2["parents_ord"] == $i) { //子に指定されている親の並び順が$iだったら $data[$category_ii]["title"] = $val1["name"]; //カテゴリタイトル(親の名前)セット $data_tmp["info_id"] = $val2["seq"]; //項目ID(子ID)セット $data_tmp["contents"] = $val2["name"]; //項目名(子の名前)セット // 求人登録数カウント $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "CONCAT(','," . $category_ii . ",',')", "value" => "%".$val2["seq"]."%", "cond" => "like"); $count = $db->getCount(); $data_tmp["count"] = $count; //form選択項目をループ foreach($cate_tmp_sel[$category_ii] as $val3) { //form選択項目をループ if ($val3 == $data_tmp["info_id"]) { $data_tmp["sel"] = "checked"; } } $data[$category_ii]["list"][] = $data_tmp; unset($data_tmp); } } } } } // if (!$kyuyo_type) { // $data["kyuyo_type"][0]["sel"] = "selected"; $item = get_info_item($data["kyuyo_type"][0]["info_id"]); } else { $item = get_info_item($kyuyo_type); } /* if (!$kyuyo) { $kyuyo = $item['kyuyo1']; } */ $data["kyuyo"] = array(); if ($kyuyo == $item['kyuyo1']) { $data["kyuyo"][] = array("value" => $item['kyuyo1'], "name" => yen_format($item['kyuyo1']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo1'], "name" => yen_format($item['kyuyo1'])); } if ($kyuyo == $item['kyuyo2']) { $data["kyuyo"][] = array("value" => $item['kyuyo2'], "name" => yen_format($item['kyuyo2']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo2'], "name" => yen_format($item['kyuyo2'])); } if ($kyuyo == $item['kyuyo3']) { $data["kyuyo"][] = array("value" => $item['kyuyo3'], "name" => yen_format($item['kyuyo3']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo3'], "name" => yen_format($item['kyuyo3'])); } if ($kyuyo == $item['kyuyo4']) { $data["kyuyo"][] = array("value" => $item['kyuyo4'], "name" => yen_format($item['kyuyo4']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo4'], "name" => yen_format($item['kyuyo4'])); } if ($kyuyo == $item['kyuyo5']) { $data["kyuyo"][] = array("value" => $item['kyuyo5'], "name" => yen_format($item['kyuyo5']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo5'], "name" => yen_format($item['kyuyo5'])); } if ($kyuyo == $item['kyuyo6']) { $data["kyuyo"][] = array("value" => $item['kyuyo6'], "name" => yen_format($item['kyuyo6']), "sel" => "selected"); } else { $data["kyuyo"][] = array("value" => $item['kyuyo6'], "name" => yen_format($item['kyuyo6'])); } // // $data["ensen"] = get_ensen_select_use($ensen); //$data["eki"] = get_eki_select($ensen, $eki); //141215 複数用 // $data["eki"] = get_eki_select2($ensen, $eki); // // 検索項目をの各項目を複数指定した場合、noindexを出力する $is_show_noindex = false; if( !$list || count($city) > 1 || count($syokusyu) > 1 || count($koyou) > 1 || count($eki) > 1 || count($category01) > 1 || ($new && $beginer) ){ $is_show_noindex = true; }elseif($data['page'] >= 2){ $is_show_noindex = true; } $data['is_show_noindex'] = $is_show_noindex; // パンクズリスト if($area){ // 都道府県 $pref_cd = $area[0]; $area_name = $data["pref_list"][$pref_cd]["name"]; $data['pankuzu_url']["{$area_name}"] = "/s/area{$pref_cd}"; // 市区町村 if(count($city) === 1){ $city_name = get_city_name($city[0]); $data['pankuzu_url']["{$city_name}"] = "/s/area{$pref_cd}/city{$city[0]}"; } // 職種 if(count($syokusyu) === 1){ $shokusyu_list = get_info_idx(INFO_SHOKUSYU); $syokusyu_name = $shokusyu_list[$syokusyu[0]]; $data['pankuzu_url']["{$syokusyu_name}"] = "/s/syokusyu{$syokusyu[0]}"; } // 沿線 if($ensen){ $ensen_name = get_ensen($ensen); $data['pankuzu_url']["{$ensen_name}"] = "/index.php?act=search&area={$pref_cd}&ensen={$ensen}"; } }elseif(count($syokusyu) === 1){ // 職種のみ $shokusyu_list = get_info_idx(INFO_SHOKUSYU); $syokusyu_name = $shokusyu_list[$syokusyu[0]]; $data['pankuzu_url']["{$syokusyu_name}"] = "/s/syokusyu{$syokusyu[0]}"; } // URLタイプ $url_types = array( '/s/' => 's', '/n/' => 'n', ); $data['url_type'] = 'normal'; if(isset($url_types[ $_SERVER['REQUEST_URI'] ])){ // 検索条件指定、「仕事を探す」「新着求人」から遷移した場合 $data['url_type'] = $url_types[ $_SERVER['REQUEST_URI'] ]; }elseif(preg_match('|^/s/.+$|', $_SERVER['REQUEST_URI'])){ // 静的URLの場合 $data['url_type'] = 'static'; } if ($act == "new") { $ap->view("new.html", $data); } elseif ($act == "search2") { $ap->view("search2.html", $data); } else { $ap->view("search.html", $data); } exit; } //-------------------------------------------- // 注目の求人 if ($act == "attension") { $page = $_REQUEST["page"]; if (!$page) { $page = 0; } // $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 // 2週間以内 $db->order[] = array("field" => "oubo_count", "desc" => "1"); $db->page = $page; $db->limit = 20; $count = $db->getCount(); $pages = intval(($count + $db->limit - 1) / $db->limit); if ($pages > 1) { $data["pager"] = page_index2($page, $pages); } $list = $db->getList(); if ($list) { $data["total"] = $count; // 総件数 $data["list_start"] = $page * 20 + 1; $data["list_end"] = $page * 20 + count($list); foreach ($list as $key => $val) { // 内容200字まで // 企業情報 // 新着 // 更新日 $val["reg_date"] = date_format2($val["reg_date"]); $list[$key] = disp_kyujin($val); } $data["list"] = $list; } $ap->view("attension.html", $data); exit; } if ($act == "base2") { $ap->view("base2.html", $data); exit; } //-------------------------------------------- if ($act == "help-company-p") { $id = $_REQUEST["id"]; if ($id) { $item = Help::getData($id); $item["title_short"] = mb_strimwidth($item["title"], 0, 20, "..."); $data["item"] = $item; $ap->view("help-company-p.html", $data); exit; } $act = "help-company"; } if ($act == "help-company") { $keyword = $_REQUEST["keyword"]; if ($keyword) { $db = new Help(); $db->search[] = array("field" => "kind", "value" => "2", "cond" => "="); $db->search[] = array("field" => "comment", "value" => "%" . $keyword . "%", "cond" => "like"); $db->page = 0; $db->limit = 0; $list = $db->getList(); if ($list) { $list2 = array(); foreach ($list as $val) { $list2[$val["category_id"]][] = $val; } unset($cond); $cond["kind"] = INFO_HELP; $ret = Info::findData($cond, null, null, array(array("field" => "ord"))); if ($ret) { foreach ($ret as $val) { $item["items"] = $list2[$val["info_id"]]; $help[] = $item; } } } if ($help) { foreach ($help as $val) { if ($val["items"]) { $data["help"][] = $val; } } } $data["keyword"] = $keyword; } else { unset($cond); $cond["kind"] = INFO_HELP; $ret = Info::findData($cond, null, null, array(array("field" => "ord"))); if ($ret) { foreach ($ret as $val) { $item = get_info_item($val["info_id"]); if ($item["kinds"] == "2") { unset($cond); $cond["category_id"] = $val["info_id"]; //$ret = Help::findData($cond); $db = new Help(); $db->search[] = array("field" => "category_id", "value" => $val["info_id"], "cond" => "="); $db->order[] = array("field" => "seq", "asc" => "1"); $ret = $db->getList(); $item["items"] = $ret; $help[] = $item; } } } $data["help"] = $help; } //dump($help); $ap->view("help-company.html", $data); exit; } if ($act == "help-user-p") { $id = $_REQUEST["id"]; if ($id) { $item = Help::getData($id); $item["title_short"] = mb_strimwidth($item["title"], 0, 20, "..."); $data["item"] = $item; $ap->view("help-user-p.html", $data); exit; } $act = "help-user"; } if ($act == "help-user") { $keyword = $_REQUEST["keyword"]; if ($keyword) { $db = new Help(); $db->search[] = array("field" => "kind", "value" => "1", "cond" => "="); $db->search[] = array("field" => "comment", "value" => "%" . $keyword . "%", "cond" => "like"); $db->page = 0; $db->limit = 0; $list = $db->getList(); if ($list) { $list2 = array(); foreach ($list as $val) { $list2[$val["category_id"]][] = $val; } unset($cond); $cond["kind"] = INFO_HELP; $ret = Info::findData($cond, null, null, array(array("field" => "ord"))); if ($ret) { foreach ($ret as $val) { $val["items"] = $list2[$val["info_id"]]; $help[] = $val; } } } if ($help) { foreach ($help as $val) { if ($val["items"]) { $data["help"][] = $val; } } } $data["keyword"] = $keyword; } else { unset($cond); $cond["kind"] = INFO_HELP; $ret = Info::findData($cond, null, null, array(array("field" => "ord"))); if ($ret) { foreach ($ret as $val) { $item = get_info_item($val["info_id"]); if ($item["kinds"] == "1") { unset($cond); $cond["category_id"] = $val["info_id"]; //$ret = Help::findData($cond); $db = new Help(); $db->search[] = array("field" => "category_id", "value" => $val["info_id"], "cond" => "="); $db->order[] = array("field" => "seq", "asc" => "1"); $ret = $db->getList(); $item["items"] = $ret; $help[] = $item; } } } $data["help"] = $help; } $ap->view("help-user.html", $data); exit; } if ($act == "event_calendar") { //パラメータがあるかないか、ないなら現在の日付を代入 if (isset($_GET['d'])) { $data["d"] = $_GET['d']; } else { $data["d"] = date("Y-m"); } //『-』を区切り文字にして分解する、分解したものをlist()関数で代入していく。 list($data['year'], $data['month']) = explode("-", $data['d']); //checkdate()でインジェクション対策。 if(!checkdate($data['month'],1,$data['year'])){ $data['date_err'] = "不正な日付です"; exit; } $data['prev'] = date("Y-m", mktime(0, 0, 0, $data['month']-1, 1, $data['year']) ); $data['next'] = date("Y-m", mktime(0, 0, 0, $data['month']+1, 1, $data['year']) ); $year = $data['year']; $month = $data['month']; $fd = date("w", strtotime("$year-$month-1") );//今月の1日の曜日を知る 2014年7月の初めは2、つまり火曜日。0から6まで取得できる $ld = date("t", strtotime("$year-$month-1") );//今月の最後の日数を取得する 2014年7月の終わりの日は31。 28から31の数字を取得できる。 $y = $fd;//曜日の初期値 //日付を作る 日曜日($y = 0)の時はセル文字を赤く、土曜日($y) for($i = 1;$i<=$ld;$i++){ switch($y){ case 0:$data['day'][$i]['youbi'] = "日"; break; case 1:$data['day'][$i]['youbi'] = "月"; break; case 2:$data['day'][$i]['youbi'] = "火"; break; case 3:$data['day'][$i]['youbi'] = "水"; break; case 4:$data['day'][$i]['youbi'] = "木"; break; case 5:$data['day'][$i]['youbi'] = "金"; break; case 6:$data['day'][$i]['youbi'] = "土"; break; default:$data['day'][$i]['youbi'] = ""; break; } $y++; $y = $y % 7; } //イベント情報取得 foreach($data['day'] as $key => $val) { $search_date = $year."-".sprintf('%02d', $month)."-".sprintf('%02d', $key); $db = new Event(); $db->search[] = array("field" => "disp_date", "value" => $search_date, "cond" => "="); $db->order[] = array("field" => "start_time", "asc" => "1"); $ret = $db->getList(); if ($ret) { $data['day'][$key]['event'] = $ret; } } $ap->view("event_calendar.html", $data); exit; } /* if ($act == "crontest") { if ($_REQUEST["crontest"] == 1) { exec('/usr/bin/php5.2 -f /home/kaigo-at/kaigo-at.jp/public_html/bin/mailproc.php'); //exec('/usr/bin/php5.2 /home/mansion-q/test-reqruit.info/public_html/bin/mailmag.php'); } elseif ($_REQUEST["crontest"] == 2) { $data["msg"] = "未実装"; } $data["pass"] = dirname(__FILE__); $ap->view("crontest.html", $data); exit; } */ /* if ($act == "help") { $ap->view("help.html", $data); exit; } if ($act == "kiyaku") { $ap->view("kiyaku.html", $data); exit; } if ($act == "iwaikin") { $ap->view("iwaikin.html", $data); exit; } if ($act == "sitemap") { $ap->view("sitemap.html", $data); exit; } */ if ($act == "search2") { $data["area"][] = $_REQUEST["area"]; // 都道府県 foreach($preficture_list as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $key, "cond" => "="); //都道府県 $count = $db->getCount(); $data["pref_list"][$key]["name"] = $val; $data["pref_list"][$key]["count"] = $count; } $ap->view("search2.html", $data); exit; } if ($act == "search3") { $data["area"][] = $_REQUEST["area"]; // 都道府県 foreach($preficture_list as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $key, "cond" => "="); //都道府県 $count = $db->getCount(); $data["pref_list"][$key]["name"] = $val; $data["pref_list"][$key]["count"] = $count; } $ap->view("search3.html", $data); exit; } //-------------------------------------------- $ap->fix_template(); //-------------------------------------------- // トップページ if ($ap->template == "index.html") { // お知らせ $db = new News(); $db->page = 0; $db->limit = 5; $db->order[] = array("field" => "disp_date", "desc" => "1"); $ret = $db->getList(); if ($ret) { $data["news"] = $ret; } // 勤務地 //$data["area"] = get_info(INFO_AREA); // 都道府県 //$data["pref_list"] = $preficture_list; // 都道府県 foreach($preficture_list as $key => $val) { $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開 $db->search[] = array("field" => "kinmu", "value" => $key, "cond" => "="); //都道府県 $count = $db->getCount(); $data["pref_list"][$key]["name"] = $val; $data["pref_list"][$key]["count"] = $count; } // 職種 $data["syokusyu"] = get_info(INFO_SHOKUSYU); // 雇用形態 $data["koyou"] = get_info(INFO_KOYOU); // // 愛知の市区町村 // $db = new Address(); // $db->search[] = array("field" => "pref_cd", "value" => "23", "cond" => "="); // 有効 // $db->order[] = array("field" => "city_cd", "asc" => "1"); // $citylist_aichi_tmp = $db->getList(); // unset($citylist_aichi); // if ($citylist_aichi_tmp) { // foreach($citylist_aichi_tmp as $val) { // if ($val["city"]) { // $citylist_aichi[$val["city_cd"]] = $val["city"]; // } // } // } // $data["citylist_aichi"] = $citylist_aichi; // 運営ピックアップ求人 $db = new Kyujin(); $db->search[] = array("field" => "del_flag", "value" => "0", "cond" => "="); // 有効 $db->search[] = array("field" => "status", "value" => "2", "cond" => "="); // 公開 $db->search[] = array("expression" => "kyujin_start<=date(now()) and kyujin_end>=date(now())"); // 公開期間内 $db->search[] = array("field" => "admin_pickup", "value" => "1", "cond" => "="); // 運営ピックアップフラグ $db->order[] = array("rand" => "1"); // 4件ランダム抽出 $db->limit = 6; $fields = array("0" => "kyujin_id" , "1" => "company_id" , "2" => "title" , "3" => "syokusyu" , "4" => "koyou" , "5" => "category01" , "6" => "pr1" , "7" => "kinmu" , "8" => "main_image" , "10" => "kyuyo" , "11" => "kyuyo_min" , "12" => "kyuyo_max" , "14" => "admin_pickup" , "15" => "kyujin_start" ); $adpick_list_tmp = $db->getList($fields); if ($adpick_list_tmp) { foreach ($adpick_list_tmp as $key => $val) { $adpick_list_tmp[$key] = disp_kyujin($val); } $data["adpick_list"] = $adpick_list_tmp; } // 新着ブログ $db = new Blog(); $db->search[] = array("field" => "status", "value" => "1", "cond" => "="); // 公開 $db->order[] = array("field" => "view_date", "desc" => "1"); $db->limit = 4; $blog_list = $db->getList(); if ($blog_list) { foreach ($blog_list as $key => &$val) { $blog_list[$key]["box1_text"] = mb_strimwidth( strip_tags(htmlspecialchars_decode($val["box1_text"])), 0, 160, "...", "UTF-8" ); $blog_list[$key]["view_date"] = date_format2($val["view_date"]); } $data["blog_list"] = $blog_list; } //トップページ沿線リスト // unset($ensen_list_tmp); // $taiou_pref_list = array("0" => 13 , "1" => 14 , "2" => 11 , "3" => 12); // この求人サイトの対応都道府県を定義 (東京、神奈川、埼玉、千葉)、キーの昇順にリスト表示される 不要な場合はコメントアウト // if ($taiou_pref_list) { //対応都道府県指定がある場合は指定都道府県のみの沿線取得 // foreach ($preficture_list as $key => $val) { // foreach ($taiou_pref_list as $key2 => $val2) { // if ($key == $val2) { //指定した対応都道府県コードに合致する場合 // $ekidata = new MyEkiDataJP(); // $lines = $ekidata->getLinesByPrefId($key); // $ensen_list_tmp[$key2]["pref_cd"] = $key; // $ensen_list_tmp[$key2]["pref"] = $val; // foreach ( $lines->line as $line ) { // $line_tmp = get_object_vars($line); //SimpleXMLObjectを配列に展開 // $ensen_list_tmp[$key2]["ensen"][$line_tmp["line_cd"]] = $line_tmp["line_name"]; // } // } // } // } // } else { //対応都道府県指定が無い場合は全国の沿線取得 // foreach ($preficture_list as $key => $val) { // if ($key > 47) { //北海道(1)~沖縄(47)まで 海外(48)はEkiDataJPでは取得できないためエラーとなる // break; // } // $ekidata = new MyEkiDataJP(); // $lines = $ekidata->getLinesByPrefId($key); // $ensen_list_tmp[$key]["pref_cd"] = $key; // $ensen_list_tmp[$key]["pref"] = $val; // foreach ( $lines->line as $line ) { // $line_tmp = get_object_vars($line); //SimpleXMLObjectを配列に展開 // $ensen_list_tmp[$key]["ensen"][$line_tmp["line_cd"]] = $line_tmp["line_name"]; // } // } // } // if ($ensen_list_tmp) { // ksort($ensen_list_tmp); // } // $data["ensen_list"] = $ensen_list_tmp; // // 変動カテゴリ $db = new Category(); $db->search[] = array("field" => "level", "value" => 1, "cond" => "="); $db->order[] = array("field" => "ord", "asc" => "1"); $cate_tit = $db->getList(); $db = new Category(); $db->search[] = array("field" => "level", "value" => 2, "cond" => "="); $db->order[] = array("field" => "parents_ord", "asc" => "1"); $cate_tmp = $db->getList(); if($cate_tit) { foreach($cate_tit as $val1) { for ($i = 1; $i < 11; $i++){ //カテゴリは最大10個までしか登録できない(運営側) $category_ii = "category" . sprintf("%02d", $i); if ($val1["ord"] == $i) { foreach($cate_tmp as $val2) { if ($val2["parents_ord"] == $i) { $data[$category_ii]["title"] = $val1["name"]; $data_tmp["info_id"] = $val2["seq"]; $data_tmp["contents"] = $val2["name"]; $data[$category_ii]["list"][] = $data_tmp; unset($data_tmp); } } } } } } // $ap->view("index.html", $data); } else { // スタティックページ $ap->view($ap->template, $data); } exit; //-------------------------------------------- // ログインしていなければ、ログインフォームを表示し、ログイン後もとの処理へ function login_check($msg) { global $sid; // ログイン確認 if (!isset($_SESSION["LOGIN"])) { // ログイン後の飛び先(戻る場所) $_SESSION['NEXT_URL'] = TOP . './logined.html&sid=' . $sid; // 現在のパラメータを保存 $_SESSION['REQUEST'] = $_REQUEST; $_SESSION['LOGIN_MESSAGE'] = $msg; // ログイン処理へ header("Location: ./myuser/login.html&sid=" . $sid); exit; } } function set_row($ary, $cnt) { $num = 0; $col = 0; $data = array(); $row = array(); foreach ($ary as $val) { $row[] = $val; if (++$col == $cnt) { $data[$num]["num"] = $num + 1; $data[$num++]["row"] = $row; $row = array(); $col = 0; } } if ($row) { $data[$num]["num"] = $num + 1; $data[$num++]["row"] = $row; } return $data; } function sel_normalize($items) { if ($items) { if (is_array($items)) { $data = array(); foreach ($items as $val) { if ($val) { $data[] = $val; } } return $data; } else { return array($items); } } return array(); } //map用に整形 hatta 121115//////////////////////////////////////////////// function GetGeocode ($add){ require_once('../lib/JSON.php'); $latlng =array(); $str = ""; $url = "http://maps.google.com/maps/api/geocode/json?address=".$add."&sensor=false"; //echo $url; // レスポンスを取得 $res = file_get_contents($url); //var_dump($res); // JSON形式から連想配列へ変換 $json = new Services_JSON(); $res_array = $json->decode($res); $results = $res_array->results; $lat = $results[0]->geometry->location->lat; $lng = $results[0]->geometry->location->lng; if($lat){ $str = ""; } return array($str,$lat,$lng); /* require_once('lib/JSON.php'); $latlng =array(); $str = ""; $url = "http://maps.google.com/maps/api/geocode/json?address='".$add."'&sensor=false"; // レスポンスを取得 $res = file_get_contents($url); // JSON形式から連想配列へ変換 $json = new Services_JSON(); $res_array = $json->decode($res); $results = $res_array->results; $lat = $results[0]->geometry->location->lat; $lng = $results[0]->geometry->location->lng; return array($lat,$lng); */ } //map用に整形 hatta 121115//////////////////////////////////////////////// ?>