Advertisement
Guest User

Untitled

a guest
Sep 12th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.50 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <?php
  4.  
  5. $servername = "localhost";
  6. $username = "root";
  7. $password = "";
  8. $dbname = "db_dealer_track";
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10.  
  11. if($conn->connect_error){
  12. die("Connection failed". $conn->connect_error);
  13. }
  14.  
  15.  
  16. if(isset($_POST['id1'])){
  17.  
  18. $sql = "SELECT * FROM tbl_dealer_info ";
  19. $sql .= "WHERE $account_name = 'account_name' ";
  20. $result = mysqli_query($conn, $sql);
  21. while($row = mysqli_fetch_array($result)){
  22.  
  23.  
  24. ?>
  25.  
  26. <html>
  27. <head>
  28. <title>iMobile </title>
  29. </head>
  30. <body bgcolor = "#D6DFE3">
  31. <center><b><h2>Please enter the following information: </h2></b></center>
  32.  
  33. <form action = "dealer_track.php" method = "post">
  34. <strong><center> <u>Fields marked with an asterisk(*) are required.</u><br><br>
  35. Name of the dealer:*
  36. <?php
  37. $sql = "SELECT account_name FROM tbl_dealer_info ";
  38. $result = mysqli_query($conn, $sql);
  39. echo "<select name = 'account_name' id = 'id'>";
  40. echo "<option value = ''>";
  41. while($row = mysqli_fetch_array($result)){
  42. echo "<option value = '" .$row['account_name'] . "'>" . $row['account_name'] . "</option>";
  43. }
  44. echo "</select>";
  45. ?>
  46. <br><br>
  47. <input type = submit id = "id1" name = "id1" value = "Display the fields" /><br>
  48. </center>
  49. <hr>
  50. <br><br>
  51.  
  52. Phone:*<br>
  53. <input type = "tel" name = "phone" pattern= "^d{3}-d{3}-d{4}$" onkeyup = "validate()" id = "id2" Required /><br><br>
  54.  
  55. // This is one of the things I tried to do with the value attribute. Still didn't work
  56. Email:*<br>
  57. <input type = "email" name = "email" id = "id3" value = "<?php echo $row['email']?>" Required /><br><br>
  58.  
  59. SFID:*<br>
  60. <input type = "text" name = "sfid" id = "id4" Required /><br><br>
  61.  
  62. Account Name:*<br>
  63. <input type = "text" name = "account_name" id = "id5" Required /><br><br>
  64. Parent Account:*<br>
  65. <input type = "text" name = "parent_account" id = "id6" Required /><br><br>
  66. AWI Code:*<br>
  67. <input type = "text" name = "awi_code" id = "id7" Required /><br><br>
  68. Sales Portal Id:*<br>
  69. <input type = "text" name = "sales_portal_id" id = "id8" Required /><br><br>
  70. IAE:*<br>
  71. <input type = "text" name = "iae" id = "id9" Required /><br><br>
  72. RSM:*<br>
  73. <?php
  74. $sql = "SELECT rsm_val FROM tbl_rsm_drop_down ";
  75. $result = mysqli_query($conn, $sql);
  76. echo "<select name = 'rsm_val'>";
  77. echo "<option value = ''></option>";
  78. while($row = mysqli_fetch_array($result)){
  79. echo "<option value = '" .$row['rsm_val'] . "'>" . $row['rsm_val'] . "</option>";
  80. }
  81. echo "</select>";
  82. ?>
  83. <br><br>
  84. Prepaid Door Type:*<br>
  85. <?php
  86. $sql = "SELECT door_type_val FROM tbl_door_type_drop_down ";
  87. $result = mysqli_query($conn, $sql);
  88. echo "<select name = 'door_type_val'>";
  89. echo "<option value = ''></option>";
  90. while($row = mysqli_fetch_array($result)){
  91. echo "<option value = '" .$row['door_type_val'] . "'>" . $row['door_type_val'] . "</option>";
  92. }
  93. echo "</select>";
  94. ?>
  95. <br><br>
  96. Payment Method:*<br>
  97. <?php
  98. $sql = "SELECT payment_method_val FROM tbl_payment_method_drop_down ";
  99. $result = mysqli_query($conn, $sql);
  100. echo "<select name = 'payment_method_val'>";
  101. echo "<option value = ''></option>";
  102. while($row = mysqli_fetch_array($result)){
  103. echo "<option value = '" .$row['payment_method_val'] . "'>" . $row['payment_method_val'] . "</option>";
  104. }
  105. echo "</select>";
  106. ?>
  107. <br><br>
  108. Region:*<br>
  109. <?php
  110. $sql = "SELECT region_val FROM tbl_region_drop_down";
  111. $result = mysqli_query($conn, $sql);
  112. echo "<select name = 'region_val'>";
  113. echo "<option value = ''></option>";
  114. while($row = mysqli_fetch_array($result)){
  115. echo "<option value = '" .$row['region_val'] . "'>" . $row['region_val'] . "</option>";
  116. }
  117. echo "</select>";
  118. ?>
  119. <br>
  120. <div align = "center" style= "margin-top:-44em">
  121. Street Address:*<br>
  122. <textarea name = "street_address" value = "street_address" Required /></textarea><br>
  123. City:*<br>
  124. <input type = "text" name = "city" id = "id15" Required /><br>
  125. State:*<br>
  126. <input type = "text" name = "state" id = "id16" Required /><br>
  127. Zip code:*<br>
  128. <input type = "text" name = "zip" id = "id17" Required /><br>
  129. Area:*<br>
  130. <input type = "text" name = "area" id = "id18" Required /><br>
  131. Market:*<br>
  132. <input type = "text" name = "market" id = "id19" Required /><br><br>
  133. iPhone Boost Approved:
  134. <input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="Yes")?> value = "Yes" />Yes
  135. <input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="No")?> value = "No" />No<br><br>
  136. iPhone Virgin Approved:
  137. <input type = "radio" name = "virgin_app" <?php if(isset($virgin_app)&& $virgin_app =="Yes")?> value = "Yes" />Yes
  138. <input type = "radio" name = "virgin_app" <?php if(isset($virgin_app)&& $virgin_app =="No")?> value = "No" />No<br><br>
  139. VirginMobile Approved:
  140. <input type = "radio" name = "virgin_mob_app" <?php if(isset($virgin_mob_app)&& $virgin_mob_app =="Yes")?> value = "Yes" />Yes
  141. <input type = "radio" name = "virgin_mob_app" <?php if(isset($virgin_mob_app)&& $virgin_mob_app =="No")?> value = "No" />No<br><br>
  142. Start Date:
  143. <input type = "datepicker" placeholder = "YYYY-MM-DD" name = "tdate" value = "" id = "id20"/><br><br>
  144. Bank Name:*<br>
  145. <input type = "text" name = "bank_name" id = "id21" Required /><br><br>
  146. Bank Account Number:*<br>
  147. <input type = "text" name = "bank_account_number" id = "id22" onkeyup = "validate2()" Required /><br><br>
  148. Routing Number:*<br>
  149. <input type = "text" name = "routing_number" id = "id23" onkeyup = "validate3()" Required /><br><br>
  150. Reason of call:*<br>
  151. <?php
  152. $sql = "SELECT type_of_call FROM tbl_call_types ";
  153. $result = mysqli_query($conn, $sql);
  154. echo "<select name = 'type_of_call' id = 'call_type' onchange = 'run()'>";
  155. echo "<option value = ''>";
  156. while($row = mysqli_fetch_array($result)){
  157. echo "<option value = '" .$row['type_of_call'] . "'>" . $row['type_of_call'] . "</option>";
  158. }
  159. echo "</select>";
  160. ?>
  161. <br><br>
  162. Comments:*<br>
  163. <textarea name = "comments" value = "comments" id = "id24" Required /></textarea><br><br>
  164. Timestamp(24-hr clock):*<br>
  165. <input type = "text" placeholder = "YYYY-MM-DD HH-MM" name = "tdate" Required /><br><br>
  166. </strong>
  167. <center><br>
  168. <input type="submit" name="submit" id = "id25" />
  169. <style>
  170. input[type=submit] {
  171. border-radius: 5px;
  172. border: 0;
  173. width: 140px;
  174. height:25px;
  175. font-family: Tahoma;
  176. background: #f4f4f4;
  177. /* Old browsers */
  178. background: -moz-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
  179. /* FF3.6+ */
  180. background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #f4f4f4), color-stop(100%, #ededed));
  181. /* Chrome,Safari4+ */
  182. background: -webkit-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
  183. /* Chrome10+,Safari5.1+ */
  184. background: -o-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
  185. /* Opera 11.10+ */
  186. background: -ms-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
  187. /* IE10+ */
  188. background: linear-gradient(to bottom, #59A0F2 1%, #ededed 100%);
  189. /* W3C */
  190. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f4f4', endColorstr='#ededed', GradientType=0);
  191. /* IE6-9 */
  192. </style>
  193. </div>
  194. </form>
  195. <?php
  196. }} // While loop and if loop at the start
  197. ?>
  198. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  199. <script>
  200.  
  201. //Javascript codes below
  202. function validate(){
  203. var element = document.getElementById("id2");
  204. element.value = element.value.replace(/[^0-9-]+/,'');
  205. }
  206. function validate2(){
  207. var element = document.getElementById("id22");
  208. element.value = element.value.replace(/[^0-9-]+/,'');
  209. }
  210. function validate3(){
  211. var element = document.getElementById("id23");
  212. element.value = element.value.replace(/[^0-9-]+/,'');
  213. }
  214. function run(){
  215. document.getElementById("id24").innerHTML = document.getElementById("call_type").value;
  216. }
  217. </script>
  218. </body>
  219. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement