PDO::ERRMODE_EXCEPTION));
$pdo->query(“SET NAMES utf8”);
$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
$stmt = $pdo->prepare(‘SELECT id, shop_name, phone, address1, genre, hp, address2, address3, kind, taste, koromo, color, ingredients, smell, zen, text1, text2, text3, text4, text5 FROM shop WHERE id = :id’);
$stmt->bindValue(‘:id’, $_GET[‘id’], PDO::PARAM_INT);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
//変数に代入
$shop_name = $row[‘shop_name’]; //店舗名
$phone = $row[‘phone’]; //電話番号
$address1 = $row[‘address1’]; //住所
$address2 = $row[‘address2’]; //住所
$address3 = $row[‘address3’]; //住所
$genre = $row[‘genre’]; //ジャンル
$hp = $row[‘hp’]; //HPリンク
$kind = $row[‘kind’]; //種類
$taste = $row[‘taste’]; //味
$koromo = $row[‘koromo’]; //衣
$color = $row[‘color’];
$ingredients = $row[‘ingredients’];
$smell = $row[‘smell’];
$zen = $row[‘zen’];
$text1 = $row[‘text1’];
$text2 = $row[‘text2’];
$text3 = $row[‘text3’];
$text4 = $row[‘text4’];
$text5 = $row[‘text5’];
//相対評価軸作成
//味
$tastelist = ‘
‘;
$optArr = array(‘コク’, ‘コクコク’, ‘バリコク’, ‘サリ’, ‘サリサリ’, ‘バリサリ’);
foreach($optArr as $value)
{
//選択済み
if($value == $taste){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘コク’){
$check = ‘ left’;
} elseif ($value == ‘バリサリ’) {
$check = ‘ right’;
} else {
$check = ”;
}
$tastelist .= ‘
‘;
}
//衣
$koromolist = ‘
‘;
$optArr = array(‘サク’, ‘サクサク’, ‘バリサク’, ‘ふわ’, ‘ふわふわ’, ‘バリふわ’);
foreach($optArr as $value)
{
//選択済み
if($value == $koromo){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘サク’){
$check = ‘ left’;
} elseif ($value == ‘バリふわ’) {
$check = ‘ right’;
} else {
$check = ”;
}
$koromolist .= ‘
‘;
}
//色
$colorlist = ‘
‘;
$optArr = array(‘イエロー’, ‘ゴールド’, ‘ブラウン’, ‘ブラック’);
foreach($optArr as $value)
{
//選択済み
if($value == $color){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘イエロー’){
$check = ‘ left’;
} elseif ($value == ‘ブラック’) {
$check = ‘ right’;
} else {
$check = ”;
}
$colorlist .= ‘
‘;
}
//具
$ingredientslist = ‘
‘;
$optArr = array(‘1’, ‘2’, ‘3’, ‘4’, ‘5’);
foreach($optArr as $value)
{
//選択済み
if($value == $ingredients){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘1’){
$check = ‘ left’;
} elseif ($value == ‘5’) {
$check = ‘ right’;
} else {
$check = ”;
}
$ingredientslist .= ‘
‘;
}
$ingredientslist .= ‘
‘;
//香
$smelllist = ‘
‘;
$optArr = array(‘香ばしい’, ‘普通’, ‘控えめ’);
foreach($optArr as $value)
{
//選択済み
if($value == $smell){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘香ばしい’){
$check = ‘ left’;
} elseif ($value == ‘控えめ’) {
$check = ‘ right’;
} else {
$check = ”;
}
$smelllist .= ‘
‘;
}
//全1
$zenlist1 = ‘
‘;
$optArr = array(‘小’, ‘中’, ‘大’);
$opt2Arr = array(‘1’, ‘2’, ‘3’);
while ( (list(, $value) = each($optArr))
&& (list(, $key) = each($opt2Arr)) )
{
//選択済み
if($key == $zen){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘小’){
$check = ‘ left’;
} elseif ($value == ‘大’) {
$check = ‘ right’;
} else {
$check = ”;
}
$zenlist1 .= ‘
‘;
}
//全2
$zenlist2 = ‘
‘;
$optArr = array(‘小’, ‘中’, ‘大’);
$opt2Arr = array(‘4’, ‘5’, ‘6’);
while ( (list(, $value) = each($optArr))
&& (list(, $key) = each($opt2Arr)) )
{
//選択済み
if($key == $zen){
$sel = ‘ active’;
} else {
$sel = ”;
}
if($value == ‘小’){
$check = ‘ left’;
} elseif ($value == ‘大’) {
$check = ‘ right’;
} else {
$check = ”;
}
$zenlist2 .= ‘
‘;
}
$image_url = ‘https://www.croquette.jp/images/shop/’.$_GET[‘id’].’.jpg’;
$banner_url = ‘https://www.croquette.jp/images/shop/banner_’.$_GET[‘id’].’.jpg’;
$banner = ‘‘;
$free_text = $text1.’
‘.$text2.’
‘.$text3.’
‘.$text4.’
‘.$text5;
$address = $address1.” “.$address2.” “.$address3;
?>