$NID = $_GET['NID']; $current_month = date('m'); $URLYEAR = $_GET["YEAR"]; // Get the Year from the URL $URLMONTH = $_GET["MONTH"]; // Get the Month from the URL $selectmonth = $_GET["M"]; // Get the the Month selected form the URL $CMONTH =date('m'); $CYEAR =date('Y'); // Find out what yaer to use. If there isn't a year in the URL then use the current year if(is_null($URLYEAR)) { $YEAR = date('Y');} else {$YEAR = $URLYEAR;} // Find out the current month to display. If there isn't a month selected use the current month. if(is_null($URLMONTH)) { $MONTH = date('m');} else {$MONTH = $URLMONTH;} include ("connections/new_con.php"); // open the connection to the database $sql_newsletter_name = "SELECT newsletterID, newslettername FROM newsletter WHERE newsletterID = '$NID'"; $result_sql_newsletter_name=mysqli_query($con, $sql_newsletter_name); $result_newsletter_name = mysqli_fetch_array($result_sql_newsletter_name); $newsletter_name = $result_newsletter_name['newslettername']; //$sql_publications = "SELECT * FROM Publications WHERE newsletterID= '$NID' AND year=2014 AND month <= '$current_month'"; //$result_publications=mysqli_query($con, $sql_publications); // create query to find all newsletters that are available for the community. $query = "Select newsletterID, month, year, newsletter_link, calendar_link, cover_image FROM Publications WHERE newsletterID='{$NID}' AND month='{$MONTH}' AND year='{$YEAR}'"; $result = mysqli_query($con, $query); $result2 = mysqli_fetch_array($result); $query2 = "Select communityID, name FROM communities WHERE communityID='{$CID}'"; $result3 = mysqli_query($con, $query2); $row = mysqli_fetch_array($result3); $query3 = "Select newsletterID, year FROM Publications WHERE newsletterID='{$NID}' GROUP BY year ORDER BY year DESC"; $result4 = mysqli_query($con, $query3); //$query5 = "Select * FROM newsletter WHERE communityID='{$CID}'"; //$result5 = mysqli_query($con, $query5); //$row5 = mysqli_fetch_array($result5); ?>