<th>No of Teachers</th> <th>HOD</th> <th>VHOD</th> <th>Action</th> </tr> <?php // an object of class 'DepartmentRepository' is made here // there, it creates objects of 'db' clas and 'Department' class // all database function is in 'db' class and is accessed using the object // setter functions of class 'Department' are accessed from the object of 'Department' // they are used to set the values obtained from database to the private variable in 'Department' // then multiple objects of 'Department' is stored in array in 'DepartmentRepository' // that array is returned here using the object of 'DepartmentRepository' $department_info = new DepartmentRepository(); foreach ($department_info->get_all() as $dept) { ?> <tr> <td><?php echo $dept->get_id(); ?> </td> <td><?php echo $dept->get_name(); ?> </td> <td><?php echo $dept->get_no_of_staff(); ?> </td> <td><?php
<tr> <th colspan="8" class="text-center">department Info<button class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#add_department"><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>Hod</th> <th>Vhod</th> <th>Teacher</th> <th>Floor</th> <th>Action</th> </tr> <?php $department_list = $repository->get_all(); foreach ($department_list as $department) { ?> <tr> <td><input type="checkbox" name="id" value="<?php echo $department->get_id(); ?> "></td> <td><?php echo $department->get_id(); ?> </td> <td><?php echo $department->get_name(); ?> </td>