-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadd.php
34 lines (29 loc) · 1.08 KB
/
add.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
<?php
ob_start();
session_start();
$item_id = $_POST['Item_Id'];
$quantity = $_POST['Quantity'];
$category = $_POST['Category'];
$gross_weight = $_POST['Gross_weight'];
$reduction_weight = $_POST['Reduction_weight'];
$wastage = $_POST['Wastage'];
$making_charge = $_POST['Making_charge'];
$description = $_POST['Description'];
$conn = mysql_connect('localhost', 'root', 'ashg123');
mysql_select_db('db_project', $conn);
$net_weight = $gross_weight - $reduction_weight;
$query = "INSERT INTO item_details (Id,Quantity,Category,short_description) VALUES ('$item_id','$quantity','$category','$description');";
$result = mysql_query($query);
$query = "INSERT INTO config_menu (item_code,making,wastage) VALUES ('$item_id','$making_charge','$wastage'); ";
$result = mysql_query($query);
$query = "INSERT INTO weight_details (Net,Gross,Reduction,item_code) VALUES ('$net_weight','$gross_weight','$reduction_weight','$item_id'); ";
$result = mysql_query($query);
echo 'Item Added';
?>
<html>
<head><title>Item Added</title></head>
<body>
<br />
<a href="./supervisor.php">Home</a>
</body>
</html>