PageRenderTime 56ms CodeModel.GetById 36ms RepoModel.GetById 1ms app.codeStats 0ms

/application/views/admin/feedback_js.php

https://github.com/surflightroy/Ushahidi_Web
PHP | 55 lines | 26 code | 9 blank | 20 comment | 7 complexity | 1b9131729de3fdeb1cd5ee0dabc6cfbc MD5 | raw file
  1. /**
  2. * Main reports js file.
  3. *
  4. * Handles javascript stuff related to reports function.
  5. *
  6. * PHP version 5
  7. * LICENSE: This source file is subject to LGPL license
  8. * that is available through the world-wide-web at the following URI:
  9. * http://www.gnu.org/copyleft/lesser.html
  10. * @author Ushahidi Team <team@ushahidi.com>
  11. * @package Ushahidi - http://source.ushahididev.com
  12. * @module API Controller
  13. * @copyright Ushahidi - http://www.ushahidi.com
  14. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
  15. */
  16. <?php require SYSPATH.'../application/views/admin/form_utils_js.php' ?>
  17. // Ajax Submission
  18. function feedbackAction ( action, confirmAction, feedback_id )
  19. {
  20. var statusMessage;
  21. if( !isChecked( "feedback" ) && feedback_id=='' )
  22. {
  23. alert('Please select at least one feedback item.');
  24. } else {
  25. var answer = confirm('Are You Sure You Want To ' + confirmAction + ' items?')
  26. if (answer){
  27. // Set Submit Type
  28. $("#action").attr("value", action);
  29. if (feedback_id != '')
  30. {
  31. // Submit Form For Single Item
  32. $("#feedback_single").attr("value",feedback_id);
  33. $("#feedbackMain").submit();
  34. }
  35. else
  36. {
  37. // Set Hidden form item to 000 so that it doesn't return server side error for blank value
  38. $("#feedback_single").attr("value", "000");
  39. // Submit Form For Multiple Items
  40. $("#feedbackMain").submit();
  41. }
  42. } else {
  43. return false;
  44. }
  45. }
  46. }