<td><?php echo $name; ?> </td> </tr> <tr> <th>価格帯</th> <td><?php echo $price; ?> </td> </tr> <tr> <th>ジャンル</th> <td><?php echo getGenreName($genre); ?> </td> </tr> <tr> <th>写真</th> <td><img src="<?php echo '../' . $photo; ?> " width="30%"></td> </tr> <tr> <th>コメント</th> <td><?php echo $comment; ?>
<th>状態</th> <th>作成日</th> </thead> <?php foreach ($stmt as $row) { ?> <tbody> <td><a href="edit.php?id=<?php echo $row["id"]; ?> "><?php echo $row["id"]; ?> </a></td> <td><?php echo getGenreName($row["genre_id"]); ?> </td> <td><?php echo $row["name"]; ?> </td> <td><?php echo $row["point"]; ?> </td> <td><?php if (!$row["status"]) { ?> <div style="color:red"><?php echo "非表示";
<?php require_once "config.php"; require_once "functions.php"; $pdo = connectDb(); $sortId = $_GET['sortId']; $genreId = $_GET['genreId']; $sql = "SELECT * FROM ichigaya_lunch"; if ($genreId != null) { $sql .= getSqlByGenreId($genreId); } else { $sql .= getCanDispSql(); } if ($sortId != null) { $sql .= getSqlBySortId($sortId); } else { $sql .= " ORDER BY update_date DESC"; } $stmt = $pdo->query($sql); foreach ($stmt as $row) { $lunches[] = array("id" => $row["id"], "genre" => getGenreName($row["genre_id"]), "name" => $row["name"], "price" => $row["price"], "photo" => $row["photo"], "comment" => $row["comment"], "url" => $row["url"], "point" => $row["point"], "update_date" => $row["update_date"]); } header('Content-Type: application/json; charset=utf-8'); echo json_encode($lunches, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); $pdo = null;