123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- require "connectionDb.php";
- if (isset($_POST['addCustomer']) && isset($_POST['addusername']) ) {
-
- echo $username = $_POST['addusername'];
- $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>';
- }else {
- // $_SESSION['error'] = "En"
- }
- ?>
- <style type="text/css">
- .addForm {
- display: none;
- }
- form.form-horizontal.formCustomer.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;
-
- }
- .form-group.row1{
- height:20px;
- margin-left: 150px;
- margin-top: 20px;
- margin-bottom: 30px;
- }
- .form-group.row1 label{
- color: #610e14;
- font-family:-webkit-pictograph;
- font-size: 20px;
- }
- .addForm span{
- color:red;
- margin-right: 5px;
- }
- .form-group.row2{
- margin-left: 50px;
- }
- .form-group.row2 label{
- color: #610e14;
- font-family:-webkit-pictograph;
- }
- .form-group.row2 input[type='text']{
- border:1px solid grey;
- border-radius: 0.5em;
- height: 30px;
- }
- .form-group.row3{
- margin-top: 30px;
- }
- .form-group.row3 label{
- color: #610e14;
- margin-left: 20px;
- font-family:-webkit-pictograph;
- }
- .form-group.row3 input[type='checkbox']{
- width: 20px;
- height: 20px;
- }
- input.btn.btn-default.addCustomer {
- background: radial-gradient(#0da3bb, #04161fc2);
- color: #fff;
- font-family: -webkit-pictograph;
- font-size: 20px;
- margin-top: 10px;
- margin-left: 90px;
- width: 120px;
- }
- </style>
- <div class="container addForm modal" id="addForm">
- <form class="form-horizontal modal-content animate formCustomer" action="#" method="post">
- <span onclick="document.getElementById('addForm').style.display='none'" class="close" title="Close PopUp">×</span>
- <div class="form-group row1">
- <label>New Customer</label>
- </div>
- <div class="form-group row2" >
- <label class="control-label col-md-2"> Name: </label>
- <div class="col-md-3">
- <input type="text" name="addusername" required="true">
- </div>
- </div>
- <div class="form-group row3">
- <div class="col-md-1"></div>
- <label class="control-label col-md-3"> Credit Sale:</label>
- <div class="col-md-3">
- <input type="checkbox" name="addcreditSale">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <input type="submit" class="btn btn-default addCustomer" value="Save" name="addCustomer">
- </div>
- </div>
- </form>
- </div>
|