Social Support Map

To populate or update this plan, please step through the Social Support module.

 

0) { //The question has been answered before and thus values can be filled in... $sql = 'SELECT answer FROM answers WHERE uid=' . $GLOBALS['locationinfo']['uid'] . ' AND qid=' . $preqid . ' AND answer like "' . $p_id . '%"'; $result = mysqli_query($GLOBALS['conn'],$sql); if (!$result) { mailIt("Could not successfully run query ($sql) from DB: " . mysqli_error($GLOBALS['conn'])); exit; } $row =mysqli_fetch_assoc($result); $answer = $row['answer']; //list($person1, $person2, $person3, $person4, $person5) = explode("::", $answer); $tempArray = explode("::", $answer); $tempArray = array_diff($tempArray, array($p_id)); mysqli_free_result($result); } else { //The question has not been answered before, so values are empty... $tempArray = array(); } } $personQualities[$i] = $tempArray; $i++; } //fourth, the types of support they can provide, 12 $preqid = 12; $i = 0; foreach ($personArray as $peep) { //look up answer for qid 12 containing $peep //store results in 2d array $personSupports $tempArray = array(); if ($peep != "") { $p_id = $peep."_".$i; $sql = 'SELECT count(answer) as count from answers where uid=' . $GLOBALS['locationinfo']['uid'] . ' AND qid=' . $preqid . ' AND answer like "' . $p_id . '%"'; $result = mysqli_query($GLOBALS['conn'],$sql); if (!$result) { mailIt("Could not successfully run query ($sql) from DB: " . mysqli_error($GLOBALS['conn'])); exit; } $row =mysqli_fetch_assoc($result); $numoftimesanswered = $row['count']; mysqli_free_result($result); if ($numoftimesanswered > 0) { //The question has been answered before and thus values can be filled in... $sql = 'SELECT answer FROM answers WHERE uid=' . $GLOBALS['locationinfo']['uid'] . ' AND qid=' . $preqid . ' AND answer like "' . $p_id . '%"'; $result = mysqli_query($GLOBALS['conn'],$sql); if (!$result) { mailIt("Could not successfully run query ($sql) from DB: " . mysqli_error($GLOBALS['conn'])); exit; } $row =mysqli_fetch_assoc($result); $answer = $row['answer']; //list($person1, $person2, $person3, $person4, $person5) = explode("::", $answer); $tempArray = explode("::", $answer); $tempArray = array_diff($tempArray, array($p_id)); mysqli_free_result($result); } else { //The question has not been answered before, so values are empty... $tempArray = array(); } } $personSupports[$i] = $tempArray; $i++; } //fifth, the qualities you have, 13 $preqid = 13; //look up answer for qid 13 and store results in array $yourQualities $sql = 'SELECT count(answer) as count from answers where uid=' . $GLOBALS['locationinfo']['uid'] . ' AND qid=' . $preqid; $result = mysqli_query($GLOBALS['conn'],$sql); if (!$result) { mailIt("Could not successfully run query ($sql) from DB: " . mysqli_error($GLOBALS['conn'])); exit; } $row =mysqli_fetch_assoc($result); $numoftimesanswered = $row['count']; mysqli_free_result($result); if ($numoftimesanswered > 0) { //The question has been answered before and thus values can be filled in... $sql = "SELECT answer FROM answers WHERE qid=" . $preqid . " AND uid=" . $GLOBALS['locationinfo']['uid']; $result = mysqli_query($GLOBALS['conn'],$sql); if (!$result) { mailIt("Could not successfully run query ($sql) from DB: " . mysqli_error($GLOBALS['conn'])); exit; } $row =mysqli_fetch_assoc($result); $answer = $row['answer']; //list($person1, $person2, $person3, $person4, $person5) = explode("::", $answer); $yourQualities = explode("::", $answer); mysqli_free_result($result); } else { //The question has not been answered before, so values are empty... $yourQualities = array(); } //sixth, the users name, at the end of 13 //take last entry from array $yourQualities and store in variable $yourName if(isset($yourQualities[count($yourQualities)-1])) { $yourName = $yourQualities[count($yourQualities)-1]; if ($yourName == "Add your own") { $yourName = "You"; } } else { $yourName = "You"; } ?>
 
"; } foreach($personQualities[0] as $qual) { echo " • " . $qual . "
"; } ?>
 
"; } foreach($personQualities[4] as $qual) { echo " • " . $qual . "
"; } ?>
"; } foreach($personQualities[1] as $qual) { echo " • " . $qual . "
"; } ?>
"; } foreach($personQualities[2] as $qual) { echo " • " . $qual . "
"; } ?>
"; } foreach($personQualities[3] as $qual) { echo " • " . $qual . "
"; } ?>

Previous Home