Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <form target="iframe_b" action="/php_src/first.php" method="POST"
  2. echo "sending data">
  3.  
  4. fieldset>
  5. <legend style="font-size:150%"><b>send MTData</b></legend>
  6. <br><br>
  7. <input type="button" id="select_all" name="select_all" value="Select All">
  8. <input type="button" id="de_select_all" name="de_select_all" value="DeSelect All">
  9. <br><br>
  10. <input type="submit" value="Submit">
  11.  
  12. <?php
  13. $dbhost = 'localhost:3036';
  14. $dbuser = 'root';
  15. $dbpass = 'XXXX';
  16. $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  17. if (!$conn) {
  18. die('Could not connect: ' . mysql_error());
  19. }
  20. mysql_select_db("ApplicationServer") or die(mysql_error());
  21. // Get all the data from the "example" table
  22. $result = mysql_query("SELECT EXTERNAL_ID,CONNECTION_STATUS FROM DEVICE_DETAILS") or die(mysql_error());
  23. echo "<table border='1'>";
  24. echo "<tr><th>Selection</th> <th>External ID</th> <th>Device status</th> <th>MT data<th> </tr>";
  25. while ($row = mysql_fetch_array($result)) {
  26. // Print out the contents of each row into a table
  27. $temp = $row['EXTERNAL_ID'];
  28. echo "<tr><td>";
  29. echo "<input type="checkbox" id="id_extID" name="yourCheckboxName".$temp."" />";
  30. echo "<td>";
  31. echo $row['EXTERNAL_ID'];
  32. echo "</td><td>";
  33. echo $row['CONNECTION_STATUS'];
  34. echo "</td><td>";
  35. echo "<input type="textbox" name="textboxName".$temp."" size="50" value = "$temp._data" />";
  36. echo "</td></tr>";
  37. }
  38. echo "</table>";
  39. mysql_close($conn);
  40.  
  41. <script type="text/javascript">
  42.  
  43. $('#select_all').click(function() {
  44. $('#id_extID option').prop('selected', true);
  45. });
  46.  
  47.  
  48. $('#de_select_all').click(function() {
  49. $('#id_extID option').prop('selected', false);
  50. });
  51. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement