function getListAdmin(QuestionBank $obj) { $course = new Course(); $list = $obj->getList(array('id', 'name', 'course')); $result = array(); $i = 0; foreach ($list as $item) { $result[$i]['id'] = $item['id']; $result[$i]['name'] = $item['name']; $result[$i]['course'] = $item['course']; $result[$i++]['course_name'] = $course->getInfo($item['course'], 'course_name'); } return $result; }
} ?> </select> </div> <div class="control-group"> <button type="submit" class="btn btn-primary" style="margin-top: 20px;">Create</button> </div> </div> </div> </form> </div> </div> </div> <div class = "qb-data hidden"> <?php $list = $obj->getList(array('id', 'name', 'course')); $result = array(); $i = 0; foreach ($list as $item) { $result[$i]['id'] = $item['id']; $result[$i]['name'] = $item['name']; $result[$i]['course'] = $item['course']; $result[$i++]['course_name'] = $course->getInfo($item['course'], 'course_name'); } echo json_encode($result); ?> </div> <script> $(document).ready(function(){ $("[data-toggle='tooltip'").tooltip(); });