Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. callAjax("http://page.app/serial?" + Date["now"](), function (a) {
  2. console["log"]("resultcheck", a);
  3. try {
  4. a = JSON["parse"](a)
  5. } catch (e) {};
  6. g["freeBussy"] = false;
  7. // Aqui verrifico el id
  8. if (b == a["id"]) {
  9. g["setstatus"](true, a["id"], f);
  10. return c(true)
  11. };
  12. g["setstatus"](false, null, f);
  13. return c(false)
  14. }
  15.  
  16. {"id":2,"email":"user1@gmail.com","name":"User example 1","online":0}
  17.  
  18. [
  19. {"id":2,"email":"user3@gmail.com","name":"User example 3","c":false},
  20. {"id":2,"email":"user2@gmail.com","name":"User example 2","c":false},
  21. {"id":1,"email":"user1@gmail.com","name":"User Example 1","c":false}
  22. ]
  23.  
  24. public function serial(Request $request){
  25. $users = User::select('id','email','name','online')->where('status','=','1')
  26. ->orderBy('id','DESC')
  27. ->get();
  28.  
  29. return response()->json($users);
  30. }
  31.  
  32. callAjax("http://page.app/serial?" + Date["now"](), function (a) {
  33. console["log"]("resultcheck", a);
  34. try {
  35. a = JSON["parse"](a)
  36. } catch (err) {console.log(err)};
  37. g["freeBussy"] = false;
  38. // Aqui verrifico el id
  39. a.forEach(function(a) {
  40. if (b == a["id"]) {
  41. g["setstatus"](true, a["id"], f);
  42. return c(true)
  43. };
  44. });
  45. g["setstatus"](false, null, f);
  46. return c(false)
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement