private function createDesc($currentParentID) { require_once 'connectdb.php'; //Create new connection object. $desc_connection = new connectdb(); //Return connection object. $con = $desc_connection->make_connection(); //Set query to get all children of current parent. $query = "SELECT * FROM relation WHERE parentID='{$currentParentID}'"; //Get result set. $setChild = mysqli_query($con, $query); echo "<ul>"; //For each child.. while ($row = mysqli_fetch_array($setChild)) { //Print a new list element and depending on if they have a spouse or not print thier name. echo "<li>"; if ($row['Spouse'] != '') { echo "<a href='#'>" . $row['fName'] . " / " . $row['Spouse'] . "</a>"; } else { echo "<a href='#'>" . $row['fName'] . "</a>"; } //Recusively call createDesc and pass the current relation. $this->createDesc($row['relationID']); echo "</li>"; } echo "</ul>"; //Close connection. mysqli_close($con); }
public function echoIndexes($indexes) { //Container for list of start nodes. echo "<div class='family-starts'>"; echo "<p>Click the family line you want to view..</p>"; echo "<ul>"; //Create new connection object. $connect = new connectdb(); //Return connection object. $con = $connect->make_connection(); //Generate the query using the indexes. $query = $this->genQuery($indexes); //Execute Query. $set = mysqli_query($con, $query); //Print the result set. $this->echoResults($set); //Close connection. mysqli_close($con); //end list echo "</ul>"; //end current block echo "</div>"; }
mysqli_close($con); ?> <hr id='time-line' /> <div id='min-date'><?php echo $min; ?> </div> <div id='max-date'><?php echo $max; ?> </div> <?php //Create connection object. $connection = new connectdb(); //Get the connection. $con = $connection->make_connection(); //Build query to determine number of unknowns. $query = "SELECT COUNT(*) AS num FROM relation WHERE YearOfBirth=0"; //Execute query. $set = mysqli_query($con, $query); //Fetch Array. $row = mysqli_fetch_array($set); //Print result. echo "There are " . $row['num'] . " family members with birth years which are unknown."; ?> </div> <!-- end content --> <!-- footer -->