Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "db_dealer_track";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if($conn->connect_error){
- die("Connection failed". $conn->connect_error);
- }
- if(isset($_POST['id1'])){
- $sql = "SELECT * FROM tbl_dealer_info ";
- $sql .= "WHERE $account_name = 'account_name' ";
- $result = mysqli_query($conn, $sql);
- while($row = mysqli_fetch_array($result)){
- ?>
- <html>
- <head>
- <title>iMobile </title>
- </head>
- <body bgcolor = "#D6DFE3">
- <center><b><h2>Please enter the following information: </h2></b></center>
- <form action = "dealer_track.php" method = "post">
- <strong><center> <u>Fields marked with an asterisk(*) are required.</u><br><br>
- Name of the dealer:*
- <?php
- $sql = "SELECT account_name FROM tbl_dealer_info ";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'account_name' id = 'id'>";
- echo "<option value = ''>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['account_name'] . "'>" . $row['account_name'] . "</option>";
- }
- echo "</select>";
- ?>
- <br><br>
- <input type = submit id = "id1" name = "id1" value = "Display the fields" /><br>
- </center>
- <hr>
- <br><br>
- Phone:*<br>
- <input type = "tel" name = "phone" pattern= "^d{3}-d{3}-d{4}$" onkeyup = "validate()" id = "id2" Required /><br><br>
- // This is one of the things I tried to do with the value attribute. Still didn't work
- Email:*<br>
- <input type = "email" name = "email" id = "id3" value = "<?php echo $row['email']?>" Required /><br><br>
- SFID:*<br>
- <input type = "text" name = "sfid" id = "id4" Required /><br><br>
- Account Name:*<br>
- <input type = "text" name = "account_name" id = "id5" Required /><br><br>
- Parent Account:*<br>
- <input type = "text" name = "parent_account" id = "id6" Required /><br><br>
- AWI Code:*<br>
- <input type = "text" name = "awi_code" id = "id7" Required /><br><br>
- Sales Portal Id:*<br>
- <input type = "text" name = "sales_portal_id" id = "id8" Required /><br><br>
- IAE:*<br>
- <input type = "text" name = "iae" id = "id9" Required /><br><br>
- RSM:*<br>
- <?php
- $sql = "SELECT rsm_val FROM tbl_rsm_drop_down ";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'rsm_val'>";
- echo "<option value = ''></option>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['rsm_val'] . "'>" . $row['rsm_val'] . "</option>";
- }
- echo "</select>";
- ?>
- <br><br>
- Prepaid Door Type:*<br>
- <?php
- $sql = "SELECT door_type_val FROM tbl_door_type_drop_down ";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'door_type_val'>";
- echo "<option value = ''></option>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['door_type_val'] . "'>" . $row['door_type_val'] . "</option>";
- }
- echo "</select>";
- ?>
- <br><br>
- Payment Method:*<br>
- <?php
- $sql = "SELECT payment_method_val FROM tbl_payment_method_drop_down ";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'payment_method_val'>";
- echo "<option value = ''></option>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['payment_method_val'] . "'>" . $row['payment_method_val'] . "</option>";
- }
- echo "</select>";
- ?>
- <br><br>
- Region:*<br>
- <?php
- $sql = "SELECT region_val FROM tbl_region_drop_down";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'region_val'>";
- echo "<option value = ''></option>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['region_val'] . "'>" . $row['region_val'] . "</option>";
- }
- echo "</select>";
- ?>
- <br>
- <div align = "center" style= "margin-top:-44em">
- Street Address:*<br>
- <textarea name = "street_address" value = "street_address" Required /></textarea><br>
- City:*<br>
- <input type = "text" name = "city" id = "id15" Required /><br>
- State:*<br>
- <input type = "text" name = "state" id = "id16" Required /><br>
- Zip code:*<br>
- <input type = "text" name = "zip" id = "id17" Required /><br>
- Area:*<br>
- <input type = "text" name = "area" id = "id18" Required /><br>
- Market:*<br>
- <input type = "text" name = "market" id = "id19" Required /><br><br>
- iPhone Boost Approved:
- <input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="Yes")?> value = "Yes" />Yes
- <input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="No")?> value = "No" />No<br><br>
- iPhone Virgin Approved:
- <input type = "radio" name = "virgin_app" <?php if(isset($virgin_app)&& $virgin_app =="Yes")?> value = "Yes" />Yes
- <input type = "radio" name = "virgin_app" <?php if(isset($virgin_app)&& $virgin_app =="No")?> value = "No" />No<br><br>
- VirginMobile Approved:
- <input type = "radio" name = "virgin_mob_app" <?php if(isset($virgin_mob_app)&& $virgin_mob_app =="Yes")?> value = "Yes" />Yes
- <input type = "radio" name = "virgin_mob_app" <?php if(isset($virgin_mob_app)&& $virgin_mob_app =="No")?> value = "No" />No<br><br>
- Start Date:
- <input type = "datepicker" placeholder = "YYYY-MM-DD" name = "tdate" value = "" id = "id20"/><br><br>
- Bank Name:*<br>
- <input type = "text" name = "bank_name" id = "id21" Required /><br><br>
- Bank Account Number:*<br>
- <input type = "text" name = "bank_account_number" id = "id22" onkeyup = "validate2()" Required /><br><br>
- Routing Number:*<br>
- <input type = "text" name = "routing_number" id = "id23" onkeyup = "validate3()" Required /><br><br>
- Reason of call:*<br>
- <?php
- $sql = "SELECT type_of_call FROM tbl_call_types ";
- $result = mysqli_query($conn, $sql);
- echo "<select name = 'type_of_call' id = 'call_type' onchange = 'run()'>";
- echo "<option value = ''>";
- while($row = mysqli_fetch_array($result)){
- echo "<option value = '" .$row['type_of_call'] . "'>" . $row['type_of_call'] . "</option>";
- }
- echo "</select>";
- ?>
- <br><br>
- Comments:*<br>
- <textarea name = "comments" value = "comments" id = "id24" Required /></textarea><br><br>
- Timestamp(24-hr clock):*<br>
- <input type = "text" placeholder = "YYYY-MM-DD HH-MM" name = "tdate" Required /><br><br>
- </strong>
- <center><br>
- <input type="submit" name="submit" id = "id25" />
- <style>
- input[type=submit] {
- border-radius: 5px;
- border: 0;
- width: 140px;
- height:25px;
- font-family: Tahoma;
- background: #f4f4f4;
- /* Old browsers */
- background: -moz-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
- /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #f4f4f4), color-stop(100%, #ededed));
- /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
- /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
- /* Opera 11.10+ */
- background: -ms-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
- /* IE10+ */
- background: linear-gradient(to bottom, #59A0F2 1%, #ededed 100%);
- /* W3C */
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f4f4', endColorstr='#ededed', GradientType=0);
- /* IE6-9 */
- </style>
- </div>
- </form>
- <?php
- }} // While loop and if loop at the start
- ?>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
- <script>
- //Javascript codes below
- function validate(){
- var element = document.getElementById("id2");
- element.value = element.value.replace(/[^0-9-]+/,'');
- }
- function validate2(){
- var element = document.getElementById("id22");
- element.value = element.value.replace(/[^0-9-]+/,'');
- }
- function validate3(){
- var element = document.getElementById("id23");
- element.value = element.value.replace(/[^0-9-]+/,'');
- }
- function run(){
- document.getElementById("id24").innerHTML = document.getElementById("call_type").value;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement