Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--////////////////////////////////////////////BEGINING////////////////////////////////////////////////-->
- <form action="" method="post">
- <table class="table">
- <tr>
- <!--////////////////////////////////////////////ENTRY////////////////////////////////////////////////-->
- <td style="width: 25%;">
- <table class="table" style="width: 100%;">
- <tr>
- <td align="center">Name:</td>
- <td align="center"><input type="text" name="name" required></td>
- </tr>
- <tr>
- <td align="center">CCP License #:</td>
- <td align="center"><input type="text" name="notes"></td>
- </tr>
- </table>
- </td>
- <!--////////////////////////////////////////////ITEMS////////////////////////////////////////////////-->
- <td style="width: 25%;">
- <table class="table" style="width: 100%;">
- <tr>
- <td colspan="11" align="center" style="color: #f1592b;font-size: 17px;font-weight: bold;">Weapon</td>
- </tr>
- <tr>
- <td align="center">Type</td>
- <td align="center"><select name="item[]">
- <option value=""></option>
- <option value="P07 Pistol, ">P07 Pistol</option>
- <option value="P07 Pistol (Khaki), ">P07 Pistol (Khaki)</option>
- <option value="PM 9mm Pistol, ">PM 9mm Pistol</option>
- <option value="ACP Pistol, ">ACP Pistol</option>
- <option value="4-five .45 Pistol , ">4-five .45 Pistol </option>
- <option value="Rook-40 Pistol, ">Rook-40 Pistol</option>
- <option value="Zubr Pistol , ">Zubr Pistol </option>
- <option value="Signal/Flare/Starter Pistol, ">Signal/Flare/Starter Pistol</option>
- </select></td>
- </tr>
- </table>
- </td>
- <!--/////////////////////////////////////////SUBMIT///////////////////////////////////////////////////-->
- <tr>
- <td colspan="4" align="left"><input type="submit" value="submit" name="sub"></td>
- </tr>
- <!--/////////////////////////////////////////ENDING///////////////////////////////////////////////////-->
- </tr>
- </table>
- </form>
- <?php
- if(isset($_POST['sub']))
- {
- $oldname="";
- $servername = "localhost";
- $username = "";
- $password = "";
- $dbname = "";
- $con = new mysqli($servername, $username, $password, $dbname);
- if ($con->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- if ($_POST["name"] != $oldname)
- {
- foreach ($_POST['item'] as $select)
- {
- $chk .= $select."";
- }
- $in_ch1=mysqli_query($con,"INSERT INTO orders (faction, name, items, filled, notes) VALUES (
- 'CCP',
- '".$_POST['name']."',
- '$chk',
- 'No',
- '".$_POST['notes']."'
- )");
- if($in_ch1>=1)
- {
- echo '<div class="alert alert-success">Successfully submitted order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
- }
- else
- {
- echo '<div class="alert alert-warning">Failed to submit order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
- }
- }
- else echo '<div class="alert alert-warning">Failed to submit order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
- }
- $con->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement