Example #1
0
    $result = $conn->query($sql);
    $rows = mysqli_fetch_row($result);
    echo $rows[0];
    ?>
) </h4>
        <br>

        <?php 
    $user_id = $_SESSION['myid'];
    $sql = "SELECT * FROM plan WHERE user_id=2";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        echo "<table class='span5 center-table'><tr>\n\n    <th>&nbsp;</th>\n    <th>Plan Name</th>\n    <th>&nbsp;&nbsp;&nbsp;</th>\n    <th>Description</th>\n    <th>&nbsp;&nbsp;Difficulty</th></tr>";
        // output data of each row
        while ($row = $result->fetch_assoc()) {
            $findlevel = ExerciseLevel::find_by_id($id = $row["plan_difficulty"]);
            echo "<tr>\n                \n\t\t<td>&nbsp;</td>\n        <td><a href='userplan.php?id=" . $row['id'] . "'><h4>" . $row["plan_name"] . "</h4></a></td>\n        <td>&nbsp;</td>\n        <td><h4>" . $row["plan_description"] . "</h4></td>\n        <td><h4>&nbsp;&nbsp;" . $findlevel->level . "</h4></td></tr>\n\n        ";
        }
        echo "</table>";
    } else {
        echo "<div class='text-center'>Hey newbie, you don't have a Plan yet!</div>";
    }
    ?>

        <br>
        <br>


        <a href="addplan.php"><h4 style='text-align: center;'>(+) Add Plan</h4></a>

                
Example #2
0
    background-color: #eee;
    cursor: -webkit-grab;
    max-width: 144px;
    font-size: large; }

</style>

	<div id="main">
    <div class="maininfo2">
    	
    	<br>
    	
    	<?php 
$plan = $_REQUEST["id"];
$findplan = Plan::find_by_id($id = $plan);
$findlevel = ExerciseLevel::find_by_id($id = $findplan->plan_difficulty);
echo "\n    \t<h2 style='text-align: center;'>" . $findplan->plan_name . "</h2>\n    \t<h4 style='text-align: center;'>Description: " . $findplan->plan_description . "</h4>\n    \t<h4 style='text-align: center;'>Difficulty: " . $findlevel->level . "</h4>";
?>
    	
    	

<div class="row">
	<div class="col-xs-6">
		
		<h3 style='text-align: center;'>Exercise Days: </h3>
		<br>
		
		<div id='sortable'>
			
	<?php 
$results = PlanDays::find_all_by_plan_id($id = $plan);