Example #1
0
function draw_group($group)
{
    $buddys = get_buddys($group);
    $kids = get_kids($group);
    ob_start();
    ?>
	<div class="group_wrapper">
		<?php 
    echo draw_group_info($group);
    ?>
		<br />
		<div class="buddy_list">
			<h3>Faddere</h3>
			<?php 
    foreach ($buddys as $buddy) {
        echo draw_small_profile($buddy->user_id);
        echo "</tr>\n";
    }
    ?>
		</div>
		<div class="kids_list">
			<h3>Barn</h3>
			<?php 
    foreach ($kids as $kid) {
        echo draw_small_profile($kid->user_id);
        echo "</tr>\n";
    }
    ?>
		</div>
	</div>
<?php 
    $data = ob_get_contents();
    ob_end_clean();
    return $data;
}
Example #2
0
		<!-- jQuery library -->
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

		<!-- Bootstrap JavaScript -->
		<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

	</head>

	<body>
		<!-- PHP Form Processing -->
		<?php 
// Variables for the form results
$spouse = $kids = $career = $location = $user = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $spouse = get_spouse($_POST["spouse1"], $_POST["spouse2"], $_POST["spouse3"]);
    $kids = get_kids($_POST["kids"]);
    $career = get_career($_POST["hobby"], $_POST["subject"]);
    $location = get_location($_POST["location"]);
    $user = test_input($_POST["user"]);
    $result = compile_result($spouse, $kids, $career, $location, $user);
}
// Compile the results of the form into HTML to display on the results page
function compile_result($spouse, $kids, $career, $location, $user)
{
    $result = "<h2>For your future, we predict....</h2>" . "<p>You will marry <b>" . $spouse . "</b>." . " For kids...we predict you will have <b>" . $kids . "</b>. Awesome right? " . "<b>" . $career . "</b>" . " Lucky you! You and your family will live in beautiful <b>" . $location . "</b>. Every day is a new adventure there!" . " What do you think <b>" . $user . "</b>? Your future is looking pretty exciting!</p>";
    return $result;
}
// Randomly selects one of the three spouse options
function get_spouse($spouse1, $spouse2, $spouse3)
{
    $spouse1 = test_input($spouse1);