<?php
include_once 'src/inc/db/function.php';
// 初始化變數
$platform_id = $itemNo = $itemName = $itemNote = "";
$itemNo = "team";

// 如果有 ID 參數,則載入現有資料
$itemNo = isset($_GET['item']) ? $_GET['item'] : null;
if ($itemNo != null) {
  $stmt = $conn->prepare("SELECT * FROM platform WHERE itemNo = ?  LIMIT 0,1");
  $stmt->execute([$itemNo]);
  if ($row = $stmt->fetch()) {
    $platform_id = $row['platform_id'];
    $itemNo = $row['itemNo'];
    $itemName = $row['itemName'];
    $itemNote = $row['itemNote'];
    $flag_view = $row['flag_view'];
    $isEditing = true;
  }
}
?>
<!DOCTYPE html>

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <?php include_once "template_css.php"; ?>

</head>

<body>
  <!--BEGIN HEADER-->
  <?php include_once "template_header.php"; ?>
  <!--END HEADER-->

  <!--BEGIN SIDEBAR-->
  <?php include_once "template_sidebar.php"; ?>
  <!--END SIDEBAR-->
  <main id="main" class="main">
    <div class="pagetitle d-flex  justify-content-between align-items-center">
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item "><a href="index.php"><i class="bi bi-house-door-fill"></i> 首頁</a></li>
          <li class="breadcrumb-item active"><?= $itemName ?></li>
        </ol>
      </nav>
      <span class="float: right;">
        <a href="#" onclick="window.history.back();" class="btn btn-sm  btn-outline-primary"><i class="bi bi-arrow-90deg-left"></i> 回上一頁</a>
      </span>
    </div>

    <section class="section"> <!-- class="card card-body " -->
      <div class="d-flex align-items-center mb-3">
        <div class="head-line" style="width:80px;"></div>
        <span class="head-title mx-2 "><?= $itemName ?></span>
        <div class="head-line " style="flex-grow: 1;"> </div>
      </div>
      <?= $itemNote ?>
    </section>

  </main><!-- End #main -->

  <!--BEGIN FOOTER-->
  <?php include_once "template_footer.php"; ?>
  <!--END FOOTER-->


</body>

</html>