Пример #1
0
echo '<div class="row">' . PHP_EOL;
while ($row = $stmt->fetch()) {
    echo '<div class="col-md-4 text-centered">' . PHP_EOL;
    echo "<a class=\"subj_btn\" href=\"selectDecks.php?subj={$row['subj_id']}\">";
    echo "{$row['subject_name']}</a>" . PHP_EOL;
    echo '</div>' . PHP_EOL;
    $counter += 4;
    $total++;
    if ($counter == 12) {
        echo '</div>' . PHP_EOL;
        // close the row
        echo '<div class="row">' . PHP_EOL;
        // start a new one
        $counter = 0;
    }
}
echo '</div>' . PHP_EOL;
// close the last row
if ($total != $numSubjs) {
    echo '<div class="text-centered">' . PHP_EOL;
    echo '<a class="btn btn-lg btn-default">Add a Subject</a>' . PHP_EOL;
    echo '</div>' . PHP_EOL;
}
?>
	
</div>

<?php 
// end the template code
end_template();
//*****************************************************************************
Пример #2
0
function show_forms($err1 = "", $err2 = "")
{
    $cssFiles = array();
    $cssFiles[] = 'css/signin.css';
    start_template($cssFiles);
    ?>
	
	<div class="container-fluid bg-1">
		<div class="form_err" id="error1"><?php 
    echo $err1;
    ?>
</div>
		<h2>Sign In Here</h2>
		<div id="signin_form">
			<form method="post" action="" accept-charset="UTF-8">
				<div class="form-group">
					<label for="user_or_email">Username or Email</label>
					<input type="text" class="form-control" id="user_or_email" 
						name="user_or_email" maxlength="255" required>
				</div>
				<div class="form-group">
					<label for="pwd">Password</label>
					<input type="password" class="form-control" id="pwd"
						name="password" maxlength="255" required>
				</div>
				<input type="hidden" name="signin" value="true">
				<input type="submit" value="Submit" class="btn btn-default">
			</form>
		</div>
	</div>

	<div class="container-fluid bg-2">
		<div class="form_err" id="error2"><?php 
    echo $err2;
    ?>
</div>
		<h2>Don't have an account?</h2>
		<h3>
			No problem! Get access to hundreds of flashcards and quizzes
			generated by students and professors alike by creating an
			account below.
		</h3>
		<div id="signin_form">
			<form method="post" action="" accept-charset="UTF-8">
				<div class="form-group">
					<label for="des_username">Desired Username</label>
					<input type="text" class="form-control" id="des_username"
						name="des_username" maxlength="255">
				</div>
				<div class="form-group">
					<label for="des_email">Desired Email</label>
					<input type="text" class="form-control" id="des_email"
						name="des_email" maxlength="255">
				</div>
				<div class="form-group">
					<label for="">User Type</label>
					<div class="radio">
						<label>
							<input type="radio" name="type" value="0">
							Student
						</label>
					</div>
					<div class="radio">
						<label>
							<input type="radio" name="type" value="1">
							Teacher
						</label>
					</div>
				</div>
				<div class="form-group">
					<label for="des_pwd">Set Password</label>
					<input type="password" class="form-control" id="des_pwd"
						maxlength="255" name="des_pwd">
				</div>
				<div class="form-group">
					<label for="des_pwd2">Re-enter Password</label>
					<input type="password" class="form-control" id="des_pwd2"
						maxlength="255" name="des_pwd2">
				</div>
				<input type="hidden" name="create" value="true">
				<input type="submit" value="Submit" class="btn btn-default">
			</form>
		</div>
	</div>

	<?php 
    end_template();
    exit;
}