示例#1
0
<?php

require_once 'models/subject.class.php';
require_once 'repository/subjectrepository.class.php';
$repository = new SubjectRepository();
$subject1 = new Subject();
$subject1->initialize(1, "Simulation & Modeling", 45, "Surendra Shakya", "CT 501");
$repository->add($subject1);
$subject2 = new Subject();
$subject2->initialize(2, "Internet & Intranet", 40, "Sajan Thapa", "CT 502");
$repository->add($subject2);
$subject3 = new Subject();
$subject3->initialize(3, "Big Data Technology", 45, "Rajiv Shah", "CT503");
$repository->add($subject3);
include_once 'includes/formvalidation.php';
?>

<?php 
include_once 'includes/header.php';
?>
		<tr>
			<th colspan="7" class="text-center">subject Info<button class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#add_subject"><span class="glyphicon glyphicon-plus"></span></button></th>
		</tr>
		<tr>
			<th><input type="checkbox" id="select_all"/></th>
			<th>Id</th>
			<th>Name</th>
			<th>Hours</th>
			<th>Teacher</th>
			<th>Code</th>
			<th>Action</th>
示例#2
0
<table class="table table-bordered table-striped table-hover">
	<tr>
		<th colspan="6" class="text-center">SUBJECTS<button role="button" class="btn btn-xs btn-success pull-right"><span class="glyphicon glyphicon-plus"></span></button></th>
	</tr>
	
	<tr>
		<th>Id</th>
		<th>Name</th>
		<th>Code</th>
		<th>Hours</th>
		<th>Program</th>
		<th>Action</th>
	</tr>

	<?php 
$subject_info = new SubjectRepository();
foreach ($subject_info->get_all() as $sub) {
    ?>
		<tr>
			<td><?php 
    echo $sub->get_id();
    ?>
</td>
			<td><?php 
    echo $sub->get_name();
    ?>
</td>			
			<td><?php 
    echo $sub->get_code();
    ?>
</td>