Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. function activeuser(userId) {
  2. $.post("/admin/activate_user", {
  3. userid: userId
  4. }, function (response) {
  5. });
  6. }
  7.  
  8. <span id="enable<?=$user->id; ?>" class="cb-enable <?=$active_class;?>" onclick="return activeuser(<?= $user->id ?>);"><span>Active</span></span>
  9. <span id="disenable<?=$user->id; ?>" class="cb-disable <?=$deactive_class;?>" onclick="return deactiveuser(<?= $user->id ?>);"><span>De-active</span></span>
  10.  
  11. if($('#thatSpan').hasClass('cb-enable') && $('#thatSpan').hasClass('selected'))
  12. {
  13. //your code goes here.
  14. }
  15.  
  16. if($('#thatSpan').is('.cb-enable.selected'))
  17. {
  18. //your code goes here.
  19. }
  20.  
  21. function activeuser(userId){
  22. if(! ($(this).hasClass('cb-enable') && $(this).hasClass('selected')) ){
  23. $.post("/admin/activate_user",
  24. {
  25. userid: userId
  26. },
  27. function(response){
  28. if(response == "active"){
  29. $('#enable'+userId).addClass('selected');
  30. $('#disenable'+userId).removeClass('selected');
  31. $('#disenable'+userId).addClass('pointer');
  32. $('#enable'+userId).removeClass('pointer');
  33. }
  34. });
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement