Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. function get_content() {
  2. global $CFG, $DB;
  3. $courseid = required_param('id', PARAM_INT);
  4. $grade_setting=$DB->get_records('grade_settings', array('courseid' => $courseid));
  5. $results = array();
  6. $new_array = array();
  7. $this->content = new stdClass;
  8. $this->content->footer = '';
  9. foreach ($grade_setting as $rows) {
  10. $results[]=
  11. [
  12. 'id' => $rows->id,
  13. 'courseid' => $rows->courseid,
  14. $rows->name => $rows->value
  15. ];
  16. foreach ($results as $key => $value) {
  17. $new_array= array_merge($new_array,$value);
  18. }
  19. }
  20. foreach ($new_array as $key => $value) {
  21. echo $key. ":".$value;
  22. /* var_dump($abc);*/
  23. };
  24.  
  25. //$this->content->text
  26.  
  27.  
  28. return $this->content;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement