"newsdetail",
"detail_file" => $json
]);
if(!empty($airQuery->error)){
$locationurl = $host . "/404.html";
header('Location: ' . $locationurl);
exit();
}
$restrictId = !empty($airQuery->detail["cms_news_access_restrict_id"]) ? $airQuery->detail["cms_news_access_restrict_id"] : "";
$restrictName = !empty($airQuery->detail["cms_news_access_restrict_name"]) ? $airQuery->detail["cms_news_access_restrict_name"] : "";
$ipAccessFlag = !empty($airQuery->detail["ip_access_flag"]) ? $airQuery->detail["ip_access_flag"] : "0";
$basicAuthFlag = !empty($airQuery->detail["basic_auth_flag"]) ? $airQuery->detail["basic_auth_flag"] : "0";
$basicAuthType = !empty($airQuery->detail["basic_auth_type"]) ? $airQuery->detail["basic_auth_type"] : "1";
if(!empty($restrictId) && $restrictId != "0" && !empty($restrictName)) {
    $restrited = new Air_Query([
      "mode" => "newsdetail",
      "detail_file" => $json,
      "detail_restricted" => true,
      "detail_restricted_type" => $airQuery->detail["news_type"],
      "detail_restricted_id" => $restrictId,
      "detail_basic_auth_flag" => $basicAuthFlag,
      "detail_basic_auth_type" => $basicAuthType,
      "detail_ip_access_flag" => $ipAccessFlag,
    ]);
    if(empty($restrited->error)){
      $airQuery = $restrited;
    }
}
$description = $airQuery->detail["description"];
$seoDescription = $airQuery->detail["description"];
$signature = $airQuery->detail["signature"];
$subjects = $airQuery->detail["subjects"];
$venue = $airQuery->detail["venue"];
$sponsorship = $airQuery->detail["sponsorship"];
$id = $airQuery->detail["cms_news_id"];
$category = $airQuery->detail["cms_news_category_class_name"];
$category2 = $airQuery->detail["cms_news_category_name"];
$categorySlug = $airQuery->detail["cms_news_category_class_slug"];
$category2Slug = $airQuery->detail["cms_news_category_slug"];
$categoryColor = $airQuery->detail["cms_news_category_class_color"];
$category2Color = $airQuery->detail["cms_news_category_color"];
$category2TextColor = $airQuery->detail["cms_news_category_text_color"];
$title = nl2br($airQuery->detail["title"]);
$pageTitle = $airQuery->detail["title"];
$documentNumber = $airQuery->detail["document_number"];
$year = $airQuery->detail["year"];
$month = $airQuery->detail["month"];
$monthEn = $airQuery->detail["monthEn"];
$date = $airQuery->detail["date"];
$day = $airQuery->detail["day"];
$dayEn = $airQuery->detail["dayEn"];
$albumDir =  $albumPath . $airQuery->detail["cms_news_id"] . "/";
$thumbnailImg = $airQuery->detail["thumbnail_file_name"] != null ? "": "";
$thumbnailPath = $airQuery->detail["thumbnail_file_name"] != null ? $host . $albumDir . $airQuery->detail["thumbnail_file_name"] : "";
$tags = $airQuery->detail["cms_news_release_tags"];
$icons = $airQuery->detail["icons"];
$DAY_J_ARR = ["日","月","火","水","木","金","土"];
$orgSchedule = $airQuery->detail["event_schedule"];
$eventSchedule = [];
foreach($orgSchedule as $org) {
  $schedule = [];
  $schedule["startYear"] = date('Y', strtotime($org["start_month_date"]));
  $schedule["startMonth"] = date('m', strtotime($org["start_month_date"]));
  $schedule["startMonthEn"] = date('M', strtotime($org["start_month_date"]));
  $schedule["startDate"] = date('d', strtotime($org["start_month_date"]));
  $schedule["startDay"] = $DAY_J_ARR[date('w', strtotime($org["start_month_date"]))];
  $schedule["startDayEn"] = date('D', strtotime($org["start_month_date"]));
  $schedule["startHour"] = str_pad($org["start_hour"], 2, "0", STR_PAD_LEFT);
  $schedule["startMinutes"] = str_pad($org["start_minutes"], 2, "0", STR_PAD_LEFT);
  $schedule["endYear"] = !empty($org["end_month_date"]) ? date('Y', strtotime($org["end_month_date"])) : "";
  $schedule["endMonth"] = !empty($org["end_month_date"]) ? date('m', strtotime($org["end_month_date"])): "";
  $schedule["endMonthEn"] = !empty($org["end_month_date"]) ? date('M', strtotime($org["end_month_date"])): "";
  $schedule["endDate"] = !empty($org["end_month_date"]) ? date('d', strtotime($org["end_month_date"])): "";
  $schedule["endDay"] = !empty($org["end_month_date"]) ? $DAY_J_ARR[date('w', strtotime($org["end_month_date"]))]: "";
  $schedule["endDayEn"] = !empty($org["end_month_date"]) ? date('D', strtotime($org["end_month_date"])): "";
  $schedule["hasEndDate"] = !empty($org["end_month_date"]) ? "hasEndDate" : "noEndDate";
  $schedule["endHour"] = str_pad($org["end_hour"], 2, "0", STR_PAD_LEFT);
  $schedule["endMinutes"] = str_pad($org["end_minutes"], 2, "0", STR_PAD_LEFT);
  $eventSchedule[] = $schedule;
}
$body = !empty($airQuery->detail["body"]) ? $airQuery->detail["body"] : "";
if (!empty($body) && $blankLinkTextFlag == "1") {
    $dom = new DOMDocument();
    $html = '