Ejemplo n.º 1
0
<?php

include '../includes/config.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $subject = $_POST["subjectid"];
    $arr = getbooks($subject);
    echo json_encode($arr);
    //echo json_encode((getsubjects($stream,$sem));
} else {
    redirect("/");
}
Ejemplo n.º 2
0
        echo '<option value="' . $value["subjectid"] . '">' . $value["subjectname"] . '</option>';
    }
}
?>
			</select>
		</div>
		<div class="input-field col s2">
			<button type="submit" class="btn">Go</button>
		</div>
		</form>
	</div>


	<div class="row">
		<?php 
$books = getbooks($_GET["subject"]);
foreach ($books as $value) {
    ?>

		 <div class="col s12 m4">
          <div class="card">
            <div class="card-image">
              <img src="img/book_cover_placeholder.png">
              <span class="card-title"><?php 
    echo $value["bookname"];
    ?>
</span>
            </div>
            <div class="card-content">
              <p><?php 
    echo $value["bookauthor"];