123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- require "connectionDb.php";
- if (isset($_POST['edit']) && isset($_POST['id']) && isset($_POST['username']) ) {
-
- $id = $_POST['id'];
- $username = $_POST['username'];
- $creditSale = $_POST['creditSale'];
- //$vehicle_id = $_POST['vehicle_id'];
- //$number = $_POST['number'];
-
- $sql ="UPDATE customer SET name='$username',credit_sale='$creditSale' WHERE id='$id'";
- //$sql2 ="UPDATE vehicle SET number='$number' WHERE id='$vehicle_id'";
- $db->exec($sql);
- //$db->exec($sql2);
- echo '<script>window.location.href="customers.php"</script>';
- }
-
- ?>
- <style type="text/css">
- .editForm {
- display: none;
- }
- form.form-horizontal.editCustomer.modal-content.animate {
- width: 400px;
- height: 280px;
- margin-left: -15px;
- background-color: #dfe3e6;
- }
- div#editForm {
- width: 400px;
- height: 280px;
- border-radius: 0.5em;
- margin-top: 100px;
-
- }
- .form-group.rowRadio {
- margin-left: 28px;
- color: #610e14;
- }
- .form-group.erow2{
- margin-left: 50px;
- }
- .form-group.erow2 input[type='text']{
- border:1px solid grey;
- border-radius: 0.5em;
- height: 35px;
- width: 250px;
- }
- .form-group.erow2 label{
- color: #610e14;
- font-family:-webkit-pictograph;
- }
- .editForm span{
- color:red;
- margin-right: 5px;
- }
- input.btn.btn-default.editSave {
- background: radial-gradient(#0da3bb, #04161fc2);
- color: #610e14;
- font-family:-webkit-pictograph;
- font-size: 18px;
- margin-right: 20px;
- width: 70px;
- }
- input.btn.btn-default.editCancel {
- background: radial-gradient(#b71515eb, #ef0b0bdb);
- color: #fff;
- font-family:-webkit-pictograph;
- font-size:18px;
- width: 73px;
- }
- .form-group.editBtn {
- margin-left: 30px;
- margin-top: 45px;
- }
- </style>
- <div class="container editForm modal" id="editForm">
- <form class="form-horizontal modal-content animate editCustomer" action="" method="post">
- <span onclick="document.getElementById('editForm').style.display='none'" class="close" title="Close PopUp">×</span>
- <div class="form-group row1">
- <label>Edit Customer</label>
- </div>
- <input type="number" name="id" id="id" hidden="hidden">
- <div class="form-group erow2">
- <label class="control-label col-sm-2"> Name: </label>
- <div class="col-sm-10">
- <input id="username" type="text" name="username">
- </div>
- </div>
- <div class="form-group rowRadio">
- <!-- <div class="col-md-1"></div> -->
- <label class="control-label col-md-4">Credit Sale:</label>
- <div class="col-md-8">
- <!-- <input id="creditSaleOn" type="checkbox" name="creditSale">
- <input id="creditSaleOff" type="checkbox" name="creditSale"> -->
- <input id="creditSaleOn" type="radio" name="creditSale" value="1"> Yes<br>
- <input id="creditSaleOff" type="radio" name="creditSale" value="0"> No<br>
- </div>
- </div>
- <!-- <input type="number" name="vehicle_id" id="vehicle_id" hidden="hidden">
- <div class="form-group">
- <label class="control-label col-sm-2"> Number</label>
- <div class="col-sm-10">
- <input id="number" type="text" name="number">
- </div>
- </div> -->
- <div class="form-group editBtn">
- <div class="col-sm-offset-2 col-sm-10">
- <input type="submit" name="edit" value="Save" class="btn btn-default editSave">
- <input type="button" class="btn btn-default editCancel" value="Cancel" onclick="document.getElementById('editForm').style.display = 'none';">
- </div>
- </div>
- </form>
- </div>
|