Guest User

Untitled

a guest
May 11th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 3.78 KB | None | 0 0
  1. <script>
  2.      $(document).ready(function() {
  3.                      $.ajax({
  4.                     url: 'login.php',
  5.                     type: 'post',
  6.                     data: {
  7.                         type: 'get_customer'
  8.                     },
  9.  
  10.                     success: function(response) {
  11.                         var msg = '';
  12.                         if (response != '') {
  13.                             $(function() {
  14.                                 var json_obj = $.parseJSON(response);
  15.                                 console.log(json_obj)
  16.                                 var output='';
  17.                                 for (var i in json_obj)
  18.                                 {
  19.                                     output+= ' <tr>';
  20.                                     output+= ' <td width="5%"><i class="fa fa-bell-o"></i></td>';
  21.                                     output+= ' <td>' + json_obj[i].name + ',  ' + json_obj[i].surname +'</td>';
  22.                                     output+= ' <td>';
  23.                                     output+= '<div class="dropdown is-hoverable">';
  24.                                     output+= '  <div class="dropdown-trigger">';
  25.                                     output+= '    <button class="button" aria-haspopup="true" aria-controls="dropdown-menu">';
  26.                                     output+= '      <span>Zarzadzaj</span>';
  27.                                     output+= '      <span class="icon is-small">';
  28.                                     output+= '        <i class="fa fa-angle-down" aria-hidden="true"></i>';
  29.                                     output+= '      </span>';
  30.                                     output+= '     </button>';
  31.                                     output+= '  </div>';
  32.                                     output+= '  <div class="dropdown-menu" id="dropdown-menu" role="menu">';
  33.                                     output+= '    <div class="dropdown-content">';
  34.                                     output+= '      <a href="#" class="dropdown-item">';
  35.                                     output+= '        Edytuj';
  36.                                     output+= '      </a>';
  37.                                     output+= '      <a class="dropdown-item">';
  38.                                     output+= '        Historia';
  39.                                     output+= '      </a>';
  40.                                     output+= '      <a href="#" class="dropdown-item ">';
  41.                                     output+= '        Napisz wiadomość';
  42.                                     output+= '      </a>';
  43.                                     output+= '      <hr class="dropdown-divider">';
  44.                                     output+= '      <div class="dropdown-item is-warning">';
  45.                                     output+= '      <p> Ta operacja nie <strong> może być cofnięta!</strong></p>';
  46.                                     output+= '      </div>';
  47.                                     output+= '      <a id="' + json_obj[i].ids +'" href="#" class="del dropdown-item ">';
  48.                                     output+= '        Usuń';
  49.                                     output+= '      </a>';
  50.                                     output+= '    </div>';
  51.                                     output+= '  </div>';
  52.                                     output+= '</div>';
  53.                                     output+= '</td>';
  54.                                     output+= '</tr>';
  55.                                                                     }
  56.                                 $('#table').html(output);
  57.                             });
  58.                         }  else {
  59.                             $('#table').text('Niedziała');
  60.                         }
  61.                     }
  62.                 });
  63.             });
  64.    
  65.     </script>
Advertisement
Add Comment
Please, Sign In to add comment