Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <script type="text/javascript">
  8. $(document).ready(function(){
  9.  
  10. });
  11. function sendPushNotification(id){
  12. echo ('I am in Send Push Nottification');
  13. var data = $('form#'+id).serialize();
  14. $('form#'+id).unbind('submit');
  15. $.ajax({
  16. url: "send_message.php",
  17. type: 'GET',
  18. data: data,
  19. beforeSend: function() {
  20.  
  21. },
  22. success: function(data, textStatus, xhr) {
  23. $('.txt_message').val("");
  24. },
  25. error: function(xhr, textStatus, errorThrown) {
  26.  
  27. }
  28. });
  29. echo ('I am in Send Push Nottification');
  30. return false;
  31. }
  32. </script>
  33. <style type="text/css">
  34. .container{
  35. width: 950px;
  36. margin: 0 auto;
  37. padding: 0;
  38. }
  39. h1{
  40. font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  41. font-size: 24px;
  42. color: #777;
  43. }
  44. div.clear{
  45. clear: both;
  46. }
  47. ul.devices{
  48. margin: 0;
  49. padding: 0;
  50. }
  51. ul.devices li{
  52. float: left;
  53. list-style: none;
  54. border: 1px solid #dedede;
  55. padding: 10px;
  56. margin: 0 15px 25px 0;
  57. border-radius: 3px;
  58. -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  59. -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  60. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  61. font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  62. color: #555;
  63. }
  64. ul.devices li label, ul.devices li span{
  65. font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  66. font-size: 12px;
  67. font-style: normal;
  68. font-variant: normal;
  69. font-weight: bold;
  70. color: #393939;
  71. display: block;
  72. float: left;
  73. }
  74. ul.devices li label{
  75. height: 25px;
  76. width: 50px;
  77. }
  78. ul.devices li textarea{
  79. float: left;
  80. resize: none;
  81. }
  82. ul.devices li .send_btn{
  83. background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
  84. background: -webkit-linear-gradient(0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
  85. background: -moz-linear-gradient(center top, #0096FF, #005DFF);
  86. background: linear-gradient(#0096FF, #005DFF);
  87. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  88. border-radius: 3px;
  89. color: #fff;
  90. }
  91. </style>
  92. </head>
  93. <body>
  94. <?php
  95. require_once('db_functions.php');
  96. $db = new DB_Functions();
  97. $users = $db->getAllUsers();
  98. if ($users != false)
  99. $no_of_users = mysql_num_rows($users);
  100. else
  101. $no_of_users = 0;
  102. ?>
  103. <div class="container">
  104. <h1>No of Devices Registered: <?php echo $no_of_users; ?></h1>
  105. <hr/>
  106. <ul class="devices">
  107. <?php
  108. if ($no_of_users > 0) {
  109. ?>
  110. <?php
  111. while ($row = mysql_fetch_array($users)) {
  112. ?>
  113. <li>
  114. <form id="<?php echo $row["id"] ?>" name="" method="post"
  115. onsubmit="return sendPushNotification('<?php echo $row["id"] ?>')">
  116. <label>Name: </label> <span><?php echo $row["name"] ?></span>
  117. <div class="clear"></div>
  118. <label>Email:</label> <span><?php echo $row["email"] ?></span>
  119. <div class="clear"></div>
  120. <div class="send_container">
  121. <textarea rows="3" name="message" cols="25" class="txt_message"
  122. placeholder="Type message here"></textarea>
  123. <input type="hidden" name="regId" value="<?php echo $row["gcm_regid"] ?>"/>
  124. <input type="submit" class="send_btn" value="Send" onclick=""/>
  125. </div>
  126. </form>
  127. </li>
  128. <?php }
  129. } else { ?>
  130. <li>
  131. No Users Registered Yet!
  132. </li>
  133. <?php } ?>
  134. </ul>
  135. </div>
  136. </body>
  137. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement