query($query); if ($result) { $row = $result->fetch_assoc(); $result->free(); $topicName = $row["WebTopicName"]; $topicID = $row["WebTopicID"]; $isDis = $row["IsDisability"] ; if ($isDis == "1") { $isDisability = true; } } // Get Overviews $query = "SELECT ReportPubNick, ReportName"; $query = $query . " FROM Products, ProductsToWebTopics, Reports"; $query = $query . " WHERE ProductsToWebTopics.ProductID=Products.ProductID"; $query = $query . " AND Products.ReportID=Reports.ReportID"; $query = $query . " AND ProductsToWebTopics.WebTopicID='" . $topicID . "'"; $query = $query . " AND ProductType='Chapter' AND IsOverview='1'"; $query = $query ." ORDER BY ReportPubNick DESC, ChapterNum"; $overviewRS = $conn->query($query); // Get chapters $query = "SELECT ChapterNum, ProductName, ReportPubNick, ReportName"; $query = $query . " FROM Products, ProductsToWebTopics, Reports"; $query = $query . " WHERE ProductsToWebTopics.ProductID=Products.ProductID"; $query = $query . " AND Products.ReportID=Reports.ReportID"; $query = $query . " AND ProductsToWebTopics.WebTopicID='" . $topicID . "'"; $query = $query . " AND ProductType='Chapter' AND IsOverview='0'"; $query = $query . " ORDER BY ReportPubNick DESC, ChapterNum"; $chapterRS = $conn->query($query); // Get other product types $query = "SELECT ProductName, ProductType, ProductPubNick"; $query = $query . " FROM Products, ProductsToWebTopics"; $query = $query . " WHERE ProductsToWebTopics.ProductID=Products.ProductID"; $query = $query . " AND ProductsToWebTopics.WebTopicID='" . $topicID . "'"; $query = $query . " AND ProductType!='Chapter'"; $query = $query . " ORDER BY ProductType, ProductName"; $productRS = $conn->query($query); ?>

Reports & Products: By Topic

All full reports include information about youth with this disability and, in addition, the following reports and products contain information specifically on youth with :

The following reports and products contain information on :

num_rows; if ($numrows > 0) { $foundProduct = true; echo "

Overview

    "; while($row = $overviewRS->fetch_assoc()) { $rptPubNick = $row["ReportPubNick"]; $path = "reports/" . rptPubNick . "/"; echo "
  • " . $row["ReportName"] . "
  • "; } echo "
"; } } else { echo mysql_error(); } $overviewRS->free(); if ($chapterRS) { $numrows = $chapterRS->num_rows; if ($numrows > 0) { $foundProduct = true; echo "

Chapter

    "; while($row = $chapterRS->fetch_assoc()) { $rptPubNick = $row["ReportPubNick"]; $chapterNum = $row["ChapterNum"]; $filename = "nlts2_report_" . $rptPubNick . "_ch" . $chapterNum . ".pdf"; $path = "reports/" . $rptPubNick . "/"; echo "
  • " . $row["ProductName"] . ", "; echo "Chapter " . $row["ChapterNum"] . " of the report, "; echo "" . $row["ReportName"] . "
  • "; } echo "
"; } } else { echo mysql_error(); } $chapterRS->free(); // Print other products $lastType = null; if ($productRS) { $numrows = $productRS->num_rows; if ($numrows > 0) { $foundProduct = true; while($row = $productRS->fetch_assoc()) { $curType = $row["ProductType"]; if ($curType != $lastType) { // we've switched types echo ""; } echo "

" . $curType . "

    "; $lastType = $curType; // Print product $path = ""; if ($curType == "Data Brief") { $path = "data_briefs/"; } else if ($curType == "Fact Sheet") { $path = "fact_sheets/"; } $filename = $row["ProductPubNick"] . ".html"; echo "
  • " . $row["ProductName"] . "
  • "; } echo "
"; } } else { echo mysql_error(); } $productRS->free(); if (!$foundProduct) { echo "

No reports or products were found for this topic.

"; } $conn->close(); ?>