reports.cli.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. require_once 'reports.lib.php';
  3. $longopts = array(
  4. 'course:',
  5. 'tool:',
  6. 'ci:',
  7. 'cn:',
  8. 'sci:',
  9. 'scn:',
  10. 'ssci:',
  11. 'sscn:',
  12. 'link:',
  13. 'addValue',
  14. 'addKey',
  15. 'help',
  16. 'clearAll',
  17. 'score:',
  18. 'progress:',
  19. 'time:',
  20. 'attempt:',
  21. 'session:',
  22. 'attempt:',
  23. 'uid:',
  24. 'key:',
  25. 'addDBKeys',
  26. 'build');
  27. $options = getopt("", $longopts);
  28. echo "\n\n";
  29. if (array_key_exists('help', $options))
  30. echo "help message\n";
  31. else if (array_key_exists('clearAll', $options)) {
  32. reports_clearAll();
  33. echo Database::error();
  34. } else if (array_key_exists('build', $options)) {
  35. reports_build();
  36. echo Database::error();
  37. } else if (array_key_exists('addDBKeys', $options)) {
  38. reports_addDBKeys();
  39. echo Database::error();
  40. } else if (array_key_exists('addValue', $options)) {
  41. reports_addValue($options['key'], $options['session'], $options['uid'],
  42. $options['attempt'], $options['score'],
  43. $options['progress'], $options['time']);
  44. echo Database::error();
  45. } else if (array_key_exists('addKey', $options)) {
  46. echo reports_addKey($options['course'], $options['tool'],
  47. $options['ci'], $options['cn'],
  48. $options['sci'], $options['scn'],
  49. $options['ssci'], $options['sscn'],
  50. $options['link']);
  51. echo "\n";
  52. echo Database::error();
  53. } else
  54. echo "action not found\n";
  55. echo "\n";
  56. ?>