addCustomer.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. require "connectionDb.php";
  3. if (isset($_POST['addCustomer']) && isset($_POST['addusername']) ) {
  4. $username = $_POST['addusername'];
  5. echo $creditSale = ($_POST['addcreditSale']=='on') ? 1 : 0 ;
  6. $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');");
  7. echo '<script>window.location.href="customers.php"</script>';
  8. }
  9. ?>
  10. <style type="text/css">
  11. .addForm {
  12. display: none;
  13. }
  14. /* form.form-horizontal.modal-content.animate {
  15. width: 400px;
  16. height: 280px;
  17. margin-left: -15px;
  18. background-color: #dfe3e6;
  19. }
  20. div#addForm {
  21. width: 400px;
  22. height: 280px;
  23. border-radius: 0.5em;
  24. margin-top: 100px;
  25. }
  26. input.btn.btn-default {
  27. background: radial-gradient(#0da3bb, #04161fc2);
  28. color: #fff;
  29. font-family: -webkit-pictograph;
  30. font-size: 20px;
  31. margin-top: -110px;
  32. margin-left: 110px;
  33. width: 120px;
  34. }*/
  35. </style>
  36. <div class="container addForm" id="addForm">
  37. <form class="form-horizontal" action="" method="post">
  38. <!-- <span onclick="document.getElementById('addForm').style.display='none'" class="close" title="Close PopUp" style="color:red;margin-right: 5px;">&times;</span> -->
  39. <div class="form-group row" style="width: height:20px;margin-left: 150px;margin-top: 20px;margin-bottom: 30px;">
  40. <label style="color: #610e14;font-family:-webkit-pictograph;font-size: 20px;">New Customer</label>
  41. </div>
  42. <div class="form-group row" style="margin-left: 50px;" >
  43. <label class="control-label col-md-2" style="color: #610e14;font-family:-webkit-pictograph;" > Name:&nbsp;&nbsp;&nbsp;&nbsp; </label>
  44. <div class="col-md-3">
  45. <input type="text" name="addusername" style="border:1px solid grey;border-radius: 0.5em;height: 30px;">
  46. </div>
  47. </div>
  48. <div class="form-group row" style="margin-top: 30px;">
  49. <div class="col-md-1"></div>
  50. <label class="control-label col-md-3" style="color: #610e14;margin-left: 20px;font-family:-webkit-pictograph;"> Credit Sale:</label>
  51. <div class="col-md-3">
  52. <input type="checkbox" name="addcreditSale" style="width: 20px;height: 20px;color: red;">
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <div class="col-sm-offset-2 col-sm-10">
  57. <input type="submit" class="btn btn-default" value="Save" name="addCustomer">
  58. </div>
  59. </div>
  60. </form>
  61. </div>
  62. <!-- <div id="modal-wrapper addForm" class="modal addForm">
  63. <form class="modal-content animate" action="/action_page.php">
  64. <div class="imgcontainer">
  65. <span onclick="document.getElementById('modal-wrapper').style.display='none'" class="close" title="Close PopUp">&times;</span>
  66. <img src="dist/img/profile.jpg" alt="Avatar" class="avatar">
  67. <h3 style="text-align:center">New Customer</h3>
  68. </div>
  69. <div class="container">
  70. <label>Customer Name:</label><input type="text" placeholder="Enter name" name="uname"><br>
  71. <input type="checkbox" style="margin:26px 30px;"> Credit Sale<br>
  72. <button type="submit" style="margin-left: 150px;">Save</button>
  73. </div>
  74. </form>
  75. </div> -->