Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. <head>
  2. <meta name="viewport" content="width=device-width, initial-scale=1" />
  3.  
  4. <?php
  5. include 'config/config.php';
  6.  
  7. ?>
  8. <style type="text/css">
  9.  
  10. #myInput {
  11. background-position: 10px 12px;
  12. background-repeat: no-repeat;
  13. width: 25%;
  14. font-size: 16px;
  15. padding: 12px 20px 12px 40px;
  16. border: 1px solid #ddd;
  17. margin-bottom: 12px;
  18. }
  19. #products {
  20. border-collapse: collapse;
  21. width: 100%;
  22. border: 1px solid #ddd;
  23. font-size: 18px;
  24. }
  25.  
  26. #products th, #products td {
  27. text-align: left;
  28. padding: 12px;
  29. }
  30.  
  31. #products tr {
  32.  
  33. border-bottom: 1px solid #ddd;
  34. }
  35.  
  36. #products tr.header, #products tr:hover {
  37.  
  38. background-color: #f1f1f1;
  39. }
  40.  
  41.  
  42.  
  43. </style>
  44. </head>
  45.  
  46.  
  47. <input type="text" id="myInput" onkeyup="imwireless()" placeholder="Search for location..">
  48.  
  49. <script>
  50. function imwireless() {
  51.  
  52. var input, filter, table, tr, td, i, txtValue;
  53. input = document.getElementById("myInput");
  54. filter = input.value.toUpperCase();
  55. table = document.getElementById("products");
  56. tr = table.getElementsByTagName("tr");
  57.  
  58. for (i = 0; i < tr.length; i++) {
  59. td = tr[i].getElementsByTagName("td")[0];
  60. if (td) {
  61. txtValue = td.textContent || td.innerText;
  62. if (txtValue.toUpperCase().indexOf(filter) > -1) {
  63. tr[i].style.display = "";
  64. } else {
  65. tr[i].style.display = "none";
  66. }
  67. }
  68. }
  69. }
  70. </script>
  71.  
  72. <?php
  73.  
  74.  
  75.  
  76. ############## Make the mysql connection ###########
  77. try {
  78. $db = new PDO("mysql:host=$hostname;dbname=realestate", $username, $password);
  79. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  80. $i_d = $_POST['search'];
  81.  
  82.  
  83.  
  84.  
  85.  
  86. ////////This is the main table for keywords//////////
  87.  
  88. $count = $db->exec($sql);
  89. $sql = "Select * from realestate WHERE Store_City_State LIKE '%" . $i_d . "%' OR Store_Street_Address LIKE '%" . $i_d . "%' ";
  90. $result = $db->query($sql);
  91. echo "<table id='products'>";
  92. echo'<tr class="header" id="top" style="background-color:#fff111"> ';
  93. echo"<td>Store City State #</td>";
  94. echo"<td id='name'>Store_Street_Address</td>";
  95. echo"<td>Current Lease?</td>";
  96. echo"<td>Monthly Rent</td>";
  97. echo"<td>Lease Expire Date</td>";
  98. echo"<td>Open Date</td>";
  99. echo"<td>Notes on Location</td>";
  100. foreach ($result as $data) {
  101. echo '
  102. <tr style="background-color:#34495E;">
  103. <td id="city">'.$data["Store_City_State"].'</td>
  104. <td id="address">'.$data["Store_Street_Address"].'</td>
  105. <td id="lease">'.$data["Do_we_have_a_current_valid_Lease"].'</td>
  106. <td id="rent">'.$data["Current_Monthly_Rent_including_Triple_Net"].'</td>
  107. <td id="expdate">'.$data["Lease_expiration_date"].'</td>
  108. <td id="opendate">'.$data["Store_opening_date"].'</td>
  109. <td id="notes">'.$data["notes"].'</td>';
  110.  
  111.  
  112.  
  113.  
  114. }
  115. echo "</tr></table>";
  116. //echo 'entry succesfull';
  117. $db = null; // close the database connection
  118.  
  119. }
  120. catch(PDOException $e) {
  121. echo $e->getMessage();
  122. }
  123.  
  124. ///////// END MAIN TABLE/////////////////////////
  125. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement