PHP Code Pharmacy Management System.
addcompany.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
<?php include('dbcon.php'); include('adminhome.php'); error_reporting(0); ?> <html> <html lang="en"> <head> </head> <style> table { width: 600px; height: 200px; position: absolute; top: 15%; left: 10%; border-radius: 10px; color:black; border : 0; background-color:; align: center; font-size: 15px; font-weight: 600; border-collapse: separate; border-spacing: 0 15px; } .Button { position: absolute; background: #337ab7; font-size: 20px; font-weight: 600; color: #fff; -webkit-appearance: button; -moz-appearance: button; appearance: button; } .Button:hover { background-color: #1d1f77; } .form-wrsignup { position: absolute; background:#f9f9fa; top: 70px; left: 250px; height: 83%; width:77%; padding: 15px 25px; box-shadow: 0px 1px 0px rgba(36, 39, 219, 0.6),inset 0px 1px 0px rgba(255,255,255,0.04); font-size: 15px; font-weight: 600; color: #fff; } h2 { color:black; } input[type=text] { width: 100%; box-sizing: border-box; border: 2px solid #ccc; border-radius: 4px; font-size: 16px; background-color: white; background-position: 10px 10px; background-repeat: no-repeat; padding: 12px 20px 12px 40px; } </style> <body> <div class="form-wrsignup"> <h2>Add Company Details</h2> <form action="#" method="post"> <table cellspacing ="30" > <tr> <td> ID</td> <td><input type="text" name="id" required="required" value="" placeholder="Id" autofocus required></input></td> </tr> <tr> <td> Company Name</td> <td><input type="text" name="name" required="required" value="" placeholder="Company Name" autofocus required></input></td> </tr> <tr> <td>Address</td> <td><input type="text" name="address" required="required" value="" placeholder="Address" required></input></td> </tr> <tr> <td>Company No</td> <td><input type="text" name="company_no" required="required" value="" placeholder="Company No" required></input></td> </tr> <tr> <td>Licience No</td> <td><input type="text" name="licience_no" required="required" value="" placeholder="Licience no" required></input></td> </tr> <tr> <td colspan="2" align ="center"><input type="submit" class="Button" title="ADD" name="Add" value="Add Company"></input></td> </tr> </table> </form> <?php if(isset($_POST['Add'])) { $Id = $_POST['id']; $Name = $_POST['name']; $Address = $_POST['address']; $Com_no = $_POST['company_no']; $Licience_no = $_POST['licience_no']; if($Id != " "&& $Name!= " "&& $Address!= " "&& $Com_no != " "&& $Licience_no != " ") { $query = "INSERT INTO company VALUES('$Id','$Name','$Address',' $Com_no','$Licience_no')"; $data= mysqli_query($con,$query); if($data) { ?> <script> alert("Add New Company Successfully"); </script> <?php } else{ ?> <script> alert("Could not add "); </script> <?php } } } ?> </div> </body> </html> |