Guest User

Untitled

a guest
Jul 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. $html .= '<form id="status_form">';
  2. foreach ($leads as $key => $type) {
  3. $html .= '<input type="checkbox" name"' . $key . '" id="' . $key . '" class="box_status" value="1"';
  4. if (something = true) {
  5. $html .= ' checked="checked"';
  6. }
  7. $html .= ' />';
  8. $html .= '<label class="checkbox-inline" for"' . $key . '">' . $type . ' (' . @$count[$key] . ')</label>';
  9. }
  10. $html .= '</form>';
  11.  
  12. echo $html;
  13.  
  14. function update_report() {
  15. var form_data = $("#status_form").serialize();
  16. $.ajax({
  17. type: 'POST',
  18. url: 'scripts/test.php',
  19. data: form_data,
  20. success: function() {
  21. window.location.reload(true);
  22. }
  23. });
  24. }
  25.  
  26. $('.box_status').change(function(){
  27. update_report();
  28. });
  29.  
  30. session_start();
  31.  
  32. if (isset ($_POST)) {
  33.  
  34. $_SESSION['crm']['reports']['index'] = array();
  35.  
  36. foreach ($_POST as $k => $v) {
  37. $_SESSION['crm']['reports']['index'][] = $k;
  38. }
  39.  
  40. $_SESSION['post'] = $_POST;
  41.  
  42. echo true;
  43. }
Add Comment
Please, Sign In to add comment