$bpr_object = new BusPersonnelRole(); ?> <option value="<?php echo $bus_person->id; ?> ">Name: <?php echo $bp_object->find_by_id($bus_person->id)->first_name; ?> <?php echo $bp_object->find_by_id($bus_person->id)->last_name; ?> · NIC Number: <?php echo $bp_object->find_by_id($bus_person->id)->nic_number; ?> · Role: <?php echo $bpr_object->find_by_id($bp_object->find_by_id($bus_person->id)->role)->role_name; ?> </option> <?php } ?> </select> </div> </div> <div class="form-actions"> <button class="btn btn-primary" name="assign">Assign</button> </div> </form>
} echo '</select>'; echo '</div>'; } else { if ($selected_object_type->object_type_name == 'bus') { echo '<label for="bus_id" class="control-label">Bus</label>'; echo '<div class="controls">'; echo '<select name="bus_id">'; foreach ($buses as $bus) { echo '<option value="' . $bus->id . '">'; echo $bus_route_object->find_by_id($bus->route_id)->route_number . ' - ' . $bus->reg_number; echo '</option>'; } echo '</select>'; echo '</div>'; } else { if ($selected_object_type->object_type_name == 'bus_personnel') { echo '<label for="bus_personnel_id" class="control-label">Bus Personnel</label>'; echo '<div class="controls">'; echo '<select name="bus_personnel_id">'; foreach ($bus_personnel as $bp) { echo '<option value="' . $bp->id . '">'; echo $bp->full_name() . ' - ' . $bp_role->find_by_id($bp->role)->role_name; echo '</option>'; } echo '</select>'; echo '</div>'; } } } }