= ".$from." "; }elseif($to){ $nendai="AND (to_days(now())-to_days(concat( birth_yy,'/',birth_mm,'/',birth_dd)))/365 <= ".$to." "; } // 酒たばこSET $al = ''; if($_GET['a']){ switch($_GET['a']){ case 0:$al = "AND alcohol='飲めない' "; break; case 1:$al = "AND alcohol='おちょこ' "; break; case 2:$al = "AND alcohol='コップ' "; break; case 3:$al = "AND alcohol='ペール' "; break; case 4:$al = "AND alcohol='バケツ' "; break; case 5:$al = "AND alcohol='樽' "; break; } } $tb = ''; if($_GET['t']){ switch($_GET['t']){ case 0:$tb = "AND tabacco='吸いません' "; break; case 1:$tb = "AND tabacco='吸います' "; break; } } // 血液型SET $blood = ''; if($_GET['bt']){ switch($_GET['bt']){ case 'A':$blood = "AND blood_type='A型' "; break; case 'B':$blood = "AND blood_type='B型' "; break; case 'AB':$blood= "AND blood_type='AB型' "; break; case 'O':$blood = "AND blood_type='O型' "; break; } } // 血液型SET $shame = ''; if($_GET['ga']){ $shame = "AND staff_img <> '' "; } // タイプSET $type1 = ''; $a_tag1= ''; if($_GET['tp1']){ foreach($tp1 as $v1){ if($type1){ $type1 .= ','; }else{ $type1 = 'AND staff_type IN ('; } $a_tag1 .= "&tp1%5B%5D=".$v1; switch($v1){ case 11:$type1 .= "'セクシー'"; break; case 12:$type1 .= "'清純'"; break; case 13:$type1 .= "'スレンダー'"; break; case 14:$type1 .= "'ギャル'"; break; case 15:$type1 .= "'萌え'"; break; case 16:$type1 .= "'可愛い'"; break; case 17:$type1 .= "'お姉'"; break; case 18:$type1 .= "'ぽっちゃり'"; break; case 31:$type1 .= "'クール'"; break; case 32:$type1 .= "'ワイルド'"; break; case 33:$type1 .= "'可愛い'"; break; case 34:$type1 .= "'王子様'"; break; case 35:$type1 .= "'渋い'"; break; case 36:$type1 .= "'お兄'"; break; case 37:$type1 .= "'ぽっちゃり'"; break; case 38:$type1 .= "'裸族'"; break; } } if($type1 != ''){$type1 .= ') ';} } $type2 = ''; $a_tag2= ''; if($_GET['tp2']){ foreach($tp2 as $v2){ if($type2){ $type2 .= ','; }else{ $type2 = 'AND staff_type2 IN ('; } $a_tag2 .= "&tp2%5B%5D=".$v2; switch($v2){ case 21:$type2 .= "'ノリノリ'"; break; case 22:$type2 .= "'小悪魔'"; break; case 23:$type2 .= "'ピュア'"; break; case 24:$type2 .= "'フレンドリー'"; break; case 25:$type2 .= "'天然'"; break; case 26:$type2 .= "'癒し'"; break; case 27:$type2 .= "'お笑い'"; break; case 41:$type2 .= "'ノリノリ'"; break; case 42:$type2 .= "'ピュア'"; break; case 43:$type2 .= "'オレ様'"; break; case 44:$type2 .= "'天然'"; break; case 45:$type2 .= "'癒し'"; break; case 46:$type2 .= "'お笑い'"; break; } } if($type2 != ''){$type2 .= ') ';} } // 検索ワードSET if($_GET['kw']){ $k = "AND concat(staff_nm,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24) collate utf8_unicode_ci LIKE '%".urldecode($_GET['kw'])."%'"; }else{ $k = ""; } $sql = "SELECT * FROM shop_staff s JOIN shop_info i ON s.shop_id=i.shop_id JOIN shop p ON s.shop_id=p.shop_id WHERE staff_disable=1 AND shop_visible=1 AND yorunavi_plan BETWEEN 2 AND 19 \n"; if(($nendai)||($sex)||($chiiki)||($genre)||($al)||($tb)||($k)||($type1)||($type2)||($blood)||($shame)){ if($nendai){ $sql1 .= $nendai."\n"; } if($sex){ $sql1 .= $sex."\n"; } if($chiiki){ $sql1 .= $chiiki."\n"; } if($genre){ $sql1 .= $genre."\n"; } if($al){ $sql1 .= $al."\n"; } if($tb){ $sql1 .= $tb."\n"; } if($type1){ $sql1 .= $type1."\n"; } if($type2){ $sql1 .= $type2."\n"; } if($blood){ $sql1 .= $blood."\n"; } if($shame){ $sql1 .= $shame."\n"; } if($k){ $sql1 .= $k."\n"; } } $res = $conn->query($sql.$sql1); $cnt = $res->num_rows; $yesterday = time()-86400; $sYear = date("Y",$yesterday); $sMon = date("m",$yesterday); $sDay = date("d",$yesterday); // 昨日のアクセス(テンポラリ)がなかったら生成 $sql0 = "SELECT * FROM temp_staff_access WHERE staff_yy=".$sYear." AND staff_mm=".$sMon." AND staff_dd=".$sDay; $res0 = $conn->query($sql0); //echo $sql0; if(! $res0->num_rows){ $sql01 = "DELETE FROM temp_staff_access"; $conn->query($sql01); $sql02 = "INSERT INTO temp_staff_access SELECT * FROM staff_access WHERE staff_yy=".$sYear." AND staff_mm=".$sMon." AND staff_dd=".$sDay; $conn->query($sql02); } $sql = "SELECT s.*,i.*,a.area_nm,g.genre_nm,k.ken_nm,ken_ank, t.daily_cnt FROM shop_staff s JOIN shop_info i ON s.shop_id=i.shop_id JOIN shop p ON s.shop_id=p.shop_id JOIN genre g ON p.genre_id=g.genre_id JOIN area a ON p.area_id=a.area_id JOIN ken k ON a.ken_id=k.ken_id LEFT OUTER JOIN temp_staff_access t ON s.shop_id=t.shop_id AND s.staff_id=t.staff_id WHERE staff_disable=1 AND shop_visible=1 AND yorunavi_plan BETWEEN 2 AND 19 \n"; if($sql1){ $sql .= $sql1; } if($cnt>$px){ $res->free; $sql .= "ORDER BY p.area_id, daily_cnt DESC, staff_upd DESC, staff_apd LIMIT ".$px.",30"; $res = $conn->query($sql); } // sqlfはkihon.phpで定義済み $staffsearcharea=''; $resf = $conn->query($sqlf); while($data1=$resf->fetch_assoc()){ $en_city=urlencode($data1['area_nm']); $ax = preg_replace('/市/','',$data1['area_nm']); if($data1['shop_area']==$c){ $doit=' selected'; }else{ $doit=''; } $staffsearcharea .= ""; } $resf->free; $Pager = new Pager; // ページャオブジェクト準備 $p_str = $Pager->doIt($cnt); // ページャ生成 ?> <?=$area?>スタッフ検索-YORUNAVI