123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- require "connectionDb.php";
- if (isset($_POST['addCustomer']) && isset($_POST['addusername']) ) {
-
- $username = $_POST['addusername'];
- echo $creditSale = ($_POST['addcreditSale']=='on') ? 1 : 0 ;
- $db->exec("INSERT INTO customer (type,created_at,updated_at,name,credit_sale) VALUES ('',strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),'$username','$creditSale');");
- echo '<script>window.location.href="customers.php"</script>';
- }
- ?>
- <style type="text/css">
- .addForm {
- display: none;
- }
- /* form.form-horizontal.modal-content.animate {
- width: 400px;
- height: 280px;
- margin-left: -15px;
- background-color: #dfe3e6;
- }
- div#addForm {
- width: 400px;
- height: 280px;
- border-radius: 0.5em;
- margin-top: 100px;
-
- }
- input.btn.btn-default {
- background: radial-gradient(#0da3bb, #04161fc2);
- color: #fff;
- font-family: -webkit-pictograph;
- font-size: 20px;
- margin-top: -110px;
- margin-left: 110px;
- width: 120px;
- }*/
- </style>
- <div class="container addForm" id="addForm">
- <form class="form-horizontal" action="" method="post">
- <!-- <span onclick="document.getElementById('addForm').style.display='none'" class="close" title="Close PopUp" style="color:red;margin-right: 5px;">×</span> -->
- <div class="form-group row" style="width: height:20px;margin-left: 150px;margin-top: 20px;margin-bottom: 30px;">
- <label style="color: #610e14;font-family:-webkit-pictograph;font-size: 20px;">New Customer</label>
- </div>
- <div class="form-group row" style="margin-left: 50px;" >
- <label class="control-label col-md-2" style="color: #610e14;font-family:-webkit-pictograph;" > Name: </label>
- <div class="col-md-3">
- <input type="text" name="addusername" style="border:1px solid grey;border-radius: 0.5em;height: 30px;">
- </div>
- </div>
- <div class="form-group row" style="margin-top: 30px;">
- <div class="col-md-1"></div>
- <label class="control-label col-md-3" style="color: #610e14;margin-left: 20px;font-family:-webkit-pictograph;"> Credit Sale:</label>
- <div class="col-md-3">
- <input type="checkbox" name="addcreditSale" style="width: 20px;height: 20px;color: red;">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <input type="submit" class="btn btn-default" value="Save" name="addCustomer">
- </div>
- </div>
- </form>
- </div>
- <!-- <div id="modal-wrapper addForm" class="modal addForm">
-
- <form class="modal-content animate" action="/action_page.php">
-
- <div class="imgcontainer">
- <span onclick="document.getElementById('modal-wrapper').style.display='none'" class="close" title="Close PopUp">×</span>
- <img src="dist/img/profile.jpg" alt="Avatar" class="avatar">
- <h3 style="text-align:center">New Customer</h3>
- </div>
- <div class="container">
- <label>Customer Name:</label><input type="text" placeholder="Enter name" name="uname"><br>
- <input type="checkbox" style="margin:26px 30px;"> Credit Sale<br>
- <button type="submit" style="margin-left: 150px;">Save</button>
- </div>
-
- </form>
-
- </div> -->
|