<?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>