|
| 1 | +<!-- Button trigger modal |
| 2 | +<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#completesignupmodal"> |
| 3 | + Launch demo modal |
| 4 | +</button> --> |
| 5 | +<?php |
| 6 | + if((isset($_POST['c']))){ |
| 7 | + $firstname = $_POST['firstname']; |
| 8 | + $lastname = $_POST['lastname']; |
| 9 | + $username = $_POST['username']; |
| 10 | + $password = $_POST['password']; |
| 11 | + // $pack=$_POST['pack']; |
| 12 | + $email=$_POST['email']; |
| 13 | + $phone=$_POST['phone']; |
| 14 | + $address=$_POST['address']; |
| 15 | + |
| 16 | + $query="SELECT username FROM `requests` WHERE username='$username'"; |
| 17 | + $exists=mysqli_query($con,$query); |
| 18 | + |
| 19 | + $num=mysqli_num_rows($exists); |
| 20 | + |
| 21 | + |
| 22 | + if($num>0){ |
| 23 | + echo "<script>alert('Username Already exists Please try Another Username');</script>"; |
| 24 | + |
| 25 | + } |
| 26 | + |
| 27 | + // $message = "$lastname $firstname would like to request an account."; |
| 28 | + else{ |
| 29 | + $query = "INSERT INTO `requests` (`firstname`, `lastname`, `username`, `password`, `pack`, `date`,`email`, `phone`, `address`) VALUES ('$firstname', '$lastname', '$username', '$password', 'complete', current_timestamp(), '$email', '$phone', '$address');"; |
| 30 | + $result=mysqli_query($con,$query); |
| 31 | + if($result){ |
| 32 | + echo "<script>alert('Your account request is now pending for approval. Please wait for confirmation. Thank you.')</script>"; |
| 33 | + }else{ |
| 34 | + echo "<script>alert('Unknown error occured.')</script>"; |
| 35 | + } |
| 36 | + } |
| 37 | + |
| 38 | +// require "PHPmailer/compr.php"; |
| 39 | + |
| 40 | +// $mail= new PHPMailer(true); |
| 41 | +// $mail-> isSMTP(true); |
| 42 | + |
| 43 | +// $mail-> Host='smtp.gmail.com'; |
| 44 | +// $mail-> Port=587; |
| 45 | +// $mail-> SMTPAuth=true; |
| 46 | +// $mail-> SMTPSecure='tls'; |
| 47 | +// $mail->SMTPAuth=true; |
| 48 | +// $mail-> Username='rnrathod37@gmail.com'; |
| 49 | +// $mail-> Password='Rnrathod@07'; |
| 50 | + |
| 51 | +// $mail-> setFrom('rnrathod37@gmail.com'); |
| 52 | +// $mail-> addAddress('rnrathod37@gmail.com'); |
| 53 | +// $mail-> isHTML(true); |
| 54 | + |
| 55 | +// $mail-> Subject='Account Request'; |
| 56 | +// $mail-> Body='There is An New Account Request From'. $_POST['firstname'].' '. $_POST['lastname'] .' For Pack :- '.$_POST['pack']; |
| 57 | +// $mail-> SMTPOptions= array('ssl'=>array( |
| 58 | + |
| 59 | +// 'verify_peer'=>false, |
| 60 | +// 'verify_peer_name'=>false, |
| 61 | +// 'allow_self_signed'=>false |
| 62 | +// )); |
| 63 | + } |
| 64 | + |
| 65 | + ?> |
| 66 | +<head> |
| 67 | +<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"> |
| 68 | +</head> |
| 69 | +<div class="modal fade" id="completesignupmodal" tabindex="-1" aria-labelledby="completesignupmodalLabel" aria-hidden="true"> |
| 70 | + <div class="modal-dialog"> |
| 71 | + <div class="modal-content"> |
| 72 | + <div class="modal-header"> |
| 73 | + <h5 class="modal-title" id="completesignupmodalLabel">Complete Pack Signup</h5> |
| 74 | + <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 75 | + </div> |
| 76 | + <div class="modal-body"> |
| 77 | + <form method="POST"> |
| 78 | + <div class="mb-3"> |
| 79 | + <label for="exampleInputname" class="form-label">FirstName</label> |
| 80 | + <input type="text" name="firstname" class="form-control" id="exampleInputname" aria-describedby="emailHelp"> |
| 81 | + |
| 82 | + </div> |
| 83 | + <div class="mb-3"> |
| 84 | + <label for="exampleInputlast" class="form-label">LastName</label> |
| 85 | + <input type="text" name="lastname" class="form-control" id="exampleInputlast" aria-describedby="emailHelp"> |
| 86 | + |
| 87 | + </div> |
| 88 | + <div class="mb-3"> |
| 89 | + <label for="exampleInputEmail1" class="form-label">UserName</label> |
| 90 | + <input type="text" name="username" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"> |
| 91 | + |
| 92 | + </div> |
| 93 | + <div class="mb-3"> |
| 94 | + <label for="exampleInputPassword1" class="form-label">Password</label> |
| 95 | + <input type="password" name="password" class="form-control" id="exampleInputPassword1"> |
| 96 | + </div> |
| 97 | + <!-- <div class="form-group"> |
| 98 | + <label for="exampleInputPack" class="form-label">Select one Pack</label> |
| 99 | + <select class="form-control-select" id="rselect" required> |
| 100 | + <option class="select-option" value="" disabled selected>Interested in...</option> |
| 101 | + <option class="select-option" value="Personal Loan">Starter</option> |
| 102 | + <option class="select-option" value="Car Loan">Medium</option> |
| 103 | + <option class="select-option" value="House Loan">Complete</option> |
| 104 | + </select> |
| 105 | + <div class="help-block with-errors"></div> |
| 106 | + </div> --> |
| 107 | + |
| 108 | + <div class="mb-3"> |
| 109 | + <label for="exampleInputPack" class="form-label">Pack Selected</label><br> |
| 110 | + <input type="text" class="form-control" value="Complete" id="exampleInputPack"> |
| 111 | + </div> |
| 112 | + |
| 113 | + |
| 114 | + <div class="mb-3"> |
| 115 | + <label for="exampleInputemail" class="form-label">Email</label> |
| 116 | + <input type="email" name="email" class="form-control" id="exampleInputemail"> |
| 117 | + </div> |
| 118 | + |
| 119 | + <div class="mb-3"> |
| 120 | + <label for="exampleInputPhone" class="form-label">Phone</label> |
| 121 | + <input type="number" name="phone" class="form-control" id="exampleInputPhone"> |
| 122 | + </div> |
| 123 | + |
| 124 | + <div class="mb-3"> |
| 125 | + <label for="exampleInputPhone" class="form-label">Address</label> |
| 126 | + <textarea class="form-control" name="address" id="floatingTextarea2" style="height: 100px"></textarea> |
| 127 | + |
| 128 | +</div> |
| 129 | +<div class="form-group checkbox"> |
| 130 | + <input type="checkbox" id="rterms" value="Agreed-to-Terms" name="rterms" required>I agree with EBase's stated <a href="privacy-policy.html">Privacy Policy</a> and <a href="terms-conditions.html">Terms & Conditions</a> |
| 131 | + <div class="help-block with-errors"></div> |
| 132 | + </div> |
| 133 | + <div class="text-center"> |
| 134 | + |
| 135 | + <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> |
| 136 | + <button type="submit" name="c" class="btn btn-primary col-3 my-3">SignUp</button> |
| 137 | + </div> |
| 138 | +</form> |
| 139 | + </div> |
| 140 | + |
| 141 | + </div> |
| 142 | + </div> |
| 143 | +</div> |
0 commit comments